[GIT pull] x86 updates for 4.17

2018-04-29 Thread Thomas Gleixner
Linus,

please pull the latest x86-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
x86-urgent-for-linus

Another set of x86 related updates:

 - Fix the long broken x32 version of the IPC user space headers which was
   noticed by Arnd Bergman in course of his ongoing y2038 work. GLIBC seems
   to have non broken private copies of these headers so this went unnoticed.

 - Two microcode fixlets which address some more fallout from the recent
   modifications in that area:

 - Unconditionally save the microcode patch, which was only saved when
   CPU_HOTPLUG was enabled causing failures in the late loading mechanism
   
 - Make the later loader synchronization finally work under all
   circumstances. It was exiting early and causing timeout failures due
   to a missing synchronization point.

 - Do not use mwait_play_dead() on AMD systems to prevent excessive power
   consumption as the CPU cannot go into deep power states from there.

 - Address an annoying sparse warning due to lost type qualifiers of the
   vmemmap and vmalloc base address constants.

 - Prevent reserving crash kernel region on Xen PV as this leads to the
   wrong perception that crash kernels actually work there which is not the
   case. Xen PV has its own crash mechanism handled by the hypervisor.

 - Add missing TLB cpuid values to the table to make the printout on
   certain machines correct.

 - Enumerate the new CLDEMOTE instruction

 - Fix an incorrect SPDX identifier

 - Remove stale macros

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/ipc: Fix x32 version of shmid64_ds and msqid64_ds

Borislav Petkov (2):
  x86/microcode/intel: Save microcode patch unconditionally
  x86/microcode: Do not exit early from __reload_late()

Dou Liyang (2):
  x86/vector: Remove the macro VECTOR_OFFSET_START
  x86/vector: Remove the unused macro FPU_IRQ

Fenghua Yu (1):
  x86/cpufeatures: Enumerate cldemote instruction

Jiri Kosina (1):
  x86/mm: Make vmemmap and vmalloc base address constants unsigned long

Petr Tesarik (1):
  x86/setup: Do not reserve a crash kernel region if booted on Xen PV

Thomas Gleixner (1):
  x86/jailhouse: Fix incorrect SPDX identifier

Yazen Ghannam (1):
  x86/smpboot: Don't use mwait_play_dead() on AMD systems

jacek.tom...@poczta.fm (1):
  x86/cpu/intel: Add missing TLB cpuid values


 arch/x86/include/asm/cpufeatures.h  |  1 +
 arch/x86/include/asm/irq_vectors.h  |  7 --
 arch/x86/include/asm/jailhouse_para.h   |  2 +-
 arch/x86/include/asm/pgtable_64_types.h |  8 +++
 arch/x86/include/uapi/asm/msgbuf.h  | 31 
 arch/x86/include/uapi/asm/shmbuf.h  | 42 +
 arch/x86/kernel/cpu/intel.c |  3 +++
 arch/x86/kernel/cpu/microcode/core.c|  6 ++---
 arch/x86/kernel/cpu/microcode/intel.c   |  2 --
 arch/x86/kernel/jailhouse.c |  2 +-
 arch/x86/kernel/setup.c |  6 +
 arch/x86/kernel/smpboot.c   |  2 ++
 12 files changed, 93 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/cpufeatures.h 
b/arch/x86/include/asm/cpufeatures.h
index d554c11e01ff..578793e97431 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -320,6 +320,7 @@
 #define X86_FEATURE_AVX512_VPOPCNTDQ   (16*32+14) /* POPCNT for vectors of 
DW/QW */
 #define X86_FEATURE_LA57   (16*32+16) /* 5-level page tables */
 #define X86_FEATURE_RDPID  (16*32+22) /* RDPID instruction */
+#define X86_FEATURE_CLDEMOTE   (16*32+25) /* CLDEMOTE instruction */
 
 /* AMD-defined CPU features, CPUID level 0x8007 (EBX), word 17 */
 #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery 
support */
diff --git a/arch/x86/include/asm/irq_vectors.h 
b/arch/x86/include/asm/irq_vectors.h
index 404c5fdff859..548d90bbf919 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -34,11 +34,6 @@
  * (0x80 is the syscall vector, 0x30-0x3f are for ISA)
  */
 #define FIRST_EXTERNAL_VECTOR  0x20
