Merge branch 'WIP.x86/asm' into x86/urgent, because the topic is ready
authorIngo Molnar <mingo@kernel.org>
Thu, 12 Apr 2018 07:42:34 +0000 (09:42 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 12 Apr 2018 07:42:34 +0000 (09:42 +0200)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
13 files changed:
Documentation/x86/x86_64/mm.txt
arch/x86/Kconfig
arch/x86/include/asm/apic.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic/apic_common.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/x2apic.h
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cpuid-deps.c
arch/x86/xen/apic.c
lib/swiotlb.c

index ea91cb61a60297ac658a4160cee200da75e6f00d..5432a96d31ffd9938a58ab43e7b34fecd2ab35e7 100644 (file)
@@ -20,7 +20,7 @@ ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks
 ffffffef00000000 - fffffffeffffffff (=64 GB) EFI region mapping space
 ... unused hole ...
 ffffffff80000000 - ffffffff9fffffff (=512 MB)  kernel text mapping, from phys 0
-ffffffffa0000000 - [fixmap start]   (~1526 MB) module mapping space (variable)
+ffffffffa0000000 - fffffffffeffffff (1520 MB) module mapping space
 [fixmap start]   - ffffffffff5fffff kernel-internal fixmap range
 ffffffffff600000 - ffffffffff600fff (=4 kB) legacy vsyscall ABI
 ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
index bcdd3e0e2ef5db6400477357639aeff9b24c6653..a29df2353da577ce9e1d082e1001a15ad5986100 100644 (file)
@@ -2759,11 +2759,9 @@ config OLPC_XO1_RTC
 
 config OLPC_XO1_SCI
        bool "OLPC XO-1 SCI extras"
-       depends on OLPC && OLPC_XO1_PM
+       depends on OLPC && OLPC_XO1_PM && GPIO_CS5535=y
        depends on INPUT=y
        select POWER_SUPPLY
-       select GPIO_CS5535
-       select MFD_CORE
        ---help---
          Add support for SCI-based features of the OLPC XO-1 laptop:
           - EC-driven system wakeups
index 40a3d3642f3ae53fc3323c17850c19117d98ba96..08acd954f00e2d14b201aa87c342c723b2e0ca5b 100644 (file)
@@ -313,7 +313,7 @@ struct apic {
        /* Probe, setup and smpboot functions */
        int     (*probe)(void);
        int     (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
-       int     (*apic_id_valid)(int apicid);
+       int     (*apic_id_valid)(u32 apicid);
        int     (*apic_id_registered)(void);
 
        bool    (*check_apicid_used)(physid_mask_t *map, int apicid);
@@ -486,7 +486,7 @@ static inline unsigned int read_apic_id(void)
        return apic->get_apic_id(reg);
 }
 
-extern int default_apic_id_valid(int apicid);
+extern int default_apic_id_valid(u32 apicid);
 extern int default_acpi_madt_oem_check(char *, char *);
 extern void default_setup_apic_routing(void);
 
index 7a37d9357bc48a4f8224179c32f3c86da0e560eb..dde444f932c135d11f93b22188689e3e97e8e046 100644 (file)
@@ -200,7 +200,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
 {
        struct acpi_madt_local_x2apic *processor = NULL;
 #ifdef CONFIG_X86_X2APIC
-       int apic_id;
+       u32 apic_id;
        u8 enabled;
 #endif
 
@@ -222,10 +222,13 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
         * to not preallocating memory for all NR_CPUS
         * when we use CPU hotplug.
         */
-       if (!apic->apic_id_valid(apic_id) && enabled)
-               printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
-       else
-               acpi_register_lapic(apic_id, processor->uid, enabled);
+       if (!apic->apic_id_valid(apic_id)) {
+               if (enabled)
+                       pr_warn(PREFIX "x2apic entry ignored\n");
+               return 0;
+       }
+
+       acpi_register_lapic(apic_id, processor->uid, enabled);
 #else
        printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
 #endif
index a360801779ae92164240f9cec48cbc1660b5c11f..02b4839478b11baa82bbde3f9e3af9a5cfdcc20e 100644 (file)
@@ -40,7 +40,7 @@ int default_check_phys_apicid_present(int phys_apicid)
        return physid_isset(phys_apicid, phys_cpu_present_map);
 }
 
-int default_apic_id_valid(int apicid)
+int default_apic_id_valid(u32 apicid)
 {
        return (apicid < 255);
 }
index 134e04506ab41419f41ddf1ee6edf767d95e0088..78778b54f904a8f15c24fa257a4699b232d3f842 100644 (file)
@@ -56,7 +56,7 @@ static u32 numachip2_set_apic_id(unsigned int id)
        return id << 24;
 }
 
-static int numachip_apic_id_valid(int apicid)
+static int numachip_apic_id_valid(u32 apicid)
 {
        /* Trust what bootloader passes in MADT */
        return 1;
index b107de381cb51a5b80600016b7c4cafc3f53b1b1..a49b3604027f677375b2bf1feb9eebcd72769112 100644 (file)
@@ -1,6 +1,6 @@
 /* Common bits for X2APIC cluster/physical modes. */
 
-int x2apic_apic_id_valid(int apicid);
+int x2apic_apic_id_valid(u32 apicid);
 int x2apic_apic_id_registered(void);
 void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
 unsigned int x2apic_get_apic_id(unsigned long id);
index e2829bf40e4a09c2fd31241be37b030c6cd1570a..b5cf9e7b3830c67128ae710911dd3ac6158f149f 100644 (file)
@@ -101,7 +101,7 @@ static int x2apic_phys_probe(void)
 }
 
 /* Common x2apic functions, also used by x2apic_cluster */
-int x2apic_apic_id_valid(int apicid)
+int x2apic_apic_id_valid(u32 apicid)
 {
        return 1;
 }
index f11910b44638c84995848a5acdecbb296ddb5636..efaf2d4f9c3c7983221298c2ecb37ce367345b1e 100644 (file)
@@ -557,7 +557,7 @@ static void uv_send_IPI_all(int vector)
        uv_send_IPI_mask(cpu_online_mask, vector);
 }
 
