[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/mmcfg: add "force" option for MCFG



On 29.08.2019 10:00, Roger Pau Monné  wrote:
> On Wed, Aug 28, 2019 at 04:24:22PM +0100, Igor Druzhinin wrote:
>> --- a/xen/arch/x86/x86_64/mmconfig-shared.c
>> +++ b/xen/arch/x86/x86_64/mmconfig-shared.c
>> @@ -26,33 +26,34 @@
>>  
>>  #include "mmconfig.h"
>>  
>> +static bool_t __read_mostly force_mmcfg = true;
>>  unsigned int pci_probe = PCI_PROBE_CONF1 | PCI_PROBE_MMCONF;
>>  
>>  static int __init parse_mmcfg(const char *s)
>>  {
>>      const char *ss;
>> -    int rc = 0;
>> +    int val, rc = 0;
>>  
>>      do {
>>          ss = strchr(s, ',');
>>          if ( !ss )
>>              ss = strchr(s, '\0');
>>  
>> -        switch ( parse_bool(s, ss) )
>> -        {
>> -        case 0:
>> -            pci_probe &= ~PCI_PROBE_MMCONF;
>> -            break;
>> -        case 1:
>> -            break;
>> -        default:
>> -            if ( !cmdline_strcmp(s, "amd_fam10") ||
>> -                 !cmdline_strcmp(s, "amd-fam10") )
>> +        if ( (val = parse_bool(s, ss)) >= 0 ) {
>> +            if ( val )
>> +               pci_probe |= PCI_PROBE_MMCONF;
>> +            else
>> +               pci_probe &= ~PCI_PROBE_MMCONF;
>> +        } else if ( (val = parse_boolean("amd_fam10", s, ss)) >= 0 ||
>> +                    (val = parse_boolean("amd-fam10", s, ss)) >= 0 ) {
>> +            if ( val )
>>                  pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
>>              else
>> -                rc = -EINVAL;
>> -            break;
>> -        }
>> +                pci_probe &= ~PCI_CHECK_ENABLE_AMD_MMCONF;
>> +        } else if ( (val = parse_boolean("force", s, ss)) >= 0)
>> +            force_mmcfg = val;
> 
> You could also consider adding a new flag to pci_probe, ie:
> PCI_PROBE_FORCE_MMCFG.

Yes please, albeit to be in sync with the other flag perhaps
better PCI_PROBE_FORCE_MMCONF or PCI_PROBE_MMCONF_FORCE.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.