-/*
- * We start allocating at 0x21 to spread out vectors evenly between
- * priority levels. (0x80 is the syscall vector)
- */
-#define VECTOR_OFFSET_START1
 
 /*
  * Reserve the lowest usable vector (and hence lowest priority)  0x20 for
@@ -119,8 +114,6 @@
 #define FIRST_SYSTEM_VECTORNR_VECTORS
 #endif
 
-#define FPU_IRQ  13
-
 /*
  * Size the maximum number of interrupts.
  *
diff --git a/arch/x86/include/asm/jailhouse_para.h 
b/arch/x86/include/asm/jailhouse_para.h
index b885a961a150..a34897aef2c2 100644
--- a/arch/x86/include/asm/jailhouse_para.h
+++ b/arch/x86/include/asm/jailhouse_para.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL2.0 */
+/* SPDX-License-Identifier: GPL-2.0 */
 
 /*
  * Jailhouse paravirt detection
diff --git 

[GIT pull] x86 updates for 4.17

2018-04-29 Thread Thomas Gleixner
Linus,

please pull the latest x86-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
x86-urgent-for-linus

Another set of x86 related updates:

 - Fix the long broken x32 version of the IPC user space headers which was
   noticed by Arnd Bergman in course of his ongoing y2038 work. GLIBC seems
   to have non broken private copies of these headers so this went unnoticed.

 - Two microcode fixlets which address some more fallout from the recent
   modifications in that area:

 - Unconditionally save the microcode patch, which was only saved when
   CPU_HOTPLUG was enabled causing failures in the late loading mechanism
   
 - Make the later loader synchronization finally work under all
   circumstances. It was exiting early and causing timeout failures due
   to a missing synchronization point.

 - Do not use mwait_play_dead() on AMD systems to prevent excessive power
   consumption as the CPU cannot go into deep power states from there.

 - Address an annoying sparse warning due to lost type qualifiers of the
   vmemmap and vmalloc base address constants.

 - Prevent reserving crash kernel region on Xen PV as this leads to the
   wrong perception that crash kernels actually work there which is not the
   case. Xen PV has its own crash mechanism handled by the hypervisor.

 - Add missing TLB cpuid values to the table to make the printout on
   certain machines correct.

 - Enumerate the new CLDEMOTE instruction

 - Fix an incorrect SPDX identifier

 - Remove stale macros

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/ipc: Fix x32 version of shmid64_ds and msqid64_ds

Borislav Petkov (2):
  x86/microcode/intel: Save microcode patch unconditionally
  x86/microcode: Do not exit early from __reload_late()

Dou Liyang (2):
  x86/vector: Remove the macro VECTOR_OFFSET_START
  x86/vector: Remove the unused macro FPU_IRQ

Fenghua Yu (1):
  x86/cpufeatures: Enumerate cldemote instruction

Jiri Kosina (1):
  x86/mm: Make vmemmap and vmalloc base address constants unsigned long

Petr Tesarik (1):
  x86/setup: Do not reserve a crash kernel region if booted on Xen PV

Thomas Gleixner (1):
  x86/jailhouse: Fix incorrect SPDX identifier

Yazen Ghannam (1):
  x86/smpboot: Don't use mwait_play_dead() on AMD systems

jacek.tom...@poczta.fm (1):
  x86/cpu/intel: Add missing TLB cpuid values


 arch/x86/include/asm/cpufeatures.h  |  1 +
 arch/x86/include/asm/irq_vectors.h  |  7 --
 arch/x86/include/asm/jailhouse_para.h   |  2 +-
 arch/x86/include/asm/pgtable_64_types.h |  8 +++
 arch/x86/include/uapi/asm/msgbuf.h  | 31 
 arch/x86/include/uapi/asm/shmbuf.h  | 42 +
 arch/x86/kernel/cpu/intel.c |  3 +++
 arch/x86/kernel/cpu/microcode/core.c|  6 ++---
 arch/x86/kernel/cpu/microcode/intel.c   |  2 --
 arch/x86/kernel/jailhouse.c |  2 +-
 arch/x86/kernel/setup.c |  6 +
 arch/x86/kernel/smpboot.c   |  2 ++
 12 files changed, 93 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/cpufeatures.h 
b/arch/x86/include/asm/cpufeatures.h
index d554c11e01ff..578793e97431 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -320,6 +320,7 @@
 #define X86_FEATURE_AVX512_VPOPCNTDQ   (16*32+14) /* POPCNT for vectors of 
DW/QW */
 #define X86_FEATURE_LA57   (16*32+16) /* 5-level page tables */
 #define X86_FEATURE_RDPID  (16*32+22) /* RDPID instruction */
+#define X86_FEATURE_CLDEMOTE   (16*32+25) /* CLDEMOTE instruction */
 
 /* AMD-defined CPU features, CPUID level 0x8007 (EBX), word 17 */
 #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery 
support */
diff --git a/arch/x86/include/asm/irq_vectors.h 
b/arch/x86/include/asm/irq_vectors.h
index 404c5fdff859..548d90bbf919 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -34,11 +34,6 @@
  * (0x80 is the syscall vector, 0x30-0x3f are for ISA)
  */
 #define FIRST_EXTERNAL_VECTOR  0x20
