diff options
| -rw-r--r-- | arch/x86/boot/string.c | 3 | ||||
| -rw-r--r-- | arch/x86/hyperv/hv_init.c | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/cpu_device_id.h | 31 | ||||
| -rw-r--r-- | arch/x86/include/asm/processor-cyrix.h | 21 | ||||
| -rw-r--r-- | arch/x86/kernel/aperture_64.c | 20 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/cyrix.c | 14 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/core.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/hpet.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/hw_breakpoint.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/mpparse.c | 4 | ||||
| -rw-r--r-- | arch/x86/lib/csum-partial_64.c | 2 | ||||
| -rw-r--r-- | arch/x86/mm/pti.c | 4 | ||||
| -rw-r--r-- | fs/proc/kcore.c | 27 | ||||
| -rw-r--r-- | include/linux/kcore.h | 2 |
14 files changed, 81 insertions, 58 deletions
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index 315a67b8896b..90154df8f125 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c | |||
| @@ -13,8 +13,9 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/kernel.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/limits.h> | ||
| 18 | #include <asm/asm.h> | 19 | #include <asm/asm.h> |
| 19 | #include "ctype.h" | 20 | #include "ctype.h" |
| 20 | #include "string.h" | 21 | #include "string.h" |
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 6461a16b4559..e4ba467a9fc6 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c | |||
| @@ -103,9 +103,13 @@ static int hv_cpu_init(unsigned int cpu) | |||
| 103 | u64 msr_vp_index; | 103 | u64 msr_vp_index; |
| 104 | struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()]; | 104 | struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()]; |
| 105 | void **input_arg; | 105 | void **input_arg; |
| 106 | struct page *pg; | ||
| 106 | 107 | ||
| 107 | input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); | 108 | input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); |
| 108 | *input_arg = page_address(alloc_page(GFP_KERNEL)); | 109 | pg = alloc_page(GFP_KERNEL); |
| 110 | if (unlikely(!pg)) | ||
| 111 | return -ENOMEM; | ||
| 112 | *input_arg = page_address(pg); | ||
| 109 | 113 | ||
| 110 | hv_get_vp_index(msr_vp_index); | 114 | hv_get_vp_index(msr_vp_index); |
| 111 | 115 | ||
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h index 3417110574c1..31c379c1da41 100644 --- a/arch/x86/include/asm/cpu_device_id.h +++ b/arch/x86/include/asm/cpu_device_id.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _CPU_DEVICE_ID | 2 | #ifndef _ASM_X86_CPU_DEVICE_ID |
| 3 | #define _CPU_DEVICE_ID 1 | 3 | #define _ASM_X86_CPU_DEVICE_ID |
| 4 | 4 | ||
| 5 | /* | 5 | /* |
| 6 | * Declare drivers belonging to specific x86 CPUs | 6 | * Declare drivers belonging to specific x86 CPUs |
| @@ -9,8 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/mod_devicetable.h> | 10 | #include <linux/mod_devicetable.h> |
| 11 | 11 | ||
| 12 | extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match); | ||
| 13 | |||
| 14 | /* | 12 | /* |
| 15 | * Match specific microcode revisions. | 13 | * Match specific microcode revisions. |
| 16 | * | 14 | * |
| @@ -22,21 +20,22 @@ extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match); | |||
| 22 | */ | 20 | */ |
| 23 | 21 | ||
| 24 | struct x86_cpu_desc { | 22 | struct x86_cpu_desc { |
| 25 | __u8 x86_family; | 23 | u8 x86_family; |
| 26 | __u8 x86_vendor; | 24 | u8 x86_vendor; |
| 27 | __u8 x86_model; | 25 | u8 x86_model; |
| 28 | __u8 x86_stepping; | 26 | u8 x86_stepping; |
| 29 | __u32 x86_microcode_rev; | 27 | u32 x86_microcode_rev; |
| 30 | }; | 28 | }; |
| 31 | 29 | ||
| 32 | #define INTEL_CPU_DESC(mod, step, rev) { \ | 30 | #define INTEL_CPU_DESC(model, stepping, revision) { \ |
| 33 | .x86_family = 6, \ | 31 | .x86_family = 6, \ |
| 34 | .x86_vendor = X86_VENDOR_INTEL, \ | 32 | .x86_vendor = X86_VENDOR_INTEL, \ |
| 35 | .x86_model = mod, \ | 33 | .x86_model = (model), \ |
| 36 | .x86_stepping = step, \ | 34 | .x86_stepping = (stepping), \ |
| 37 | .x86_microcode_rev = rev, \ | 35 | .x86_microcode_rev = (revision), \ |
| 38 | } | 36 | } |
| 39 | 37 | ||
| 38 | extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match); | ||
| 40 | extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table); | 39 | extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table); |
| 41 | 40 | ||
| 42 | #endif | 41 | #endif /* _ASM_X86_CPU_DEVICE_ID */ |
diff --git a/arch/x86/include/asm/processor-cyrix.h b/arch/x86/include/asm/processor-cyrix.h index aaedd73ea2c6..df700a6cc869 100644 --- a/arch/x86/include/asm/processor-cyrix.h +++ b/arch/x86/include/asm/processor-cyrix.h | |||
| @@ -3,19 +3,6 @@ | |||
| 3 | * NSC/Cyrix CPU indexed register access. Must be inlined instead of | 3 | * NSC/Cyrix CPU indexed register access. Must be inlined instead of |
| 4 | * macros to ensure correct access ordering | 4 | * macros to ensure correct access ordering |
| 5 | * Access order is always 0x22 (=offset), 0x23 (=value) | 5 | * Access order is always 0x22 (=offset), 0x23 (=value) |
| 6 | * | ||
| 7 | * When using the old macros a line like | ||
| 8 | * setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); | ||
| 9 | * gets expanded to: | ||
| 10 | * do { | ||
| 11 | * outb((CX86_CCR2), 0x22); | ||
| 12 | * outb((({ | ||
| 13 | * outb((CX86_CCR2), 0x22); | ||
| 14 | * inb(0x23); | ||
| 15 | * }) | 0x88), 0x23); | ||
| 16 | * } while (0); | ||
| 17 | * | ||
| 18 | * which in fact violates the access order (= 0x22, 0x22, 0x23, 0x23). | ||
| 19 | */ | 6 | */ |
| 20 | 7 | ||
| 21 | static inline u8 getCx86(u8 reg) | 8 | static inline u8 getCx86(u8 reg) |
| @@ -29,11 +16,3 @@ static inline void setCx86(u8 reg, u8 data) | |||
| 29 | outb(reg, 0x22); | 16 | outb(reg, 0x22); |
| 30 | outb(data, 0x23); | 17 | outb(data, 0x23); |
| 31 | } | 18 | } |
| 32 | |||
| 33 | #define getCx86_old(reg) ({ outb((reg), 0x22); inb(0x23); }) | ||
| 34 | |||
| 35 | #define setCx86_old(reg, data) do { \ | ||
| 36 | outb((reg), 0x22); \ | ||
| 37 | outb((data), 0x23); \ | ||
| 38 | } while (0) | ||
| 39 | |||
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 58176b56354e..294ed4392a0e 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #define pr_fmt(fmt) "AGP: " fmt | 14 | #define pr_fmt(fmt) "AGP: " fmt |
| 15 | 15 | ||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/kcore.h> | ||
| 17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 19 | #include <linux/memblock.h> | 20 | #include <linux/memblock.h> |
| @@ -57,7 +58,7 @@ int fallback_aper_force __initdata; | |||
| 57 | 58 | ||
| 58 | int fix_aperture __initdata = 1; | 59 | int fix_aperture __initdata = 1; |
| 59 | 60 | ||
| 60 | #ifdef CONFIG_PROC_VMCORE | 61 | #if defined(CONFIG_PROC_VMCORE) || defined(CONFIG_PROC_KCORE) |
| 61 | /* | 62 | /* |
| 62 | * If the first kernel maps the aperture over e820 RAM, the kdump kernel will | 63 | * If the first kernel maps the aperture over e820 RAM, the kdump kernel will |
| 63 | * use the same range because it will remain configured in the northbridge. | 64 | * use the same range because it will remain configured in the northbridge. |
| @@ -66,20 +67,25 @@ int fix_aperture __initdata = 1; | |||
| 66 | */ | 67 | */ |
| 67 | static unsigned long aperture_pfn_start, aperture_page_count; | 68 | static unsigned long aperture_pfn_start, aperture_page_count; |
| 68 | 69 | ||
| 69 | static int gart_oldmem_pfn_is_ram(unsigned long pfn) | 70 | static int gart_mem_pfn_is_ram(unsigned long pfn) |
| 70 | { | 71 | { |
| 71 | return likely((pfn < aperture_pfn_start) || | 72 | return likely((pfn < aperture_pfn_start) || |
| 72 | (pfn >= aperture_pfn_start + aperture_page_count)); | 73 | (pfn >= aperture_pfn_start + aperture_page_count)); |
| 73 | } | 74 | } |
| 74 | 75 | ||
| 75 | static void exclude_from_vmcore(u64 aper_base, u32 aper_order) | 76 | static void __init exclude_from_core(u64 aper_base, u32 aper_order) |
| 76 | { | 77 | { |
| 77 | aperture_pfn_start = aper_base >> PAGE_SHIFT; | 78 | aperture_pfn_start = aper_base >> PAGE_SHIFT; |
| 78 | aperture_page_count = (32 * 1024 * 1024) << aper_order >> PAGE_SHIFT; | 79 | aperture_page_count = (32 * 1024 * 1024) << aper_order >> PAGE_SHIFT; |
| 79 | WARN_ON(register_oldmem_pfn_is_ram(&gart_oldmem_pfn_is_ram)); | 80 | #ifdef CONFIG_PROC_VMCORE |
| 81 | WARN_ON(register_oldmem_pfn_is_ram(&gart_mem_pfn_is_ram)); | ||
| 82 | #endif | ||
| 83 | #ifdef CONFIG_PROC_KCORE | ||
| 84 | WARN_ON(register_mem_pfn_is_ram(&gart_mem_pfn_is_ram)); | ||
| 85 | #endif | ||
| 80 | } | 86 | } |
| 81 | #else | 87 | #else |
| 82 | static void exclude_from_vmcore(u64 aper_base, u32 aper_order) | 88 | static void exclude_from_core(u64 aper_base, u32 aper_order) |
| 83 | { | 89 | { |
| 84 | } | 90 | } |
| 85 | #endif | 91 | #endif |
| @@ -474,7 +480,7 @@ out: | |||
| 474 | * may have allocated the range over its e820 RAM | 480 | * may have allocated the range over its e820 RAM |
| 475 | * and fixed up the northbridge | 481 | * and fixed up the northbridge |
| 476 | */ | 482 | */ |
| 477 | exclude_from_vmcore(last_aper_base, last_aper_order); | 483 | exclude_from_core(last_aper_base, last_aper_order); |
| 478 | 484 | ||
| 479 | return 1; | 485 | return 1; |
| 480 | } | 486 | } |
| @@ -520,7 +526,7 @@ out: | |||
| 520 | * overlap with the first kernel's memory. We can't access the | 526 | * overlap with the first kernel's memory. We can't access the |
| 521 | * range through vmcore even though it should be part of the dump. | 527 | * range through vmcore even though it should be part of the dump. |
| 522 | */ | 528 | */ |
| 523 | exclude_from_vmcore(aper_alloc, aper_order); | 529 | exclude_from_core(aper_alloc, aper_order); |
| 524 | 530 | ||
| 525 | /* Fix up the north bridges */ | 531 | /* Fix up the north bridges */ |
| 526 | for (i = 0; i < amd_nb_bus_dev_ranges[i].dev_limit; i++) { | 532 | for (i = 0; i < amd_nb_bus_dev_ranges[i].dev_limit; i++) { |
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index d12226f60168..1d9b8aaea06c 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c | |||
| @@ -124,7 +124,7 @@ static void set_cx86_reorder(void) | |||
| 124 | setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ | 124 | setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ |
| 125 | 125 | ||
| 126 | /* Load/Store Serialize to mem access disable (=reorder it) */ | 126 | /* Load/Store Serialize to mem access disable (=reorder it) */ |
| 127 | setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80); | 127 | setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80); |
| 128 | /* set load/store serialize from 1GB to 4GB */ | 128 | /* set load/store serialize from 1GB to 4GB */ |
| 129 | ccr3 |= 0xe0; | 129 | ccr3 |= 0xe0; |
| 130 | setCx86(CX86_CCR3, ccr3); | 130 | setCx86(CX86_CCR3, ccr3); |
| @@ -135,11 +135,11 @@ static void set_cx86_memwb(void) | |||
| 135 | pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); | 135 | pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); |
| 136 | 136 | ||
| 137 | /* CCR2 bit 2: unlock NW bit */ | 137 | /* CCR2 bit 2: unlock NW bit */ |
| 138 | setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04); | 138 | setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04); |
| 139 | /* set 'Not Write-through' */ | 139 | /* set 'Not Write-through' */ |
| 140 | write_cr0(read_cr0() | X86_CR0_NW); | 140 | write_cr0(read_cr0() | X86_CR0_NW); |
| 141 | /* CCR2 bit 2: lock NW bit and set WT1 */ | 141 | /* CCR2 bit 2: lock NW bit and set WT1 */ |
| 142 | setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14); | 142 | setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | /* | 145 | /* |
| @@ -153,14 +153,14 @@ static void geode_configure(void) | |||
| 153 | local_irq_save(flags); | 153 | local_irq_save(flags); |
| 154 | 154 | ||
| 155 | /* Suspend on halt power saving and enable #SUSP pin */ | 155 | /* Suspend on halt power saving and enable #SUSP pin */ |
| 156 | setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88); | 156 | setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); |
| 157 | 157 | ||
| 158 | ccr3 = getCx86(CX86_CCR3); | 158 | ccr3 = getCx86(CX86_CCR3); |
| 159 | setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ | 159 | setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ |
| 160 | 160 | ||
| 161 | 161 | ||
| 162 | /* FPU fast, DTE cache, Mem bypass */ | 162 | /* FPU fast, DTE cache, Mem bypass */ |
| 163 | setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38); | 163 | setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38); |
| 164 | setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ | 164 | setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ |
| 165 | 165 | ||
| 166 | set_cx86_memwb(); | 166 | set_cx86_memwb(); |
| @@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) | |||
| 296 | /* GXm supports extended cpuid levels 'ala' AMD */ | 296 | /* GXm supports extended cpuid levels 'ala' AMD */ |
| 297 | if (c->cpuid_level == 2) { | 297 | if (c->cpuid_level == 2) { |
| 298 | /* Enable cxMMX extensions (GX1 Datasheet 54) */ | 298 | /* Enable cxMMX extensions (GX1 Datasheet 54) */ |
| 299 | setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1); | 299 | setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1); |
| 300 | 300 | ||
| 301 | /* | 301 | /* |
| 302 | * GXm : 0x30 ... 0x5f GXm datasheet 51 | 302 | * GXm : 0x30 ... 0x5f GXm datasheet 51 |
| @@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) | |||
| 319 | if (dir1 > 7) { | 319 | if (dir1 > 7) { |
| 320 | dir0_msn++; /* M II */ | 320 | dir0_msn++; /* M II */ |
| 321 | /* Enable MMX extensions (App note 108) */ | 321 | /* Enable MMX extensions (App note 108) */ |
| 322 | setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1); | 322 | setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1); |
| 323 | } else { | 323 | } else { |
| 324 | /* A 6x86MX - it has the bug. */ | 324 | /* A 6x86MX - it has the bug. */ |
| 325 | set_cpu_bug(c, X86_BUG_COMA); | 325 | set_cpu_bug(c, X86_BUG_COMA); |
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 97f9ada9ceda..5260185cbf7b 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c | |||
| @@ -608,6 +608,8 @@ static int microcode_reload_late(void) | |||
| 608 | if (ret > 0) | 608 | if (ret > 0) |
| 609 | microcode_check(); | 609 | microcode_check(); |
| 610 | 610 | ||
| 611 | pr_info("Reload completed, microcode revision: 0x%x\n", boot_cpu_data.microcode); | ||
| 612 | |||
| 611 | return ret; | 613 | return ret; |
| 612 | } | 614 | } |
| 613 | 615 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index dfd3aca82c61..fb32925a2e62 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
| @@ -905,6 +905,8 @@ int __init hpet_enable(void) | |||
| 905 | return 0; | 905 | return 0; |
| 906 | 906 | ||
| 907 | hpet_set_mapping(); | 907 | hpet_set_mapping(); |
| 908 | if (!hpet_virt_address) | ||
| 909 | return 0; | ||
| 908 | 910 | ||
| 909 | /* | 911 | /* |
| 910 | * Read the period and check for a sane value: | 912 | * Read the period and check for a sane value: |
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index ff9bfd40429e..d73083021002 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
| @@ -354,6 +354,7 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, | |||
| 354 | #endif | 354 | #endif |
| 355 | default: | 355 | default: |
| 356 | WARN_ON_ONCE(1); | 356 | WARN_ON_ONCE(1); |
| 357 | return -EINVAL; | ||
| 357 | } | 358 | } |
| 358 | 359 | ||
| 359 | /* | 360 | /* |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 3482460d984d..1bfe5c6e6cfe 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
| @@ -598,8 +598,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length) | |||
| 598 | mpf_base = base; | 598 | mpf_base = base; |
| 599 | mpf_found = true; | 599 | mpf_found = true; |
| 600 | 600 | ||
| 601 | pr_info("found SMP MP-table at [mem %#010lx-%#010lx] mapped at [%p]\n", | 601 | pr_info("found SMP MP-table at [mem %#010lx-%#010lx]\n", |
| 602 | base, base + sizeof(*mpf) - 1, mpf); | 602 | base, base + sizeof(*mpf) - 1); |
| 603 | 603 | ||
| 604 | memblock_reserve(base, sizeof(*mpf)); | 604 | memblock_reserve(base, sizeof(*mpf)); |
| 605 | if (mpf->physptr) | 605 | if (mpf->physptr) |
diff --git a/arch/x86/lib/csum-partial_64.c b/arch/x86/lib/csum-partial_64.c index 9baca3e054be..e7925d668b68 100644 --- a/arch/x86/lib/csum-partial_64.c +++ b/arch/x86/lib/csum-partial_64.c | |||
| @@ -94,7 +94,7 @@ static unsigned do_csum(const unsigned char *buff, unsigned len) | |||
| 94 | : "m" (*(unsigned long *)buff), | 94 | : "m" (*(unsigned long *)buff), |
| 95 | "r" (zero), "0" (result)); | 95 | "r" (zero), "0" (result)); |
| 96 | --count; | 96 | --count; |
| 97 | buff += 8; | 97 | buff += 8; |
| 98 | } | 98 | } |
| 99 | result = add32_with_carry(result>>32, | 99 | result = add32_with_carry(result>>32, |
| 100 | result&0xffffffff); | 100 | result&0xffffffff); |
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 4fee5c3003ed..139b28a01ce4 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c | |||
| @@ -77,7 +77,7 @@ static void __init pti_print_if_secure(const char *reason) | |||
| 77 | pr_info("%s\n", reason); | 77 | pr_info("%s\n", reason); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | enum pti_mode { | 80 | static enum pti_mode { |
| 81 | PTI_AUTO = 0, | 81 | PTI_AUTO = 0, |
| 82 | PTI_FORCE_OFF, | 82 | PTI_FORCE_OFF, |
| 83 | PTI_FORCE_ON | 83 | PTI_FORCE_ON |
| @@ -602,7 +602,7 @@ static void pti_clone_kernel_text(void) | |||
| 602 | set_memory_global(start, (end_global - start) >> PAGE_SHIFT); | 602 | set_memory_global(start, (end_global - start) >> PAGE_SHIFT); |
| 603 | } | 603 | } |
| 604 | 604 | ||
| 605 | void pti_set_kernel_image_nonglobal(void) | 605 | static void pti_set_kernel_image_nonglobal(void) |
| 606 | { | 606 | { |
| 607 | /* | 607 | /* |
| 608 | * The identity map is created with PMDs, regardless of the | 608 | * The identity map is created with PMDs, regardless of the |
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index bbcc185062bb..d29d869abec1 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
| @@ -54,6 +54,28 @@ static LIST_HEAD(kclist_head); | |||
| 54 | static DECLARE_RWSEM(kclist_lock); | 54 | static DECLARE_RWSEM(kclist_lock); |
| 55 | static int kcore_need_update = 1; | 55 | static int kcore_need_update = 1; |
| 56 | 56 | ||
| 57 | /* | ||
| 58 | * Returns > 0 for RAM pages, 0 for non-RAM pages, < 0 on error | ||
| 59 | * Same as oldmem_pfn_is_ram in vmcore | ||
| 60 | */ | ||
| 61 | static int (*mem_pfn_is_ram)(unsigned long pfn); | ||
| 62 | |||
| 63 | int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn)) | ||
| 64 | { | ||
| 65 | if (mem_pfn_is_ram) | ||
| 66 | return -EBUSY; | ||
| 67 | mem_pfn_is_ram = fn; | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | static int pfn_is_ram(unsigned long pfn) | ||
| 72 | { | ||
| 73 | if (mem_pfn_is_ram) | ||
| 74 | return mem_pfn_is_ram(pfn); | ||
| 75 | else | ||
| 76 | return 1; | ||
| 77 | } | ||
| 78 | |||
| 57 | /* This doesn't grab kclist_lock, so it should only be used at init time. */ | 79 | /* This doesn't grab kclist_lock, so it should only be used at init time. */ |
| 58 | void __init kclist_add(struct kcore_list *new, void *addr, size_t size, | 80 | void __init kclist_add(struct kcore_list *new, void *addr, size_t size, |
| 59 | int type) | 81 | int type) |
| @@ -465,6 +487,11 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) | |||
| 465 | goto out; | 487 | goto out; |
| 466 | } | 488 | } |
| 467 | m = NULL; /* skip the list anchor */ | 489 | m = NULL; /* skip the list anchor */ |
| 490 | } else if (!pfn_is_ram(__pa(start) >> PAGE_SHIFT)) { | ||
| 491 | if (clear_user(buffer, tsz)) { | ||
| 492 | ret = -EFAULT; | ||
| 493 | goto out; | ||
| 494 | } | ||
| 468 | } else if (m->type == KCORE_VMALLOC) { | 495 | } else if (m->type == KCORE_VMALLOC) { |
| 469 | vread(buf, (char *)start, tsz); | 496 | vread(buf, (char *)start, tsz); |
| 470 | /* we have to zero-fill user buffer even if no read */ | 497 | /* we have to zero-fill user buffer even if no read */ |
diff --git a/include/linux/kcore.h b/include/linux/kcore.h index 8c3f8c14eeaa..c843f4a9c512 100644 --- a/include/linux/kcore.h +++ b/include/linux/kcore.h | |||
| @@ -44,6 +44,8 @@ void kclist_add_remap(struct kcore_list *m, void *addr, void *vaddr, size_t sz) | |||
| 44 | m->vaddr = (unsigned long)vaddr; | 44 | m->vaddr = (unsigned long)vaddr; |
| 45 | kclist_add(m, addr, sz, KCORE_REMAP); | 45 | kclist_add(m, addr, sz, KCORE_REMAP); |
| 46 | } | 46 | } |
| 47 | |||
| 48 | extern int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn)); | ||
| 47 | #else | 49 | #else |
| 48 | static inline | 50 | static inline |
| 49 | void kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | 51 | void kclist_add(struct kcore_list *new, void *addr, size_t size, int type) |
