diff options
27 files changed, 106 insertions, 57 deletions
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig index 7ef4a099defc..6205d3b81e6d 100644 --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig | |||
| @@ -176,6 +176,7 @@ CONFIG_E1000E=y | |||
| 176 | CONFIG_SKY2=y | 176 | CONFIG_SKY2=y |
| 177 | CONFIG_FORCEDETH=y | 177 | CONFIG_FORCEDETH=y |
| 178 | CONFIG_8139TOO=y | 178 | CONFIG_8139TOO=y |
| 179 | CONFIG_R8169=y | ||
| 179 | CONFIG_FDDI=y | 180 | CONFIG_FDDI=y |
| 180 | CONFIG_INPUT_POLLDEV=y | 181 | CONFIG_INPUT_POLLDEV=y |
| 181 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | 182 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index afb222b63cae..c84584bb9402 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c | |||
| @@ -604,7 +604,7 @@ amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, int idx, | |||
| 604 | return &amd_f15_PMC20; | 604 | return &amd_f15_PMC20; |
| 605 | } | 605 | } |
| 606 | case AMD_EVENT_NB: | 606 | case AMD_EVENT_NB: |
| 607 | /* moved to perf_event_amd_uncore.c */ | 607 | /* moved to uncore.c */ |
| 608 | return &emptyconstraint; | 608 | return &emptyconstraint; |
| 609 | default: | 609 | default: |
| 610 | return &emptyconstraint; | 610 | return &emptyconstraint; |
diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index aff4b5b69d40..238ae3248ba5 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * perf_event_intel_cstate.c: support cstate residency counters | 2 | * Support cstate residency counters |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2015, Intel Corp. | 4 | * Copyright (C) 2015, Intel Corp. |
| 5 | * Author: Kan Liang (kan.liang@intel.com) | 5 | * Author: Kan Liang (kan.liang@intel.com) |
diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c index 22054ca49026..9d05c7e67f60 100644 --- a/arch/x86/events/intel/rapl.c +++ b/arch/x86/events/intel/rapl.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * perf_event_intel_rapl.c: support Intel RAPL energy consumption counters | 2 | * Support Intel RAPL energy consumption counters |
| 3 | * Copyright (C) 2013 Google, Inc., Stephane Eranian | 3 | * Copyright (C) 2013 Google, Inc., Stephane Eranian |
| 4 | * | 4 | * |
| 5 | * Intel RAPL interface is specified in the IA-32 Manual Vol3b | 5 | * Intel RAPL interface is specified in the IA-32 Manual Vol3b |
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h index ad986c1e29bc..df5989f27b1b 100644 --- a/arch/x86/events/intel/uncore.h +++ b/arch/x86/events/intel/uncore.h | |||
| @@ -360,7 +360,7 @@ extern struct list_head pci2phy_map_head; | |||
| 360 | extern struct pci_extra_dev *uncore_extra_pci_dev; | 360 | extern struct pci_extra_dev *uncore_extra_pci_dev; |
| 361 | extern struct event_constraint uncore_constraint_empty; | 361 | extern struct event_constraint uncore_constraint_empty; |
| 362 | 362 | ||
| 363 | /* perf_event_intel_uncore_snb.c */ | 363 | /* uncore_snb.c */ |
| 364 | int snb_uncore_pci_init(void); | 364 | int snb_uncore_pci_init(void); |
| 365 | int ivb_uncore_pci_init(void); | 365 | int ivb_uncore_pci_init(void); |
| 366 | int hsw_uncore_pci_init(void); | 366 | int hsw_uncore_pci_init(void); |
| @@ -371,7 +371,7 @@ void nhm_uncore_cpu_init(void); | |||
| 371 | void skl_uncore_cpu_init(void); | 371 | void skl_uncore_cpu_init(void); |
| 372 | int snb_pci2phy_map_init(int devid); | 372 | int snb_pci2phy_map_init(int devid); |
| 373 | 373 | ||
| 374 | /* perf_event_intel_uncore_snbep.c */ | 374 | /* uncore_snbep.c */ |
| 375 | int snbep_uncore_pci_init(void); | 375 | int snbep_uncore_pci_init(void); |
| 376 | void snbep_uncore_cpu_init(void); | 376 | void snbep_uncore_cpu_init(void); |
| 377 | int ivbep_uncore_pci_init(void); | 377 | int ivbep_uncore_pci_init(void); |
| @@ -385,5 +385,5 @@ void knl_uncore_cpu_init(void); | |||
| 385 | int skx_uncore_pci_init(void); | 385 | int skx_uncore_pci_init(void); |
| 386 | void skx_uncore_cpu_init(void); | 386 | void skx_uncore_cpu_init(void); |
| 387 | 387 | ||
| 388 | /* perf_event_intel_uncore_nhmex.c */ | 388 | /* uncore_nhmex.c */ |
| 389 | void nhmex_uncore_cpu_init(void); | 389 | void nhmex_uncore_cpu_init(void); |
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index db64baf0e500..8bef70e7f3cc 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c | |||
| @@ -158,13 +158,13 @@ void hyperv_init(void) | |||
| 158 | clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100); | 158 | clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100); |
| 159 | return; | 159 | return; |
| 160 | } | 160 | } |
| 161 | register_msr_cs: | ||
| 161 | #endif | 162 | #endif |
| 162 | /* | 163 | /* |
| 163 | * For 32 bit guests just use the MSR based mechanism for reading | 164 | * For 32 bit guests just use the MSR based mechanism for reading |
| 164 | * the partition counter. | 165 | * the partition counter. |
| 165 | */ | 166 | */ |
| 166 | 167 | ||
| 167 | register_msr_cs: | ||
| 168 | hyperv_cs = &hyperv_cs_msr; | 168 | hyperv_cs = &hyperv_cs_msr; |
| 169 | if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) | 169 | if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) |
| 170 | clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100); | 170 | clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100); |
diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h index 34684adb6899..b3b09b98896d 100644 --- a/arch/x86/include/asm/pkeys.h +++ b/arch/x86/include/asm/pkeys.h | |||
| @@ -46,6 +46,15 @@ extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, | |||
| 46 | static inline | 46 | static inline |
| 47 | bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) | 47 | bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) |
| 48 | { | 48 | { |
| 49 | /* | ||
| 50 | * "Allocated" pkeys are those that have been returned | ||
| 51 | * from pkey_alloc(). pkey 0 is special, and never | ||
| 52 | * returned from pkey_alloc(). | ||
| 53 | */ | ||
| 54 | if (pkey <= 0) | ||
| 55 | return false; | ||
| 56 | if (pkey >= arch_max_pkey()) | ||
| 57 | return false; | ||
| 49 | return mm_pkey_allocation_map(mm) & (1U << pkey); | 58 | return mm_pkey_allocation_map(mm) & (1U << pkey); |
| 50 | } | 59 | } |
| 51 | 60 | ||
| @@ -82,12 +91,6 @@ int mm_pkey_alloc(struct mm_struct *mm) | |||
| 82 | static inline | 91 | static inline |
| 83 | int mm_pkey_free(struct mm_struct *mm, int pkey) | 92 | int mm_pkey_free(struct mm_struct *mm, int pkey) |
| 84 | { | 93 | { |
| 85 | /* | ||
| 86 | * pkey 0 is special, always allocated and can never | ||
| 87 | * be freed. | ||
| 88 | */ | ||
| 89 | if (!pkey) | ||
| 90 | return -EINVAL; | ||
| 91 | if (!mm_pkey_is_allocated(mm, pkey)) | 94 | if (!mm_pkey_is_allocated(mm, pkey)) |
| 92 | return -EINVAL; | 95 | return -EINVAL; |
| 93 | 96 | ||
diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h index 5138dacf8bb8..07244ea16765 100644 --- a/arch/x86/include/uapi/asm/bootparam.h +++ b/arch/x86/include/uapi/asm/bootparam.h | |||
| @@ -58,7 +58,7 @@ struct setup_header { | |||
| 58 | __u32 header; | 58 | __u32 header; |
| 59 | __u16 version; | 59 | __u16 version; |
| 60 | __u32 realmode_swtch; | 60 | __u32 realmode_swtch; |
| 61 | __u16 start_sys; | 61 | __u16 start_sys_seg; |
| 62 | __u16 kernel_version; | 62 | __u16 kernel_version; |
| 63 | __u8 type_of_loader; | 63 | __u8 type_of_loader; |
| 64 | __u8 loadflags; | 64 | __u8 loadflags; |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 4261b3282ad9..aee7deddabd0 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
| @@ -1610,24 +1610,15 @@ static inline void try_to_enable_x2apic(int remap_mode) { } | |||
| 1610 | static inline void __x2apic_enable(void) { } | 1610 | static inline void __x2apic_enable(void) { } |
| 1611 | #endif /* !CONFIG_X86_X2APIC */ | 1611 | #endif /* !CONFIG_X86_X2APIC */ |
| 1612 | 1612 | ||
| 1613 | static int __init try_to_enable_IR(void) | ||
| 1614 | { | ||
| 1615 | #ifdef CONFIG_X86_IO_APIC | ||
| 1616 | if (!x2apic_enabled() && skip_ioapic_setup) { | ||
| 1617 | pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n"); | ||
| 1618 | return -1; | ||
| 1619 | } | ||
| 1620 | #endif | ||
| 1621 | return irq_remapping_enable(); | ||
| 1622 | } | ||
| 1623 | |||
| 1624 | void __init enable_IR_x2apic(void) | 1613 | void __init enable_IR_x2apic(void) |
| 1625 | { | 1614 | { |
| 1626 | unsigned long flags; | 1615 | unsigned long flags; |
| 1627 | int ret, ir_stat; | 1616 | int ret, ir_stat; |
| 1628 | 1617 | ||
| 1629 | if (skip_ioapic_setup) | 1618 | if (skip_ioapic_setup) { |
| 1619 | pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n"); | ||
| 1630 | return; | 1620 | return; |
| 1621 | } | ||
| 1631 | 1622 | ||
| 1632 | ir_stat = irq_remapping_prepare(); | 1623 | ir_stat = irq_remapping_prepare(); |
| 1633 | if (ir_stat < 0 && !x2apic_supported()) | 1624 | if (ir_stat < 0 && !x2apic_supported()) |
| @@ -1645,7 +1636,7 @@ void __init enable_IR_x2apic(void) | |||
| 1645 | 1636 | ||
| 1646 | /* If irq_remapping_prepare() succeeded, try to enable it */ | 1637 | /* If irq_remapping_prepare() succeeded, try to enable it */ |
| 1647 | if (ir_stat >= 0) | 1638 | if (ir_stat >= 0) |
| 1648 | ir_stat = try_to_enable_IR(); | 1639 | ir_stat = irq_remapping_enable(); |
| 1649 | /* ir_stat contains the remap mode or an error code */ | 1640 | /* ir_stat contains the remap mode or an error code */ |
| 1650 | try_to_enable_x2apic(ir_stat); | 1641 | try_to_enable_x2apic(ir_stat); |
| 1651 | 1642 | ||
| @@ -2062,10 +2053,10 @@ static int allocate_logical_cpuid(int apicid) | |||
| 2062 | 2053 | ||
| 2063 | /* Allocate a new cpuid. */ | 2054 | /* Allocate a new cpuid. */ |
| 2064 | if (nr_logical_cpuids >= nr_cpu_ids) { | 2055 | if (nr_logical_cpuids >= nr_cpu_ids) { |
| 2065 | WARN_ONCE(1, "Only %d processors supported." | 2056 | WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. " |
| 2066 | "Processor %d/0x%x and the rest are ignored.\n", | 2057 | "Processor %d/0x%x and the rest are ignored.\n", |
| 2067 | nr_cpu_ids - 1, nr_logical_cpuids, apicid); | 2058 | nr_cpu_ids, nr_logical_cpuids, apicid); |
| 2068 | return -1; | 2059 | return -EINVAL; |
| 2069 | } | 2060 | } |
| 2070 | 2061 | ||
| 2071 | cpuid_to_apicid[nr_logical_cpuids] = apicid; | 2062 | cpuid_to_apicid[nr_logical_cpuids] = apicid; |
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 0bbe0f3a039f..c05509d38b1f 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/sched/signal.h> | 28 | #include <linux/sched/signal.h> |
| 29 | #include <linux/sched/task.h> | 29 | #include <linux/sched/task.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | #include <linux/cpu.h> | ||
| 32 | #include <linux/task_work.h> | 31 | #include <linux/task_work.h> |
| 33 | 32 | ||
| 34 | #include <uapi/linux/magic.h> | 33 | #include <uapi/linux/magic.h> |
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 891f4dad7b2c..22403a28caf5 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <asm/hypervisor.h> | 30 | #include <asm/hypervisor.h> |
| 31 | #include <asm/timer.h> | 31 | #include <asm/timer.h> |
| 32 | #include <asm/apic.h> | 32 | #include <asm/apic.h> |
| 33 | #include <asm/timer.h> | ||
| 34 | 33 | ||
| 35 | #undef pr_fmt | 34 | #undef pr_fmt |
| 36 | #define pr_fmt(fmt) "vmware: " fmt | 35 | #define pr_fmt(fmt) "vmware: " fmt |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index dc6ba5bda9fc..89ff7af2de50 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
| @@ -354,7 +354,7 @@ static int hpet_resume(struct clock_event_device *evt, int timer) | |||
| 354 | 354 | ||
| 355 | irq_domain_deactivate_irq(irq_get_irq_data(hdev->irq)); | 355 | irq_domain_deactivate_irq(irq_get_irq_data(hdev->irq)); |
| 356 | irq_domain_activate_irq(irq_get_irq_data(hdev->irq)); | 356 | irq_domain_activate_irq(irq_get_irq_data(hdev->irq)); |
| 357 | disable_irq(hdev->irq); | 357 | disable_hardirq(hdev->irq); |
| 358 | irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu)); | 358 | irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu)); |
| 359 | enable_irq(hdev->irq); | 359 | enable_irq(hdev->irq); |
| 360 | } | 360 | } |
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index bdb83e431d89..38b64587b31b 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
| @@ -167,7 +167,7 @@ static int __init boot_params_kdebugfs_init(void) | |||
| 167 | struct dentry *dbp, *version, *data; | 167 | struct dentry *dbp, *version, *data; |
| 168 | int error = -ENOMEM; | 168 | int error = -ENOMEM; |
| 169 | 169 | ||
| 170 | dbp = debugfs_create_dir("boot_params", NULL); | 170 | dbp = debugfs_create_dir("boot_params", arch_debugfs_dir); |
| 171 | if (!dbp) | 171 | if (!dbp) |
| 172 | return -ENOMEM; | 172 | return -ENOMEM; |
| 173 | 173 | ||
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index e244c19a2451..4194d6f9bb29 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -223,6 +223,22 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
| 223 | DMI_MATCH(DMI_BOARD_NAME, "P4S800"), | 223 | DMI_MATCH(DMI_BOARD_NAME, "P4S800"), |
| 224 | }, | 224 | }, |
| 225 | }, | 225 | }, |
| 226 | { /* Handle problems with rebooting on ASUS EeeBook X205TA */ | ||
| 227 | .callback = set_acpi_reboot, | ||
| 228 | .ident = "ASUS EeeBook X205TA", | ||
| 229 | .matches = { | ||
| 230 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
| 231 | DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"), | ||
| 232 | }, | ||
| 233 | }, | ||
| 234 | { /* Handle problems with rebooting on ASUS EeeBook X205TAW */ | ||
| 235 | .callback = set_acpi_reboot, | ||
| 236 | .ident = "ASUS EeeBook X205TAW", | ||
| 237 | .matches = { | ||
| 238 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
| 239 | DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"), | ||
| 240 | }, | ||
| 241 | }, | ||
| 226 | 242 | ||
| 227 | /* Certec */ | 243 | /* Certec */ |
| 228 | { /* Handle problems with rebooting on Certec BPC600 */ | 244 | { /* Handle problems with rebooting on Certec BPC600 */ |
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 0cb52ae0a8f0..190e718694b1 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
| @@ -735,6 +735,15 @@ void pcibios_disable_device (struct pci_dev *dev) | |||
| 735 | pcibios_disable_irq(dev); | 735 | pcibios_disable_irq(dev); |
| 736 | } | 736 | } |
| 737 | 737 | ||
| 738 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | ||
| 739 | void pcibios_release_device(struct pci_dev *dev) | ||
| 740 | { | ||
| 741 | if (atomic_dec_return(&dev->enable_cnt) >= 0) | ||
| 742 | pcibios_disable_device(dev); | ||
| 743 | |||
| 744 | } | ||
| 745 | #endif | ||
| 746 | |||
| 738 | int pci_ext_cfg_avail(void) | 747 | int pci_ext_cfg_avail(void) |
| 739 | { | 748 | { |
| 740 | if (raw_pci_ext_ops) | 749 | if (raw_pci_ext_ops) |
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 766d4d3529a1..f25982cdff90 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
| @@ -1847,7 +1847,6 @@ static void pq_init(int node, int pnode) | |||
| 1847 | 1847 | ||
| 1848 | ops.write_payload_first(pnode, first); | 1848 | ops.write_payload_first(pnode, first); |
| 1849 | ops.write_payload_last(pnode, last); | 1849 | ops.write_payload_last(pnode, last); |
| 1850 | ops.write_g_sw_ack(pnode, 0xffffUL); | ||
| 1851 | 1850 | ||
| 1852 | /* in effect, all msg_type's are set to MSG_NOOP */ | 1851 | /* in effect, all msg_type's are set to MSG_NOOP */ |
| 1853 | memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); | 1852 | memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); |
diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c index 25e068ba3382..b6d5c8946e66 100644 --- a/arch/x86/purgatory/purgatory.c +++ b/arch/x86/purgatory/purgatory.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include "sha256.h" | 13 | #include "sha256.h" |
| 14 | #include "purgatory.h" | ||
| 14 | #include "../boot/string.h" | 15 | #include "../boot/string.h" |
| 15 | 16 | ||
| 16 | struct sha_region { | 17 | struct sha_region { |
| @@ -18,11 +19,11 @@ struct sha_region { | |||
| 18 | unsigned long len; | 19 | unsigned long len; |
| 19 | }; | 20 | }; |
| 20 | 21 | ||
| 21 | unsigned long backup_dest = 0; | 22 | static unsigned long backup_dest; |
| 22 | unsigned long backup_src = 0; | 23 | static unsigned long backup_src; |
| 23 | unsigned long backup_sz = 0; | 24 | static unsigned long backup_sz; |
| 24 | 25 | ||
| 25 | u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 }; | 26 | static u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 }; |
| 26 | 27 | ||
| 27 | struct sha_region sha_regions[16] = {}; | 28 | struct sha_region sha_regions[16] = {}; |
| 28 | 29 | ||
| @@ -39,7 +40,7 @@ static int copy_backup_region(void) | |||
| 39 | return 0; | 40 | return 0; |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | int verify_sha256_digest(void) | 43 | static int verify_sha256_digest(void) |
| 43 | { | 44 | { |
| 44 | struct sha_region *ptr, *end; | 45 | struct sha_region *ptr, *end; |
| 45 | u8 digest[SHA256_DIGEST_SIZE]; | 46 | u8 digest[SHA256_DIGEST_SIZE]; |
diff --git a/arch/x86/purgatory/purgatory.h b/arch/x86/purgatory/purgatory.h new file mode 100644 index 000000000000..e2e365a6c192 --- /dev/null +++ b/arch/x86/purgatory/purgatory.h | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef PURGATORY_H | ||
| 2 | #define PURGATORY_H | ||
| 3 | |||
| 4 | #ifndef __ASSEMBLY__ | ||
| 5 | extern void purgatory(void); | ||
| 6 | #endif /* __ASSEMBLY__ */ | ||
| 7 | |||
| 8 | #endif /* PURGATORY_H */ | ||
diff --git a/arch/x86/purgatory/setup-x86_64.S b/arch/x86/purgatory/setup-x86_64.S index fe3c91ba1bd0..f90e9dfa90bb 100644 --- a/arch/x86/purgatory/setup-x86_64.S +++ b/arch/x86/purgatory/setup-x86_64.S | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * This source code is licensed under the GNU General Public License, | 9 | * This source code is licensed under the GNU General Public License, |
| 10 | * Version 2. See the file COPYING for more details. | 10 | * Version 2. See the file COPYING for more details. |
| 11 | */ | 11 | */ |
| 12 | #include "purgatory.h" | ||
| 12 | 13 | ||
| 13 | .text | 14 | .text |
| 14 | .globl purgatory_start | 15 | .globl purgatory_start |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 219b90bc0922..f15900132912 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
| @@ -41,8 +41,10 @@ void acpi_gpe_apply_masked_gpes(void); | |||
| 41 | void acpi_container_init(void); | 41 | void acpi_container_init(void); |
| 42 | void acpi_memory_hotplug_init(void); | 42 | void acpi_memory_hotplug_init(void); |
| 43 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | 43 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC |
| 44 | void pci_ioapic_remove(struct acpi_pci_root *root); | ||
| 44 | int acpi_ioapic_remove(struct acpi_pci_root *root); | 45 | int acpi_ioapic_remove(struct acpi_pci_root *root); |
| 45 | #else | 46 | #else |
| 47 | static inline void pci_ioapic_remove(struct acpi_pci_root *root) { return; } | ||
| 46 | static inline int acpi_ioapic_remove(struct acpi_pci_root *root) { return 0; } | 48 | static inline int acpi_ioapic_remove(struct acpi_pci_root *root) { return 0; } |
| 47 | #endif | 49 | #endif |
| 48 | #ifdef CONFIG_ACPI_DOCK | 50 | #ifdef CONFIG_ACPI_DOCK |
diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 6d7ce6e12aaa..1120dfd625b8 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c | |||
| @@ -206,24 +206,34 @@ int acpi_ioapic_add(acpi_handle root_handle) | |||
| 206 | return ACPI_SUCCESS(status) && ACPI_SUCCESS(retval) ? 0 : -ENODEV; | 206 | return ACPI_SUCCESS(status) && ACPI_SUCCESS(retval) ? 0 : -ENODEV; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | int acpi_ioapic_remove(struct acpi_pci_root *root) | 209 | void pci_ioapic_remove(struct acpi_pci_root *root) |
| 210 | { | 210 | { |
| 211 | int retval = 0; | ||
| 212 | struct acpi_pci_ioapic *ioapic, *tmp; | 211 | struct acpi_pci_ioapic *ioapic, *tmp; |
| 213 | 212 | ||
| 214 | mutex_lock(&ioapic_list_lock); | 213 | mutex_lock(&ioapic_list_lock); |
| 215 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { | 214 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { |
| 216 | if (root->device->handle != ioapic->root_handle) | 215 | if (root->device->handle != ioapic->root_handle) |
| 217 | continue; | 216 | continue; |
| 218 | |||
| 219 | if (acpi_unregister_ioapic(ioapic->handle, ioapic->gsi_base)) | ||
| 220 | retval = -EBUSY; | ||
| 221 | |||
| 222 | if (ioapic->pdev) { | 217 | if (ioapic->pdev) { |
| 223 | pci_release_region(ioapic->pdev, 0); | 218 | pci_release_region(ioapic->pdev, 0); |
| 224 | pci_disable_device(ioapic->pdev); | 219 | pci_disable_device(ioapic->pdev); |
| 225 | pci_dev_put(ioapic->pdev); | 220 | pci_dev_put(ioapic->pdev); |
| 226 | } | 221 | } |
| 222 | } | ||
| 223 | mutex_unlock(&ioapic_list_lock); | ||
| 224 | } | ||
| 225 | |||
| 226 | int acpi_ioapic_remove(struct acpi_pci_root *root) | ||
| 227 | { | ||
| 228 | int retval = 0; | ||
| 229 | struct acpi_pci_ioapic *ioapic, *tmp; | ||
| 230 | |||
| 231 | mutex_lock(&ioapic_list_lock); | ||
| 232 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { | ||
| 233 | if (root->device->handle != ioapic->root_handle) | ||
| 234 | continue; | ||
| 235 | if (acpi_unregister_ioapic(ioapic->handle, ioapic->gsi_base)) | ||
| 236 | retval = -EBUSY; | ||
| 227 | if (ioapic->res.flags && ioapic->res.parent) | 237 | if (ioapic->res.flags && ioapic->res.parent) |
| 228 | release_resource(&ioapic->res); | 238 | release_resource(&ioapic->res); |
| 229 | list_del(&ioapic->list); | 239 | list_del(&ioapic->list); |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index bf601d4df8cf..919be0aa2578 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -648,12 +648,12 @@ static void acpi_pci_root_remove(struct acpi_device *device) | |||
| 648 | 648 | ||
| 649 | pci_stop_root_bus(root->bus); | 649 | pci_stop_root_bus(root->bus); |
| 650 | 650 | ||
| 651 | WARN_ON(acpi_ioapic_remove(root)); | 651 | pci_ioapic_remove(root); |
| 652 | |||
| 653 | device_set_run_wake(root->bus->bridge, false); | 652 | device_set_run_wake(root->bus->bridge, false); |
| 654 | pci_acpi_remove_bus_pm_notifier(device); | 653 | pci_acpi_remove_bus_pm_notifier(device); |
| 655 | 654 | ||
| 656 | pci_remove_root_bus(root->bus); | 655 | pci_remove_root_bus(root->bus); |
| 656 | WARN_ON(acpi_ioapic_remove(root)); | ||
| 657 | 657 | ||
| 658 | dmar_device_remove(device->handle); | 658 | dmar_device_remove(device->handle); |
| 659 | 659 | ||
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c index 7913363bde5c..4f3c758d875d 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | #error Instruction buffer size too small | 31 | #error Instruction buffer size too small |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | /* Based on branch_type() from perf_event_intel_lbr.c */ | 34 | /* Based on branch_type() from arch/x86/events/intel/lbr.c */ |
| 35 | static void intel_pt_insn_decoder(struct insn *insn, | 35 | static void intel_pt_insn_decoder(struct insn *insn, |
| 36 | struct intel_pt_insn *intel_pt_insn) | 36 | struct intel_pt_insn *intel_pt_insn) |
| 37 | { | 37 | { |
diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/x86/fsgsbase.c index 5b2b4b3c634c..b4967d875236 100644 --- a/tools/testing/selftests/x86/fsgsbase.c +++ b/tools/testing/selftests/x86/fsgsbase.c | |||
| @@ -245,7 +245,7 @@ void do_unexpected_base(void) | |||
| 245 | long ret; | 245 | long ret; |
| 246 | asm volatile ("int $0x80" | 246 | asm volatile ("int $0x80" |
| 247 | : "=a" (ret) : "a" (243), "b" (low_desc) | 247 | : "=a" (ret) : "a" (243), "b" (low_desc) |
| 248 | : "flags"); | 248 | : "r8", "r9", "r10", "r11"); |
| 249 | memcpy(&desc, low_desc, sizeof(desc)); | 249 | memcpy(&desc, low_desc, sizeof(desc)); |
| 250 | munmap(low_desc, sizeof(desc)); | 250 | munmap(low_desc, sizeof(desc)); |
| 251 | 251 | ||
diff --git a/tools/testing/selftests/x86/ldt_gdt.c b/tools/testing/selftests/x86/ldt_gdt.c index 4af47079cf04..f6121612e769 100644 --- a/tools/testing/selftests/x86/ldt_gdt.c +++ b/tools/testing/selftests/x86/ldt_gdt.c | |||
| @@ -45,6 +45,12 @@ | |||
| 45 | #define AR_DB (1 << 22) | 45 | #define AR_DB (1 << 22) |
| 46 | #define AR_G (1 << 23) | 46 | #define AR_G (1 << 23) |
| 47 | 47 | ||
| 48 | #ifdef __x86_64__ | ||
| 49 | # define INT80_CLOBBERS "r8", "r9", "r10", "r11" | ||
| 50 | #else | ||
| 51 | # define INT80_CLOBBERS | ||
| 52 | #endif | ||
| 53 | |||
| 48 | static int nerrs; | 54 | static int nerrs; |
| 49 | 55 | ||
| 50 | /* Points to an array of 1024 ints, each holding its own index. */ | 56 | /* Points to an array of 1024 ints, each holding its own index. */ |
| @@ -588,7 +594,7 @@ static int invoke_set_thread_area(void) | |||
| 588 | asm volatile ("int $0x80" | 594 | asm volatile ("int $0x80" |
| 589 | : "=a" (ret), "+m" (low_user_desc) : | 595 | : "=a" (ret), "+m" (low_user_desc) : |
| 590 | "a" (243), "b" (low_user_desc) | 596 | "a" (243), "b" (low_user_desc) |
| 591 | : "flags"); | 597 | : INT80_CLOBBERS); |
| 592 | return ret; | 598 | return ret; |
| 593 | } | 599 | } |
| 594 | 600 | ||
| @@ -657,7 +663,7 @@ static void test_gdt_invalidation(void) | |||
| 657 | "+a" (eax) | 663 | "+a" (eax) |
| 658 | : "m" (low_user_desc_clear), | 664 | : "m" (low_user_desc_clear), |
| 659 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) | 665 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) |
| 660 | : "flags"); | 666 | : INT80_CLOBBERS); |
| 661 | 667 | ||
| 662 | if (sel != 0) { | 668 | if (sel != 0) { |
| 663 | result = "FAIL"; | 669 | result = "FAIL"; |
| @@ -688,7 +694,7 @@ static void test_gdt_invalidation(void) | |||
| 688 | "+a" (eax) | 694 | "+a" (eax) |
| 689 | : "m" (low_user_desc_clear), | 695 | : "m" (low_user_desc_clear), |
| 690 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) | 696 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) |
| 691 | : "flags"); | 697 | : INT80_CLOBBERS); |
| 692 | 698 | ||
| 693 | if (sel != 0) { | 699 | if (sel != 0) { |
| 694 | result = "FAIL"; | 700 | result = "FAIL"; |
| @@ -721,7 +727,7 @@ static void test_gdt_invalidation(void) | |||
| 721 | "+a" (eax) | 727 | "+a" (eax) |
| 722 | : "m" (low_user_desc_clear), | 728 | : "m" (low_user_desc_clear), |
| 723 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) | 729 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) |
| 724 | : "flags"); | 730 | : INT80_CLOBBERS); |
| 725 | 731 | ||
| 726 | #ifdef __x86_64__ | 732 | #ifdef __x86_64__ |
| 727 | syscall(SYS_arch_prctl, ARCH_GET_FS, &new_base); | 733 | syscall(SYS_arch_prctl, ARCH_GET_FS, &new_base); |
| @@ -774,7 +780,7 @@ static void test_gdt_invalidation(void) | |||
| 774 | "+a" (eax) | 780 | "+a" (eax) |
| 775 | : "m" (low_user_desc_clear), | 781 | : "m" (low_user_desc_clear), |
| 776 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) | 782 | [arg1] "r" ((unsigned int)(unsigned long)low_user_desc_clear) |
| 777 | : "flags"); | 783 | : INT80_CLOBBERS); |
| 778 | 784 | ||
| 779 | #ifdef __x86_64__ | 785 | #ifdef __x86_64__ |
| 780 | syscall(SYS_arch_prctl, ARCH_GET_GS, &new_base); | 786 | syscall(SYS_arch_prctl, ARCH_GET_GS, &new_base); |
diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c index b037ce9cf116..eaea92439708 100644 --- a/tools/testing/selftests/x86/ptrace_syscall.c +++ b/tools/testing/selftests/x86/ptrace_syscall.c | |||
| @@ -58,7 +58,8 @@ static void do_full_int80(struct syscall_args32 *args) | |||
| 58 | asm volatile ("int $0x80" | 58 | asm volatile ("int $0x80" |
| 59 | : "+a" (args->nr), | 59 | : "+a" (args->nr), |
| 60 | "+b" (args->arg0), "+c" (args->arg1), "+d" (args->arg2), | 60 | "+b" (args->arg0), "+c" (args->arg1), "+d" (args->arg2), |
| 61 | "+S" (args->arg3), "+D" (args->arg4), "+r" (bp)); | 61 | "+S" (args->arg3), "+D" (args->arg4), "+r" (bp) |
| 62 | : : "r8", "r9", "r10", "r11"); | ||
| 62 | args->arg5 = bp; | 63 | args->arg5 = bp; |
| 63 | #else | 64 | #else |
| 64 | sys32_helper(args, int80_and_ret); | 65 | sys32_helper(args, int80_and_ret); |
diff --git a/tools/testing/selftests/x86/single_step_syscall.c b/tools/testing/selftests/x86/single_step_syscall.c index 50c26358e8b7..a48da95c18fd 100644 --- a/tools/testing/selftests/x86/single_step_syscall.c +++ b/tools/testing/selftests/x86/single_step_syscall.c | |||
| @@ -56,9 +56,11 @@ static volatile sig_atomic_t sig_traps; | |||
| 56 | #ifdef __x86_64__ | 56 | #ifdef __x86_64__ |
| 57 | # define REG_IP REG_RIP | 57 | # define REG_IP REG_RIP |
| 58 | # define WIDTH "q" | 58 | # define WIDTH "q" |
| 59 | # define INT80_CLOBBERS "r8", "r9", "r10", "r11" | ||
| 59 | #else | 60 | #else |
| 60 | # define REG_IP REG_EIP | 61 | # define REG_IP REG_EIP |
| 61 | # define WIDTH "l" | 62 | # define WIDTH "l" |
| 63 | # define INT80_CLOBBERS | ||
| 62 | #endif | 64 | #endif |
| 63 | 65 | ||
| 64 | static unsigned long get_eflags(void) | 66 | static unsigned long get_eflags(void) |
| @@ -140,7 +142,8 @@ int main() | |||
| 140 | 142 | ||
| 141 | printf("[RUN]\tSet TF and check int80\n"); | 143 | printf("[RUN]\tSet TF and check int80\n"); |
| 142 | set_eflags(get_eflags() | X86_EFLAGS_TF); | 144 | set_eflags(get_eflags() | X86_EFLAGS_TF); |
| 143 | asm volatile ("int $0x80" : "=a" (tmp) : "a" (SYS_getpid)); | 145 | asm volatile ("int $0x80" : "=a" (tmp) : "a" (SYS_getpid) |
| 146 | : INT80_CLOBBERS); | ||
| 144 | check_result(); | 147 | check_result(); |
| 145 | 148 | ||
| 146 | /* | 149 | /* |