-/*
- * We start allocating at 0x21 to spread out vectors evenly between
- * priority levels. (0x80 is the syscall vector)
- */
-#define VECTOR_OFFSET_START1
 
 /*
  * Reserve the lowest usable vector (and hence lowest priority)  0x20 for
@@ -119,8 +114,6 @@
 #define FIRST_SYSTEM_VECTORNR_VECTORS
 #endif
 
-#define FPU_IRQ  13
-
 /*
  * Size the maximum number of interrupts.
  *
diff --git a/arch/x86/include/asm/jailhouse_para.h 
b/arch/x86/include/asm/jailhouse_para.h
index b885a961a150..a34897aef2c2 100644
--- a/arch/x86/include/asm/jailhouse_para.h
+++ b/arch/x86/include/asm/jailhouse_para.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL2.0 */
+/* SPDX-License-Identifier: GPL-2.0 */
 
 /*
  * Jailhouse paravirt detection
diff --git 

[GIT pull] x86 updates for 4.17

2018-04-15 Thread Thomas Gleixner
Linus,

please pull the latest x86-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
x86-urgent-for-linus

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.

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/olpc: Fix inconsistent MFD_CS5535 configuration

Christoph Hellwig (1):
  swiotlb: Use dma_direct_supported() for swiotlb_ops

Dominik Brodowski (10):
  syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
  syscalls/x86: Use 'struct pt_regs' based syscall calling convention for 
64-bit syscalls
  syscalls/core: Prepare CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y for compat 
syscalls
  syscalls/x86: Use 'struct pt_regs' based syscall calling for 
IA32_EMULATION and x32
  syscalls/x86: Unconditionally enable 'struct pt_regs' based syscalls on 
x86_64
  syscalls/x86: Extend register clearing on syscall entry to lower registers
  syscalls/core, syscalls/x86: Clean up syscall stub naming convention
  syscalls/core, syscalls/x86: Clean up compat syscall stub naming 
convention
  syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to 
__x64_sys_*()
  syscalls/x86: Adapt syscall_wrapper.h to the new syscall stub naming 
convention

Kirill A. Shutemov (2):
  x86/mm: Fix documentation of module mapping range with 4-level paging
  x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption

Li RongQing (1):
  x86/apic: Fix signedness bug in APIC ID validity checks

Linus Torvalds (1):
  x86/syscalls: Don't pointlessly reload the system call number

Ralf Ramsauer (1):
  x86/cpuid: Switch to 'static const' specifier


 Documentation/process/adding-syscalls.rst |   4 +-
 Documentation/x86/x86_64/mm.txt   |   2 +-
 arch/x86/Kconfig  |   5 +-
 arch/x86/entry/calling.h  |   2 +
 arch/x86/entry/common.c   |  20 +-
 arch/x86/entry/entry_64.S |   3 +-
 arch/x86/entry/entry_64_compat.S  |   6 +
 arch/x86/entry/syscall_32.c   |  15 +-
 arch/x86/entry/syscall_64.c   |   6 +-
 arch/x86/entry/syscalls/syscall_32.tbl| 723 +++---
 arch/x86/entry/syscalls/syscall_64.tbl| 712 ++---
 arch/x86/entry/syscalls/syscalltbl.sh |  14 +-
 arch/x86/entry/vsyscall/vsyscall_64.c |  18 +-
 arch/x86/include/asm/apic.h   |   4 +-
 arch/x86/include/asm/syscall.h|   4 +
 arch/x86/include/asm/syscall_wrapper.h| 209 +
 arch/x86/include/asm/syscalls.h   |  17 +-
 arch/x86/kernel/acpi/boot.c   |  13 +-
 arch/x86/kernel/apic/apic_common.c|   2 +-
 arch/x86/kernel/apic/apic_numachip.c  |   2 +-
 arch/x86/kernel/apic/x2apic.h |   2 +-
 arch/x86/kernel/apic/x2apic_phys.c|   2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c|   2 +-
 arch/x86/kernel/cpu/common.c  |  32 +-
 arch/x86/kernel/cpu/cpuid-deps.c  |   2 +-
 arch/x86/xen/apic.c   |   2 +-
 include/linux/compat.h|  51 ++-
 include/linux/syscalls.h  |  42 +-
 init/Kconfig  |  10 +
 kernel/sys_ni.c   |  10 +
 kernel/time/posix-stubs.c |  10 +
 lib/swiotlb.c |   2 +-
 scripts/bloat-o-meter |   4 +-
 33 files changed, 1150 insertions(+), 802 deletions(-)
 create mode 100644 arch/x86/include/asm/syscall_wrapper.h

diff --git a/Documentation/process/adding-syscalls.rst 
b/Documentation/process/adding-syscalls.rst
index 314c8bf6f2a2..0d4f29bc798b 100644
--- a/Documentation/process/adding-syscalls.rst
+++ b/Documentation/process/adding-syscalls.rst
@@ -360,7 +360,7 @@ First, the entry in 
``arch/x86/entry/syscalls/syscall_32.tbl`` gets an extra
 column to indicate that a 32-bit userspace program running on a 64-bit kernel
 should hit the compat entry point::
 
-380   i386 xyzzy sys_xyzzycompat_sys_xyzzy
+380   i386 xyzzy sys_xyzzy

[GIT pull] x86 updates for 4.17

2018-04-15 Thread Thomas Gleixner
Linus,

please pull the latest x86-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
x86-urgent-for-linus

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.

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/olpc: Fix inconsistent MFD_CS5535 configuration

Christoph Hellwig (1):
  swiotlb: Use dma_direct_supported() for swiotlb_ops

Dominik Brodowski (10):
  syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
  syscalls/x86: Use 'struct pt_regs' based syscall calling convention for 
64-bit syscalls
  syscalls/core: Prepare CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y for compat 
syscalls
  syscalls/x86: Use 'struct pt_regs' based syscall calling for 
IA32_EMULATION and x32
  syscalls/x86: Unconditionally enable 'struct pt_regs' based syscalls on 
x86_64
  syscalls/x86: Extend register clearing on syscall entry to lower registers
  syscalls/core, syscalls/x86: Clean up syscall stub naming convention
  syscalls/core, syscalls/x86: Clean up compat syscall stub naming 
convention
  syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to 
__x64_sys_*()
  syscalls/x86: Adapt syscall_wrapper.h to the new syscall stub naming 
convention

Kirill A. Shutemov (2):
  x86/mm: Fix documentation of module mapping range with 4-level paging
  x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption

Li RongQing (1):
  x86/apic: Fix signedness bug in APIC ID validity checks

Linus Torvalds (1):
  x86/syscalls: Don't pointlessly reload the system call number

Ralf Ramsauer (1):
  x86/cpuid: Switch to 'static const' specifier


 Documentation/process/adding-syscalls.rst |   4 +-
 Documentation/x86/x86_64/mm.txt   |   2 +-
 arch/x86/Kconfig  |   5 +-
 arch/x86/entry/calling.h  |   2 +
 arch/x86/entry/common.c   |  20 +-
 arch/x86/entry/entry_64.S |   3 +-
 arch/x86/entry/entry_64_compat.S  |   6 +
 arch/x86/entry/syscall_32.c   |  15 +-
 arch/x86/entry/syscall_64.c   |   6 +-
 arch/x86/entry/syscalls/syscall_32.tbl| 723 +++---
 arch/x86/entry/syscalls/syscall_64.tbl| 712 ++---
 arch/x86/entry/syscalls/syscalltbl.sh |  14 +-
 arch/x86/entry/vsyscall/vsyscall_64.c |  18 +-
 arch/x86/include/asm/apic.h   |   4 +-
 arch/x86/include/asm/syscall.h|   4 +
 arch/x86/include/asm/syscall_wrapper.h| 209 +
 arch/x86/include/asm/syscalls.h   |  17 +-
 arch/x86/kernel/acpi/boot.c   |  13 +-
 arch/x86/kernel/apic/apic_common.c|   2 +-
 arch/x86/kernel/apic/apic_numachip.c  |   2 +-
 arch/x86/kernel/apic/x2apic.h |   2 +-
 arch/x86/kernel/apic/x2apic_phys.c|   2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c|   2 +-
 arch/x86/kernel/cpu/common.c  |  32 +-
 arch/x86/kernel/cpu/cpuid-deps.c  |   2 +-
 arch/x86/xen/apic.c   |   2 +-
 include/linux/compat.h|  51 ++-
 include/linux/syscalls.h  |  42 +-
 init/Kconfig  |  10 +
 kernel/sys_ni.c   |  10 +
 kernel/time/posix-stubs.c |  10 +
 lib/swiotlb.c |   2 +-
 scripts/bloat-o-meter |   4 +-
 33 files changed, 1150 insertions(+), 802 deletions(-)
 create mode 100644 arch/x86/include/asm/syscall_wrapper.h

diff --git a/Documentation/process/adding-syscalls.rst 
b/Documentation/process/adding-syscalls.rst
index 314c8bf6f2a2..0d4f29bc798b 100644
--- a/Documentation/process/adding-syscalls.rst
+++ b/Documentation/process/adding-syscalls.rst
@@ -360,7 +360,7 @@ First, the entry in 
``arch/x86/entry/syscalls/syscall_32.tbl`` gets an extra
 column to indicate that a 32-bit userspace program running on a 64-bit kernel
 should hit the compat entry point::
 
-380   i386 xyzzy sys_xyzzycompat_sys_xyzzy
+380   i386 xyzzy sys_xyzzy