-static int uv_apic_id_valid(int apicid)
+static int uv_apic_id_valid(u32 apicid)
 {
        return 1;
 }
index 348cf48212405077bd731e25cf7a41de585ba61d..2981bf287ef51aec612d2e9fa33f3b9ea1d1634d 100644 (file)
@@ -848,18 +848,6 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
                c->x86_power = edx;
        }
 
-       if (c->extended_cpuid_level >= 0x80000008) {
-               cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
-
-               c->x86_virt_bits = (eax >> 8) & 0xff;
-               c->x86_phys_bits = eax & 0xff;
-               c->x86_capability[CPUID_8000_0008_EBX] = ebx;
-       }
-#ifdef CONFIG_X86_32
-       else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
-               c->x86_phys_bits = 36;
-#endif
-
        if (c->extended_cpuid_level >= 0x8000000a)
                c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a);
 
@@ -874,6 +862,23 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
        apply_forced_caps(c);
 }
 
+static void get_cpu_address_sizes(struct cpuinfo_x86 *c)
+{
+       u32 eax, ebx, ecx, edx;
+
+       if (c->extended_cpuid_level >= 0x80000008) {
+               cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
+
+               c->x86_virt_bits = (eax >> 8) & 0xff;
+               c->x86_phys_bits = eax & 0xff;
+               c->x86_capability[CPUID_8000_0008_EBX] = ebx;
+       }
+#ifdef CONFIG_X86_32
+       else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
+               c->x86_phys_bits = 36;
+#endif
+}
+
 static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_X86_32
@@ -965,6 +970,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
                cpu_detect(c);
                get_cpu_vendor(c);
                get_cpu_cap(c);
+               get_cpu_address_sizes(c);
                setup_force_cpu_cap(X86_FEATURE_CPUID);
 
                if (this_cpu->c_early_init)
@@ -1097,6 +1103,8 @@ static void generic_identify(struct cpuinfo_x86 *c)
 
        get_cpu_cap(c);
 
+       get_cpu_address_sizes(c);
+
        if (c->cpuid_level >= 0x00000001) {
                c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
 #ifdef CONFIG_X86_32
index 904b0a3c4e53c10e4e7e36e2f7a1296d3bd21ed7..2c0bd38a44ab125c6a6f9627eea0cc69c3d882f5 100644 (file)
@@ -19,7 +19,7 @@ struct cpuid_dep {
  * called from cpu hotplug. It shouldn't do anything in this case,
  * but it's difficult to tell that to the init reference checker.
  */
-const static struct cpuid_dep cpuid_deps[] = {
+static const struct cpuid_dep cpuid_deps[] = {
        { X86_FEATURE_XSAVEOPT,         X86_FEATURE_XSAVE     },
        { X86_FEATURE_XSAVEC,           X86_FEATURE_XSAVE     },
        { X86_FEATURE_XSAVES,           X86_FEATURE_XSAVE     },
index 2163888497d326ec26d7eba1168541ce16f5a87a..5e53bfbe5823b78cb6666ce9c3fcf563eed3e47e 100644 (file)
@@ -112,7 +112,7 @@ static int xen_madt_oem_check(char *oem_id, char *oem_table_id)
        return xen_pv_domain();
 }
 
-static int xen_id_always_valid(int apicid)
+static int xen_id_always_valid(u32 apicid)
 {
        return 1;
 }
index 47aeb04c1997bf45c943985cfda6f08ea716b92d..32aacd0d56a8051e255416e4e8c997efe9ad7514 100644 (file)
@@ -1087,6 +1087,6 @@ const struct dma_map_ops swiotlb_dma_ops = {
        .unmap_sg               = swiotlb_unmap_sg_attrs,
        .map_page               = swiotlb_map_page,
        .unmap_page             = swiotlb_unmap_page,
-       .dma_supported          = swiotlb_dma_supported,
+       .dma_supported          = dma_direct_supported,
 };
 #endif /* CONFIG_DMA_DIRECT_OPS */