kernel-fxtec-pro1x/arch/x86/kernel
Jeremy Fitzhardinge cd5dce2fb0 x86: fix CPA self-test for "x86/paravirt: groundwork for 64-bit Xen support"
Ingo Molnar wrote:
> -tip auto-testing found pagetable corruption (CPA self-test failure):
>
> [   32.956015] CPA self-test:
> [   32.958822]  4k 2048 large 508 gb 0 x 2556[ffff880000000000-ffff88003fe00000] miss 0
> [   32.964000] CPA ffff88001d54e000: bad pte 1d4000e3
> [   32.968000] CPA ffff88001d54e000: unexpected level 2
> [   32.972000] CPA ffff880022c5d000: bad pte 22c000e3
> [   32.976000] CPA ffff880022c5d000: unexpected level 2
> [   32.980000] CPA ffff8800200ce000: bad pte 200000e3
> [   32.984000] CPA ffff8800200ce000: unexpected level 2
> [   32.988000] CPA ffff8800210f0000: bad pte 210000e3
>
> config and full log can be found at:
>
>  http://redhat.com/~mingo/misc/config-Mon_Jun_30_11_11_51_CEST_2008.bad
>  http://redhat.com/~mingo/misc/log-Mon_Jun_30_11_11_51_CEST_2008.bad

Phew.  OK, I've worked this out.  Short version is that's it's a false
alarm, and there was no real failure here.  Long version:

    * I changed the code to create the physical mapping pagetables to
      reuse any existing mapping rather than replace it.   Specifically,
      reusing an pud pointed to by the pgd caused this symptom to appear.
    * The specific PUD being reused is the one created statically in
      head_64.S, which creates an initial 1GB mapping.
    * That mapping doesn't have _PAGE_GLOBAL set on it, due to the
      inconsistency between __PAGE_* and PAGE_*.
    * The CPA test attempts to clear _PAGE_GLOBAL, and then checks to
      see that the resulting range is 1) shattered into 4k pages, and 2)
      has no _PAGE_GLOBAL.
    * However, since it didn't have _PAGE_GLOBAL on that range to start
      with, change_page_attr_clear() had nothing to do, and didn't
      bother shattering the range,
    * resulting in the reported messages

The simple fix is to set _PAGE_GLOBAL in level2_ident_pgt.

An additional fix to make CPA testing more robust by using some other
pagetable bit (one of the unused available-to-software ones).  This
would solve spurious CPA test warnings under Xen which uses _PAGE_GLOBAL
for its own purposes (ie, not under guest control).

