Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner: "A set of fixes and updates for x86: - Address a swiotlb regression which was caused by the recent DMA rework and made driver fail because dma_direct_supported() returned false - Fix a signedness bug in the APIC ID validation which caused invalid APIC IDs to be detected as valid thereby bloating the CPU possible space. - Fix inconsisten config dependcy/select magic for the MFD_CS5535 driver. - Fix a corruption of the physical address space bits when encryption has reduced the address space and late cpuinfo updates overwrite the reduced bit information with the original value. - Dominiks syscall rework which consolidates the architecture specific syscall functions so all syscalls can be wrapped with the same macros. This allows to switch x86/64 to struct pt_regs based syscalls. Extend the clearing of user space controlled registers in the entry patch to the lower registers" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Fix signedness bug in APIC ID validity checks x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption x86/olpc: Fix inconsistent MFD_CS5535 configuration swiotlb: Use dma_direct_supported() for swiotlb_ops syscalls/x86: Adapt syscall_wrapper.h to the new syscall stub naming convention syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*() syscalls/core, syscalls/x86: Clean up compat syscall stub naming convention syscalls/core, syscalls/x86: Clean up syscall stub naming convention syscalls/x86: Extend register clearing on syscall entry to lower registers syscalls/x86: Unconditionally enable 'struct pt_regs' based syscalls on x86_64 syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32 syscalls/core: Prepare CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y for compat syscalls syscalls/x86: Use 'struct pt_regs' based syscall calling convention for 64-bit syscalls syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y x86/syscalls: Don't pointlessly reload the system call number x86/mm: Fix documentation of module mapping range with 4-level paging x86/cpuid: Switch to 'static const' specifier
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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 },
|
||||
|
Reference in New Issue
Block a user