id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
1755fbcc6666906cada43c1c839ca1fc6616d4a6
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Introduce gfn_to_gpa()
Problem Details: Converting a frame number to an address is tricky since the data type changes size. Introduce a function to do it. This fixes an actual bug when accessing guest ptes. Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 048849d97b35..eda82cded88e 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -499,6 +499,10 @@ static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) return slot - kvm->memslots; } +static inline gpa_t gfn_to_gpa(gfn_t gf...
2065b3727ecdb64450597d70f7e13af00b85dbd8
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Fix potential memory leak with smp real-mode
Problem Details: When we map a page, we check whether some other vcpu mapped it for us and if so, bail out. But we should decrease the refcount on the page as we do so. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 87d8e70fe502..8add4d5c6840 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -907,8 +907,10 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, hpa_t p) pte = table[index]; was_rmapped = is_rmap_pte(pte); - if (is_shadow_presen...
00fc9f5ae5988fb180f5a288451a741b35cc806e
Analyze and fix the following issue in the Linux kernel code: KVM: Remove unused "rmap_overflow" variable
Problem Details: Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 19014564ddbb..ba78a45811cd 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -318,7 +318,6 @@ struct kvm { unsigned int n_alloc_mmu_pages; struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; - unsigned ...
15b00f32d53f31fe194b17ca0384a37756b55be2
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Force seg.base == (seg.sel << 4) in real mode
Problem Details: Ensure that segment.base == segment.selector << 4 when entering the real mode on Intel so that the CPU will not bark at us. This fixes some old protected mode demo from http://www.x86.org/articles/pmbasics/tspec_a1_doc.htm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity ...
```diff diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 0c082faaa6db..b4c0bdce7b34 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1165,7 +1165,8 @@ static void fix_rmode_seg(int seg, struct kvm_save_segment *save) save->base = vmcs_readl(sf->base); save->limit = vmcs_read32(sf->limit); save->...
a16b043cc96db4a01abb337bef4a51cebcfcbb1b
Analyze and fix the following issue in the Linux kernel code: KVM: Remove __init attributes for kvm_init_debug and kvm_init_msr_list
Problem Details: Since their callers are not declared with __init. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 7335435f528e..e24489b409cf 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -1332,7 +1332,7 @@ static u64 stat_get(void *_offset) DEFINE_SIMPLE_ATTRIBUTE(stat_fops, stat_get, NULL, "%llu\n"); -static __init void kvm_init_...
56919c5c97aa07b150311c5c9802af07872ee2b0
Analyze and fix the following issue in the Linux kernel code: KVM: Remove ptr comparisons to 0
Problem Details: Fix sparse warnings "Using plain integer as NULL pointer" Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index e34e246eafec..c4ad66bb5e08 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -398,7 +398,7 @@ static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm) static inline int irqchip_in_kernel(struct kvm *kvm) { - return pic_irqchip(kvm) != ...
9c8cba3761d4741cfd53ecc40604fac01f52128a
Analyze and fix the following issue in the Linux kernel code: KVM: Fix faults during injection of real-mode interrupts
Problem Details: If vmx fails to inject a real-mode interrupt while fetching the interrupt redirection table, it fails to record this in the vectoring information field. So we detect this condition and do it ourselves. Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index f045f4005eaa..26719aa9701e 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -65,7 +65,13 @@ struct vcpu_vmx { int fs_reload_needed; int guest_efer_loaded; } host_state; - + struct { + struct { + bool pending; + u8...
1155f76a8166ae6fc88e7d73eb6817eb9012d476
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Read & store IDT_VECTORING_INFO_FIELD
Problem Details: We'll want to write to it in order to fix real-mode irq injection problems, but it is a read-only field. Storing it in a variable solves that issue. Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index d2c25e25d3aa..f045f4005eaa 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -48,6 +48,7 @@ struct vcpu_vmx { struct kvm_vcpu vcpu; int launched; u8 fail; + u32 idt_vectoring_info;...
9f1ef3f8f5f8ade2561d969181b152c225b82a3e
Analyze and fix the following issue in the Linux kernel code: KVM: Simplify decode_register_operand() calling convention
Problem Details: Now that rex_prefix is part of the decode cache, there is no need to pass it along. Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 884e4a2e47e6..b352a6c4d4a2 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -518,10 +518,10 @@ static int test_cc(unsigned int condition, unsigned int flags) static void decode_register_operand(struct operand *o...
aab61cc0d28f6fab0c2c9137d95dea54c7dbcf46
Analyze and fix the following issue in the Linux kernel code: KVM: Fix gfn_to_page() acquiring mmap_sem twice
Problem Details: KVM's nopage handler calls gfn_to_page() which acquires the mmap_sem when calling out to get_user_pages(). nopage handlers are already invoked with the mmap_sem held though. Introduce a __gfn_to_page() for use by the nopage handler which requires the lock to already be held. This was noticed by tglx...
```diff diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index ac5ed00e9065..f439e45233f2 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -633,7 +633,10 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn) } EXPORT_SYMBOL_GPL(kvm_is_visible_gfn); -struct page *gfn_to_page(struct kvm...
b284be576471b1521dd04c0845beedb790cbb9d7
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: cmc, clc, cli, sti
Problem Details: Instruction: cmc, clc, cli, sti opcodes: 0xf5, 0xf8, 0xfa, 0xfb respectively. [avi: fix reference to EFLG_IF which is not defined anywhere] Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 988c6498640f..e962de331606 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -161,10 +161,10 @@ static u8 opcode_table[256] = { ImplicitOps, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 0, 0, 0, /* 0xF0 - 0...
e25e3ed56fce591e09477b0ce043d90f97988f37
Analyze and fix the following issue in the Linux kernel code: KVM: Add some \n in ioapic_debug()
Problem Details: Add new-line at end of debug strings. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c index c7992e667fdb..8503d99b8339 100644 --- a/drivers/kvm/ioapic.c +++ b/drivers/kvm/ioapic.c @@ -40,8 +40,11 @@ #include <asm/apicdef.h> #include <asm/io_apic.h> #include "irq.h" -/* #define ioapic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */ +...
c22e3514fceb2f514093ce1d19a2f660ac7347ae
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Fix nx access bit for huge pages
Problem Details: We must set the bit before the shift, otherwise the wrong bit gets set. Signed-off-by: Avi Kivity <avi@qumranet.com>
```diff diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index da36e48fd026..e07cb2e006c2 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -382,9 +382,9 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, metaphysical = 1; hugepage_access = walker->pte; ...
d589444e924bc72e42fa94853f9096589d69374d
Analyze and fix the following issue in the Linux kernel code: KVM: Add kvm_free_lapic() to pair with kvm_create_lapic()
Problem Details: Instead of the asymetry of kvm_free_apic, implement kvm_free_lapic(). And guess what? I found a minor bug: we don't need to hrtimer_cancel() from kvm_main.c, because we do that in kvm_free_apic(). Also: 1) kvm_vcpu_uninit should be the reverse order from kvm_vcpu_init. 2) Don't set apic->regs_page to...
```diff diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 11fc014e2b30..508280ea6fcf 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -139,7 +139,7 @@ int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu); int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); int kvm_create_lapic(struct kvm_vcpu *vcpu); v...
b4c6abfef400c0f74d9b86a149a6719706cfdbbc
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: Any legacy prefix after a REX prefix nullifies its effect
Problem Details: This patch modifies the management of REX prefix according behavior I saw in Xen 3.1. In Xen, this modification has been introduced by Jan Beulich. http://lists.xensource.com/archives/html/xen-changelog/2007-01/msg00081.html Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi ...
```diff diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index 0afe660aec4b..e294d8409571 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -521,7 +521,6 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) { struct decode_cache *c = &ctxt->decode; ...
7aa81cc04781b5b99a0647ec04533599d78cd219
Analyze and fix the following issue in the Linux kernel code: KVM: Refactor hypercall infrastructure (v3)
Problem Details: This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong hypercall instruction for the underlying architecture and replacing it with the right one lazily. A ...
```diff diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 3b0bc4bda5f2..da9c3aa1c08c 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -46,6 +46,7 @@ #define KVM_MAX_CPUID_ENTRIES 40 #define DE_VECTOR 0 +#define UD_VECTOR 6 #define NM_VECTOR 7 #define DF_VECTOR 8 #define TS_VECTOR 10 @@ -317,9 +31...
afadcd788f37bfa62d92662e54a720c26c91becf
Analyze and fix the following issue in the Linux kernel code: x86: fix nodemap_size according to nodeid bits
Problem Details: memnode.map is s16 array because of nodeid is 16 bit now. so need to increase the nodemap_size according to that bits. Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index f0e5cabe49d8..dc3b1f7e1451 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -92,7 +92,7 @@ static int __init allocate_cachealigned_memnodemap(void) pad = L1_CACHE_BYTES - 1; pad_addr = 0x8000; - nodemap_size = pad + memnodem...
9198715763e8d0fd7fb7578c07916a5313e28b9d
Analyze and fix the following issue in the Linux kernel code: x86: fix overlap between pagetable with bss section
Problem Details: one early crash on one 8 node 256g machine: Command line: console=uart8250,io,0x3f8,115200n8 initrd=kernel.org/mydisk11_x86_64.gz rw root=/dev/ram0 debug initcall_debug apic=debug acpi.debug_level=0x0000000f pci=routeirq ip=dhcp load_ramdisk=1 ramdisk_size=131072 BOOT_IMAGE=kernel.org/bzImage_2.6.25_k...
```diff diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index f8b7bebb4344..c617174e8963 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c @@ -70,8 +70,8 @@ void __init reserve_early(unsigned long start, unsigned long end) for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++)...
f6df72e71eba621b2f5c49b3a763116fac748f6e
Analyze and fix the following issue in the Linux kernel code: x86: fix early_ioremap pagetable ops
Problem Details: Put appropriate pagetable update hooks in so that paravirt knows what's going on in there. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index ac9ab20d8092..ed795721ca8e 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -18,6 +18,7 @@ #include <asm/fixmap.h> #include <asm/pgtable.h> #include <asm/tlbflush.h> +#include <asm/pgalloc.h> enum ioremap_mode { IOR_MODE_U...
f212ec4b7b4d84290f12c9c0416cdea283bf5f40
Analyze and fix the following issue in the Linux kernel code: x86: early boot debugging via FireWire (ohci1394_dma=early)
Problem Details: This patch adds a new configuration option, which adds support for a new early_param which gets checked in arch/x86/kernel/setup_{32,64}.c:setup_arch() to decide wether OHCI-1394 FireWire controllers should be initialized and enabled for physical DMA access to allow remote debugging of early problems l...
```diff diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt new file mode 100644 index 000000000000..de4804e8b396 --- /dev/null +++ b/Documentation/debugging-via-ohci1394.txt @@ -0,0 +1,179 @@ + + Using physical DMA provided by OHCI-1394 FireWire controllers for debugging +...
d7d119d777d7ed22c4095915e9c985a8b75bfe5f
Analyze and fix the following issue in the Linux kernel code: x86: arch/x86/mm/init_32.c printk fixes
Problem Details: printk fixes. NOP in terms of functionality, but strings got a bit larger due to the KERN_ markers that were added. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index c6975fc6944a..02d269c07b96 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -530,7 +530,7 @@ void __init paging_init(void) #ifdef CONFIG_X86_PAE set_nx(); if (nx_enabled) - printk("NX (Execute Disable) protection: active\n")...
10f22dde556d1ed41d55355d1fb8ad495f9810c8
Analyze and fix the following issue in the Linux kernel code: x86: arch/x86/mm/init_64.c printk fixes
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index bb732bb79b4a..a95272644591 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -46,10 +46,6 @@ #include <asm/kdebug.h> #include <asm/numa.h> -#ifndef Dprintk -# define Dprintk(x...) -#endif - const struct dma_mapping_ops *dma_op...
a3828064be4ed8e95907d3943e7af13cb709694d
Analyze and fix the following issue in the Linux kernel code: x86: fixes some bugs about EFI memory map handling
Problem Details: This patch fixes some bugs of EFI memory handing code. - On x86_64, it is possible that EFI memory map can not be mapped via identity map, so efi_map_memmap is removed, just use early_ioremap. - On i386, the EFI memory map mapping take effect cross paging_init, so it is not necessary to use efi_m...
```diff diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 174b067b9d03..1411324a625c 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c @@ -474,6 +474,8 @@ void __init efi_enter_virtual_mode(void) efi.reset_system = virt_efi_reset_system; efi.set_virtual_address_map = virt_efi_set_virtual...
29caf2f98cdb266dffb50dfd412f951e8d46f719
Analyze and fix the following issue in the Linux kernel code: x86: add is_f00f_bug helper to fault_32|64.c
Problem Details: Further towards unifying these files, add another helper in same spirit as is_errata93. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index f4f8c324715f..75ae8c498d67 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -211,8 +211,6 @@ void dump_pagetable(unsigned long address) printk("\n"); } -void do_invalid_op(struct pt_regs *, unsigned long); - static inlin...
86f03989d99cfa2e1216cdd7aa996852236909cf
Analyze and fix the following issue in the Linux kernel code: x86: cpa: fix the self-test
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 2d0bd33b73aa..2e1e3af28c3a 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -40,7 +40,7 @@ comment "Page alloc debug is incompatible with Software Suspend on i386" config DEBUG_PAGEALLOC bool "Debug page memory allocation...
8f46924600e30b140445f5b84abe9b80d2fff5fb
Analyze and fix the following issue in the Linux kernel code: x86: enable CONFIG_DEBUG_PAGEALLOC more widely
Problem Details: make CONFIG_DEBUG_PAGEALLOC universally available. CONFIG_HIBERNATION and CONFIG_HUGETLBFS was disabling it, for no particular reason. If there are any unfixed bugs here we'll fix it, but do not disable vital debugging facilities like that .. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by:...
```diff diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 2a859a7e2d74..347e33e5f395 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -40,7 +40,7 @@ comment "Page alloc debug is incompatible with Software Suspend on i386" config DEBUG_PAGEALLOC bool "Debug page memory allocation...
ee01f1122ceb02a2c9b7142c5dd17b49e59ba774
Analyze and fix the following issue in the Linux kernel code: x86: init memory debugging
Problem Details: debug incorrect/late access to init memory, by permanently unmapping the init memory ranges. Depends on CONFIG_DEBUG_PAGEALLOC=y. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index a72737c05747..8d7f723cfc28 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -783,6 +783,16 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) { unsigned long addr; +#ifdef CONFIG_DEBUG_PAGEALLOC + /* ...
4c61afcdb2cd4be299c1442b33adf312b695e2d7
Analyze and fix the following issue in the Linux kernel code: x86: fix clflush_page_range logic
Problem Details: only present ptes must be flushed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index bbfc8e2466ab..97ec9e7d29d9 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -26,7 +26,6 @@ within(unsigned long addr, unsigned long start, unsigned long end) * Flushing functions */ - /** * clflush_cache_range - flush...
56744546b3e5379177a70e7306c6283f727e4732
Analyze and fix the following issue in the Linux kernel code: x86: cpa use the new set_clr function
Problem Details: Convert cpa_set and cpa_clear to call the new set_clr function. Seperate out the debug helpers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index c54832b75069..7823adab96e4 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -321,116 +321,16 @@ static int change_page_attr_set_clr(unsigned long addr, int numpages, return ret; } -/** - * change_page_attr_set - Change pa...
edeed30589f5defe63ce6aaae56f2b7c855e4520
Analyze and fix the following issue in the Linux kernel code: x86: add testcases for RODATA and NX protections/attributes
Problem Details: Latest update; I now have 4 NX tests, but 2 fail so they're #if 0'd. I also cleaned up the NX test code quite a bit, and got rid of the ugly exception table sorting stuff. From: Arjan van de Ven <arjan@linux.intel.com> This patch adds testcases for the CONFIG_DEBUG_RODATA configuration option as well...
```diff diff --git a/arch/x86/kernel/test_nx.c b/arch/x86/kernel/test_nx.c new file mode 100644 index 000000000000..6d7ef11e7975 --- /dev/null +++ b/arch/x86/kernel/test_nx.c @@ -0,0 +1,176 @@ +/* + * test_nx.c: functional test for NX functionality + * + * (C) Copyright 2008 Intel Corporation + * Author: Arjan van de V...
4692a1450b4d1000a942022b088c8791749dd65e
Analyze and fix the following issue in the Linux kernel code: x86: cpa: fix loop
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index a2ee317548f2..5cfc0d4ade56 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -304,7 +304,7 @@ static int change_page_attr_addr(unsigned long address, pgprot_t prot) static int change_page_attr_set(unsigned long addr, int numpa...
a72a08a4b61cb8868606a69b744848552e92062b
Analyze and fix the following issue in the Linux kernel code: x86: cpa: fix split thinko
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 23f0aa3d01c1..a2ee317548f2 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -216,8 +216,12 @@ repeat: prot = static_protections(prot, address); if (level == PG_LEVEL_4K) { + WARN_ON_ONCE(pgprot_val(prot) & _PAGE_PSE); ...
488fd99588bf23da951b524a806e44feaa1aa366
Analyze and fix the following issue in the Linux kernel code: x86: fix pageattr-selftest
Problem Details: In Ingo's testing, he found a bug in the CPA selftest code. What would happen is that the test would call change_page_attr_addr on a range of memory, part of which was read only, part of which was writable. The only thing the test wanted to change was the global bit... What actually happened was that ...
```diff diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c index 6a41a0f0c149..fe73905d075e 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c @@ -162,8 +162,8 @@ static __init int exercise_pageattr(void) continue; } - err = change_page_attr_addr(addr[i], len[i], - ...
5f8681529cb243b3a492e55f2da9d632ad0d5e32
Analyze and fix the following issue in the Linux kernel code: x86: fix ioremap API
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index e84c09e7d2c1..8777bb7688f4 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -106,8 +106,8 @@ static int ioremap_change_attr(unsigned long phys_addr, unsigned long size, * have to convert them into an offset in a page-aligned map...
266b9f8727976769e2ed2dad77ac9295f37e321e
Analyze and fix the following issue in the Linux kernel code: x86: fix ioremap RAM check
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 24e42cab8d58..e84c09e7d2c1 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -125,23 +125,14 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRES...
950f9d95bed1a366434d3597ea75f5b9d772d74f
Analyze and fix the following issue in the Linux kernel code: x86: fix the missing BIOS area check in page_is_ram
Problem Details: page_is_ram has a FIXME since ages, which reminds to sanity check the BIOS area between 640k and 1M, which is sometimes falsely reported as RAM in the e820 tables. Implement the sanity check. Move the BIOS range defines from pageattr.c into e820.h to avoid duplicate defines. Signed-off-by: Thomas Gle...
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index d3026e1906f9..24e42cab8d58 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -42,13 +42,18 @@ int page_is_ram(unsigned long pagenr) */ if (e820.map[i].type != E820_RAM) continue; - /* - * !!!FIXME!!! Some BIOSen repor...
91eebf40b3cb5abd76e813e17dbc320ff2ea3295
Analyze and fix the following issue in the Linux kernel code: x86: style cleanup of ioremap code
Problem Details: Fix the coding style before going further. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 18757f058bda..30ff2586db1e 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -1,6 +1,4 @@ /* - * arch/i386/mm/ioremap.c - * * Re-map IO memory to kernel address space so that we can access it. * This is needed for ...
1aaf74e919be54be0023c3124923fb537c7fb772
Analyze and fix the following issue in the Linux kernel code: x86: fix ioremap pgprot inconsistency
Problem Details: The pgprot flags which are handed into ioremap_page_range() are different to those which are set in change_page_attr(). The ioremap_page_range flags are executable, while the c_p_a flags are not. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/ioremap_64.c b/arch/x86/mm/ioremap_64.c index 0a05f024dc22..a37556124c86 100644 --- a/arch/x86/mm/ioremap_64.c +++ b/arch/x86/mm/ioremap_64.c @@ -53,7 +53,7 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long size, * Must use a address here and not struct page because the...
a40343497e8983cdf07fde99c9081ee62b96f745
Analyze and fix the following issue in the Linux kernel code: x86: fix ioremap pgprot inconsistency
Problem Details: The pgprot flags which are handed into ioremap_page_range() are different to those which are set in change_page_attr(). The ioremap_page_range flags are executable, while the c_p_a flags are not. Also make the mappings global (which is a NOP currently on 32bit, although CPUs from PPRO+ onwards support ...
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index f8e6c4709cc2..18757f058bda 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -67,8 +67,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l return NULL; } - prot = __pgprot(_PAG...
1c17f4d615f34a4ecfcf9132d643126b226f5e79
Analyze and fix the following issue in the Linux kernel code: x86: ioremap_nocache fix
Problem Details: This patch fixes a bug of ioremap_nocache. ioremap_nocache() will call __ioremap() with flags != 0 to do the real work, which will call change_page_attr_addr() if phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT). But some pages between 0 ~ end_pfn_map << PAGE_SHIFT are not mapped by identity map, thi...
```diff diff --git a/arch/x86/mm/ioremap_64.c b/arch/x86/mm/ioremap_64.c index 2815ab60009b..0a05f024dc22 100644 --- a/arch/x86/mm/ioremap_64.c +++ b/arch/x86/mm/ioremap_64.c @@ -41,7 +41,14 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long size, if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { ...
4c881ca1819da180b047f87eedeb9a5957918705
Analyze and fix the following issue in the Linux kernel code: x86: fix NX bit handling in change_page_attr()
Problem Details: This patch fixes a bug of change_page_attr/change_page_attr_addr on Intel i386/x86_64 CPUs. After changing page attribute to be executable with these functions, the page remains un-executable on Intel i386/x86_64 CPU. Because on Intel i386/x86_64 CPU, only if the "NX" bits of all three level page tab...
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index d18c41d752f3..cbe8e9223bee 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -130,8 +130,13 @@ static int split_large_page(pte_t *kpte, unsigned long address) set_pte(&pbase[i], pfn_pte(addr >> PAGE_SHIFT, ref_prot)); /*...
5508a7489659f1eed108d3ae7c2d36c8794ee330
Analyze and fix the following issue in the Linux kernel code: x86: cpa self-test fixes
Problem Details: cpa self-test fixes. change_page_attr_addr() was buggy, it passed in a virtual address as a physical one. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c index 91e05a26004d..a12dabbd5c33 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c @@ -106,12 +106,6 @@ static __init int print_split(struct split_state *s) return err; } -static __init int state_same(struct spl...
a2172e2586f6662af996e47f417bb718c37cf8d2
Analyze and fix the following issue in the Linux kernel code: x86: fix some bugs about EFI runtime code mapping
Problem Details: This patch fixes some bugs of making EFI runtime code executable. - Use change_page_attr in i386 too. Because the runtime code may be mapped not through ioremap. - If there is no _PAGE_NX in __supported_pte_mask, the change_page_attr is not called. - Make efi_ioremap map pages as PAGE_KERNEL_EXE...
```diff diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 5d492f99d967..834ecfb41e97 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c @@ -40,6 +40,8 @@ #include <asm/setup.h> #include <asm/efi.h> #include <asm/time.h> +#include <asm/cacheflush.h> +#include <asm/tlbflush.h> #define EFI...
cd58289667293593b04fd315ec7f2f37589134cb
Analyze and fix the following issue in the Linux kernel code: x86: fix more non-global TLB flushes
Problem Details: fix more __flush_tlb() instances, out of caution. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 58438bafedca..a317336cdeaa 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -27,7 +27,7 @@ static void __init zap_identity_mappings(void) { pgd_t *pgd = pgd_offset_k(0UL); pgd_clear(pgd); - __flush_tlb(); + __flus...
1a2b441231ddc12b785940000320894bfa02bd82
Analyze and fix the following issue in the Linux kernel code: x86: fix early_ioremap() on 64-bit
Problem Details: Fix early_ioremap() on x86-64 I had ACPI failures on several machines since a few days. Symptom was NUMA nodes not getting detected or worse cores not getting detected. They all came from ACPI not being able to read various of its tables. I finally bisected it down to Jeremy's "put _PAGE_GLOBAL into P...
```diff diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 0fd9d7f77786..c250580a9432 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -228,7 +228,7 @@ __meminit void *early_ioremap(unsigned long addr, unsigned long size) addr &= PMD_MASK; for (i = 0; i < pmds; i++, addr += PMD_SIZE...
3c868823413d76bdd80c643603be8ab09dcb4d65
Analyze and fix the following issue in the Linux kernel code: x86: c_p_a() fix: reorder TLB / cache flushes to follow Intel recommendation
Problem Details: Intel recommends to first flush the TLBs and then the caches on caching attribute changes. c_p_a() previously did it the other way round. Reorder that. The procedure is still not fully compliant to the Intel documentation because Intel recommends a all CPU synchronization step between the TLB flushes ...
```diff diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index 523fd5b37df9..5cb5c7101f41 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c @@ -87,6 +87,12 @@ static void flush_kernel_map(void *arg) struct list_head *lh = (struct list_head *)arg; struct page *p; + /* + * Fl...
6ba9b7d8f0fe786954015ce5c0ef1837d5df56b7
Analyze and fix the following issue in the Linux kernel code: x86: fix c_p_a() boot crash
Problem Details: fix: > hm, i just found a failing 64-bit .config while testing your CPA > patchset: > > [ 1.916541] CPA mapping 4k 0 large 2048 gb 0 x 0[0-0] miss 0 > [ 1.919874] Unable to handle kernel paging request at 000000000335aea8 RIP: > [ 1.919874] [<ffffffff8021d2d3>] change_page_attr+0x3/0x61 >...
```diff diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c index c58fab061762..91e05a26004d 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c @@ -177,7 +177,7 @@ static __init int exercise_pageattr(void) continue; } - err = change_page_attr(virt_to_page(addr[i]), l...
aaa0e89023656c078c67cbd0460fc2ccbf3323c6
Analyze and fix the following issue in the Linux kernel code: x86: don't drop NX bit in pte modifier functions on 32-bit
Problem Details: The pte_* modifier functions that cleared bits dropped the NX bit on 32bit PAE because they only worked in int, but NX is in bit 63. Fix that by adding appropiate casts so that the arithmetic happens as long long on PAE kernels. I decided to just use 64bit arithmetic instead of open coding like pte_mo...
```diff diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index b4ee5939afe5..2f93723a3e18 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h @@ -147,17 +147,17 @@ static inline int pmd_large(pmd_t pte) { (_PAGE_PSE|_PAGE_PRESENT); } -static inline pte_t pte_mkclean(pte_t pte)...
0e3a95492989e452a33e5df9b51365da574b854d
Analyze and fix the following issue in the Linux kernel code: x86: early_ioremap_init(), enhance warnings
Problem Details: enhance the debug warning in early_ioremap_init(). Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index b743de841f68..f8e6c4709cc2 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -243,7 +243,22 @@ void __init early_ioremap_init(void) pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN)); *pgd = __pa(bm_pte) | _PAGE_...
927222b102186a6cc3e43e25062fcd18c800435e
Analyze and fix the following issue in the Linux kernel code: x86: fix EISA ioremap
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 8534cb53ff60..3cf72977d012 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c @@ -1142,11 +1142,11 @@ void __init trap_init(void) int i; #ifdef CONFIG_EISA - void __iomem *p = ioremap(0x0FFFD9, 4); + void __iom...
d701fda8601fe267fbd3648f108f0e751305101b
Analyze and fix the following issue in the Linux kernel code: x86: fix early_ioremap()/btmap
Problem Details: fix a long-standing weakness of the early-ioremap allocator: it uses a single pgd entry for the boot mappings, and was not properly protecting itself against crossing a 2MB (4MB) boundary. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/include/asm-x86/fixmap_32.h b/include/asm-x86/fixmap_32.h index 46bedb7b5426..fde140fd6d95 100644 --- a/include/asm-x86/fixmap_32.h +++ b/include/asm-x86/fixmap_32.h @@ -90,10 +90,18 @@ enum fixed_addresses { FIX_PARAVIRT_BOOTMAP, #endif __end_of_permanent_fixed_addresses, - /* temporary boot-...
793b24a2dd0d695c748efba7b2295e7f9fdd3139
Analyze and fix the following issue in the Linux kernel code: x86: make early_ioremap_debug early_param
Problem Details: This patch makes "early_ioremap_debug" a early parameter, because "early_ioreamp/early_iounmap" is only used during early boot stage. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 30855c44818d..7f7daf50efed 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -215,9 +215,9 @@ static int __init early_ioremap_debug_setup(char *str) { early_ioremap_debug = 1; - return 1; + return 0; } -__setup("e...
d18d6d65efc2f5a3ff9a41528fbcb716b2e32615
Analyze and fix the following issue in the Linux kernel code: x86: early_ioremap(), debugging
Problem Details: add early_ioremap() debug printouts via the early_ioremap_debug boot option. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 4bcd5e065df4..30855c44818d 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -208,6 +208,17 @@ void iounmap(volatile void __iomem *addr) } EXPORT_SYMBOL(iounmap); + +int __initdata early_ioremap_debug; + +static int...
bd796ed0232a036f5ab14ac68d0a05f791ebcc3b
Analyze and fix the following issue in the Linux kernel code: x86: add debug warnings to early_ioremap()
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 63f76ecae44c..4bcd5e065df4 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -306,12 +306,15 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size) /* Don't allow wraparound or zero size */ las...
64a8f852a20e90bf3018d3ace5b7f514f39db4cd
Analyze and fix the following issue in the Linux kernel code: x86: early_ioremap_reset fix
Problem Details: This patch fixes a bug of early_ioremap_reset. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 43b5e9fd6370..bfd7b8b2fe60 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c @@ -247,7 +247,7 @@ void __init early_ioremap_reset(void) unsigned long *pte, phys, addr; after_paging_init = 1; - for (idx = FIX_BTMAP_BEG...
beacfaac3f23b30814aafee37a055257c7062ef3
Analyze and fix the following issue in the Linux kernel code: x86 32-bit boot: rename bt_ioremap() to early_ioremap()
Problem Details: This patch renames bt_ioremap to early_ioremap, which is used in x86_64. This makes it easier to merge i386 and x86_64 usage. [ mingo@elte.hu: fix ] Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 2939b015c2ed..5d492f99d967 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c @@ -256,12 +256,12 @@ void __init efi_init(void) memmap.desc_version = boot_params.efi_info.efi_memdesc_version; memmap.desc_size = boot_params.efi_info....
851339b1ffc2b215c7c4e448465e78a4c2f643f2
Analyze and fix the following issue in the Linux kernel code: x86: clean up arch/x86/mm/pageattr-test.c
Problem Details: fix 15 checkpatch warnings. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c index 4b22eb47f23a..c58fab061762 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c @@ -4,36 +4,36 @@ * Clears the global bit on random pages in the direct mapping, then reverts * and compares page tables forwards...
6371b495991debfd1417b17c2bc4f7d7bae05739
Analyze and fix the following issue in the Linux kernel code: x86: change ioremap() to default to uncached
Problem Details: Prepare ioremap() to default to uncached. This will be the safest - but first we have to fix CPA. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h index 2a04bd17eac5..db3978846379 100644 --- a/include/asm-x86/io_32.h +++ b/include/asm-x86/io_32.h @@ -111,18 +111,27 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign * make bus memory CPU accessible via the rea...
5a96f4a55c3b0bfd40771a973b173e1b94909559
Analyze and fix the following issue in the Linux kernel code: x86: fix recursion in arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Problem Details: remove the recursion from this function. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 77e666628818..32671da8184e 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c @@ -555,7 +555,7 @@ static __cpuinit int threshold_create_device(unsigned int cpu) ...
8fe3deef013bebdbed1f75ae59ef9707fb6e5cc7
Analyze and fix the following issue in the Linux kernel code: x86: preallocate pmds at pgd creation time
Problem Details: In PAE mode, an update to the pgd requires a cr3 reload to make sure the processor notices the changes. Since this also has the side-effect of flushing the tlb, its an expensive operation which we want to avoid where possible. This patch mitigates the cost of installing the initial set of pmds on pro...
```diff diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index f85ee44720d2..33ddddfc26b0 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c @@ -294,6 +294,70 @@ static void pgd_dtor(void *pgd) #define UNSHARED_PTRS_PER_PGD \ (SHARED_KERNEL_PMD ? USER_PTRS_PER_PGD : PTRS_PER_PGD)...
a89780f3b84f9a421e2608580b55f12b3ac4f9c2
Analyze and fix the following issue in the Linux kernel code: xen: fix mismerge in masking pte flags
Problem Details: Looks like a mismerge/misapply dropped one of the cases of pte flag masking for Xen. Also, only mask the flags for present ptes. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 3e9e095c295c..e6184735545f 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -241,8 +241,10 @@ unsigned long long xen_pgd_val(pgd_t pgd) pte_t xen_make_pte(unsigned long long pte) { - if (pte & 1) + if (pte & _PAGE_PRESENT) { pte = phys...
c6c2d7a084d14a8a701be84872aa1b77d2945f46
Analyze and fix the following issue in the Linux kernel code: x86: fix usage of .section .sched.text in assembler code
Problem Details: Without this patch the linker will generate a section named .sched.text.1 which is unexpected. This is because the gcc generated section has "ax" but the assembler usage of .sched.text lacks the "ax" specifier. It would be better to have a definition we could use from assembler code but I did not find...
```diff diff --git a/arch/x86/lib/semaphore_32.S b/arch/x86/lib/semaphore_32.S index e2c6e0d5e125..3899bd37fdf0 100644 --- a/arch/x86/lib/semaphore_32.S +++ b/arch/x86/lib/semaphore_32.S @@ -29,7 +29,7 @@ * registers (%eax, %edx and %ecx) except %eax whish is either a return * value or just clobbered.. */ - .sect...
adb8daed46356d1772e8bd8def1b70c8cb58ce12
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in setup_64.c
Problem Details: Fix the following warning: WARNING: arch/x86/kernel/built-in.o(.cpuinit.text+0x7a3): Section mismatch: reference to .init.text:amd_detect_cmp in 'init_amd' The function amd_detect_cmp were annotated __init and was only used from init_amd() which are annotated __cpuinit. Annotate amd_detect_cmp() with...
```diff diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 9ee2bc30d530..c9b7f44ea497 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -530,7 +530,7 @@ static int nearby_node(int apicid) * On a AMD dual core setup the lower bits of the APIC id distingush the cores. ...
3eaf5efae72b33bc6132e9590e5d4bf11532f8c4
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in topology.c
Problem Details: Fix following warning: WARNING: arch/x86/kernel/built-in.o(__ksymtab+0x2b0): Section mismatch: reference to .cpuinit.text:arch_register_cpu in '__ksymtab_arch_register_cpu' Annotating exported symbols are wrong. Previously the warning were hidden by avoiding the export in the non HOTPLUG_CPU case but ...
```diff diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index a0d1719bda79..78cbb655aa79 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c @@ -33,7 +33,8 @@ static DEFINE_PER_CPU(struct x86_cpu, cpu_devices); -int __cpuinit arch_register_cpu(int num) +#ifdef CONFIG_HOTPL...
1e296f578a8ef70b314315a2bfc7b036f947803f
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in srat_64.c
Problem Details: Fix the following warnings: WARNING: arch/x86/mm/built-in.o(.text+0x1abc): Section mismatch: reference to .init.data:nodes_parsed in 'unparse_node' WARNING: arch/x86/mm/built-in.o(.text+0x1ac6): Section mismatch: reference to .cpuinit.data:apicid_to_node in 'unparse_node' WARNING: arch/x86/mm/built-in....
```diff diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 37308d6bb5d9..65416f843e59 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c @@ -323,7 +323,7 @@ static int __init nodes_cover_memory(const struct bootnode *nodes) return 1; } -static void unparse_node(int node) +static void __in...
85b74d6c119a7dae882569e57925eaafecc07859
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in early-quirks.c
Problem Details: Fix following warnings: WARNING: arch/x86/kernel/built-in.o(.text+0x139e1): Section mismatch: reference to .init.data:early_qrk in 'check_dev_quirk' WARNING: arch/x86/kernel/built-in.o(.text+0x139f5): Section mismatch: reference to .init.data:early_qrk in 'check_dev_quirk' WARNING: arch/x86/kernel/buil...
```diff diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 3f88e437e843..9f51e1ea9e82 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -133,7 +133,7 @@ static struct chipset early_qrk[] __initdata = { {} }; -static void check_dev_quirk(int num, int...
87d7e98012e60d36cdb6c9c6a6cd1dec7c2b5a1c
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in acpi/boot.c
Problem Details: Fix following warning: WARNING: arch/x86/kernel/built-in.o(.text+0x10ea0): Section mismatch: reference to .cpuinit.data:num_processors in 'acpi_unmap_lsapic' The exported function acpi_unmap_lsapic() references the variable num_processors that is annotated __cpuinitdata. Remove the annotation of num_...
```diff diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index cc06eae1b037..67009cdd5eca 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c @@ -68,7 +68,7 @@ unsigned int def_to_bigsmp = 0; /* Processor that is doing the boot up */ unsigned int boot_cpu_physical_apic...
4c02ad1efdd1293d6fdd453a2f27ad993458dcd1
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in process_*.c
Problem Details: Fix the following warning: WARNING: arch/x86/kernel/built-in.o(.text+0x3): Section mismatch: reference to .cpuinit.data:force_mwait in 'mwait_usable' [Seen on 64 bit only but similar pattern exist on 32 bit so fix it there too] mwait_usable() were only used by a function annotated __cpuinit so annotat...
```diff diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index b72d7d132072..968371ab223a 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -285,7 +285,7 @@ static void mwait_idle(void) mwait_idle_with_hints(0, 0); } -static int mwait_usable(const struct cpuinf...
b48ed48a7816aafedb260cafe872a55757b9489e
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in mcheck/mce_amd_64.c
Problem Details: Fix following warning: WARNING: arch/x86/kernel/cpu/mcheck/built-in.o(.text+0x1584): Section mismatch: reference to .cpuinit.text:threshold_create_device in 'threshold_cpu_callback' threshold_cpu_callback() is only used by threshold_cpu_notifier. threshold_cpu_notifier is only used for cpu hot plug as...
```diff diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 550502596ca3..77e666628818 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c @@ -645,7 +645,7 @@ static void threshold_remove_device(unsigned int cpu) } /* ge...
1e35669d017eac5bea4739f927b28e64731504e1
Analyze and fix the following issue in the Linux kernel code: x86: fix section mismatch warning in mcheck/mce_64.c
Problem Details: Fix following warning: WARNING: arch/x86/kernel/cpu/mcheck/built-in.o(.text+0x752): Section mismatch: reference to .cpuinit.text:mce_create_device in 'mce_cpu_callback' mce_cpu_callback() is only used by mce_cpu_notofier. The notifier is only used for hotplugable cpu's as it is registered using regist...
```diff diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 98b23d55fe6e..9a699ed03598 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c @@ -854,8 +854,8 @@ static void mce_remove_device(unsigned int cpu) } /* Get notified when a cpu ...
5e3a77e9a9b7bfc1f69f51fe6d34aa649887980c
Analyze and fix the following issue in the Linux kernel code: x86: add support for the RDC R-321x SoC
Problem Details: This patch adds support for the RDC R-321x system-on-chip, also known as R-861x-(G). It uses the generic GPIO API and has support for the on-chip hardware watchdog. Build-fix from: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu> Signed-off-by: I...
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 32e267186035..92dc919c7640 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -291,6 +291,18 @@ config X86_ES7000 Only choose this option if you have such a system, otherwise you should say N here. +config X86_RDC321X + bool "RDC R-321x SoC" ...
519efbc0b3b6004a3b98d66a446bce30852c8171
Analyze and fix the following issue in the Linux kernel code: x86: fix cpu MHz reporting for AMD family 0x11
Problem Details: Fix cpu MHz reporting for AMD family 0x11 when powernow-k8 is disabled. Just adhere to the CONSTANT_TSC feature bit for AMD CPUs when deciding whether cpu_khz needs calibration. The additional check for CPU family is not needed and prevents calibration for future CPUs. Signed-off-by: Andreas Herrmann...
```diff diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index 61b17f5ec867..0380795121a6 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c @@ -120,8 +120,7 @@ void __init time_init(void) cpu_khz = tsc_khz; if (cpu_has(&boot_cpu_data, X86_FEATURE_CONSTANT_TSC) && - boot_cpu...
9a1b62fe858ba6780a9aeb4ab5f7751038a6c15d
Analyze and fix the following issue in the Linux kernel code: x86: fix NUMA emulation on 64-bit
Problem Details: I found a small bug of NUMA emulation code for x86_64. (CONFIG_NUMA_EMU) If machine is non-NUMA, find_node_by_addr() should return NUMA_NO_NODE, but current implementation code returns existent maximum NUMA node number + 1. This is not existent NUMA node number. However, this behaviour does not affect...
```diff diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 4aed38fa4a65..37308d6bb5d9 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c @@ -416,7 +416,7 @@ static int __init find_node_by_addr(unsigned long addr) break; } } - return i; + return ret; } /* ```
53391fa20cab6df6b476a5a0ad6be653c9de0c46
Analyze and fix the following issue in the Linux kernel code: cpufreq: fix obvious condition statement error
Problem Details: The function __cpufreq_set_policy in file drivers/cpufreq/cpufreq.c has a very obvious error: if (policy->min > data->min && policy->min > policy->max) { ret = -EINVAL; goto error_out; } This condtion statement is wrong because it returns -EINVAL only i...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5efd5550f4ca..b730d6709529 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1604,7 +1604,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(str...
1ce357129a55a791318e23f5d7b8a9f1352858aa
Analyze and fix the following issue in the Linux kernel code: x86: early cpu_to_node fix in numa_64.c
Problem Details: Both of these references to cpu_to_node() can potentially occur before the "late" cpu_to_node map is setup. Therefore, they should be changed to use early_cpu_to_node(). Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutro...
```diff diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 0ca96d86cb71..f0e5cabe49d8 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -251,7 +251,7 @@ void __init numa_init_array(void) rr = first_node(node_online_map); for (i = 0; i < NR_CPUS; i++) { - if (cpu_to_node(i) != NUMA_N...
e6c4dc6c36b01d33a2e0c8a89828d8dd44fb4c1b
Analyze and fix the following issue in the Linux kernel code: x86: GEODE add the "mfgptfix" boot time option to fix MFGPT timers
Problem Details: The new "mfgptfix" boot command line option may be usd to fix MFGPT timers on AMD Geode platforms when the BIOS has incorrectly applied a workaround. TinyBIOS version 0.98 is known to be affected, 0.99 fixes the problem by letting the user disable the workaround. Signed-off-by: Willy Tarreau <w@1wt.eu...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fe3031d56431..5d171b7b8393 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1092,6 +1092,11 @@ and is between 256 and 4096 characters. It is defined in the file Multi-Fu...
3212bff370c2f22e4987c6679ba485654cefb178
Analyze and fix the following issue in the Linux kernel code: x86: left over fix for leak of early_ioremp in dmi_scan
Problem Details: Signed-off-by: Yinghai Lu <yinghai@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 5f9d0bc839ba..9008ed5ef4ce 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -353,6 +353,7 @@ void __init dmi_scan_machine(void) return; } } + dmi_iounmap(p, 0x10000); } out: printk(KERN_INF...
11201e603d28a1cb7a4bb1d65f39e61629c97a28
Analyze and fix the following issue in the Linux kernel code: x86: fix DEBUG_RODATA kconfig text
Problem Details: fix kconfig text and make DEBUG_RODATA default. this helps debugging quite a bit. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 0a82b889d76e..9bb61e1aed69 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -61,13 +61,13 @@ config DEBUG_PER_CPU_MAPS config DEBUG_RODATA bool "Write protect kernel read-only data structures" + default y depends on DEB...
8b2f7ffffe7f247ba237322fee78c528ba88f16b
Analyze and fix the following issue in the Linux kernel code: x86: fix Section mismatch: reference to .init.text:lguest_entry
Problem Details: fix: > WARNING: vmlinux.o(.data+0x4): Section mismatch: reference to .init.text:lguest_entry (between 'subarch_entries' and 'stack_start') Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index a2b6331434da..5d8c5730686b 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -9,6 +9,7 @@ .text #include <linux/threads.h> +#include <linux/init.h> #include <linux/linkage.h> #include <asm/segment.h> #include...
a5ff677c2fb10567d1e750fb9e4417d95081071b
Analyze and fix the following issue in the Linux kernel code: x86: make printk_address available on X86_32
Problem Details: Small fomatting fixes to 64-bit as well, trailing whitespace and extra semicolon, also move the ifdefs for CONFIG_KALLSYMS into the function itself. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 270cfd483160..8534cb53ff60 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c @@ -102,6 +102,34 @@ asmlinkage void machine_check(void); int kstack_depth_to_print = 24; static unsigned int code_bytes = 64; +void ...
625d6cffcac1c96faa18d629f1271d63af0e05f2
Analyze and fix the following issue in the Linux kernel code: x86: fix early cpu_to_node panic from nr_free_zone_pages
Problem Details: call early_cpu_to_node() since per_cpu(cpu_to_node_map) might not be setup yet. I also had to export x86_cpu_to_node_map_early_ptr because of some calls from the network code to numa_node_id(): net/ipv4/netfilter/arp_tables.c: net/ipv4/netfilter/ip_tables.c: net/ipv4/netfilter/ip_tables.c: Signed...
```diff diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 70b463abf6f4..441af4edea59 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -37,9 +37,7 @@ u16 x86_cpu_to_node_map_init[NR_CPUS] = { void *x86_cpu_to_node_map_early_ptr; DEFINE_PER_CPU(u16, x86_cpu_to_node_map) = NUMA_NO_NODE; ...
08b6d290f977d8145804fd2b9bc2c331f2484f8e
Analyze and fix the following issue in the Linux kernel code: xen: fix section usage in xen-head.S and setup.c
Problem Details: additional section for .init.text appending a number. A side effect of this was a section mismatch warning because modpost did not recognize a .init.text section named .init.text.1: WARNING: vmlinux.o(.text.head+0x247): Section mismatch: reference to .init.text.1:start_kernel (between 'is386' and 'che...
```diff diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 7d6d0ef55890..3bad4773a2f3 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -60,7 +60,7 @@ static void xen_idle(void) /* * Set the bit indicating "nosegneg" library variants should be used. */ -static void fiddle_vdso(void) +stat...
75f2ce033168ff435e72bf5bb615176d9930e77f
Analyze and fix the following issue in the Linux kernel code: x86: get_cycles() fix
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h index a6e8d35c3f86..7d3e27f7d484 100644 --- a/include/asm-x86/tsc.h +++ b/include/asm-x86/tsc.h @@ -27,10 +27,8 @@ static inline cycles_t get_cycles(void) if (!cpu_has_tsc) return 0; #endif - -#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_...
17abecfe651c862cd31b1f9e8ef6cfc29083f00d
Analyze and fix the following issue in the Linux kernel code: x86: fix up alternatives with lockdep enabled
Problem Details: An older binutils bug caused us to not fix up alternatives. This problem involved mutex.c but we dont do lockdep section tricks there anymore, so this workaround is moot. Keep the printk nevertheless, just in case ... We can remove that later on. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-b...
```diff diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 318a4f9b7ece..45d79ea890ae 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -342,12 +342,13 @@ void alternatives_smp_switch(int smp) #ifdef CONFIG_LOCKDEP /* - * A not yet fixed binutils secti...
df43510b18b8439465b4b58556f0495b5f5d771e
Analyze and fix the following issue in the Linux kernel code: x86: check_tsc_warp() slowness fix
Problem Details: 100 million max # of loops is a bit too much - reduce it to 10 million. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index ace340524c01..7110078f242c 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -67,12 +67,12 @@ static __cpuinit void check_tsc_warp(void) /* * Be nice every now and then (and also check whether - * mea...
5f5cd8fd60c71ce47d2ce4e60e7ccbc306e91c64
Analyze and fix the following issue in the Linux kernel code: x86: add debug of invalid per_cpu map accesses
Problem Details: dont crash survivable situations. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index f1e12329078e..9a8228a177c7 100644 --- a/include/asm-x86/topology.h +++ b/include/asm-x86/topology.h @@ -66,14 +66,15 @@ static inline int early_cpu_to_node(int cpu) static inline int cpu_to_node(int cpu) { -#ifdef CONFIG_DEBUG_PER_CP...
c49a4955ea504c82f6b690491639bba5b8c1dc47
Analyze and fix the following issue in the Linux kernel code: x86: add debug of invalid per_cpu map accesses
Problem Details: Provide a means to trap usages of per_cpu map variables before they are setup. Define CONFIG_DEBUG_PER_CPU_MAPS to activate. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 88420af98140..0a82b889d76e 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -47,6 +47,18 @@ config DEBUG_PAGEALLOC This results in a large slowdown, but helps to find certain types of memory corruptions. +config DEBU...
0164fe16247ac2e1b697a9bf0e71df81497c4709
Analyze and fix the following issue in the Linux kernel code: x86: fix early NUMA-id access
Problem Details: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 04cbecaeca81..f828e6a6973d 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c @@ -382,7 +382,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) setup_node_bootmem(i, nodes[i].start, nodes[i].end); for (i = ...
834beda15ecc43c110c0a6ac39ec1aa79f891716
Analyze and fix the following issue in the Linux kernel code: x86: change NR_CPUS arrays in numa_64 fixup
Problem Details: Change the following static arrays sized by NR_CPUS to per_cpu data variables: char cpu_to_node_map[NR_CPUS]; fixup: - Split cpu_to_node function into "early" and "late" versions so that x86_cpu_to_node_map_early_ptr is not EXPORT'ed and the cpu_to_node inline function is more streamlined...
```diff diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c index 8fa0de810d0b..855ec82e4f76 100644 --- a/arch/x86/kernel/setup64.c +++ b/arch/x86/kernel/setup64.c @@ -83,6 +83,40 @@ static int __init nonx32_setup(char *str) } __setup("noexec32=", nonx32_setup); +/* + * Copy data used in early init r...
404ee5b14b68d3cba287c2596588b83790c49f7b
Analyze and fix the following issue in the Linux kernel code: x86: convert TSC disabling to generic cpuid disable bitmap
Problem Details: Fix from: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index a96abd453e0d..9b95edcfc6ae 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -154,7 +154,7 @@ static void __init check_config(void) * If we configured ourselves for a TSC, we'd better have one! */ #ifdef CO...
94ea03cdda520f0c0dc80cbb4674ab9a33749ee2
Analyze and fix the following issue in the Linux kernel code: x86: provide read and write cr8 paravirt hooks
Problem Details: Since the cr8 manipulation functions ended up staying in the tree, they can't be defined just when PARAVIRT is off: In this patch, those functions are defined for the PARAVIRT case too. [ mingo@elte.hu: fixes ] Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <m...
```diff diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 73547acbbbf5..a55f95e921ee 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h @@ -619,6 +619,7 @@ static inline void write_cr4(unsigned long x) PVOP_VCALL1(pv_cpu_ops.write_cr4, x); } +#ifdef CONFIG_X86_64 sta...
67926892ef7a7fbc76de607120d44416019fdf07
Analyze and fix the following issue in the Linux kernel code: x86: fix unconditional arch/x86/kernel/pcspeaker.o compiling
Problem Details: do not add the pcspkr platform device if pcspkr support is disabled. Signed-off-by: Michael Opdenacker <michael@free-electrons.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index c414c45a0f13..5bdb0f0431e9 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -67,7 +67,10 @@ obj-$(CONFIG_MGEODE_LX) += geode_32.o mfgpt_32.o obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o obj-$(CONFIG_PARAVIRT) += ...
71617bf140fd5a35645527502cd330f84045d40c
Analyze and fix the following issue in the Linux kernel code: x86: only call early_init_amd one time
Problem Details: Andi's patch " x86: move X86_FEATURE_CONSTANT_TSC into early cpu feature detection Need this in the next patch in time_init and that happens early. This includes a minor fix on i386 where early_intel_workarounds() [which is now called early_init_intel] really executes early as the...
```diff diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 12948316e6a6..08e85b79e702 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -954,6 +954,9 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) case X86_VENDOR_AMD: early_init_amd(c); break...
99fc8d424bc5d803fe92cad56c068fe64e73747a
Analyze and fix the following issue in the Linux kernel code: x86, 32-bit: trim memory not covered by wb mtrrs
Problem Details: On some machines, buggy BIOSes don't properly setup WB MTRRs to cover all available RAM, meaning the last few megs (or even gigs) of memory will be marked uncached. Since Linux tends to allocate from high memory addresses first, this causes the machine to be unusably slow as soon as the kernel starts ...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 860a90875491..b8fadf5f75a3 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -570,6 +570,12 @@ and is between 256 and 4096 characters. It is defined in the file See driver...
03252919b79891063cf99145612360efbdf9500b
Analyze and fix the following issue in the Linux kernel code: x86: print which shared library/executable faulted in segfault etc. messages v3
Problem Details: They now look like: hal-resmgr[13791]: segfault at 3c rip 2b9c8caec182 rsp 7fff1e825d30 error 4 in libacl.so.1.1.0[2b9c8caea000+6000] This makes it easier to pinpoint bugs to specific libraries. And printing the offset into a mapping also always allows to find the correct fault point in a library ev...
```diff diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 74df55895c8c..89a690edf999 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c @@ -198,12 +198,15 @@ asmlinkage int sys_sigreturn(unsigned long __unused) return ax; badframe: - if (show_unhandled_signals && ...
ca74a6f84e68b44867022f4a4f3ec17c087c864e
Analyze and fix the following issue in the Linux kernel code: x86: optimize lock prefix switching to run less frequently
Problem Details: On VMs implemented using JITs that cache translated code changing the lock prefixes is a quite costly operation that forces the JIT to throw away and retranslate a lot of code. Previously a SMP kernel would rewrite the locks once for each CPU which is quite unnecessary. This patch changes the code to ...
```diff diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index cdc43242da92..318a4f9b7ece 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -273,6 +273,7 @@ struct smp_alt_module { }; static LIST_HEAD(smp_alt_modules); static DEFINE_SPINLOCK(smp_alt); +static...
064954761254ef17fae2b84fb5a034d48a769143
Analyze and fix the following issue in the Linux kernel code: x86: kdump failure
Problem Details: kdump needs ELF_CORE_COPY_REGS in crash_save_cpu(). This lack of the macro causes the following BUG. SysRq : Trigger a crashdump ------------[ cut here ]------------ kernel BUG at include/linux/elfcore.h:105! invalid opcode: 0000 [1] PREEMPT SMP Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp...
```diff diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h index dab4744f9586..d9c94e707289 100644 --- a/include/asm-x86/elf.h +++ b/include/asm-x86/elf.h @@ -106,6 +106,31 @@ extern unsigned int vdso_enabled; _r->ax = 0; \ } while (0) +/* + * regs is struct pt_regs, pr_reg is elf_gregset_t (which is + * n...
118c890961a2ca456947d72ebe0ce43de07907f0
Analyze and fix the following issue in the Linux kernel code: arch/x86/mm/numa_64.c: section fix
Problem Details: WARNING: vmlinux.o(__ksymtab+0x670): Section mismatch: reference to .init.data:x86_cpu_to_node_map_init (between '__ksymtab_x86_cpu_to_node_map_init' and '__ksymtab_node_data') Cc: Matthew Dobson <colpatch@us.ibm.com> Cc: Mike Travis <travis@sgi.com> Cc: Christoph Lameter <clameter@sgi.com> Signed-off...
```diff diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index dca58fb39b08..7b03d2090c28 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -31,7 +31,7 @@ bootmem_data_t plat_node_bdata[MAX_NUMNODES]; struct memnode memnode; -u16 x86_cpu_to_node_map_init[NR_CPUS] __initdata = { +u16 x86_c...
4dbf7af6442a9a882855bed0d999659ac413e3ac
Analyze and fix the following issue in the Linux kernel code: x86: adjust/fix LDT handling for Xen
Problem Details: Based on patch from Jan Beulich <jbeulich@novell.com>. Don't rely on kmalloc(PAGE_SIZE) returning PAGE_SIZE aligned memory (Xen requires GDT *and* LDT to be page-aligned). Using the page allocator interface also removes the (albeit small) slab allocator overhead. The same change being done for 64-bits...
```diff diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index b8ef46270e24..8a7660c8394a 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -12,7 +12,6 @@ #include <linux/mm.h> #include <linux/smp.h> #include <linux/vmalloc.h> -#include <linux/slab.h> #include <asm/uaccess.h> #include <...
fb8830e72d9bd86f1e7b6886cb1886c391130f86
Analyze and fix the following issue in the Linux kernel code: x86: fix singlestep handling in reenter_kprobe
Problem Details: Highlight peculiar cases in singles-step kprobe handling. In reenter_kprobe(), a breakpoint in KPROBE_HIT_SS case can only occur when single-stepping a breakpoint on which a probe was installed. Since such probes are single-stepped inline, identifying these cases is unambiguous. All other cases leadin...
```diff diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index edc0a8e59247..f7ddbb8c3fe8 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c @@ -443,17 +443,6 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, *sara = (unsigned long) &kretprobe_trampoline; }...