Also, we should revisit the use of _PAGE_GLOBAL in asm-x86/pgtable.h,
and use it consistently, and drop MAKE_GLOBAL.  The first time I
proposed it it caused breakages in the very early CPA code; with luck
that's all fixed now.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Mark McLoughlin <markmc@redhat.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-08 13:16:15 +02:00
..
acpi x86: check command line when CONFIG_X86_MPPARSE is not set, v2 2008-07-08 12:48:31 +02:00
cpu x86: remove open-coded save/load segment operations 2008-07-08 13:10:25 +02:00
.gitignore
alternative.c x86: harden kernel code patching 2008-04-25 19:54:07 +02:00
amd_iommu.c x86, AMD IOMMU: flush domain TLB when there is more than one page to flush 2008-07-04 11:44:40 +02:00
amd_iommu_init.c x86, AMD IOMMU: remove unnecessary code from the iommu_enable function 2008-07-04 11:44:44 +02:00
aperture_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
apic_32.c x86: use disable_apic in 32bit 2008-07-08 13:16:08 +02:00
apic_64.c x86: nmi_watchdog - use NMI_NONE by default 2008-07-08 12:51:41 +02:00
apm_32.c x86: Switch apm to unlocked_kernel 2008-05-25 12:03:27 +02:00
asm-offsets.c
asm-offsets_32.c x86/paravirt: split sysret and sysexit 2008-07-08 13:13:15 +02:00
asm-offsets_64.c x86/paravirt, 64-bit: add adjust_exception_frame 2008-07-08 13:15:57 +02:00
audit_64.c
bootflag.c
cpuid.c PM: Remove destroy_suspended_device() 2008-04-19 19:10:28 -07:00
crash.c x86: allow machine_crash_shutdown to be replaced 2008-04-27 12:00:29 +03:00
crash_dump_32.c
crash_dump_64.c
doublefault_32.c
ds.c
e820.c x86: move reserve_setup_data to setup.c 2008-07-08 13:16:14 +02:00
early-quirks.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
early_printk.c
efi.c x86 boot: only pick up additional EFI memmap if add_efi_memmap flag 2008-07-08 13:10:41 +02:00
efi_32.c x86: fix Intel Mac booting with EFI 2008-07-03 08:19:18 +02:00
efi_64.c x86: add flags parameter to reserve_bootmem_generic() 2008-07-08 11:49:49 +02:00
efi_stub_32.S
efi_stub_64.S
entry_32.S x86/paravirt: split sysret and sysexit 2008-07-08 13:13:15 +02:00
entry_64.S x86/paravirt, 64-bit: make load_gs_index() a paravirt operation 2008-07-08 13:15:58 +02:00
genapic_64.c x86: introduce max_physical_apicid for bigsmp switching 2008-06-10 11:32:09 +02:00
genapic_flat_64.c
genx2apic_uv_x.c x86, uv: update macros used by UV platform 2008-06-02 12:56:00 +02:00
geode_32.c x86, geode: add a VSA2 ID for General Software 2008-06-19 14:19:03 +02:00
head.c x86: move reserve_setup_data to setup.c 2008-07-08 13:16:14 +02:00
head32.c x86: extract common part of head32.c and head64.c into head.c 2008-06-05 15:10:02 +02:00
head64.c x86: move reserve_setup_data to setup.c 2008-07-08 13:16:14 +02:00
head_32.S x86: boot secondary cpus through initial_code 2008-07-08 12:48:18 +02:00
head_64.S x86: fix CPA self-test for "x86/paravirt: groundwork for 64-bit Xen support" 2008-07-08 13:16:15 +02:00
hpet.c x86: clean up computation of HPET .mult variables 2008-05-12 21:27:54 +02:00
i386_ksyms_32.c
i387.c x86 ptrace: fix PTRACE_GETFPXREGS error 2008-07-01 11:03:31 +02:00
i8237.c
i8253.c x86: cleanup div_sc() usage 2008-04-26 17:35:47 +02:00
i8259.c i8259: fix final ugliness 2008-06-02 11:55:52 +02:00
init_task.c [PATCH] take init_files to fs/file.c 2008-05-16 17:22:20 -04:00
io_apic_32.c x86: let setup_arch call init_apic_mappings for 32bit 2008-07-08 13:16:04 +02:00
io_apic_64.c x86: nmi_watchdog - use NMI_NONE by default 2008-07-08 12:51:41 +02:00
io_delay.c
ioport.c
ipi.c x86: ipi.c: removed duplicated include 2008-05-25 08:58:32 +02:00
irq_32.c Merge branch 'x86/irq' into x86/devel 2008-07-08 09:53:57 +02:00
irq_64.c x86: make /proc/stat account for all interrupts 2008-05-25 07:11:49 +02:00
irqinit_32.c x86: rename the i8259_32/64.c leftovers to irqinit_32/64.c 2008-05-24 16:47:39 +02:00
irqinit_64.c x86: rename the i8259_32/64.c leftovers to irqinit_32/64.c 2008-05-24 16:47:39 +02:00
k8.c
kdebugfs.c x86, boot: export linked list of struct setup_data via debugfs 2008-04-26 21:34:42 +02:00
kgdb.c
kprobes.c
kvm.c x86: KVM guest: hypercall batching 2008-04-27 12:00:28 +03:00
kvmclock.c x86: KVM guest: Use the paravirt clocksource structs and functions 2008-06-24 21:02:33 +03:00
ldt.c x86: avoid re-loading LDT in unrelated address spaces 2008-05-22 19:11:20 +02:00
machine_kexec_32.c x86: arch/x86/kernel/machine_kexec_32.c: remove extra semicolons 2008-06-24 18:37:49 +02:00
machine_kexec_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
Makefile x86: rename setup_32.c to setup.c 2008-07-08 13:10:49 +02:00
mca_32.c
mfgpt_32.c geode: fix modular build 2008-06-12 21:25:51 +02:00
microcode.c x86: microcode: cosmetic changes 2008-07-03 11:37:20 +02:00
mmconf-fam10h_64.c x86: move mmconfig declarations to header 2008-05-30 15:45:17 -07:00
module_32.c
module_64.c
mpparse.c x86: add flags parameter to reserve_bootmem_generic() 2008-07-08 11:49:49 +02:00
msr.c PM: Remove destroy_suspended_device() 2008-04-19 19:10:28 -07:00
nmi.c x86: nmi_watchdog - introduce nmi_watchdog_active() helper 2008-07-08 12:51:42 +02:00
numaq_32.c x86: make generic arch support NUMAQ 2008-06-10 11:34:42 +02:00
olpc.c x86: olpc: add One Laptop Per Child architecture support 2008-04-29 08:06:07 -07:00
paravirt.c x86, paravirt, 64-bit: fix compile errors with IA32_EMULATION off 2008-07-08 13:16:13 +02:00
paravirt_patch_32.c x86/paravirt: split sysret and sysexit 2008-07-08 13:13:15 +02:00
paravirt_patch_64.c x86/paravirt: add sysret/sysexit pvops for returning to 32-bit compatibility userspace 2008-07-08 13:15:52 +02:00
pci-calgary_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
pci-dma.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
pci-gart_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
pci-nommu.c x86: unify pci-nommu 2008-04-19 19:19:57 +02:00
pci-swiotlb_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
pcspeaker.c
pmtimer_64.c
probe_roms_32.c x86: seperate probe_roms into another file 2008-07-08 12:50:05 +02:00
process.c x86: add C1E aware idle function, fix 2008-07-08 07:47:37 +02:00
process_32.c x86: move cpu_exit_clear to process_32.c 2008-07-08 12:48:24 +02:00
process_64.c x86: save %fs and %gs before load_TLS() and arch_leave_lazy_cpu_mode() 2008-07-08 13:11:11 +02:00
ptrace.c x86 ptrace: fix PTRACE_GETFPXREGS error 2008-07-01 11:03:31 +02:00
pvclock.c x86: Add structs and functions for paravirt clocksource 2008-06-24 21:02:31 +03:00
quirks.c x86: add another PCI ID for ICH6 force hpet. 2008-06-05 15:11:35 +02:00
reboot.c x86: constify data in reboot.c 2008-05-25 08:58:30 +02:00
reboot_fixups_32.c x86: constify data in reboot.c 2008-05-25 08:58:30 +02:00
relocate_kernel_32.S
relocate_kernel_64.S
rtc.c provide rtc_cmos platform device 2008-06-12 18:05:42 -07:00
scx200_32.c
setup.c x86: move reserve_setup_data to setup.c 2008-07-08 13:16:14 +02:00
setup_percpu.c x86: move parse elfvorehdr back to setup.c 2008-07-08 13:10:53 +02:00
sigframe.h
signal_32.c signals: x86 TS_RESTORE_SIGMASK 2008-04-30 08:29:37 -07:00
signal_64.c signals: x86 TS_RESTORE_SIGMASK 2008-04-30 08:29:37 -07:00
smp.c x86: fix app crashes after SMP resume 2008-05-13 19:36:12 +02:00
smpboot.c x86: nmi_watchdog - use NMI_NONE by default 2008-07-08 12:51:41 +02:00
smpcommon.c
smpcommon_32.c
srat_32.c x86: numa32 pfn print out using hex instead 2008-07-08 12:50:23 +02:00
stacktrace.c
step.c
summit_32.c x86: make generic arch support NUMAQ 2008-06-10 11:34:42 +02:00
sys_i386_32.c x86: coding style fixes to arch/x86/kernel/sys_i386_32.c 2008-06-10 12:34:54 +02:00
sys_x86_64.c unified (weak) sys_pipe implementation 2008-05-03 13:50:33 -07:00
syscall_64.c
syscall_table_32.S
tce_64.c
test_nx.c
test_rodata.c
time_32.c x86: I/O APIC: AEOI timer acknowledgement clean-ups 2008-07-08 09:12:53 +02:00
time_64.c x86: use cpu_khz for loops_per_jiffy calculation, cleanup 2008-06-24 13:53:46 +02:00
tlb_32.c
tlb_64.c SGI UV: TLB shootdown using broadcast assist unit, cleanups 2008-07-08 12:23:24 +02:00
tlb_uv.c x86, SGI UV: uv_ptc_proc_write fix 2008-07-08 12:23:31 +02:00
tls.c
tls.h
topology.c
trampoline.c x86: extend e820 ealy_res support 32bit 2008-05-25 10:55:11 +02:00
trampoline_32.S x86: trampoline_32.S - switch to .cpuinit.data 2008-04-26 17:35:47 +02:00
trampoline_64.S
traps_32.c x86: let setup_arch call init_apic_mappings for 32bit 2008-07-08 13:16:04 +02:00
traps_64.c Merge branch 'x86/nmi' into x86/devel 2008-07-08 12:17:08 +02:00
tsc_32.c Merge branches 'x86/mmio', 'x86/delay', 'x86/idle', 'x86/oprofile', 'x86/debug', 'x86/ptrace' and 'x86/amd-iommu' into x86/devel 2008-07-08 09:46:15 +02:00
tsc_64.c Merge branch 'linus' into x86/timers 2008-06-16 11:20:57 +02:00
tsc_sync.c
verify_cpu_64.S
vm86_32.c
vmi_32.c x86/paravirt: split sysret and sysexit 2008-07-08 13:13:15 +02:00
vmiclock_32.c x86: unify interrupt vector defines 2008-05-12 21:28:05 +02:00
vmlinux.lds.S
vmlinux_32.lds.S x86: move tracedata to RODATA 2008-05-25 07:09:47 +02:00
vmlinux_64.lds.S Merge branches 'x86/numa-fixes', 'x86/apic', 'x86/apm', 'x86/bitops', 'x86/build', 'x86/cleanups', 'x86/cpa', 'x86/cpu', 'x86/defconfig', 'x86/gart', 'x86/i8259', 'x86/intel', 'x86/irqstats', 'x86/kconfig', 'x86/ldt', 'x86/mce', 'x86/memtest', 'x86/pat', 'x86/ptemask', 'x86/resumetrace', 'x86/threadinfo', 'x86/timers', 'x86/vdso' and 'x86/xen' into x86/devel 2008-07-08 09:16:56 +02:00
vsmp_64.c x86: vsmp_64 add missing includes 2008-05-25 08:58:24 +02:00
vsyscall_64.c x86, 64-bit: use write_gdt_entry in vsyscall_set_cpu 2008-07-08 13:10:26 +02:00
x8664_ksyms_64.c x86: move x86_64 gdt closer to i386 2008-07-08 12:48:16 +02:00