Re: [PATCH] x86: x86_{phys,virt}_bits field also for i386 (v2)

From: Yinghai Lu
Date: Fri Sep 05 2008 - 12:56:35 EST


On Fri, Sep 5, 2008 at 8:00 AM, Ingo Molnar <mingo@xxxxxxx> wrote:
>
> * Jan Beulich <jbeulich@xxxxxxxxxx> wrote:
>
>> Make the x86_{phys,virt}_bits common for 32- and 64-bits, and use the
>> former in ioremap's phys_addr_valid() check also on 32bit/PAE.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
>>
>> ---
>> arch/x86/kernel/cpu/common.c | 17 +++++++++++++++++
>> arch/x86/mm/ioremap.c | 15 ++++++---------
>> include/asm-x86/processor.h | 4 ++--
>> 3 files changed, 25 insertions(+), 11 deletions(-)
>
> hm, the cpu/common.c bits just got reworked massively in tip/master.
> I've tried a blind merge (see the patch below) but at least the first
> hunk looks wrong. Mind looking at how to merge this?
>
> Ingo
>
> --------------->
> Subject: x86: x86_{phys,virt}_bits field also for i386 (v2)
> From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
> Date: Fri, 05 Sep 2008 13:07:24 +0100
>
> Make the x86_{phys,virt}_bits common for 32- and 64-bits, and use the
> former in ioremap's phys_addr_valid() check also on 32bit/PAE.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
>
> ---
> arch/x86/kernel/cpu/common.c | 17 +++++++++++++++++
> arch/x86/mm/ioremap.c | 15 ++++++---------
> include/asm-x86/processor.h | 4 ++--
> 3 files changed, 25 insertions(+), 11 deletions(-)
>
> Index: tip/arch/x86/kernel/cpu/common.c
> ===================================================================
> --- tip.orig/arch/x86/kernel/cpu/common.c
> +++ tip/arch/x86/kernel/cpu/common.c
> @@ -464,6 +464,18 @@ static void __cpuinit get_cpu_cap(struct
> c->x86_capability[1] = cpuid_edx(0x80000001);
> c->x86_capability[6] = cpuid_ecx(0x80000001);
> }
> + if (xlvl >= 0x80000008) {
> + u32 eax = cpuid_eax(0x80000008);
> +
> + c->x86_phys_bits = eax & 0xff;
> + c->x86_virt_bits = (eax >> 8) & 0xff;
> + /* CPUID workaround for Intel 0F33/0F34 CPU */
> + if (c->x86_vendor == X86_VENDOR_INTEL
> + && c->x86 == 0xF && c->x86_model == 0x3
> + && (c->x86_mask == 0x3
> + || c->x86_mask == 0x4))
> + c->x86_phys_bits = 36;
> + }
> }
>
> #ifdef CONFIG_X86_64

there is the same code in the same func for 64 bit.

also could move the intel workaround code to early_init_intel and init_intel of
intel.c/intel_64.c

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/