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

Re: [PATCH] x86/mtrr: Drop workaround for old 32bit CPUs


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 8 Jul 2020 11:52:57 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Wed, 08 Jul 2020 10:53:05 +0000
  • Ironport-sdr: px4yTnfH5mWopo2kT1HqDZOMMJGbDfRLN3R+tZgPrQgSVr6awm6WgNA/6/k5qYXvzPAhRfw5fp B895dWBT3wALOjZEQnFPRr8zwIulKu6IGIfstja0zS0PEERvz/e+sS5McxOj1baC30wBfzd+XM MMSRyMAkh49mddKSTy2+AUeMzCkFGonOo0dS8c5Py9NYse3VUu47WivBvu/yYh79n6KtyZ9aEh lyjCxmedZO5zwILBMRYlA+9VkVLBscoP9t1EaOX/RlGAzwkHxmufUnwq1/ej2kRtCk88qX/wxv lAQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08/07/2020 11:48, Roger Pau Monné wrote:
> On Wed, Jul 08, 2020 at 11:14:43AM +0100, Andrew Cooper wrote:
>> This logic is dead as Xen is 64bit-only these days.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks,

>> ---
>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>> CC: Wei Liu <wl@xxxxxxx>
>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> ---
>>  xen/arch/x86/cpu/mtrr/generic.c | 17 -----------------
>>  1 file changed, 17 deletions(-)
>>
>> diff --git a/xen/arch/x86/cpu/mtrr/generic.c 
>> b/xen/arch/x86/cpu/mtrr/generic.c
>> index 89634f918f..06fa0c0420 100644
>> --- a/xen/arch/x86/cpu/mtrr/generic.c
>> +++ b/xen/arch/x86/cpu/mtrr/generic.c
>> @@ -570,23 +570,6 @@ int generic_validate_add_page(unsigned long base, 
>> unsigned long size, unsigned i
>>  {
>>      unsigned long lbase, last;
>>  
>> -    /*  For Intel PPro stepping <= 7, must be 4 MiB aligned 
>> -        and not touch 0x70000000->0x7003FFFF */
>> -    if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 &&
>> -        boot_cpu_data.x86_model == 1 &&
>> -        boot_cpu_data.x86_mask <= 7) {
>> -            if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
>> -                    printk(KERN_WARNING "mtrr: base(%#lx000) is not 4 MiB 
>> aligned\n", base);
>> -                    return -EINVAL;
>> -            }
>> -            if (!(base + size < 0x70000 || base > 0x7003F) &&
>> -                (type == MTRR_TYPE_WRCOMB
>> -                 || type == MTRR_TYPE_WRBACK)) {
>> -                    printk(KERN_WARNING "mtrr: writable mtrr between 
>> 0x70000000 and 0x7003FFFF may hang the CPU.\n");
>> -                    return -EINVAL;
>> -            }
>> -    }
>> -
>>      /*  Check upper bits of base and last are equal and lower bits are 0
>>          for base and 1 for last  */
>>      last = base + size - 1;
> FWIW, you could also initialize last at definition time.

I've got some very different cleanup in mind for that code, seeing as it
can be simplified to a single test expression.

~Andrew



 


Rackspace

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