Re: [GIT pull] x86 updates for 5.1

2019-03-31 Thread pr-tracker-bot
The pull request you sent on Sun, 31 Mar 2019 10:39:43 -:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/915ee0da5ecb7ac7fd023ae36f01c47ce47a45d1

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT pull] x86 updates for 5.1

2019-03-31 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

up to:  f560bd19d2fe ("x86/realmode: Make set_real_mode_mem() static inline")

A pile of x86 updates:

 - Prevent exceeding he valid physical address space in the /dev/mem limit
   checks.

 - Move all header content inside the header guard to prevent compile
   failures.

 - Fix the bogus __percpu annotation in this_cpu_has() which makes sparse
   very noisy.

 - Disable switch jump tables completely when retpolines are enabled.

 - Prevent leaking the trampoline address.

Thanks,

tglx

-->
Baoquan He (1):
  x86/boot: Fix incorrect ifdeffery scope

Daniel Borkmann (1):
  x86/retpolines: Disable switch jump tables when retpolines are enabled

Jann Horn (1):
  x86/cpufeature: Fix __percpu annotation in this_cpu_has()

Matteo Croce (2):
  x86/realmode: Don't leak the trampoline kernel address
  x86/realmode: Make set_real_mode_mem() static inline

Peng Hao (1):
  x86/resctrl: Remove unused variable

Ralph Campbell (1):
  x86/mm: Don't exceed the valid physical address space


 arch/x86/Makefile |  8 ++--
 arch/x86/boot/compressed/misc.h   |  4 ++--
 arch/x86/include/asm/cpufeature.h |  5 +++--
 arch/x86/include/asm/realmode.h   |  6 +-
 arch/x86/kernel/cpu/resctrl/monitor.c |  3 ---
 arch/x86/mm/mmap.c|  2 +-
 arch/x86/platform/efi/quirks.c|  2 +-
 arch/x86/realmode/init.c  | 11 +--
 8 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 2d8b9d8ca4f8..a587805c6687 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -219,8 +219,12 @@ ifdef CONFIG_RETPOLINE
   # Additionally, avoid generating expensive indirect jumps which
   # are subject to retpolines for small number of switch cases.
   # clang turns off jump table generation by default when under
-  # retpoline builds, however, gcc does not for x86.
-  KBUILD_CFLAGS += $(call cc-option,--param=case-values-threshold=20)
+  # retpoline builds, however, gcc does not for x86. This has
+  # only been fixed starting from gcc stable version 8.4.0 and
+  # onwards, but not for older ones. See gcc bug #86952.
+  ifndef CONFIG_CC_IS_CLANG
+KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables)
+  endif
 endif
 
 archscripts: scripts_basic
diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
index fd13655e0f9b..d2f184165934 100644
--- a/arch/x86/boot/compressed/misc.h
+++ b/arch/x86/boot/compressed/misc.h
@@ -120,8 +120,6 @@ static inline void console_init(void)
 
 void set_sev_encryption_mask(void);
 
-#endif
-
 /* acpi.c */
 #ifdef CONFIG_ACPI
 acpi_physical_address get_rsdp_addr(void);
@@ -135,3 +133,5 @@ int count_immovable_mem_regions(void);
 #else
 static inline int count_immovable_mem_regions(void) { return 0; }
 #endif
+
+#endif /* BOOT_COMPRESSED_MISC_H */
diff --git a/arch/x86/include/asm/cpufeature.h 
b/arch/x86/include/asm/cpufeature.h
index ce95b8cbd229..0e56ff7e4848 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -112,8 +112,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 test_cpu_cap(c, bit))
 
 #define this_cpu_has(bit)  \
-   (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :  \
-x86_this_cpu_test_bit(bit, (unsigned long *)_info.x86_capability))
+   (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :  \
+x86_this_cpu_test_bit(bit, \
+   (unsigned long __percpu *)_info.x86_capability))
 
 /*
  * This macro is for detection of features which need kernel
diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h
index 63b3393bd98e..c53682303c9c 100644
--- a/arch/x86/include/asm/realmode.h
+++ b/arch/x86/include/asm/realmode.h
@@ -77,7 +77,11 @@ static inline size_t real_mode_size_needed(void)
return ALIGN(real_mode_blob_end - real_mode_blob, PAGE_SIZE);
 }
 
-void set_real_mode_mem(phys_addr_t mem, size_t size);
+static inline void set_real_mode_mem(phys_addr_t mem)
+{
+   real_mode_header = (struct real_mode_header *) __va(mem);
+}
+
 void reserve_real_mode(void);
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c 
b/arch/x86/kernel/cpu/resctrl/monitor.c
index f33f11f69078..1573a0a6b525 100644
--- a/arch/x86/kernel/cpu/resctrl/monitor.c
+++ b/arch/x86/kernel/cpu/resctrl/monitor.c
@@ -501,11 +501,8 @@ void cqm_handle_limbo(struct work_struct *work)
 void cqm_setup_limbo_handler(struct rdt_domain *dom, unsigned long delay_ms)
 {
unsigned long delay = msecs_to_jiffies(delay_ms);
-   struct rdt_resource *r;
int cpu;
 
-   r = _resources_all[RDT_RESOURCE_L3];
-
cpu = cpumask_any(>cpu_mask);
 

Re: [GIT pull] x86 updates for 5.1

2019-03-24 Thread pr-tracker-bot
The pull request you sent on Sun, 24 Mar 2019 14:12:21 -:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/19caf581ba441659f1a71e9a5baed032fdcfceef

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT pull] x86 updates for 5.1

2019-03-24 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 x86 fixes:

 - Prevent potential NULL pointer dereferences in the HPET and HyperV code

 - Exclude the GART aperture from /proc/kcore to prevent kernel crashes on
   access
 
 - Use the correct macros for Cyrix I/O on Geode processors

 - Remove yet another kernel address printk leak

 - Announce microcode reload completion as requested by quite some
   people. Microcode loading has become popular recently.

 - Same 'Make Clang' happy fixlets

 - A few cleanups for recently added code

Thanks,

tglx

-->
Aditya Pakki (1):
  x86/hpet: Prevent potential NULL pointer dereference

Borislav Petkov (1):
  x86/microcode: Announce reload operation's completion

Colin Ian King (1):
  x86/lib: Fix indentation issue, remove extra tab

Ingo Molnar (1):
  x86/cpufeature: Fix various quality problems in the  
header

Kairui Song (1):
  x86/gart: Exclude GART aperture from kcore

Kangjie Lu (1):
  x86/hyperv: Prevent potential NULL pointer dereference

Matteo Croce (1):
  x86/mm: Don't leak kernel addresses

Matthew Whitehead (2):
  x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
  x86/cpu/cyrix: Remove {get,set}Cx86_old macros used for Cyrix processors

Nathan Chancellor (1):
  x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() 
return an error

Nick Desaulniers (1):
  x86/boot: Restrict header scope to make Clang happy

Valdis Kletnieks (1):
  x86/mm/pti: Make local symbols static


 arch/x86/boot/string.c |  3 ++-
 arch/x86/hyperv/hv_init.c  |  6 +-
 arch/x86/include/asm/cpu_device_id.h   | 31 +++
 arch/x86/include/asm/processor-cyrix.h | 21 -
 arch/x86/kernel/aperture_64.c  | 20 +---
 arch/x86/kernel/cpu/cyrix.c| 14 +++---
 arch/x86/kernel/cpu/microcode/core.c   |  2 ++
 arch/x86/kernel/hpet.c |  2 ++
 arch/x86/kernel/hw_breakpoint.c|  1 +
 arch/x86/kernel/mpparse.c  |  4 ++--
 arch/x86/lib/csum-partial_64.c |  2 +-
 arch/x86/mm/pti.c  |  4 ++--
 fs/proc/kcore.c| 27 +++
 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 @@
  */
 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include "ctype.h"
 #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)
u64 msr_vp_index;
struct hv_vp_assist_page **hvp = _vp_assist_page[smp_processor_id()];
void **input_arg;
+   struct page *pg;
 
input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
-   *input_arg = page_address(alloc_page(GFP_KERNEL));
+   pg = alloc_page(GFP_KERNEL);
+   if (unlikely(!pg))
+   return -ENOMEM;
+   *input_arg = page_address(pg);
 
hv_get_vp_index(msr_vp_index);
 
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 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _CPU_DEVICE_ID
-#define _CPU_DEVICE_ID 1
+#ifndef _ASM_X86_CPU_DEVICE_ID
+#define _ASM_X86_CPU_DEVICE_ID
 
 /*
  * Declare drivers belonging to specific x86 CPUs
@@ -9,8 +9,6 @@
 
 #include 
 
-extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
-
 /*
  * Match specific microcode revisions.
  *
@@ -22,21 +20,22 @@ extern const struct x86_cpu_id *x86_match_cpu(const struct 
x86_cpu_id *match);
  */
 
 struct x86_cpu_desc {
-   __u8x86_family;
-   __u8x86_vendor;
-   __u8x86_model;
-   __u8x86_stepping;
-   __u32   x86_microcode_rev;
+   u8  x86_family;
+   u8  x86_vendor;
+   u8  x86_model;
+   u8  x86_stepping;
+   u32 x86_microcode_rev;
 };
 
-#define INTEL_CPU_DESC(mod, step, rev) {   \
-   .x86_family = 6,\
-   .x86_vendor = X86_VENDOR_INTEL, \
-   .x86_model = mod,   \
-   .x86_stepping = step,   \
-   .x86_microcode_rev = rev,   \
+#define INTEL_CPU_DESC(model, stepping, revision) {\
+   

Re: [GIT pull] x86 updates for 5.0

2019-02-03 Thread pr-tracker-bot
The pull request you sent on Sun, 03 Feb 2019 17:16:07 +0100:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/24b888d8d59847871387aa3b241b524661070a6e

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT pull] x86 updates for 5.0

2019-02-03 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 few updates for x86:

 - Fix an unintended sign extension issue in the fault handling code

 - Rename the new resource control config switch so it's less confusing

 - Avoid setting up EFI info in kexec when the EFI runtime is disabled.

 - Fix the microcode version check in the AMD microcode loader so it only
   loads higher version numbers and never downgrades

 - Set EFER.LME in the 32bit trampoline before returning to long mode to
   handle older AMD/KVM behaviour properly.

 - Add Darren and Andy as x86/platform reviewers.


Thanks,

tglx

-->
Borislav Petkov (1):
  MAINTAINERS: Add Andy and Darren as arch/x86/platform/ reviewers

Colin Ian King (1):
  x86/fault: Fix sign-extend unintended sign extension

Johannes Weiner (1):
  x86/resctrl: Avoid confusion over the new X86_RESCTRL config

Kairui Song (1):
  x86/kexec: Don't setup EFI info if EFI runtime is not enabled

Kan Liang (1):
  x86/cpu: Add Atom Tremont (Jacobsville)

Thomas Lendacky (1):
  x86/microcode/amd: Don't falsely trick the late loading mechanism

Wei Huang (1):
  x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before 
returning to long mode


 Documentation/x86/resctrl_ui.txt | 2 +-
 MAINTAINERS  | 9 +
 arch/x86/Kconfig | 6 +++---
 arch/x86/boot/compressed/head_64.S   | 8 
 arch/x86/boot/compressed/pgtable.h   | 2 +-
 arch/x86/include/asm/intel-family.h  | 3 ++-
 arch/x86/include/asm/resctrl_sched.h | 4 ++--
 arch/x86/kernel/cpu/Makefile | 2 +-
 arch/x86/kernel/cpu/microcode/amd.c  | 2 +-
 arch/x86/kernel/cpu/resctrl/Makefile | 4 ++--
 arch/x86/kernel/kexec-bzimage64.c| 3 +++
 arch/x86/mm/fault.c  | 2 +-
 include/linux/sched.h| 2 +-
 13 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/Documentation/x86/resctrl_ui.txt b/Documentation/x86/resctrl_ui.txt
index e8e8d14d3c4e..c1f95b59e14d 100644
--- a/Documentation/x86/resctrl_ui.txt
+++ b/Documentation/x86/resctrl_ui.txt
@@ -9,7 +9,7 @@ Fenghua Yu 
 Tony Luck 
 Vikas Shivappa 
 
-This feature is enabled by the CONFIG_X86_RESCTRL and the x86 /proc/cpuinfo
+This feature is enabled by the CONFIG_X86_CPU_RESCTRL and the x86 /proc/cpuinfo
 flag bits:
 RDT (Resource Director Technology) Allocation - "rdt_a"
 CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
diff --git a/MAINTAINERS b/MAINTAINERS
index 32d76a90..a98a7325df8c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16631,6 +16631,15 @@ S: Maintained
 F: drivers/platform/x86/
 F: drivers/platform/olpc/
 
+X86 PLATFORM DRIVERS - ARCH
+R: Darren Hart 
+R: Andy Shevchenko 
+L: platform-driver-...@vger.kernel.org
+L: x...@kernel.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
+S: Maintained
+F: arch/x86/platform
+
 X86 VDSO
 M: Andy Lutomirski 
 L: linux-kernel@vger.kernel.org
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 26387c7bf305..68261430fe6e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -446,12 +446,12 @@ config RETPOLINE
  branches. Requires a compiler with -mindirect-branch=thunk-extern
  support for full protection. The kernel may run slower.
 
-config X86_RESCTRL
-   bool "Resource Control support"
+config X86_CPU_RESCTRL
+   bool "x86 CPU resource control support"
depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
select KERNFS
help
- Enable Resource Control support.
+ Enable x86 CPU resource control support.
 
  Provide support for the allocation and monitoring of system resources
  usage by the CPU.
diff --git a/arch/x86/boot/compressed/head_64.S 
b/arch/x86/boot/compressed/head_64.S
index 64037895b085..f105ae8651c9 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -600,6 +600,14 @@ ENTRY(trampoline_32bit_src)
lealTRAMPOLINE_32BIT_PGTABLE_OFFSET(%ecx), %eax
movl%eax, %cr3
 3:
+   /* Set EFER.LME=1 as a precaution in case hypervsior pulls the rug */
+   pushl   %ecx
+   movl$MSR_EFER, %ecx
+   rdmsr
+   btsl$_EFER_LME, %eax
+   wrmsr
+   popl%ecx
+
/* Enable PAE and LA57 (if required) paging modes */
movl$X86_CR4_PAE, %eax
cmpl$0, %edx
diff --git a/arch/x86/boot/compressed/pgtable.h 
b/arch/x86/boot/compressed/pgtable.h
index 91f75638f6e6..6ff7e81b5628 100644
--- a/arch/x86/boot/compressed/pgtable.h
+++ b/arch/x86/boot/compressed/pgtable.h
@@ -6,7 +6,7 @@
 #define TRAMPOLINE_32BIT_PGTABLE_OFFSET0
 
 #define TRAMPOLINE_32BIT_CODE_OFFSET   PAGE_SIZE
-#define TRAMPOLINE_32BIT_CODE_SIZE 0x60
+#define TRAMPOLINE_32BIT_CODE_SIZE 0x70
 
 #define 

Re: [GIT pull] x86 updates for 5.0

2019-01-27 Thread pr-tracker-bot
The pull request you sent on Sun, 27 Jan 2019 12:05:08 +0100:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/8a5f06056a25ac7dbca2b0505cc0fe8ffb6947c1

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT pull] x86 updates for 5.0

2019-01-27 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 for x86:

 - Fix the swapped outb() parameters in the KASLR code

 - Fix the PKEY handling at fork which missed to preserve the pkey state
   for the child. Comes with a test case to validate that.

 - Fix the entry stack handling for XEN PV to respect that XEN PV systems
   enter the function already on the current thread stack and not on the
   trampoline.

 - Fix kexec load failure caused by using a stale value when the kexec_buf
   structure is reused for subsequent allocations.

 - Fix a bogus sizeof() in the memory encryption code

 - Enforce PCI dependency for the Intel Low Power Subsystem

 - Enforce PCI_LOCKLESS_CONFIG when PCI is enabled

Thanks,

tglx

-->
Daniel Drake (1):
  x86/kaslr: Fix incorrect i8254 outb() parameters

Dave Hansen (2):
  x86/pkeys: Properly copy pkey state at fork()
  x86/selftests/pkeys: Fork() to check for state being preserved

Dave Young (1):
  x86/kexec: Fix a kexec_file_load() failure

Jan Beulich (1):
  x86/entry/64/compat: Fix stack switching for XEN PV

Peng Hao (1):
  x86/mm/mem_encrypt: Fix erroneous sizeof()

Sinan Kaya (2):
  x86/intel/lpss: Make PCI dependency explicit
  x86/Kconfig: Select PCI_LOCKLESS_CONFIG if PCI is enabled


 arch/x86/Kconfig  |  4 +--
 arch/x86/entry/entry_64_compat.S  |  6 ++--
 arch/x86/include/asm/mmu_context.h| 18 
 arch/x86/kernel/crash.c   |  1 +
 arch/x86/kernel/kexec-bzimage64.c |  2 ++
 arch/x86/lib/kaslr.c  |  4 +--
 arch/x86/mm/mem_encrypt_identity.c|  4 +--
 tools/testing/selftests/x86/protection_keys.c | 41 ---
 8 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 15af091611e2..26387c7bf305 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -198,7 +198,7 @@ config X86
select IRQ_FORCED_THREADING
select NEED_SG_DMA_LENGTH
select PCI_DOMAINS  if PCI
-   select PCI_LOCKLESS_CONFIG
+   select PCI_LOCKLESS_CONFIG  if PCI
select PERF_EVENTS
select RTC_LIB
select RTC_MC146818_LIB
@@ -617,7 +617,7 @@ config X86_INTEL_QUARK
 
 config X86_INTEL_LPSS
bool "Intel Low Power Subsystem Support"
-   depends on X86 && ACPI
+   depends on X86 && ACPI && PCI
select COMMON_CLK
select PINCTRL
select IOSF_MBI
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 8eaf8952c408..39913770a44d 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -361,7 +361,8 @@ ENTRY(entry_INT80_compat)
 
/* Need to switch before accessing the thread stack. */
SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
-   movq%rsp, %rdi
+   /* In the Xen PV case we already run on the thread stack. */
+   ALTERNATIVE "movq %rsp, %rdi", "jmp .Lint80_keep_stack", 
X86_FEATURE_XENPV
movqPER_CPU_VAR(cpu_current_top_of_stack), %rsp
 
pushq   6*8(%rdi)   /* regs->ss */
@@ -370,8 +371,9 @@ ENTRY(entry_INT80_compat)
pushq   3*8(%rdi)   /* regs->cs */
pushq   2*8(%rdi)   /* regs->ip */
pushq   1*8(%rdi)   /* regs->orig_ax */
-
pushq   (%rdi)  /* pt_regs->di */
+.Lint80_keep_stack:
+
pushq   %rsi/* pt_regs->si */
xorl%esi, %esi  /* nospec   si */
pushq   %rdx/* pt_regs->dx */
diff --git a/arch/x86/include/asm/mmu_context.h 
b/arch/x86/include/asm/mmu_context.h
index 0ca50611e8ce..19d18fae6ec6 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -178,6 +178,10 @@ static inline void switch_ldt(struct mm_struct *prev, 
struct mm_struct *next)
 
 void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
 
+/*
+ * Init a new mm.  Used on mm copies, like at fork()
+ * and on mm's that are brand-new, like at execve().
+ */
 static inline int init_new_context(struct task_struct *tsk,
   struct mm_struct *mm)
 {
@@ -228,8 +232,22 @@ do {   \
 } while (0)
 #endif
 
+static inline void arch_dup_pkeys(struct mm_struct *oldmm,
+ struct mm_struct *mm)
+{
+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
+   if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
+   return;
+
+   /* Duplicate the oldmm pkey state in mm: */
+   mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map;
+   mm->context.execute_only_pkey   = oldmm->context.execute_only_pkey;
+#endif
+}
+
 static inline 

[GIT pull] x86 updates for 5.0

2019-01-27 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 for x86:

 - Fix the swapped outb() parameters in the KASLR code

 - Fix the PKEY handling at fork which missed to preserve the pkey state
   for the child. Comes with a test case to validate that.

 - Fix the entry stack handling for XEN PV to respect that XEN PV systems
   enter the function already on the current thread stack and not on the
   trampoline.

 - Fix kexec load failure caused by using a stale value when the kexec_buf
   structure is reused for subsequent allocations.

 - Fix a bogus sizeof() in the memory encryption code

 - Enforce PCI dependency for the Intel Low Power Subsystem

 - Enforce PCI_LOCKLESS_CONFIG when PCI is enabled

Thanks,

tglx

-->
Daniel Drake (1):
  x86/kaslr: Fix incorrect i8254 outb() parameters

Dave Hansen (2):
  x86/pkeys: Properly copy pkey state at fork()
  x86/selftests/pkeys: Fork() to check for state being preserved

Dave Young (1):
  x86/kexec: Fix a kexec_file_load() failure

Jan Beulich (1):
  x86/entry/64/compat: Fix stack switching for XEN PV

Peng Hao (1):
  x86/mm/mem_encrypt: Fix erroneous sizeof()

Sinan Kaya (2):
  x86/intel/lpss: Make PCI dependency explicit
  x86/Kconfig: Select PCI_LOCKLESS_CONFIG if PCI is enabled


 arch/x86/Kconfig  |  4 +--
 arch/x86/entry/entry_64_compat.S  |  6 ++--
 arch/x86/include/asm/mmu_context.h| 18 
 arch/x86/kernel/crash.c   |  1 +
 arch/x86/kernel/kexec-bzimage64.c |  2 ++
 arch/x86/lib/kaslr.c  |  4 +--
 arch/x86/mm/mem_encrypt_identity.c|  4 +--
 tools/testing/selftests/x86/protection_keys.c | 41 ---
 8 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 15af091611e2..26387c7bf305 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -198,7 +198,7 @@ config X86
select IRQ_FORCED_THREADING
select NEED_SG_DMA_LENGTH
select PCI_DOMAINS  if PCI
-   select PCI_LOCKLESS_CONFIG
+   select PCI_LOCKLESS_CONFIG  if PCI
select PERF_EVENTS
select RTC_LIB
select RTC_MC146818_LIB
@@ -617,7 +617,7 @@ config X86_INTEL_QUARK
 
 config X86_INTEL_LPSS
bool "Intel Low Power Subsystem Support"
-   depends on X86 && ACPI
+   depends on X86 && ACPI && PCI
select COMMON_CLK
select PINCTRL
select IOSF_MBI
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 8eaf8952c408..39913770a44d 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -361,7 +361,8 @@ ENTRY(entry_INT80_compat)
 
/* Need to switch before accessing the thread stack. */
SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
-   movq%rsp, %rdi
+   /* In the Xen PV case we already run on the thread stack. */
+   ALTERNATIVE "movq %rsp, %rdi", "jmp .Lint80_keep_stack", 
X86_FEATURE_XENPV
movqPER_CPU_VAR(cpu_current_top_of_stack), %rsp
 
pushq   6*8(%rdi)   /* regs->ss */
@@ -370,8 +371,9 @@ ENTRY(entry_INT80_compat)
pushq   3*8(%rdi)   /* regs->cs */
pushq   2*8(%rdi)   /* regs->ip */
pushq   1*8(%rdi)   /* regs->orig_ax */
-
pushq   (%rdi)  /* pt_regs->di */
+.Lint80_keep_stack:
+
pushq   %rsi/* pt_regs->si */
xorl%esi, %esi  /* nospec   si */
pushq   %rdx/* pt_regs->dx */
diff --git a/arch/x86/include/asm/mmu_context.h 
b/arch/x86/include/asm/mmu_context.h
index 0ca50611e8ce..19d18fae6ec6 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -178,6 +178,10 @@ static inline void switch_ldt(struct mm_struct *prev, 
struct mm_struct *next)
 
 void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
 
+/*
+ * Init a new mm.  Used on mm copies, like at fork()
+ * and on mm's that are brand-new, like at execve().
+ */
 static inline int init_new_context(struct task_struct *tsk,
   struct mm_struct *mm)
 {
@@ -228,8 +232,22 @@ do {   \
 } while (0)
 #endif
 
+static inline void arch_dup_pkeys(struct mm_struct *oldmm,
+ struct mm_struct *mm)
+{
+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
+   if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
+   return;
+
+   /* Duplicate the oldmm pkey state in mm: */
+   mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map;
+   mm->context.execute_only_pkey   = oldmm->context.execute_only_pkey;
+#endif
+}
+
 static inline 

[GIT pull] x86 updates for 4.19

2018-09-02 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


x86 specific updates for 4.19:

 Speculation:
 
  - Make the micro code check more robust

  - Make the L1TF memory limit depend on the internal cache physical
address space and not on the CPUID advertised physical address space,
which might be significantly smaller. This avoids disabling L1TF on
machines which utilize the full physical address space.

  - Fix the GDT mapping for EFI calls on 32bit PTI

  - Fix the MCE nospec implementation to prevent #GP

 Fixes and robustness:
 
  - Use the proper operand order for LSL in the VDSO

  - Prevent NMI uaccess race against CR3 switching

  - Add a lockdep check to verify that text_mutex is held in text_poke()
functions

  - Repair the fallout of giving native_restore_fl() a prototype

  - Prevent kernel memory dumps based on usermode RIP

  - Wipe KASAN shadow stack before rewinding the stack to prevent false
positives

  - Move the AMS GOTO enforcement to the actual build stage to allow user
API header extraction without a compiler

  - Fix a section mismatch introduced by the on demand VDSO mapping change

 Miscelaneous:
 
  - Trivial typo, GCC quirk removal and CC_SET/OUT() cleanups.

Thanks,

tglx

-->
Andi Kleen (2):
  x86/spectre: Add missing family 6 check to microcode check
  x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+

Andy Lutomirski (1):
  x86/nmi: Fix NMI uaccess race against CR3 switching

Ben Hutchings (1):
  x86: Allow generating user-space headers without a compiler

Jann Horn (2):
  x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit()
  x86/dumpstack: Don't dump kernel memory based on usermode RIP

Jiri Kosina (1):
  x86/alternatives: Lockdep-enforce text_mutex in text_poke*()

Joerg Roedel (1):
  x86/efi: Load fixmap GDT in efi_call_phys_epilog()

Masahiro Yamada (1):
  x86/build: Remove jump label quirk for GCC older than 4.5.2

Nick Desaulniers (1):
  x86/irqflags: Mark native_restore_fl extern inline

Nikolas Nyby (1):
  x86/Kconfig: Fix trivial typo

Randy Dunlap (1):
  x86/pti: Fix section mismatch warning/error

Samuel Neves (1):
  x86/vdso: Fix lsl operand order

Tony Luck (1):
  x86/mce: Fix set_mce_nospec() to avoid #GP fault

Uros Bizjak (1):
  x86/asm: Use CC_SET()/CC_OUT() in __gen_sigismember()


 arch/x86/Kconfig  |  2 +-
 arch/x86/Makefile | 23 ++--
 arch/x86/events/core.c|  2 +-
 arch/x86/include/asm/irqflags.h   |  3 ++-
 arch/x86/include/asm/processor.h  |  4 +++-
 arch/x86/include/asm/signal.h |  7 +++---
 arch/x86/include/asm/stacktrace.h |  2 +-
 arch/x86/include/asm/tlbflush.h   | 40 ++
 arch/x86/include/asm/vgtod.h  |  2 +-
 arch/x86/kernel/alternative.c |  9 
 arch/x86/kernel/cpu/bugs.c| 46 ++-
 arch/x86/kernel/cpu/common.c  |  1 +
 arch/x86/kernel/cpu/intel.c   |  3 +++
 arch/x86/kernel/dumpstack.c   | 20 ++---
 arch/x86/lib/usercopy.c   |  5 +
 arch/x86/mm/fault.c   |  2 +-
 arch/x86/mm/pageattr.c| 25 -
 arch/x86/mm/pti.c |  2 +-
 arch/x86/mm/tlb.c |  7 ++
 arch/x86/platform/efi/efi_32.c|  8 ++-
 scripts/Kbuild.include|  4 
 21 files changed, 167 insertions(+), 50 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c5ff296bc5d1..1a0be022f91d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2843,7 +2843,7 @@ config X86_SYSFB
  This option, if enabled, marks VGA/VBE/EFI framebuffers as generic
  framebuffers so the new generic system-framebuffer drivers can be
  used on x86. If the framebuffer is not compatible with the generic
- modes, it is adverticed as fallback platform framebuffer so legacy
+ modes, it is advertised as fallback platform framebuffer so legacy
  drivers like efifb, vesafb and uvesafb can pick it up.
  If this option is not selected, all system framebuffers are always
  marked as fallback platform framebuffers as usual.
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 94859241bc3e..8f6e7eb8ae9f 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -175,22 +175,6 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
   endif
 endif
 
-ifndef CC_HAVE_ASM_GOTO
-  $(error Compiler lacks asm-goto support.)
-endif
-
-#
-# Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a
-# GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226).  There's no way
-# to test for this bug at compile-time because the test case needs to execute,
-# which is a no-go for cross compilers.  So check the GCC version instead.
-#
-ifdef 

[GIT pull] x86 updates for 4.19

2018-09-02 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


x86 specific updates for 4.19:

 Speculation:
 
  - Make the micro code check more robust

  - Make the L1TF memory limit depend on the internal cache physical
address space and not on the CPUID advertised physical address space,
which might be significantly smaller. This avoids disabling L1TF on
machines which utilize the full physical address space.

  - Fix the GDT mapping for EFI calls on 32bit PTI

  - Fix the MCE nospec implementation to prevent #GP

 Fixes and robustness:
 
  - Use the proper operand order for LSL in the VDSO

  - Prevent NMI uaccess race against CR3 switching

  - Add a lockdep check to verify that text_mutex is held in text_poke()
functions

  - Repair the fallout of giving native_restore_fl() a prototype

  - Prevent kernel memory dumps based on usermode RIP

  - Wipe KASAN shadow stack before rewinding the stack to prevent false
positives

  - Move the AMS GOTO enforcement to the actual build stage to allow user
API header extraction without a compiler

  - Fix a section mismatch introduced by the on demand VDSO mapping change

 Miscelaneous:
 
  - Trivial typo, GCC quirk removal and CC_SET/OUT() cleanups.

Thanks,

tglx

-->
Andi Kleen (2):
  x86/spectre: Add missing family 6 check to microcode check
  x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+

Andy Lutomirski (1):
  x86/nmi: Fix NMI uaccess race against CR3 switching

Ben Hutchings (1):
  x86: Allow generating user-space headers without a compiler

Jann Horn (2):
  x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit()
  x86/dumpstack: Don't dump kernel memory based on usermode RIP

Jiri Kosina (1):
  x86/alternatives: Lockdep-enforce text_mutex in text_poke*()

Joerg Roedel (1):
  x86/efi: Load fixmap GDT in efi_call_phys_epilog()

Masahiro Yamada (1):
  x86/build: Remove jump label quirk for GCC older than 4.5.2

Nick Desaulniers (1):
  x86/irqflags: Mark native_restore_fl extern inline

Nikolas Nyby (1):
  x86/Kconfig: Fix trivial typo

Randy Dunlap (1):
  x86/pti: Fix section mismatch warning/error

Samuel Neves (1):
  x86/vdso: Fix lsl operand order

Tony Luck (1):
  x86/mce: Fix set_mce_nospec() to avoid #GP fault

Uros Bizjak (1):
  x86/asm: Use CC_SET()/CC_OUT() in __gen_sigismember()


 arch/x86/Kconfig  |  2 +-
 arch/x86/Makefile | 23 ++--
 arch/x86/events/core.c|  2 +-
 arch/x86/include/asm/irqflags.h   |  3 ++-
 arch/x86/include/asm/processor.h  |  4 +++-
 arch/x86/include/asm/signal.h |  7 +++---
 arch/x86/include/asm/stacktrace.h |  2 +-
 arch/x86/include/asm/tlbflush.h   | 40 ++
 arch/x86/include/asm/vgtod.h  |  2 +-
 arch/x86/kernel/alternative.c |  9 
 arch/x86/kernel/cpu/bugs.c| 46 ++-
 arch/x86/kernel/cpu/common.c  |  1 +
 arch/x86/kernel/cpu/intel.c   |  3 +++
 arch/x86/kernel/dumpstack.c   | 20 ++---
 arch/x86/lib/usercopy.c   |  5 +
 arch/x86/mm/fault.c   |  2 +-
 arch/x86/mm/pageattr.c| 25 -
 arch/x86/mm/pti.c |  2 +-
 arch/x86/mm/tlb.c |  7 ++
 arch/x86/platform/efi/efi_32.c|  8 ++-
 scripts/Kbuild.include|  4 
 21 files changed, 167 insertions(+), 50 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c5ff296bc5d1..1a0be022f91d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2843,7 +2843,7 @@ config X86_SYSFB
  This option, if enabled, marks VGA/VBE/EFI framebuffers as generic
  framebuffers so the new generic system-framebuffer drivers can be
  used on x86. If the framebuffer is not compatible with the generic
- modes, it is adverticed as fallback platform framebuffer so legacy
+ modes, it is advertised as fallback platform framebuffer so legacy
  drivers like efifb, vesafb and uvesafb can pick it up.
  If this option is not selected, all system framebuffers are always
  marked as fallback platform framebuffers as usual.
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 94859241bc3e..8f6e7eb8ae9f 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -175,22 +175,6 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
   endif
 endif
 
-ifndef CC_HAVE_ASM_GOTO
-  $(error Compiler lacks asm-goto support.)
-endif
-
-#
-# Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a
-# GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226).  There's no way
-# to test for this bug at compile-time because the test case needs to execute,
-# which is a no-go for cross compilers.  So check the GCC version instead.
-#
-ifdef 

[GIT pull] x86 updates for 4.19

2018-08-26 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 pile of x86 fixes:

 - Correct the L!TF fallout on 32bit and the off by one in the 'too much
   RAM for protection' calculation.

 - Add a helpful kernel message for the 'too much RAM' case

 - Unbreak the VDSO in case that the compiler desides to use indirect
   jumps/calls and emits retpolines which cannot be resolved because the
   kernel uses its own thunks, which does not work for the VDSO. Make it
   use the builtin thunks.

 - Re-export start_thread() which was unexported when the 32/64bit
   implementation was unified. start_thread() is required by modular binfmt
   handlers.

 - Trivial cleanups

Thanks,

tglx

-->
Andy Lutomirski (1):
  x86/vdso: Fix vDSO build if a retpoline is emitted

Arnd Bergmann (1):
  x86/mce: Add notifier_block forward declaration

Josh Poimboeuf (1):
  x86/kvm/vmx: Remove duplicate l1d flush definitions

Rian Hunter (1):
  x86/process: Re-export start_thread()

Vlastimil Babka (3):
  x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
  x86/speculation/l1tf: Fix off-by-one error when warning that system has 
too much RAM
  x86/speculation/l1tf: Suggest what to do on systems with too much RAM


 Makefile | 4 
 arch/x86/entry/vdso/Makefile | 6 --
 arch/x86/include/asm/mce.h   | 1 +
 arch/x86/include/asm/processor.h | 4 ++--
 arch/x86/kernel/cpu/bugs.c   | 4 
 arch/x86/kernel/process_64.c | 1 +
 arch/x86/kvm/vmx.c   | 3 ---
 arch/x86/mm/init.c   | 4 ++--
 arch/x86/mm/mmap.c   | 2 +-
 9 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index a0650bf79606..7bab2e90e4e1 100644
--- a/Makefile
+++ b/Makefile
@@ -507,9 +507,13 @@ KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
 endif
 
 RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern 
-mindirect-branch-register
+RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline 
-mindirect-branch-register
 RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
+RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
 RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call 
cc-option,$(RETPOLINE_CFLAGS_CLANG)))
+RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call 
cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
 export RETPOLINE_CFLAGS
+export RETPOLINE_VDSO_CFLAGS
 
 KBUILD_CFLAGS  += $(call cc-option,-fno-PIE)
 KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 9f695f517747..fa3f439f0a92 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -68,9 +68,9 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so 
$(obj)/vdso2c FORCE
 CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 
\
$(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
-fno-omit-frame-pointer -foptimize-sibling-calls \
-   -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
+   -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO $(RETPOLINE_VDSO_CFLAGS)
 
-$(vobjs): KBUILD_CFLAGS := $(filter-out 
$(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
+$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) 
$(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
 
 #
 # vDSO code runs in userspace and -pg doesn't help with profiling anyway.
@@ -132,11 +132,13 @@ KBUILD_CFLAGS_32 := $(filter-out 
-mcmodel=kernel,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32))
+KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
 KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
 KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
 KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
 KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS)
 $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
 
 $(obj)/vdso32.so.dbg: FORCE \
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 8c7b3e5a2d01..3a17107594c8 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -148,6 +148,7 @@ enum mce_notifier_prios {
MCE_PRIO_LOWEST = 0,
 };
 
+struct notifier_block;
 extern void mce_register_decode_chain(struct notifier_block *nb);
 extern void mce_unregister_decode_chain(struct notifier_block *nb);
 
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 682286aca881..c24297268ebc 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -181,9 +181,9 @@ extern const struct 

[GIT pull] x86 updates for 4.19

2018-08-26 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 pile of x86 fixes:

 - Correct the L!TF fallout on 32bit and the off by one in the 'too much
   RAM for protection' calculation.

 - Add a helpful kernel message for the 'too much RAM' case

 - Unbreak the VDSO in case that the compiler desides to use indirect
   jumps/calls and emits retpolines which cannot be resolved because the
   kernel uses its own thunks, which does not work for the VDSO. Make it
   use the builtin thunks.

 - Re-export start_thread() which was unexported when the 32/64bit
   implementation was unified. start_thread() is required by modular binfmt
   handlers.

 - Trivial cleanups

Thanks,

tglx

-->
Andy Lutomirski (1):
  x86/vdso: Fix vDSO build if a retpoline is emitted

Arnd Bergmann (1):
  x86/mce: Add notifier_block forward declaration

Josh Poimboeuf (1):
  x86/kvm/vmx: Remove duplicate l1d flush definitions

Rian Hunter (1):
  x86/process: Re-export start_thread()

Vlastimil Babka (3):
  x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit
  x86/speculation/l1tf: Fix off-by-one error when warning that system has 
too much RAM
  x86/speculation/l1tf: Suggest what to do on systems with too much RAM


 Makefile | 4 
 arch/x86/entry/vdso/Makefile | 6 --
 arch/x86/include/asm/mce.h   | 1 +
 arch/x86/include/asm/processor.h | 4 ++--
 arch/x86/kernel/cpu/bugs.c   | 4 
 arch/x86/kernel/process_64.c | 1 +
 arch/x86/kvm/vmx.c   | 3 ---
 arch/x86/mm/init.c   | 4 ++--
 arch/x86/mm/mmap.c   | 2 +-
 9 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index a0650bf79606..7bab2e90e4e1 100644
--- a/Makefile
+++ b/Makefile
@@ -507,9 +507,13 @@ KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
 endif
 
 RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern 
-mindirect-branch-register
+RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline 
-mindirect-branch-register
 RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
+RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
 RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call 
cc-option,$(RETPOLINE_CFLAGS_CLANG)))
+RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call 
cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
 export RETPOLINE_CFLAGS
+export RETPOLINE_VDSO_CFLAGS
 
 KBUILD_CFLAGS  += $(call cc-option,-fno-PIE)
 KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 9f695f517747..fa3f439f0a92 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -68,9 +68,9 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so 
$(obj)/vdso2c FORCE
 CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 
\
$(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
-fno-omit-frame-pointer -foptimize-sibling-calls \
-   -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
+   -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO $(RETPOLINE_VDSO_CFLAGS)
 
-$(vobjs): KBUILD_CFLAGS := $(filter-out 
$(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
+$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) 
$(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
 
 #
 # vDSO code runs in userspace and -pg doesn't help with profiling anyway.
@@ -132,11 +132,13 @@ KBUILD_CFLAGS_32 := $(filter-out 
-mcmodel=kernel,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32))
+KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32))
 KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
 KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
 KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
 KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
 KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS)
 $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
 
 $(obj)/vdso32.so.dbg: FORCE \
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 8c7b3e5a2d01..3a17107594c8 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -148,6 +148,7 @@ enum mce_notifier_prios {
MCE_PRIO_LOWEST = 0,
 };
 
+struct notifier_block;
 extern void mce_register_decode_chain(struct notifier_block *nb);
 extern void mce_unregister_decode_chain(struct notifier_block *nb);
 
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 682286aca881..c24297268ebc 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -181,9 +181,9 @@ extern const struct 

[GIT pull] x86 updates for 4.18

2018-07-08 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 for x86:

  - Prevent an out-of-bounds access in mtrr_write()

  - Break a circular dependency in the new hyperv IPI acceleration code

  - Address the build breakage related to inline functions by enforcing
gnu_inline and explicitely bringing native_save_fl() out of line, which
also adds a set of _ARM_ARG macros which provide 32/64bit safety.

  - Initialize the shadow CR4 per cpu variable before using it.

Thanks,

tglx

-->
H. Peter Anvin (1):
  x86/asm: Add _ASM_ARG* constants for argument registers to 

Jann Horn (1):
  x86/mtrr: Don't copy out-of-bounds data in mtrr_write

K. Y. Srinivasan (1):
  x86/hyper-v: Fix the circular dependency in IPI enlightenment

Nick Desaulniers (2):
  compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations
  x86/paravirt: Make native_save_fl() extern inline

Zhenzhong Duan (1):
  x86/mm/32: Initialize the CR4 shadow before __flush_tlb_all()


 arch/x86/hyperv/hv_apic.c   |  5 
 arch/x86/hyperv/hv_init.c   |  5 +++-
 arch/x86/include/asm/asm.h  | 59 +
 arch/x86/include/asm/irqflags.h |  2 +-
 arch/x86/include/asm/mshyperv.h |  5 +++-
 arch/x86/kernel/Makefile|  1 +
 arch/x86/kernel/cpu/mtrr/if.c   |  3 ++-
 arch/x86/kernel/irqflags.S  | 26 ++
 arch/x86/kernel/smpboot.c   |  5 
 include/linux/compiler-gcc.h| 29 +++-
 10 files changed, 129 insertions(+), 11 deletions(-)
 create mode 100644 arch/x86/kernel/irqflags.S

diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
index f68855499391..402338365651 100644
--- a/arch/x86/hyperv/hv_apic.c
+++ b/arch/x86/hyperv/hv_apic.c
@@ -114,6 +114,8 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, 
int vector)
ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
}
+   if (nr_bank < 0)
+   goto ipi_mask_ex_done;
if (!nr_bank)
ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
 
@@ -158,6 +160,9 @@ static bool __send_ipi_mask(const struct cpumask *mask, int 
vector)
 
for_each_cpu(cur_cpu, mask) {
vcpu = hv_cpu_number_to_vp_number(cur_cpu);
+   if (vcpu == VP_INVAL)
+   goto ipi_mask_done;
+
/*
 * This particular version of the IPI hypercall can
 * only target upto 64 CPUs.
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 4c431e1c1eff..1ff420217298 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -265,7 +265,7 @@ void __init hyperv_init(void)
 {
u64 guest_id, required_msrs;
union hv_x64_msr_hypercall_contents hypercall_msr;
-   int cpuhp;
+   int cpuhp, i;
 
if (x86_hyper_type != X86_HYPER_MS_HYPERV)
return;
@@ -293,6 +293,9 @@ void __init hyperv_init(void)
if (!hv_vp_index)
return;
 
+   for (i = 0; i < num_possible_cpus(); i++)
+   hv_vp_index[i] = VP_INVAL;
+
hv_vp_assist_page = kcalloc(num_possible_cpus(),
sizeof(*hv_vp_assist_page), GFP_KERNEL);
if (!hv_vp_assist_page) {
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 219faaec51df..990770f9e76b 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -46,6 +46,65 @@
 #define _ASM_SI__ASM_REG(si)
 #define _ASM_DI__ASM_REG(di)
 
+#ifndef __x86_64__
+/* 32 bit */
+
+#define _ASM_ARG1  _ASM_AX
+#define _ASM_ARG2  _ASM_DX
+#define _ASM_ARG3  _ASM_CX
+
+#define _ASM_ARG1L eax
+#define _ASM_ARG2L edx
+#define _ASM_ARG3L ecx
+
+#define _ASM_ARG1W ax
+#define _ASM_ARG2W dx
+#define _ASM_ARG3W cx
+
+#define _ASM_ARG1B al
+#define _ASM_ARG2B dl
+#define _ASM_ARG3B cl
+
+#else
+/* 64 bit */
+
+#define _ASM_ARG1  _ASM_DI
+#define _ASM_ARG2  _ASM_SI
+#define _ASM_ARG3  _ASM_DX
+#define _ASM_ARG4  _ASM_CX
+#define _ASM_ARG5  r8
+#define _ASM_ARG6  r9
+
+#define _ASM_ARG1Q rdi
+#define _ASM_ARG2Q rsi
+#define _ASM_ARG3Q rdx
+#define _ASM_ARG4Q rcx
+#define _ASM_ARG5Q r8
+#define _ASM_ARG6Q r9
+
+#define _ASM_ARG1L edi
+#define _ASM_ARG2L esi
+#define _ASM_ARG3L edx
+#define _ASM_ARG4L ecx
+#define _ASM_ARG5L r8d
+#define _ASM_ARG6L r9d
+
+#define _ASM_ARG1W di
+#define _ASM_ARG2W si
+#define _ASM_ARG3W dx
+#define _ASM_ARG4W cx
+#define _ASM_ARG5W r8w
+#define _ASM_ARG6W r9w
+
+#define _ASM_ARG1B dil
+#define _ASM_ARG2B sil
+#define _ASM_ARG3B dl
+#define _ASM_ARG4B cl
+#define 

[GIT pull] x86 updates for 4.18

2018-07-08 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 for x86:

  - Prevent an out-of-bounds access in mtrr_write()

  - Break a circular dependency in the new hyperv IPI acceleration code

  - Address the build breakage related to inline functions by enforcing
gnu_inline and explicitely bringing native_save_fl() out of line, which
also adds a set of _ARM_ARG macros which provide 32/64bit safety.

  - Initialize the shadow CR4 per cpu variable before using it.

Thanks,

tglx

-->
H. Peter Anvin (1):
  x86/asm: Add _ASM_ARG* constants for argument registers to 

Jann Horn (1):
  x86/mtrr: Don't copy out-of-bounds data in mtrr_write

K. Y. Srinivasan (1):
  x86/hyper-v: Fix the circular dependency in IPI enlightenment

Nick Desaulniers (2):
  compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations
  x86/paravirt: Make native_save_fl() extern inline

Zhenzhong Duan (1):
  x86/mm/32: Initialize the CR4 shadow before __flush_tlb_all()


 arch/x86/hyperv/hv_apic.c   |  5 
 arch/x86/hyperv/hv_init.c   |  5 +++-
 arch/x86/include/asm/asm.h  | 59 +
 arch/x86/include/asm/irqflags.h |  2 +-
 arch/x86/include/asm/mshyperv.h |  5 +++-
 arch/x86/kernel/Makefile|  1 +
 arch/x86/kernel/cpu/mtrr/if.c   |  3 ++-
 arch/x86/kernel/irqflags.S  | 26 ++
 arch/x86/kernel/smpboot.c   |  5 
 include/linux/compiler-gcc.h| 29 +++-
 10 files changed, 129 insertions(+), 11 deletions(-)
 create mode 100644 arch/x86/kernel/irqflags.S

diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
index f68855499391..402338365651 100644
--- a/arch/x86/hyperv/hv_apic.c
+++ b/arch/x86/hyperv/hv_apic.c
@@ -114,6 +114,8 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, 
int vector)
ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
}
+   if (nr_bank < 0)
+   goto ipi_mask_ex_done;
if (!nr_bank)
ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
 
@@ -158,6 +160,9 @@ static bool __send_ipi_mask(const struct cpumask *mask, int 
vector)
 
for_each_cpu(cur_cpu, mask) {
vcpu = hv_cpu_number_to_vp_number(cur_cpu);
+   if (vcpu == VP_INVAL)
+   goto ipi_mask_done;
+
/*
 * This particular version of the IPI hypercall can
 * only target upto 64 CPUs.
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 4c431e1c1eff..1ff420217298 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -265,7 +265,7 @@ void __init hyperv_init(void)
 {
u64 guest_id, required_msrs;
union hv_x64_msr_hypercall_contents hypercall_msr;
-   int cpuhp;
+   int cpuhp, i;
 
if (x86_hyper_type != X86_HYPER_MS_HYPERV)
return;
@@ -293,6 +293,9 @@ void __init hyperv_init(void)
if (!hv_vp_index)
return;
 
+   for (i = 0; i < num_possible_cpus(); i++)
+   hv_vp_index[i] = VP_INVAL;
+
hv_vp_assist_page = kcalloc(num_possible_cpus(),
sizeof(*hv_vp_assist_page), GFP_KERNEL);
if (!hv_vp_assist_page) {
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 219faaec51df..990770f9e76b 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -46,6 +46,65 @@
 #define _ASM_SI__ASM_REG(si)
 #define _ASM_DI__ASM_REG(di)
 
+#ifndef __x86_64__
+/* 32 bit */
+
+#define _ASM_ARG1  _ASM_AX
+#define _ASM_ARG2  _ASM_DX
+#define _ASM_ARG3  _ASM_CX
+
+#define _ASM_ARG1L eax
+#define _ASM_ARG2L edx
+#define _ASM_ARG3L ecx
+
+#define _ASM_ARG1W ax
+#define _ASM_ARG2W dx
+#define _ASM_ARG3W cx
+
+#define _ASM_ARG1B al
+#define _ASM_ARG2B dl
+#define _ASM_ARG3B cl
+
+#else
+/* 64 bit */
+
+#define _ASM_ARG1  _ASM_DI
+#define _ASM_ARG2  _ASM_SI
+#define _ASM_ARG3  _ASM_DX
+#define _ASM_ARG4  _ASM_CX
+#define _ASM_ARG5  r8
+#define _ASM_ARG6  r9
+
+#define _ASM_ARG1Q rdi
+#define _ASM_ARG2Q rsi
+#define _ASM_ARG3Q rdx
+#define _ASM_ARG4Q rcx
+#define _ASM_ARG5Q r8
+#define _ASM_ARG6Q r9
+
+#define _ASM_ARG1L edi
+#define _ASM_ARG2L esi
+#define _ASM_ARG3L edx
+#define _ASM_ARG4L ecx
+#define _ASM_ARG5L r8d
+#define _ASM_ARG6L r9d
+
+#define _ASM_ARG1W di
+#define _ASM_ARG2W si
+#define _ASM_ARG3W dx
+#define _ASM_ARG4W cx
+#define _ASM_ARG5W r8w
+#define _ASM_ARG6W r9w
+
+#define _ASM_ARG1B dil
+#define _ASM_ARG2B sil
+#define _ASM_ARG3B dl
+#define _ASM_ARG4B cl
+#define 

[GIT pull] x86 updates for 4.18

2018-06-24 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 for x86:

 - Make Xen PV guest deal with speculative store bypass correctly
 
 - Address more fallout from the 5-Level pagetable handling. Undo an
   __initdata annotation to avoid section mismatch and malfunction when
   post init code would touch the freed variable.

 - Handle exception fixup in math_error() before calling notify_die(). The
   reverse call order incorrectly triggers notify_die() listeners for
   soemthing which is handled correctly at the site which issues the
   floating point instruction.

 - Fix an off by one in the LLC topology calculation on AMD

 - Handle non standard memory block sizes gracefully un UV platforms

 - Plug a memory leak in the microcode loader

 - Sanitize the purgatory build magic

 - Add the x86 specific device tree bindings directory to the x86
   MAINTAINER file patterns.

Thanks,

tglx

-->
Geert Uytterhoeven (1):
  MAINTAINERS: Add file patterns for x86 device tree bindings

Juergen Gross (1):
  x86/xen: Add call of speculative_store_bypass_ht_init() to PV paths

Kirill A. Shutemov (2):
  Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
  x86/mm: Fix 'no5lvl' handling

Masahiro Yamada (2):
  Revert "kexec/purgatory: Add clean-up for purgatory directory"
  x86/build: Remove unnecessary preparation for purgatory

Siarhei Liakh (1):
  x86: Call fixup_exception() before notify_die() in math_error()

Suravee Suthikulpanit (1):
  x86/CPU/AMD: Fix LLC ID bit-shift calculation

Zhenzhong Duan (1):
  x86/microcode/intel: Fix memleak in save_microcode_patch()

mike.tra...@hpe.com (3):
  x86/platform/UV: Add adjustable set memory block size function
  x86/platform/UV: Use new set memory block size function
  x86/platform/UV: Add kernel parameter to set memory block size


 MAINTAINERS   |  1 +
 arch/x86/Makefile |  6 
 arch/x86/kernel/apic/x2apic_uv_x.c| 60 +--
 arch/x86/kernel/cpu/cacheinfo.c   |  2 +-
 arch/x86/kernel/cpu/common.c  |  3 ++
 arch/x86/kernel/cpu/microcode/intel.c |  5 ++-
 arch/x86/kernel/head64.c  |  2 +-
 arch/x86/kernel/traps.c   | 14 
 arch/x86/mm/init_64.c | 20 +---
 arch/x86/xen/smp_pv.c |  5 +++
 include/linux/memory.h|  1 +
 11 files changed, 97 insertions(+), 22 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9d5eeff51b5f..5e33d27e9171 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15572,6 +15572,7 @@ M:  x...@kernel.org
 L: linux-kernel@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
 S: Maintained
+F: Documentation/devicetree/bindings/x86/
 F: Documentation/x86/
 F: arch/x86/
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index f0a6ea22429d..a08e82856563 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -258,11 +258,6 @@ archscripts: scripts_basic
 archheaders:
$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
 
-archprepare:
-ifeq ($(CONFIG_KEXEC_FILE),y)
-   $(Q)$(MAKE) $(build)=arch/x86/purgatory 
arch/x86/purgatory/kexec-purgatory.c
-endif
-
 ###
 # Kernel objects
 
@@ -327,7 +322,6 @@ archclean:
$(Q)rm -rf $(objtree)/arch/x86_64
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=arch/x86/tools
-   $(Q)$(MAKE) $(clean)=arch/x86/purgatory
 
 define archhelp
   echo  '* bzImage  - Compressed kernel image (arch/x86/boot/bzImage)'
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c 
b/arch/x86/kernel/apic/x2apic_uv_x.c
index efaf2d4f9c3c..d492752f79e1 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -392,6 +393,51 @@ extern int uv_hub_info_version(void)
 }
 EXPORT_SYMBOL(uv_hub_info_version);
 
+/* Default UV memory block size is 2GB */
+static unsigned long mem_block_size = (2UL << 30);
+
+/* Kernel parameter to specify UV mem block size */
+static int parse_mem_block_size(char *ptr)
+{
+   unsigned long size = memparse(ptr, NULL);
+
+   /* Size will be rounded down by set_block_size() below */
+   mem_block_size = size;
+   return 0;
+}
+early_param("uv_memblksize", parse_mem_block_size);
+
+static __init int adj_blksize(u32 lgre)
+{
+   unsigned long base = (unsigned long)lgre << UV_GAM_RANGE_SHFT;
+   unsigned long size;
+
+   for (size = mem_block_size; size > MIN_MEMORY_BLOCK_SIZE; size >>= 1)
+   if (IS_ALIGNED(base, size))
+   break;
+
+   if (size >= mem_block_size)
+   return 0;
+
+   mem_block_size = size;
+   return 1;
+}
+
+static __init void set_block_size(void)
+{
+   

[GIT pull] x86 updates for 4.18

2018-06-24 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 for x86:

 - Make Xen PV guest deal with speculative store bypass correctly
 
 - Address more fallout from the 5-Level pagetable handling. Undo an
   __initdata annotation to avoid section mismatch and malfunction when
   post init code would touch the freed variable.

 - Handle exception fixup in math_error() before calling notify_die(). The
   reverse call order incorrectly triggers notify_die() listeners for
   soemthing which is handled correctly at the site which issues the
   floating point instruction.

 - Fix an off by one in the LLC topology calculation on AMD

 - Handle non standard memory block sizes gracefully un UV platforms

 - Plug a memory leak in the microcode loader

 - Sanitize the purgatory build magic

 - Add the x86 specific device tree bindings directory to the x86
   MAINTAINER file patterns.

Thanks,

tglx

-->
Geert Uytterhoeven (1):
  MAINTAINERS: Add file patterns for x86 device tree bindings

Juergen Gross (1):
  x86/xen: Add call of speculative_store_bypass_ht_init() to PV paths

Kirill A. Shutemov (2):
  Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
  x86/mm: Fix 'no5lvl' handling

Masahiro Yamada (2):
  Revert "kexec/purgatory: Add clean-up for purgatory directory"
  x86/build: Remove unnecessary preparation for purgatory

Siarhei Liakh (1):
  x86: Call fixup_exception() before notify_die() in math_error()

Suravee Suthikulpanit (1):
  x86/CPU/AMD: Fix LLC ID bit-shift calculation

Zhenzhong Duan (1):
  x86/microcode/intel: Fix memleak in save_microcode_patch()

mike.tra...@hpe.com (3):
  x86/platform/UV: Add adjustable set memory block size function
  x86/platform/UV: Use new set memory block size function
  x86/platform/UV: Add kernel parameter to set memory block size


 MAINTAINERS   |  1 +
 arch/x86/Makefile |  6 
 arch/x86/kernel/apic/x2apic_uv_x.c| 60 +--
 arch/x86/kernel/cpu/cacheinfo.c   |  2 +-
 arch/x86/kernel/cpu/common.c  |  3 ++
 arch/x86/kernel/cpu/microcode/intel.c |  5 ++-
 arch/x86/kernel/head64.c  |  2 +-
 arch/x86/kernel/traps.c   | 14 
 arch/x86/mm/init_64.c | 20 +---
 arch/x86/xen/smp_pv.c |  5 +++
 include/linux/memory.h|  1 +
 11 files changed, 97 insertions(+), 22 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9d5eeff51b5f..5e33d27e9171 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15572,6 +15572,7 @@ M:  x...@kernel.org
 L: linux-kernel@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
 S: Maintained
+F: Documentation/devicetree/bindings/x86/
 F: Documentation/x86/
 F: arch/x86/
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index f0a6ea22429d..a08e82856563 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -258,11 +258,6 @@ archscripts: scripts_basic
 archheaders:
$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
 
-archprepare:
-ifeq ($(CONFIG_KEXEC_FILE),y)
-   $(Q)$(MAKE) $(build)=arch/x86/purgatory 
arch/x86/purgatory/kexec-purgatory.c
-endif
-
 ###
 # Kernel objects
 
@@ -327,7 +322,6 @@ archclean:
$(Q)rm -rf $(objtree)/arch/x86_64
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=arch/x86/tools
-   $(Q)$(MAKE) $(clean)=arch/x86/purgatory
 
 define archhelp
   echo  '* bzImage  - Compressed kernel image (arch/x86/boot/bzImage)'
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c 
b/arch/x86/kernel/apic/x2apic_uv_x.c
index efaf2d4f9c3c..d492752f79e1 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -392,6 +393,51 @@ extern int uv_hub_info_version(void)
 }
 EXPORT_SYMBOL(uv_hub_info_version);
 
+/* Default UV memory block size is 2GB */
+static unsigned long mem_block_size = (2UL << 30);
+
+/* Kernel parameter to specify UV mem block size */
+static int parse_mem_block_size(char *ptr)
+{
+   unsigned long size = memparse(ptr, NULL);
+
+   /* Size will be rounded down by set_block_size() below */
+   mem_block_size = size;
+   return 0;
+}
+early_param("uv_memblksize", parse_mem_block_size);
+
+static __init int adj_blksize(u32 lgre)
+{
+   unsigned long base = (unsigned long)lgre << UV_GAM_RANGE_SHFT;
+   unsigned long size;
+
+   for (size = mem_block_size; size > MIN_MEMORY_BLOCK_SIZE; size >>= 1)
+   if (IS_ALIGNED(base, size))
+   break;
+
+   if (size >= mem_block_size)
+   return 0;
+
+   mem_block_size = size;
+   return 1;
+}
+
+static __init void set_block_size(void)
+{
+   

[GIT pull] x86 updates for 4.18

2018-06-10 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 pile of x86 updates and fixes:

 - Fix the (late) fallout from the vector management rework causing hlist
   corruption and irq descriptor reference leaks caused by a missing sanity
   check.

   The straight forward fix triggered another long standing issue to
   surface. The pre rework code hid the issue due to being way slower, but
   now the chance that user space sees an EBUSY error return when updating
   irq affinities is way higher, though quite a bunch of userspace tools do
   not handle it properly despite the fact that EBUSY could be returned for
   at least 10 years. It turned out that the EBUSY return can be avoided
   completely by utilizing the existing delayed affinity update mechanism
   for irq remapped scenarios as well. That's a bit more error handling in
   the kernel, but avoids fruitless fingerpointing discussions with tool
   developers.

 - Decouple PHYSICAL_MASK from AMD SME as its going to be required for the
   upcoming Intel memory encryption support as well.

 - Handle legacy device ACPI detection properly for newer platforms

 - Fix the wrong argument ordering in the vector allocation tracepoint

 - Simplify the IDT setup code for the APIC=n case

 - Use the proper string helpers in the MTRR code

 - Remove a stale unused VDSO source file

 - Convert the microcode update lock to a raw spinlock as its used in
   atomic context.

Thanks,

tglx

-->
Andy Shevchenko (2):
  x86/mtrr: Convert to use match_string() helper
  x86/mtrr: Convert to use strncpy_from_user() helper

Arnd Bergmann (1):
  x86: Mark native_set_p4d() as __always_inline

Dou Liyang (2):
  x86/idt: Simplify the idt_setup_apic_and_irq_gates()
  x86/vector: Fix the args of vector_alloc tracepoint

Jann Horn (1):
  x86/vdso: Remove unused file

Kirill A. Shutemov (1):
  x86/mm: Decouple dynamic __PHYSICAL_MASK from AMD SME

Rajneesh Bhardwaj (1):
  x86/i8237: Register device based on FADT legacy boot flag

Scott Wood (1):
  x86/microcode: Make the late update update_lock a raw lock for RT

Thomas Gleixner (9):
  x86/apic/vector: Prevent hlist corruption and leaks
  genirq/generic_pending: Do not lose pending affinity update
  genirq/migration: Avoid out of line call if pending is not set
  x86/apic: Provide apic_ack_irq()
  irq_remapping: Use apic_ack_irq()
  x86/ioapic: Use apic_ack_irq()
  x86/platform/uv: Use apic_ack_irq()
  genirq/affinity: Defer affinity setting if irq chip is busy
  x86/apic/vector: Print APIC control bits in debugfs

Tony Luck (1):
  x86/intel_rdt: Enable CMT and MBM on new Skylake stepping

Varsha Rao (1):
  x86/platform/uv: Remove extra parentheses


 arch/x86/Kconfig |  4 +++
 arch/x86/boot/compressed/kaslr_64.c  |  5 
 arch/x86/include/asm/apic.h  |  2 ++
 arch/x86/include/asm/page_types.h|  8 +-
 arch/x86/include/asm/pgtable_64.h|  4 +--
 arch/x86/include/asm/trace/irq_vectors.h |  2 +-
 arch/x86/include/asm/x86_init.h  |  1 +
 arch/x86/kernel/apic/io_apic.c   |  2 +-
 arch/x86/kernel/apic/vector.c| 45 +---
 arch/x86/kernel/cpu/intel_rdt.c  |  2 ++
 arch/x86/kernel/cpu/microcode/core.c |  6 ++---
 arch/x86/kernel/cpu/mtrr/if.c| 33 +--
 arch/x86/kernel/i8237.c  | 25 ++
 arch/x86/kernel/idt.c|  7 ++---
 arch/x86/kernel/platform-quirks.c|  7 -
 arch/x86/mm/mem_encrypt_identity.c   |  3 +++
 arch/x86/mm/pgtable.c|  5 
 arch/x86/platform/uv/tlb_uv.c|  2 +-
 arch/x86/platform/uv/uv_irq.c|  7 +
 drivers/iommu/amd_iommu.c|  2 +-
 drivers/iommu/intel_irq_remapping.c  |  2 +-
 drivers/iommu/irq_remapping.c|  5 
 drivers/iommu/irq_remapping.h|  2 --
 include/linux/irq.h  |  7 -
 kernel/irq/manage.c  | 37 --
 kernel/irq/migration.c   | 31 ++
 26 files changed, 176 insertions(+), 80 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c07f492b871a..43a8fc476296 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -337,6 +337,9 @@ config ARCH_SUPPORTS_UPROBES
 config FIX_EARLYCON_MEM
def_bool y
 
+config DYNAMIC_PHYSICAL_MASK
+   bool
+
 config PGTABLE_LEVELS
int
default 5 if X86_5LEVEL
@@ -1508,6 +1511,7 @@ config ARCH_HAS_MEM_ENCRYPT
 config AMD_MEM_ENCRYPT
bool "AMD Secure Memory Encryption (SME) support"
depends on X86_64 && CPU_SUP_AMD
+   select DYNAMIC_PHYSICAL_MASK
---help---
  Say yes to enable support for the encryption of 

[GIT pull] x86 updates for 4.18

2018-06-10 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 pile of x86 updates and fixes:

 - Fix the (late) fallout from the vector management rework causing hlist
   corruption and irq descriptor reference leaks caused by a missing sanity
   check.

   The straight forward fix triggered another long standing issue to
   surface. The pre rework code hid the issue due to being way slower, but
   now the chance that user space sees an EBUSY error return when updating
   irq affinities is way higher, though quite a bunch of userspace tools do
   not handle it properly despite the fact that EBUSY could be returned for
   at least 10 years. It turned out that the EBUSY return can be avoided
   completely by utilizing the existing delayed affinity update mechanism
   for irq remapped scenarios as well. That's a bit more error handling in
   the kernel, but avoids fruitless fingerpointing discussions with tool
   developers.

 - Decouple PHYSICAL_MASK from AMD SME as its going to be required for the
   upcoming Intel memory encryption support as well.

 - Handle legacy device ACPI detection properly for newer platforms

 - Fix the wrong argument ordering in the vector allocation tracepoint

 - Simplify the IDT setup code for the APIC=n case

 - Use the proper string helpers in the MTRR code

 - Remove a stale unused VDSO source file

 - Convert the microcode update lock to a raw spinlock as its used in
   atomic context.

Thanks,

tglx

-->
Andy Shevchenko (2):
  x86/mtrr: Convert to use match_string() helper
  x86/mtrr: Convert to use strncpy_from_user() helper

Arnd Bergmann (1):
  x86: Mark native_set_p4d() as __always_inline

Dou Liyang (2):
  x86/idt: Simplify the idt_setup_apic_and_irq_gates()
  x86/vector: Fix the args of vector_alloc tracepoint

Jann Horn (1):
  x86/vdso: Remove unused file

Kirill A. Shutemov (1):
  x86/mm: Decouple dynamic __PHYSICAL_MASK from AMD SME

Rajneesh Bhardwaj (1):
  x86/i8237: Register device based on FADT legacy boot flag

Scott Wood (1):
  x86/microcode: Make the late update update_lock a raw lock for RT

Thomas Gleixner (9):
  x86/apic/vector: Prevent hlist corruption and leaks
  genirq/generic_pending: Do not lose pending affinity update
  genirq/migration: Avoid out of line call if pending is not set
  x86/apic: Provide apic_ack_irq()
  irq_remapping: Use apic_ack_irq()
  x86/ioapic: Use apic_ack_irq()
  x86/platform/uv: Use apic_ack_irq()
  genirq/affinity: Defer affinity setting if irq chip is busy
  x86/apic/vector: Print APIC control bits in debugfs

Tony Luck (1):
  x86/intel_rdt: Enable CMT and MBM on new Skylake stepping

Varsha Rao (1):
  x86/platform/uv: Remove extra parentheses


 arch/x86/Kconfig |  4 +++
 arch/x86/boot/compressed/kaslr_64.c  |  5 
 arch/x86/include/asm/apic.h  |  2 ++
 arch/x86/include/asm/page_types.h|  8 +-
 arch/x86/include/asm/pgtable_64.h|  4 +--
 arch/x86/include/asm/trace/irq_vectors.h |  2 +-
 arch/x86/include/asm/x86_init.h  |  1 +
 arch/x86/kernel/apic/io_apic.c   |  2 +-
 arch/x86/kernel/apic/vector.c| 45 +---
 arch/x86/kernel/cpu/intel_rdt.c  |  2 ++
 arch/x86/kernel/cpu/microcode/core.c |  6 ++---
 arch/x86/kernel/cpu/mtrr/if.c| 33 +--
 arch/x86/kernel/i8237.c  | 25 ++
 arch/x86/kernel/idt.c|  7 ++---
 arch/x86/kernel/platform-quirks.c|  7 -
 arch/x86/mm/mem_encrypt_identity.c   |  3 +++
 arch/x86/mm/pgtable.c|  5 
 arch/x86/platform/uv/tlb_uv.c|  2 +-
 arch/x86/platform/uv/uv_irq.c|  7 +
 drivers/iommu/amd_iommu.c|  2 +-
 drivers/iommu/intel_irq_remapping.c  |  2 +-
 drivers/iommu/irq_remapping.c|  5 
 drivers/iommu/irq_remapping.h|  2 --
 include/linux/irq.h  |  7 -
 kernel/irq/manage.c  | 37 --
 kernel/irq/migration.c   | 31 ++
 26 files changed, 176 insertions(+), 80 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c07f492b871a..43a8fc476296 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -337,6 +337,9 @@ config ARCH_SUPPORTS_UPROBES
 config FIX_EARLYCON_MEM
def_bool y
 
+config DYNAMIC_PHYSICAL_MASK
+   bool
+
 config PGTABLE_LEVELS
int
default 5 if X86_5LEVEL
@@ -1508,6 +1511,7 @@ config ARCH_HAS_MEM_ENCRYPT
 config AMD_MEM_ENCRYPT
bool "AMD Secure Memory Encryption (SME) support"
depends on X86_64 && CPU_SUP_AMD
+   select DYNAMIC_PHYSICAL_MASK
---help---
  Say yes to enable support for the encryption of 

[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

[GIT pull] x86 updates for 4.16

2018-02-18 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

Three patchlets to correct HIGHMEM64G and CMPXCHG64 dependencies in Kconfig
when CPU selections are explicitely set to M586 or M686.

Thanks,

tglx

-->
Matthew Whitehead (3):
  x86/Kconfig: Add missing i586-class CPUs to the X86_CMPXCHG64 Kconfig 
group
  x86/Kconfig: Exclude i586-class CPUs lacking PAE support from the 
HIGHMEM64G Kconfig group
  x86/Kconfig: Explicitly enumerate i686-class CPUs in Kconfig


 arch/x86/Kconfig | 2 +-
 arch/x86/Kconfig.cpu | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a528c14d45a5..c1236b187824 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1404,7 +1404,7 @@ config HIGHMEM4G
 
 config HIGHMEM64G
bool "64GB"
-   depends on !M486
+   depends on !M486 && !M586 && !M586TSC && !M586MMX && !MGEODE_LX && 
!MGEODEGX1 && !MCYRIXIII && !MELAN && !MWINCHIPC6 && !WINCHIP3D && !MK6
select X86_PAE
---help---
  Select this if you have a 32-bit processor and more than 4
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 65a9a4716e34..8b8d2297d486 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -374,7 +374,7 @@ config X86_TSC
 
 config X86_CMPXCHG64
def_bool y
-   depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || 
MPENTIUMIII || MPENTIUMII || M686 || MATOM
+   depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || 
MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX 
|| MGEODEGX1 || MK6 || MK7 || MK8
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
@@ -385,7 +385,7 @@ config X86_CMOV
 config X86_MINIMUM_CPU_FAMILY
int
default "64" if X86_64
-   default "6" if X86_32 && X86_P6_NOP
+   default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || 
MCORE2 || MK7 || MK8)
default "5" if X86_32 && X86_CMPXCHG64
default "4"
 


[GIT pull] x86 updates for 4.16

2018-02-18 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

Three patchlets to correct HIGHMEM64G and CMPXCHG64 dependencies in Kconfig
when CPU selections are explicitely set to M586 or M686.

Thanks,

tglx

-->
Matthew Whitehead (3):
  x86/Kconfig: Add missing i586-class CPUs to the X86_CMPXCHG64 Kconfig 
group
  x86/Kconfig: Exclude i586-class CPUs lacking PAE support from the 
HIGHMEM64G Kconfig group
  x86/Kconfig: Explicitly enumerate i686-class CPUs in Kconfig


 arch/x86/Kconfig | 2 +-
 arch/x86/Kconfig.cpu | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a528c14d45a5..c1236b187824 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1404,7 +1404,7 @@ config HIGHMEM4G
 
 config HIGHMEM64G
bool "64GB"
-   depends on !M486
+   depends on !M486 && !M586 && !M586TSC && !M586MMX && !MGEODE_LX && 
!MGEODEGX1 && !MCYRIXIII && !MELAN && !MWINCHIPC6 && !WINCHIP3D && !MK6
select X86_PAE
---help---
  Select this if you have a 32-bit processor and more than 4
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 65a9a4716e34..8b8d2297d486 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -374,7 +374,7 @@ config X86_TSC
 
 config X86_CMPXCHG64
def_bool y
-   depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || 
MPENTIUMIII || MPENTIUMII || M686 || MATOM
+   depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || 
MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX 
|| MGEODEGX1 || MK6 || MK7 || MK8
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
@@ -385,7 +385,7 @@ config X86_CMOV
 config X86_MINIMUM_CPU_FAMILY
int
default "64" if X86_64
-   default "6" if X86_32 && X86_P6_NOP
+   default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || 
MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || 
MCORE2 || MK7 || MK8)
default "5" if X86_32 && X86_CMPXCHG64
default "4"
 


[GIT pull] x86 updates for 4.16

2018-02-04 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 small set of changes:

  - A fixup for kexec related to 5-level paging mode. That covers most of
the cases except kexec from a 5-level kernel to a 4-level kernel. The
latter needs more work and is going to come in 4.17

  - Two trivial fixes for build warnings triggered by LTO and gcc-8.

Thanks,

tglx

-->
Arnd Bergmann (2):
  x86/dumpstack: Avoid uninitlized variable
  x86/power: Fix swsusp_arch_resume prototype

Kirill A. Shutemov (1):
  x86/kexec: Make kexec (mostly) work in 5-level paging mode


 arch/x86/kernel/dumpstack.c  | 2 +-
 arch/x86/kernel/relocate_kernel_64.S | 8 
 arch/x86/power/hibernate_32.c| 2 +-
 arch/x86/power/hibernate_64.c| 2 +-
 include/linux/suspend.h  | 2 ++
 kernel/power/power.h | 3 ---
 6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index afbecff161d1..a2d8a3908670 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -109,7 +109,7 @@ void show_trace_log_lvl(struct task_struct *task, struct 
pt_regs *regs,
struct stack_info stack_info = {0};
unsigned long visit_mask = 0;
int graph_idx = 0;
-   bool partial;
+   bool partial = false;
 
printk("%sCall Trace:\n", log_lvl);
 
diff --git a/arch/x86/kernel/relocate_kernel_64.S 
b/arch/x86/kernel/relocate_kernel_64.S
index 307d3bac5f04..11eda21eb697 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -68,6 +68,9 @@ relocate_kernel:
movq%cr4, %rax
movq%rax, CR4(%r11)
 
+   /* Save CR4. Required to enable the right paging mode later. */
+   movq%rax, %r13
+
/* zero out flags, and disable interrupts */
pushq $0
popfq
@@ -126,8 +129,13 @@ identity_mapped:
/*
 * Set cr4 to a known state:
 *  - physical address extension enabled
+*  - 5-level paging, if it was enabled before
 */
movl$X86_CR4_PAE, %eax
+   testq   $X86_CR4_LA57, %r13
+   jz  1f
+   orl $X86_CR4_LA57, %eax
+1:
movq%rax, %cr4
 
jmp 1f
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index c35fdb585c68..afc4ed7b1578 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t 
*pg_dir)
 #endif
 }
 
-int swsusp_arch_resume(void)
+asmlinkage int swsusp_arch_resume(void)
 {
int error;
 
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index f910c514438f..0ef5e5204968 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -174,7 +174,7 @@ static int relocate_restore_code(void)
return 0;
 }
 
-int swsusp_arch_resume(void)
+asmlinkage int swsusp_arch_resume(void)
 {
int error;
 
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cc22a24516d6..440b62f7502e 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
 extern void swsusp_set_page_free(struct page *);
 extern void swsusp_unset_page_free(struct page *);
 extern unsigned long get_safe_page(gfp_t gfp_mask);
+extern asmlinkage int swsusp_arch_suspend(void);
+extern asmlinkage int swsusp_arch_resume(void);
 
 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
 extern int hibernate(void);
diff --git a/kernel/power/power.h b/kernel/power/power.h
index f29cd178df90..9e58bdc8a562 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -104,9 +104,6 @@ extern int in_suspend;
 extern dev_t swsusp_resume_device;
 extern sector_t swsusp_resume_block;
 
-extern asmlinkage int swsusp_arch_suspend(void);
-extern asmlinkage int swsusp_arch_resume(void);
-
 extern int create_basic_memory_bitmaps(void);
 extern void free_basic_memory_bitmaps(void);
 extern int hibernate_preallocate_memory(void);


[GIT pull] x86 updates for 4.16

2018-02-04 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 small set of changes:

  - A fixup for kexec related to 5-level paging mode. That covers most of
the cases except kexec from a 5-level kernel to a 4-level kernel. The
latter needs more work and is going to come in 4.17

  - Two trivial fixes for build warnings triggered by LTO and gcc-8.

Thanks,

tglx

-->
Arnd Bergmann (2):
  x86/dumpstack: Avoid uninitlized variable
  x86/power: Fix swsusp_arch_resume prototype

Kirill A. Shutemov (1):
  x86/kexec: Make kexec (mostly) work in 5-level paging mode


 arch/x86/kernel/dumpstack.c  | 2 +-
 arch/x86/kernel/relocate_kernel_64.S | 8 
 arch/x86/power/hibernate_32.c| 2 +-
 arch/x86/power/hibernate_64.c| 2 +-
 include/linux/suspend.h  | 2 ++
 kernel/power/power.h | 3 ---
 6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index afbecff161d1..a2d8a3908670 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -109,7 +109,7 @@ void show_trace_log_lvl(struct task_struct *task, struct 
pt_regs *regs,
struct stack_info stack_info = {0};
unsigned long visit_mask = 0;
int graph_idx = 0;
-   bool partial;
+   bool partial = false;
 
printk("%sCall Trace:\n", log_lvl);
 
diff --git a/arch/x86/kernel/relocate_kernel_64.S 
b/arch/x86/kernel/relocate_kernel_64.S
index 307d3bac5f04..11eda21eb697 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -68,6 +68,9 @@ relocate_kernel:
movq%cr4, %rax
movq%rax, CR4(%r11)
 
+   /* Save CR4. Required to enable the right paging mode later. */
+   movq%rax, %r13
+
/* zero out flags, and disable interrupts */
pushq $0
popfq
@@ -126,8 +129,13 @@ identity_mapped:
/*
 * Set cr4 to a known state:
 *  - physical address extension enabled
+*  - 5-level paging, if it was enabled before
 */
movl$X86_CR4_PAE, %eax
+   testq   $X86_CR4_LA57, %r13
+   jz  1f
+   orl $X86_CR4_LA57, %eax
+1:
movq%rax, %cr4
 
jmp 1f
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index c35fdb585c68..afc4ed7b1578 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t 
*pg_dir)
 #endif
 }
 
-int swsusp_arch_resume(void)
+asmlinkage int swsusp_arch_resume(void)
 {
int error;
 
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index f910c514438f..0ef5e5204968 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -174,7 +174,7 @@ static int relocate_restore_code(void)
return 0;
 }
 
-int swsusp_arch_resume(void)
+asmlinkage int swsusp_arch_resume(void)
 {
int error;
 
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cc22a24516d6..440b62f7502e 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
 extern void swsusp_set_page_free(struct page *);
 extern void swsusp_unset_page_free(struct page *);
 extern unsigned long get_safe_page(gfp_t gfp_mask);
+extern asmlinkage int swsusp_arch_suspend(void);
+extern asmlinkage int swsusp_arch_resume(void);
 
 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
 extern int hibernate(void);
diff --git a/kernel/power/power.h b/kernel/power/power.h
index f29cd178df90..9e58bdc8a562 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -104,9 +104,6 @@ extern int in_suspend;
 extern dev_t swsusp_resume_device;
 extern sector_t swsusp_resume_block;
 
-extern asmlinkage int swsusp_arch_suspend(void);
-extern asmlinkage int swsusp_arch_resume(void);
-
 extern int create_basic_memory_bitmaps(void);
 extern void free_basic_memory_bitmaps(void);
 extern int hibernate_preallocate_memory(void);


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Ingo Molnar

* Linus Torvalds  wrote:

> On Tue, Nov 14, 2017 at 1:48 AM, Borislav Petkov  wrote:
> >
> > Just did 2 suspend cycles (once to RAM and once to disk) on my x230
> > with your tree from right now and it looks ok so far. So it could be
> > machine- and config-specific...
> 
> .. and it's not repeatable for me. I rebooted pretty quickly, and
> didn't gather a lot of information (well, 'dmesg' would SIBGUS, so..)
> and it hasn't happened again.
> 
> Will ignore until I have more information.

Haven't seen such behavior or got such reports - although admittedly laptop 
suspend/resume testing is done only sporadically, as it isn't easily automated.

As per the symptoms one thing that _could_ produce SIGSEGVs are the 
CONFIG_X86_INTEL_UMIP changes: the upcoming changes that make any UMIP action 
more 
verbose should make it more apparent if that's the case.

Plus, of course, anything entry code related. We did a few harmless 
(looking...) 
x86/mm changes as well, but none stands out at the moment.

Thanks,

Ingo


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Ingo Molnar

* Linus Torvalds  wrote:

> On Tue, Nov 14, 2017 at 1:48 AM, Borislav Petkov  wrote:
> >
> > Just did 2 suspend cycles (once to RAM and once to disk) on my x230
> > with your tree from right now and it looks ok so far. So it could be
> > machine- and config-specific...
> 
> .. and it's not repeatable for me. I rebooted pretty quickly, and
> didn't gather a lot of information (well, 'dmesg' would SIBGUS, so..)
> and it hasn't happened again.
> 
> Will ignore until I have more information.

Haven't seen such behavior or got such reports - although admittedly laptop 
suspend/resume testing is done only sporadically, as it isn't easily automated.

As per the symptoms one thing that _could_ produce SIGSEGVs are the 
CONFIG_X86_INTEL_UMIP changes: the upcoming changes that make any UMIP action 
more 
verbose should make it more apparent if that's the case.

Plus, of course, anything entry code related. We did a few harmless 
(looking...) 
x86/mm changes as well, but none stands out at the moment.

Thanks,

Ingo


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Linus Torvalds
On Tue, Nov 14, 2017 at 1:48 AM, Borislav Petkov  wrote:
>
> Just did 2 suspend cycles (once to RAM and once to disk) on my x230
> with your tree from right now and it looks ok so far. So it could be
> machine- and config-specific...

.. and it's not repeatable for me. I rebooted pretty quickly, and
didn't gather a lot of information (well, 'dmesg' would SIBGUS, so..)
and it hasn't happened again.

Will ignore until I have more information.

   Linus


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Linus Torvalds
On Tue, Nov 14, 2017 at 1:48 AM, Borislav Petkov  wrote:
>
> Just did 2 suspend cycles (once to RAM and once to disk) on my x230
> with your tree from right now and it looks ok so far. So it could be
> machine- and config-specific...

.. and it's not repeatable for me. I rebooted pretty quickly, and
didn't gather a lot of information (well, 'dmesg' would SIBGUS, so..)
and it hasn't happened again.

Will ignore until I have more information.

   Linus


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Borislav Petkov
On Mon, Nov 13, 2017 at 09:02:36PM -0800, Linus Torvalds wrote:
> On Mon, Nov 13, 2017 at 12:24 AM, Ingo Molnar  wrote:
> >
> >git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> > x86-asm-for-linus
> 
> Hmm #2.
> 
> My laptop had odd SIGBUS and IO errors after a suspend/resume cycle
> when running commit d6ec9d9a4def, which is after my merge of the x86
> core changes.

Just did 2 suspend cycles (once to RAM and once to disk) on my x230
with your tree from right now and it looks ok so far. So it could be
machine- and config-specific...

-- 
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.


Re: [GIT PULL] x86 updates for v4.15

2017-11-14 Thread Borislav Petkov
On Mon, Nov 13, 2017 at 09:02:36PM -0800, Linus Torvalds wrote:
> On Mon, Nov 13, 2017 at 12:24 AM, Ingo Molnar  wrote:
> >
> >git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> > x86-asm-for-linus
> 
> Hmm #2.
> 
> My laptop had odd SIGBUS and IO errors after a suspend/resume cycle
> when running commit d6ec9d9a4def, which is after my merge of the x86
> core changes.

Just did 2 suspend cycles (once to RAM and once to disk) on my x230
with your tree from right now and it looks ok so far. So it could be
machine- and config-specific...

-- 
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.


Re: [GIT PULL] x86 updates for v4.15

2017-11-13 Thread Linus Torvalds
On Mon, Nov 13, 2017 at 12:24 AM, Ingo Molnar  wrote:
>
>git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-asm-for-linus

Hmm #2.

My laptop had odd SIGBUS and IO errors after a suspend/resume cycle
when running commit d6ec9d9a4def, which is after my merge of the x86
core changes.

I'm probably not going to be able to bisect it - there's nothing in
the logs, probably because processes just died (and most likely the IO
errors were due to the disk having gone missing), but looking at the
merges I had done up until that point, all the suspect ones are from
you.

The x86 pull obviously being the most likely one, just based on
content, and based on that "after suspend/resume".

I'm wondering how much suspend/resume testing that entry code has
gotten. Last release it was the TLB ASID code that messed up on
suspend/resume, I suspect there is a decided lack of test coverage in
the otherwise good x86 farm..

I'll see if I can get anything interesting out of testing some more,
but I thought I'd give you guys a heads up.

Usually it's the networking tree and the PM tree that triggers issues
on my laptop, but neither of those had been merged at that point. But
there also really isn't anything else that looks odd in there.

 Linus


Re: [GIT PULL] x86 updates for v4.15

2017-11-13 Thread Linus Torvalds
On Mon, Nov 13, 2017 at 12:24 AM, Ingo Molnar  wrote:
>
>git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-asm-for-linus

Hmm #2.

My laptop had odd SIGBUS and IO errors after a suspend/resume cycle
when running commit d6ec9d9a4def, which is after my merge of the x86
core changes.

I'm probably not going to be able to bisect it - there's nothing in
the logs, probably because processes just died (and most likely the IO
errors were due to the disk having gone missing), but looking at the
merges I had done up until that point, all the suspect ones are from
you.

The x86 pull obviously being the most likely one, just based on
content, and based on that "after suspend/resume".

I'm wondering how much suspend/resume testing that entry code has
gotten. Last release it was the TLB ASID code that messed up on
suspend/resume, I suspect there is a decided lack of test coverage in
the otherwise good x86 farm..

I'll see if I can get anything interesting out of testing some more,
but I thought I'd give you guys a heads up.

Usually it's the networking tree and the PM tree that triggers issues
on my laptop, but neither of those had been merged at that point. But
there also really isn't anything else that looks odd in there.

 Linus


[GIT PULL] x86 updates for v4.15

2017-11-13 Thread Ingo Molnar
Linus,

Please pull the latest x86-asm-for-linus git tree from:

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

   # HEAD: 91a6a6cfee8ad34ea4cc10a54c0765edfe437cdb Merge branch 'linus' into 
x86/asm, to resolve conflict

Note that in this cycle most of the x86 topics interacted at a level that 
caused 
them to be merged into tip:x86/asm - but this should be a temporary phenomenon, 
hopefully we'll back to the usual patterns in the next merge window.

The main changes in this cycle were:

Hardware enablement:

 - Add support for the Intel UMIP (User Mode Instruction Prevention) CPU 
feature.
   This is a security feature that disables certain instructions such as SGDT, 
   SLDT, SIDT, SMSW and STR. [Note that this is disabled by default for now, 
there 
   are some smaller enhancements in the pipeline that I'll follow up with in 
the 
   next 1-2 days, which allows this to be enabled by default.] (Ricardo Neri)

 - Add support for the AMD SEV (Secure Encrypted Virtualization) CPU feature, 
on 
   top of SME (Secure Memory Encryption) support that was added in v4.14.  
   (Tom Lendacky, Brijesh Singh)

 - Enable new SSE/AVX/AVX512 CPU features: AVX512_VBMI2, GFNI, VAES, 
VPCLMULQDQ, 
   AVX512_VNNI, AVX512_BITALG. (Gayatri Kammela)

Other changes:

 - A big series of entry code simplifications and enhancements (Andy Lutomirski)

 - Make the ORC unwinder default on x86 and various objtool enhancements.
   (Josh Poimboeuf)

 - 5-level paging enhancements (Kirill A. Shutemov)

 - Micro-optimize the entry code a bit (Borislav Petkov)

 - Improve the handling of interdependent CPU features in the early FPU
   init code (Andi Kleen)

 - Build system enhancements (Changbin Du, Masahiro Yamada)

 - ... plus misc enhancements, fixes and cleanups.

  out-of-topic modifications in x86-asm-for-linus:
  --
  Makefile   # 11af847446ed: x86/unwind: Rename 
unwinder 
  arch/powerpc/kernel/machine_kexec_file_64.c# 1d2e733b13b4: resource: Provide 
resource s
  include/asm-generic/vmlinux.lds.h  # ac26963a1175: percpu: Introduce 
DEFINE_PER
   # 11af847446ed: x86/unwind: Rename unwinder 
  include/linux/ioport.h # 0e4c12b45aa8: x86/mm, resource: Use 
PAGE_K
   # 1d2e733b13b4: resource: Provide resource s
  include/linux/kexec.h  # 1d2e733b13b4: resource: Provide resource 
s
  include/linux/mem_encrypt.h# d8aa7eea78a1: x86/mm: Add Secure 
Encrypted
  include/linux/mm.h # 15670bfe1990: x86/mm/64: Rename the 
regist
  include/linux/mmzone.h # 83e3c48729d9: mm/sparsemem: Allocate 
mem_s
  include/linux/percpu-defs.h# ac26963a1175: percpu: Introduce 
DEFINE_PER
  kernel/extable.c   # e846d1395806: kprobes, x86/alternatives: 
U
  kernel/kexec_file.c# 1d2e733b13b4: resource: Provide resource 
s
  kernel/resource.c  # 0e4c12b45aa8: x86/mm, resource: Use 
PAGE_K
   # 1d2e733b13b4: resource: Provide resource s
   # 4ac2aed837cb: resource: Consolidate resour
  lib/swiotlb.c  # d7b417fa08d1: x86/mm: Add DMA support 
for 
  mm/gup.c   # 5b65c4677a57: mm, x86/mm: Fix 
performance 
  mm/sparse.c# 629a359bdb0e: mm/sparsemem: Fix ARM64 
boot
   # 83e3c48729d9: mm/sparsemem: Allocate mem_s
  scripts/Makefile.build # 11af847446ed: x86/unwind: Rename 
unwinder 
  tools/objtool/check.c  # 00d96180dc38: objtool: Don't report end 
of
  tools/objtool/objtool.c# 6a93bb7e4a7d: objtool: Print top level 
com
  tools/testing/selftests/x86/entry_from_vm86.c# a9e017d5619e: selftests/x86: 
Add tests for
   # 9390afebe1d3: selftests/x86: Add tests for
  tools/testing/selftests/x86/ldt_gdt.c# fec8f5ae1715: selftests/x86/ldt_get: 
Add a
   # adedf2893c19: selftests/x86/ldt_gdt: Run m
   # d744dcad3909: selftests/x86/ldt_gdt: Add i
   # d60ad744c974: selftests/x86/ldt_gdt: Robus
  tools/testing/selftests/x86/protection_keys.c# 693cb5580fdb: 
selftests/x86/protection_key

 Thanks,

Ingo

-->
Andi Kleen (5):
  bitops: Add clear/set_bit32() to linux/bitops.h
  x86/cpuid: Add generic table for CPUID dependencies
  x86/fpu: Parse clearcpuid= as early XSAVE argument
  x86/fpu: Make XSAVE check the base CPUID features before enabling
  x86/fpu: Remove the explicit clearing of XSAVE dependent features

Andrey Ryabinin (1):
  x86/kasan: Use the same shadow offset for 4- and 5-level paging

Andy Lutomirski (24):
  x86/entry/64: Remove the restore_c_regs_and_iret label
  x86/entry/64: Split the IRET-to-user and 

[GIT PULL] x86 updates for v4.15

2017-11-13 Thread Ingo Molnar
Linus,

Please pull the latest x86-asm-for-linus git tree from:

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

   # HEAD: 91a6a6cfee8ad34ea4cc10a54c0765edfe437cdb Merge branch 'linus' into 
x86/asm, to resolve conflict

Note that in this cycle most of the x86 topics interacted at a level that 
caused 
them to be merged into tip:x86/asm - but this should be a temporary phenomenon, 
hopefully we'll back to the usual patterns in the next merge window.

The main changes in this cycle were:

Hardware enablement:

 - Add support for the Intel UMIP (User Mode Instruction Prevention) CPU 
feature.
   This is a security feature that disables certain instructions such as SGDT, 
   SLDT, SIDT, SMSW and STR. [Note that this is disabled by default for now, 
there 
   are some smaller enhancements in the pipeline that I'll follow up with in 
the 
   next 1-2 days, which allows this to be enabled by default.] (Ricardo Neri)

 - Add support for the AMD SEV (Secure Encrypted Virtualization) CPU feature, 
on 
   top of SME (Secure Memory Encryption) support that was added in v4.14.  
   (Tom Lendacky, Brijesh Singh)

 - Enable new SSE/AVX/AVX512 CPU features: AVX512_VBMI2, GFNI, VAES, 
VPCLMULQDQ, 
   AVX512_VNNI, AVX512_BITALG. (Gayatri Kammela)

Other changes:

 - A big series of entry code simplifications and enhancements (Andy Lutomirski)

 - Make the ORC unwinder default on x86 and various objtool enhancements.
   (Josh Poimboeuf)

 - 5-level paging enhancements (Kirill A. Shutemov)

 - Micro-optimize the entry code a bit (Borislav Petkov)

 - Improve the handling of interdependent CPU features in the early FPU
   init code (Andi Kleen)

 - Build system enhancements (Changbin Du, Masahiro Yamada)

 - ... plus misc enhancements, fixes and cleanups.

  out-of-topic modifications in x86-asm-for-linus:
  --
  Makefile   # 11af847446ed: x86/unwind: Rename 
unwinder 
  arch/powerpc/kernel/machine_kexec_file_64.c# 1d2e733b13b4: resource: Provide 
resource s
  include/asm-generic/vmlinux.lds.h  # ac26963a1175: percpu: Introduce 
DEFINE_PER
   # 11af847446ed: x86/unwind: Rename unwinder 
  include/linux/ioport.h # 0e4c12b45aa8: x86/mm, resource: Use 
PAGE_K
   # 1d2e733b13b4: resource: Provide resource s
  include/linux/kexec.h  # 1d2e733b13b4: resource: Provide resource 
s
  include/linux/mem_encrypt.h# d8aa7eea78a1: x86/mm: Add Secure 
Encrypted
  include/linux/mm.h # 15670bfe1990: x86/mm/64: Rename the 
regist
  include/linux/mmzone.h # 83e3c48729d9: mm/sparsemem: Allocate 
mem_s
  include/linux/percpu-defs.h# ac26963a1175: percpu: Introduce 
DEFINE_PER
  kernel/extable.c   # e846d1395806: kprobes, x86/alternatives: 
U
  kernel/kexec_file.c# 1d2e733b13b4: resource: Provide resource 
s
  kernel/resource.c  # 0e4c12b45aa8: x86/mm, resource: Use 
PAGE_K
   # 1d2e733b13b4: resource: Provide resource s
   # 4ac2aed837cb: resource: Consolidate resour
  lib/swiotlb.c  # d7b417fa08d1: x86/mm: Add DMA support 
for 
  mm/gup.c   # 5b65c4677a57: mm, x86/mm: Fix 
performance 
  mm/sparse.c# 629a359bdb0e: mm/sparsemem: Fix ARM64 
boot
   # 83e3c48729d9: mm/sparsemem: Allocate mem_s
  scripts/Makefile.build # 11af847446ed: x86/unwind: Rename 
unwinder 
  tools/objtool/check.c  # 00d96180dc38: objtool: Don't report end 
of
  tools/objtool/objtool.c# 6a93bb7e4a7d: objtool: Print top level 
com
  tools/testing/selftests/x86/entry_from_vm86.c# a9e017d5619e: selftests/x86: 
Add tests for
   # 9390afebe1d3: selftests/x86: Add tests for
  tools/testing/selftests/x86/ldt_gdt.c# fec8f5ae1715: selftests/x86/ldt_get: 
Add a
   # adedf2893c19: selftests/x86/ldt_gdt: Run m
   # d744dcad3909: selftests/x86/ldt_gdt: Add i
   # d60ad744c974: selftests/x86/ldt_gdt: Robus
  tools/testing/selftests/x86/protection_keys.c# 693cb5580fdb: 
selftests/x86/protection_key

 Thanks,

Ingo

-->
Andi Kleen (5):
  bitops: Add clear/set_bit32() to linux/bitops.h
  x86/cpuid: Add generic table for CPUID dependencies
  x86/fpu: Parse clearcpuid= as early XSAVE argument
  x86/fpu: Make XSAVE check the base CPUID features before enabling
  x86/fpu: Remove the explicit clearing of XSAVE dependent features

Andrey Ryabinin (1):
  x86/kasan: Use the same shadow offset for 4- and 5-level paging

Andy Lutomirski (24):
  x86/entry/64: Remove the restore_c_regs_and_iret label
  x86/entry/64: Split the IRET-to-user and 

[GIT pull] x86 updates for 4.13

2017-07-09 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

The x86 updates contain:

- A fix for a longstanding PAT bug, where PAT was reported on CPUs that
  do not support it, which leads to wrong caching attributes and
  missing MTRR updates

- Prevent overwriting of the e820 firmware table, which causes kexec
  kernels to lose the fake mptable which is stored there.

- Cleanup of the UV/BAU code, removing unused code and making
  local functions static.

Thanks,

tglx

-->
Chen Yu (3):
  x86/boot/e820: Avoid overwriting e820_table_firmware
  x86/boot/e820: Rename the e820_table_firmware to e820_table_kexec
  x86/boot/e820: Introduce the bootloader provided e820_table_firmware[] 
table

Colin Ian King (1):
  x86/platform/uv/BAU: Minor cleanup, make some local functions static

Mikulas Patocka (1):
  x86/mm/pat: Don't report PAT on CPUs that don't support it


 arch/x86/include/asm/e820/api.h   |  1 +
 arch/x86/include/asm/pat.h|  1 +
 arch/x86/kernel/e820.c| 49 ---
 arch/x86/kernel/kexec-bzimage64.c |  4 ++--
 arch/x86/kernel/setup.c   |  7 ++
 arch/x86/mm/pat.c | 28 ++
 arch/x86/platform/uv/tlb_uv.c | 31 +
 7 files changed, 65 insertions(+), 56 deletions(-)

diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h
index 8e0f8b85b209..a504adc661a4 100644
--- a/arch/x86/include/asm/e820/api.h
+++ b/arch/x86/include/asm/e820/api.h
@@ -4,6 +4,7 @@
 #include 
 
 extern struct e820_table *e820_table;
+extern struct e820_table *e820_table_kexec;
 extern struct e820_table *e820_table_firmware;
 
 extern unsigned long pci_mem_start;
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h
index 0b1ff4c1c14e..fffb2794dd89 100644
--- a/arch/x86/include/asm/pat.h
+++ b/arch/x86/include/asm/pat.h
@@ -7,6 +7,7 @@
 bool pat_enabled(void);
 void pat_disable(const char *reason);
 extern void pat_init(void);
+extern void init_cache_modes(void);
 
 extern int reserve_memtype(u64 start, u64 end,
enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm);
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d78a586ba8dc..532da61d605c 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -20,10 +20,12 @@
 #include 
 
 /*
- * We organize the E820 table into two main data structures:
+ * We organize the E820 table into three main data structures:
  *
  * - 'e820_table_firmware': the original firmware version passed to us by the
- *   bootloader - not modified by the kernel. We use this to:
+ *   bootloader - not modified by the kernel. It is composed of two parts:
+ *   the first 128 E820 memory entries in boot_params.e820_table and the 
remaining
+ *   (if any) entries of the SETUP_E820_EXT nodes. We use this to:
  *
  *   - inform the user about the firmware's notion of memory layout
  * via /sys/firmware/memmap
@@ -31,6 +33,14 @@
  *   - the hibernation code uses it to generate a kernel-independent MD5
  * fingerprint of the physical memory layout of a system.
  *
+ * - 'e820_table_kexec': a slightly modified (by the kernel) firmware version
+ *   passed to us by the bootloader - the major difference between
+ *   e820_table_firmware[] and this one is that, the latter marks the 
setup_data
+ *   list created by the EFI boot stub as reserved, so that kexec can reuse the
+ *   setup_data information in the second kernel. Besides, e820_table_kexec[]
+ *   might also be modified by the kexec itself to fake a mptable.
+ *   We use this to:
+ *
  *   - kexec, which is a bootloader in disguise, uses the original E820
  * layout to pass to the kexec-ed kernel. This way the original kernel
  * can have a restricted E820 map while the kexec()-ed kexec-kernel
@@ -46,9 +56,11 @@
  * specific memory layout data during early bootup.
  */
 static struct e820_table e820_table_init   __initdata;
+static struct e820_table e820_table_kexec_init __initdata;
 static struct e820_table e820_table_firmware_init  __initdata;
 
 struct e820_table *e820_table __refdata= 
_table_init;
+struct e820_table *e820_table_kexec __refdata  = 
_table_kexec_init;
 struct e820_table *e820_table_firmware __refdata   = 
_table_firmware_init;
 
 /* For PCI or other memory-mapped resources */
@@ -470,9 +482,9 @@ u64 __init e820__range_update(u64 start, u64 size, enum 
e820_type old_type, enum
return __e820__range_update(e820_table, start, size, old_type, 
new_type);
 }
 
-static u64 __init e820__range_update_firmware(u64 start, u64 size, enum 
e820_type old_type, enum e820_type  new_type)
+static u64 __init e820__range_update_kexec(u64 start, u64 size, enum e820_type 
old_type, enum 

[GIT pull] x86 updates for 4.13

2017-07-09 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

The x86 updates contain:

- A fix for a longstanding PAT bug, where PAT was reported on CPUs that
  do not support it, which leads to wrong caching attributes and
  missing MTRR updates

- Prevent overwriting of the e820 firmware table, which causes kexec
  kernels to lose the fake mptable which is stored there.

- Cleanup of the UV/BAU code, removing unused code and making
  local functions static.

Thanks,

tglx

-->
Chen Yu (3):
  x86/boot/e820: Avoid overwriting e820_table_firmware
  x86/boot/e820: Rename the e820_table_firmware to e820_table_kexec
  x86/boot/e820: Introduce the bootloader provided e820_table_firmware[] 
table

Colin Ian King (1):
  x86/platform/uv/BAU: Minor cleanup, make some local functions static

Mikulas Patocka (1):
  x86/mm/pat: Don't report PAT on CPUs that don't support it


 arch/x86/include/asm/e820/api.h   |  1 +
 arch/x86/include/asm/pat.h|  1 +
 arch/x86/kernel/e820.c| 49 ---
 arch/x86/kernel/kexec-bzimage64.c |  4 ++--
 arch/x86/kernel/setup.c   |  7 ++
 arch/x86/mm/pat.c | 28 ++
 arch/x86/platform/uv/tlb_uv.c | 31 +
 7 files changed, 65 insertions(+), 56 deletions(-)

diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h
index 8e0f8b85b209..a504adc661a4 100644
--- a/arch/x86/include/asm/e820/api.h
+++ b/arch/x86/include/asm/e820/api.h
@@ -4,6 +4,7 @@
 #include 
 
 extern struct e820_table *e820_table;
+extern struct e820_table *e820_table_kexec;
 extern struct e820_table *e820_table_firmware;
 
 extern unsigned long pci_mem_start;
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h
index 0b1ff4c1c14e..fffb2794dd89 100644
--- a/arch/x86/include/asm/pat.h
+++ b/arch/x86/include/asm/pat.h
@@ -7,6 +7,7 @@
 bool pat_enabled(void);
 void pat_disable(const char *reason);
 extern void pat_init(void);
+extern void init_cache_modes(void);
 
 extern int reserve_memtype(u64 start, u64 end,
enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm);
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d78a586ba8dc..532da61d605c 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -20,10 +20,12 @@
 #include 
 
 /*
- * We organize the E820 table into two main data structures:
+ * We organize the E820 table into three main data structures:
  *
  * - 'e820_table_firmware': the original firmware version passed to us by the
- *   bootloader - not modified by the kernel. We use this to:
+ *   bootloader - not modified by the kernel. It is composed of two parts:
+ *   the first 128 E820 memory entries in boot_params.e820_table and the 
remaining
+ *   (if any) entries of the SETUP_E820_EXT nodes. We use this to:
  *
  *   - inform the user about the firmware's notion of memory layout
  * via /sys/firmware/memmap
@@ -31,6 +33,14 @@
  *   - the hibernation code uses it to generate a kernel-independent MD5
  * fingerprint of the physical memory layout of a system.
  *
+ * - 'e820_table_kexec': a slightly modified (by the kernel) firmware version
+ *   passed to us by the bootloader - the major difference between
+ *   e820_table_firmware[] and this one is that, the latter marks the 
setup_data
+ *   list created by the EFI boot stub as reserved, so that kexec can reuse the
+ *   setup_data information in the second kernel. Besides, e820_table_kexec[]
+ *   might also be modified by the kexec itself to fake a mptable.
+ *   We use this to:
+ *
  *   - kexec, which is a bootloader in disguise, uses the original E820
  * layout to pass to the kexec-ed kernel. This way the original kernel
  * can have a restricted E820 map while the kexec()-ed kexec-kernel
@@ -46,9 +56,11 @@
  * specific memory layout data during early bootup.
  */
 static struct e820_table e820_table_init   __initdata;
+static struct e820_table e820_table_kexec_init __initdata;
 static struct e820_table e820_table_firmware_init  __initdata;
 
 struct e820_table *e820_table __refdata= 
_table_init;
+struct e820_table *e820_table_kexec __refdata  = 
_table_kexec_init;
 struct e820_table *e820_table_firmware __refdata   = 
_table_firmware_init;
 
 /* For PCI or other memory-mapped resources */
@@ -470,9 +482,9 @@ u64 __init e820__range_update(u64 start, u64 size, enum 
e820_type old_type, enum
return __e820__range_update(e820_table, start, size, old_type, 
new_type);
 }
 
-static u64 __init e820__range_update_firmware(u64 start, u64 size, enum 
e820_type old_type, enum e820_type  new_type)
+static u64 __init e820__range_update_kexec(u64 start, u64 size, enum e820_type 
old_type, enum 

[GIT pull] x86 updates for 4.9

2016-10-08 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 pile of regression fixes and updates:

  - Address the fallout of the patches which made the cpuid - nodeid
relation permanent: Handling of invalid APIC ids and preventing
pointless warning messages.

  - Force eager FPU when protection keys are enabled. Protection keys are
not generating FPU exceptions so they cannot work with the lazy FPU
mechanism.

  - Prevent force migration of interrupts which are not part of the CPU
vector domain.

  - Handle the fact that APIC ids are not updated in the ACPI/MADT tables
on physical CPU hotplug

  - Remove bash-isms from syscall table generator script

  - Use the hypervisor supplied APIC frequency when running on VMware


Thanks,

tglx

-->
Dave Hansen (1):
  x86/pkeys: Make protection keys an "eager" feature

Josh Poimboeuf (1):
  x86/unwind: Fix oprofile module link error

Mika Westerberg (1):
  x86/irq: Prevent force migration of irqs which are not in the vector 
domain

Prarit Bhargava (1):
  arch/x86: Handle non enumerated CPU after physical hotplug

Renat Valiullin (1):
  x86/vmware: Skip lapic calibration on VMware

Thomas Gleixner (2):
  x86/acpi: Prevent LAPIC id 0xff from being accounted
  x86/apic: Prevent pointless warning messages

sylvain.bertr...@gmail.com (1):
  x86/syscalls: Remove bash-isms in syscall table generator


 arch/x86/entry/syscalls/syscalltbl.sh | 15 +--
 arch/x86/include/asm/fpu/xstate.h |  7 ---
 arch/x86/include/asm/unwind.h | 14 ++
 arch/x86/kernel/acpi/boot.c   |  4 
 arch/x86/kernel/apic/apic.c   |  8 +---
 arch/x86/kernel/apic/vector.c | 23 ---
 arch/x86/kernel/cpu/vmware.c  | 12 ++--
 arch/x86/kernel/smpboot.c | 18 +++---
 arch/x86/kernel/unwind_guess.c| 10 ++
 9 files changed, 79 insertions(+), 32 deletions(-)

diff --git a/arch/x86/entry/syscalls/syscalltbl.sh 
b/arch/x86/entry/syscalls/syscalltbl.sh
index cd3d3015d7df..751d1f992630 100644
--- a/arch/x86/entry/syscalls/syscalltbl.sh
+++ b/arch/x86/entry/syscalls/syscalltbl.sh
@@ -10,8 +10,11 @@ syscall_macro() {
 
 # Entry can be either just a function name or "function/qualifier"
 real_entry="${entry%%/*}"
-qualifier="${entry:${#real_entry}}"# Strip the function 
name
-qualifier="${qualifier:1}" # Strip the slash, if any
+if [ "$entry" = "$real_entry" ]; then
+qualifier=
+else
+qualifier=${entry#*/}
+fi
 
 echo "__SYSCALL_${abi}($nr, $real_entry, $qualifier)"
 }
@@ -22,7 +25,7 @@ emit() {
 entry="$3"
 compat="$4"
 
-if [ "$abi" == "64" -a -n "$compat" ]; then
+if [ "$abi" = "64" -a -n "$compat" ]; then
echo "a compat entry for a 64-bit syscall makes no sense" >&2
exit 1
 fi
@@ -45,17 +48,17 @@ emit() {
 grep '^[0-9]' "$in" | sort -n | (
 while read nr abi name entry compat; do
abi=`echo "$abi" | tr '[a-z]' '[A-Z]'`
-   if [ "$abi" == "COMMON" -o "$abi" == "64" ]; then
+   if [ "$abi" = "COMMON" -o "$abi" = "64" ]; then
# COMMON is the same as 64, except that we don't expect X32
# programs to use it.  Our expectation has nothing to do with
# any generated code, so treat them the same.
emit 64 "$nr" "$entry" "$compat"
-   elif [ "$abi" == "X32" ]; then
+   elif [ "$abi" = "X32" ]; then
# X32 is equivalent to 64 on an X32-compatible kernel.
echo "#ifdef CONFIG_X86_X32_ABI"
emit 64 "$nr" "$entry" "$compat"
echo "#endif"
-   elif [ "$abi" == "I386" ]; then
+   elif [ "$abi" = "I386" ]; then
emit "$abi" "$nr" "$entry" "$compat"
else
echo "Unknown abi $abi" >&2
diff --git a/arch/x86/include/asm/fpu/xstate.h 
b/arch/x86/include/asm/fpu/xstate.h
index d4957ac72b48..430bacf73074 100644
--- a/arch/x86/include/asm/fpu/xstate.h
+++ b/arch/x86/include/asm/fpu/xstate.h
@@ -27,11 +27,12 @@
 XFEATURE_MASK_YMM | \
 XFEATURE_MASK_OPMASK | \
 XFEATURE_MASK_ZMM_Hi256 | \
-XFEATURE_MASK_Hi16_ZMM  | \
-XFEATURE_MASK_PKRU)
+XFEATURE_MASK_Hi16_ZMM)
 
 /* Supported features which require eager state saving */
-#define XFEATURE_MASK_EAGER(XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR)
+#define XFEATURE_MASK_EAGER(XFEATURE_MASK_BNDREGS | \
+XFEATURE_MASK_BNDCSR | \
+XFEATURE_MASK_PKRU)
 
 /* All currently supported features */
 #define XCNTXT_MASK(XFEATURE_MASK_LAZY | XFEATURE_MASK_EAGER)

[GIT pull] x86 updates for 4.9

2016-10-08 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 pile of regression fixes and updates:

  - Address the fallout of the patches which made the cpuid - nodeid
relation permanent: Handling of invalid APIC ids and preventing
pointless warning messages.

  - Force eager FPU when protection keys are enabled. Protection keys are
not generating FPU exceptions so they cannot work with the lazy FPU
mechanism.

  - Prevent force migration of interrupts which are not part of the CPU
vector domain.

  - Handle the fact that APIC ids are not updated in the ACPI/MADT tables
on physical CPU hotplug

  - Remove bash-isms from syscall table generator script

  - Use the hypervisor supplied APIC frequency when running on VMware


Thanks,

tglx

-->
Dave Hansen (1):
  x86/pkeys: Make protection keys an "eager" feature

Josh Poimboeuf (1):
  x86/unwind: Fix oprofile module link error

Mika Westerberg (1):
  x86/irq: Prevent force migration of irqs which are not in the vector 
domain

Prarit Bhargava (1):
  arch/x86: Handle non enumerated CPU after physical hotplug

Renat Valiullin (1):
  x86/vmware: Skip lapic calibration on VMware

Thomas Gleixner (2):
  x86/acpi: Prevent LAPIC id 0xff from being accounted
  x86/apic: Prevent pointless warning messages

sylvain.bertr...@gmail.com (1):
  x86/syscalls: Remove bash-isms in syscall table generator


 arch/x86/entry/syscalls/syscalltbl.sh | 15 +--
 arch/x86/include/asm/fpu/xstate.h |  7 ---
 arch/x86/include/asm/unwind.h | 14 ++
 arch/x86/kernel/acpi/boot.c   |  4 
 arch/x86/kernel/apic/apic.c   |  8 +---
 arch/x86/kernel/apic/vector.c | 23 ---
 arch/x86/kernel/cpu/vmware.c  | 12 ++--
 arch/x86/kernel/smpboot.c | 18 +++---
 arch/x86/kernel/unwind_guess.c| 10 ++
 9 files changed, 79 insertions(+), 32 deletions(-)

diff --git a/arch/x86/entry/syscalls/syscalltbl.sh 
b/arch/x86/entry/syscalls/syscalltbl.sh
index cd3d3015d7df..751d1f992630 100644
--- a/arch/x86/entry/syscalls/syscalltbl.sh
+++ b/arch/x86/entry/syscalls/syscalltbl.sh
@@ -10,8 +10,11 @@ syscall_macro() {
 
 # Entry can be either just a function name or "function/qualifier"
 real_entry="${entry%%/*}"
-qualifier="${entry:${#real_entry}}"# Strip the function 
name
-qualifier="${qualifier:1}" # Strip the slash, if any
+if [ "$entry" = "$real_entry" ]; then
+qualifier=
+else
+qualifier=${entry#*/}
+fi
 
 echo "__SYSCALL_${abi}($nr, $real_entry, $qualifier)"
 }
@@ -22,7 +25,7 @@ emit() {
 entry="$3"
 compat="$4"
 
-if [ "$abi" == "64" -a -n "$compat" ]; then
+if [ "$abi" = "64" -a -n "$compat" ]; then
echo "a compat entry for a 64-bit syscall makes no sense" >&2
exit 1
 fi
@@ -45,17 +48,17 @@ emit() {
 grep '^[0-9]' "$in" | sort -n | (
 while read nr abi name entry compat; do
abi=`echo "$abi" | tr '[a-z]' '[A-Z]'`
-   if [ "$abi" == "COMMON" -o "$abi" == "64" ]; then
+   if [ "$abi" = "COMMON" -o "$abi" = "64" ]; then
# COMMON is the same as 64, except that we don't expect X32
# programs to use it.  Our expectation has nothing to do with
# any generated code, so treat them the same.
emit 64 "$nr" "$entry" "$compat"
-   elif [ "$abi" == "X32" ]; then
+   elif [ "$abi" = "X32" ]; then
# X32 is equivalent to 64 on an X32-compatible kernel.
echo "#ifdef CONFIG_X86_X32_ABI"
emit 64 "$nr" "$entry" "$compat"
echo "#endif"
-   elif [ "$abi" == "I386" ]; then
+   elif [ "$abi" = "I386" ]; then
emit "$abi" "$nr" "$entry" "$compat"
else
echo "Unknown abi $abi" >&2
diff --git a/arch/x86/include/asm/fpu/xstate.h 
b/arch/x86/include/asm/fpu/xstate.h
index d4957ac72b48..430bacf73074 100644
--- a/arch/x86/include/asm/fpu/xstate.h
+++ b/arch/x86/include/asm/fpu/xstate.h
@@ -27,11 +27,12 @@
 XFEATURE_MASK_YMM | \
 XFEATURE_MASK_OPMASK | \
 XFEATURE_MASK_ZMM_Hi256 | \
-XFEATURE_MASK_Hi16_ZMM  | \
-XFEATURE_MASK_PKRU)
+XFEATURE_MASK_Hi16_ZMM)
 
 /* Supported features which require eager state saving */
-#define XFEATURE_MASK_EAGER(XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR)
+#define XFEATURE_MASK_EAGER(XFEATURE_MASK_BNDREGS | \
+XFEATURE_MASK_BNDCSR | \
+XFEATURE_MASK_PKRU)
 
 /* All currently supported features */
 #define XCNTXT_MASK(XFEATURE_MASK_LAZY | XFEATURE_MASK_EAGER)

[git pull] x86 updates for 4.6

2016-04-03 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

this lot contains:

 - Some fixups for the fallout of the topology consolidation which
   unearthed AMD/Intel inconsistencies
 - Documentation for the x86 topology management
 - Support for AMD advanced power management bits
 - Two simple cleanups removing duplicated code

Thanks,

tglx

-->
Borislav Petkov (3):
  x86/cpu: Get rid of compute_unit_id
  x86/Documentation: Start documenting x86 topology
  x86/thread_info: Merge two !__ASSEMBLY__ sections

Huang Rui (1):
  x86/cpu: Add advanced power management bits

Peter Zijlstra (2):
  x86/topology: Fix AMD core count
  perf/x86/amd: Cleanup Fam10h NB event constraints

Vladimir Zapolskiy (1):
  x86/cpufreq: Remove duplicated TDP MSR macro definitions


 Documentation/x86/topology.txt | 208 +
 arch/x86/events/amd/core.c |  21 +++-
 arch/x86/events/perf_event.h   |   5 +
 arch/x86/include/asm/msr-index.h   |   8 +-
 arch/x86/include/asm/processor.h   |   2 -
 arch/x86/include/asm/smp.h |   1 +
 arch/x86/include/asm/thread_info.h |   6 +-
 arch/x86/kernel/amd_nb.c   |   6 +-
 arch/x86/kernel/cpu/amd.c  |  12 +--
 arch/x86/kernel/cpu/powerflags.c   |   2 +
 arch/x86/kernel/smpboot.c  |   2 +-
 arch/x86/ras/mce_amd_inj.c |   3 +-
 12 files changed, 246 insertions(+), 30 deletions(-)
 create mode 100644 Documentation/x86/topology.txt

diff --git a/Documentation/x86/topology.txt b/Documentation/x86/topology.txt
new file mode 100644
index ..06afac252f5b
--- /dev/null
+++ b/Documentation/x86/topology.txt
@@ -0,0 +1,208 @@
+x86 Topology
+
+
+This documents and clarifies the main aspects of x86 topology modelling and
+representation in the kernel. Update/change when doing changes to the
+respective code.
+
+The architecture-agnostic topology definitions are in
+Documentation/cputopology.txt. This file holds x86-specific
+differences/specialities which must not necessarily apply to the generic
+definitions. Thus, the way to read up on Linux topology on x86 is to start
+with the generic one and look at this one in parallel for the x86 specifics.
+
+Needless to say, code should use the generic functions - this file is *only*
+here to *document* the inner workings of x86 topology.
+
+Started by Thomas Gleixner  and Borislav Petkov 
.
+
+The main aim of the topology facilities is to present adequate interfaces to
+code which needs to know/query/use the structure of the running system wrt
+threads, cores, packages, etc.
+
+The kernel does not care about the concept of physical sockets because a
+socket has no relevance to software. It's an electromechanical component. In
+the past a socket always contained a single package (see below), but with the
+advent of Multi Chip Modules (MCM) a socket can hold more than one package. So
+there might be still references to sockets in the code, but they are of
+historical nature and should be cleaned up.
+
+The topology of a system is described in the units of:
+
+- packages
+- cores
+- threads
+
+* Package:
+
+  Packages contain a number of cores plus shared resources, e.g. DRAM
+  controller, shared caches etc.
+
+  AMD nomenclature for package is 'Node'.
+
+  Package-related topology information in the kernel:
+
+  - cpuinfo_x86.x86_max_cores:
+
+The number of cores in a package. This information is retrieved via CPUID.
+
+  - cpuinfo_x86.phys_proc_id:
+
+The physical ID of the package. This information is retrieved via CPUID
+and deduced from the APIC IDs of the cores in the package.
+
+  - cpuinfo_x86.logical_id:
+
+The logical ID of the package. As we do not trust BIOSes to enumerate the
+packages in a consistent way, we introduced the concept of logical package
+ID so we can sanely calculate the number of maximum possible packages in
+the system and have the packages enumerated linearly.
+
+  - topology_max_packages():
+
+The maximum possible number of packages in the system. Helpful for per
+package facilities to preallocate per package information.
+
+
+* Cores:
+
+  A core consists of 1 or more threads. It does not matter whether the threads
+  are SMT- or CMT-type threads.
+
+  AMDs nomenclature for a CMT core is "Compute Unit". The kernel always uses
+  "core".
+
+  Core-related topology information in the kernel:
+
+  - smp_num_siblings:
+
+The number of threads in a core. The number of threads in a package can be
+calculated by:
+
+   threads_per_package = cpuinfo_x86.x86_max_cores * smp_num_siblings
+
+
+* Threads:
+
+  A thread is a single scheduling unit. It's the equivalent to a logical Linux
+  CPU.
+
+  AMDs nomenclature for CMT threads is "Compute Unit Core". The kernel always
+  uses 

[git pull] x86 updates for 4.6

2016-04-03 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

this lot contains:

 - Some fixups for the fallout of the topology consolidation which
   unearthed AMD/Intel inconsistencies
 - Documentation for the x86 topology management
 - Support for AMD advanced power management bits
 - Two simple cleanups removing duplicated code

Thanks,

tglx

-->
Borislav Petkov (3):
  x86/cpu: Get rid of compute_unit_id
  x86/Documentation: Start documenting x86 topology
  x86/thread_info: Merge two !__ASSEMBLY__ sections

Huang Rui (1):
  x86/cpu: Add advanced power management bits

Peter Zijlstra (2):
  x86/topology: Fix AMD core count
  perf/x86/amd: Cleanup Fam10h NB event constraints

Vladimir Zapolskiy (1):
  x86/cpufreq: Remove duplicated TDP MSR macro definitions


 Documentation/x86/topology.txt | 208 +
 arch/x86/events/amd/core.c |  21 +++-
 arch/x86/events/perf_event.h   |   5 +
 arch/x86/include/asm/msr-index.h   |   8 +-
 arch/x86/include/asm/processor.h   |   2 -
 arch/x86/include/asm/smp.h |   1 +
 arch/x86/include/asm/thread_info.h |   6 +-
 arch/x86/kernel/amd_nb.c   |   6 +-
 arch/x86/kernel/cpu/amd.c  |  12 +--
 arch/x86/kernel/cpu/powerflags.c   |   2 +
 arch/x86/kernel/smpboot.c  |   2 +-
 arch/x86/ras/mce_amd_inj.c |   3 +-
 12 files changed, 246 insertions(+), 30 deletions(-)
 create mode 100644 Documentation/x86/topology.txt

diff --git a/Documentation/x86/topology.txt b/Documentation/x86/topology.txt
new file mode 100644
index ..06afac252f5b
--- /dev/null
+++ b/Documentation/x86/topology.txt
@@ -0,0 +1,208 @@
+x86 Topology
+
+
+This documents and clarifies the main aspects of x86 topology modelling and
+representation in the kernel. Update/change when doing changes to the
+respective code.
+
+The architecture-agnostic topology definitions are in
+Documentation/cputopology.txt. This file holds x86-specific
+differences/specialities which must not necessarily apply to the generic
+definitions. Thus, the way to read up on Linux topology on x86 is to start
+with the generic one and look at this one in parallel for the x86 specifics.
+
+Needless to say, code should use the generic functions - this file is *only*
+here to *document* the inner workings of x86 topology.
+
+Started by Thomas Gleixner  and Borislav Petkov 
.
+
+The main aim of the topology facilities is to present adequate interfaces to
+code which needs to know/query/use the structure of the running system wrt
+threads, cores, packages, etc.
+
+The kernel does not care about the concept of physical sockets because a
+socket has no relevance to software. It's an electromechanical component. In
+the past a socket always contained a single package (see below), but with the
+advent of Multi Chip Modules (MCM) a socket can hold more than one package. So
+there might be still references to sockets in the code, but they are of
+historical nature and should be cleaned up.
+
+The topology of a system is described in the units of:
+
+- packages
+- cores
+- threads
+
+* Package:
+
+  Packages contain a number of cores plus shared resources, e.g. DRAM
+  controller, shared caches etc.
+
+  AMD nomenclature for package is 'Node'.
+
+  Package-related topology information in the kernel:
+
+  - cpuinfo_x86.x86_max_cores:
+
+The number of cores in a package. This information is retrieved via CPUID.
+
+  - cpuinfo_x86.phys_proc_id:
+
+The physical ID of the package. This information is retrieved via CPUID
+and deduced from the APIC IDs of the cores in the package.
+
+  - cpuinfo_x86.logical_id:
+
+The logical ID of the package. As we do not trust BIOSes to enumerate the
+packages in a consistent way, we introduced the concept of logical package
+ID so we can sanely calculate the number of maximum possible packages in
+the system and have the packages enumerated linearly.
+
+  - topology_max_packages():
+
+The maximum possible number of packages in the system. Helpful for per
+package facilities to preallocate per package information.
+
+
+* Cores:
+
+  A core consists of 1 or more threads. It does not matter whether the threads
+  are SMT- or CMT-type threads.
+
+  AMDs nomenclature for a CMT core is "Compute Unit". The kernel always uses
+  "core".
+
+  Core-related topology information in the kernel:
+
+  - smp_num_siblings:
+
+The number of threads in a core. The number of threads in a package can be
+calculated by:
+
+   threads_per_package = cpuinfo_x86.x86_max_cores * smp_num_siblings
+
+
+* Threads:
+
+  A thread is a single scheduling unit. It's the equivalent to a logical Linux
+  CPU.
+
+  AMDs nomenclature for CMT threads is "Compute Unit Core". The kernel always
+  uses "thread".
+
+  Thread-related 

[GIT pull] x86 updates for 4.5

2016-02-28 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

This update contains:

  - Hopefully the last ASM CLAC fixups
  
  - A fix for the Quark family related to the IMR lock which makes kexec work
again

  - A off-by-one fix in the MPX code. Ironic, isn't it?

  - A fix for X86_PAE which addresses once more an unsigned long
vs. phys_addr_t hickup.

Thanks,

tglx

-->
Andy Lutomirski (2):
  x86/entry/32: Add an ASM_CLAC to entry_SYSENTER_32
  x86/entry/compat: Add missing CLAC to entry_INT80_32

Bryan O'Donoghue (1):
  x86/platform/intel/quark: Change the kernel's IMR lock bit to false

Colin Ian King (1):
  x86/mpx: Fix off-by-one comparison with nr_registers

Dexuan Cui (1):
  x86/mm: Fix slow_virt_to_phys() for X86_PAE again


 arch/x86/entry/entry_32.S   |  1 +
 arch/x86/entry/entry_64_compat.S|  1 +
 arch/x86/mm/mpx.c   |  2 +-
 arch/x86/mm/pageattr.c  | 14 ++
 arch/x86/platform/intel-quark/imr.c |  4 ++--
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 77d8c5112900..bb3e376d0f33 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -294,6 +294,7 @@ sysenter_past_esp:
pushl   $__USER_DS  /* pt_regs->ss */
pushl   %ebp/* pt_regs->sp (stashed in bp) */
pushfl  /* pt_regs->flags (except IF = 0) */
+   ASM_CLAC/* Clear AC after saving FLAGS */
orl $X86_EFLAGS_IF, (%esp)  /* Fix IF */
pushl   $__USER_CS  /* pt_regs->cs */
pushl   $0  /* pt_regs->ip = 0 (placeholder) */
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index ff1c6d61f332..3c99040b 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -261,6 +261,7 @@ ENTRY(entry_INT80_compat)
 * Interrupts are off on entry.
 */
PARAVIRT_ADJUST_EXCEPTION_FRAME
+   ASM_CLAC/* Do this early to minimize exposure */
SWAPGS
 
/*
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index b2fd67da1701..ef05755a1900 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -123,7 +123,7 @@ static int get_reg_offset(struct insn *insn, struct pt_regs 
*regs,
break;
}
 
-   if (regno > nr_registers) {
+   if (regno >= nr_registers) {
WARN_ONCE(1, "decoded an instruction with an invalid register");
return -EINVAL;
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 2440814b0069..9cf96d82147a 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -419,24 +419,30 @@ pmd_t *lookup_pmd_address(unsigned long address)
 phys_addr_t slow_virt_to_phys(void *__virt_addr)
 {
unsigned long virt_addr = (unsigned long)__virt_addr;
-   unsigned long phys_addr, offset;
+   phys_addr_t phys_addr;
+   unsigned long offset;
enum pg_level level;
pte_t *pte;
 
pte = lookup_address(virt_addr, );
BUG_ON(!pte);
 
+   /*
+* pXX_pfn() returns unsigned long, which must be cast to phys_addr_t
+* before being left-shifted PAGE_SHIFT bits -- this trick is to
+* make 32-PAE kernel work correctly.
+*/
switch (level) {
case PG_LEVEL_1G:
-   phys_addr = pud_pfn(*(pud_t *)pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pud_pfn(*(pud_t *)pte) << PAGE_SHIFT;
offset = virt_addr & ~PUD_PAGE_MASK;
break;
case PG_LEVEL_2M:
-   phys_addr = pmd_pfn(*(pmd_t *)pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pmd_pfn(*(pmd_t *)pte) << PAGE_SHIFT;
offset = virt_addr & ~PMD_PAGE_MASK;
break;
default:
-   phys_addr = pte_pfn(*pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pte_pfn(*pte) << PAGE_SHIFT;
offset = virt_addr & ~PAGE_MASK;
}
 
diff --git a/arch/x86/platform/intel-quark/imr.c 
b/arch/x86/platform/intel-quark/imr.c
index c61b6c332e97..bfadcd0f4944 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -592,14 +592,14 @@ static void __init imr_fixup_memmap(struct imr_device 
*idev)
end = (unsigned long)__end_rodata - 1;
 
/*
-* Setup a locked IMR around the physical extent of the kernel
+* Setup an unlocked IMR around the physical extent of the kernel
 * from the beginning of the .text secton to the end of the
 * .rodata section as one physically contiguous block.
 *
 * We don't round up @size since it is already PAGE_SIZE aligned.
 * 

[GIT pull] x86 updates for 4.5

2016-02-28 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

This update contains:

  - Hopefully the last ASM CLAC fixups
  
  - A fix for the Quark family related to the IMR lock which makes kexec work
again

  - A off-by-one fix in the MPX code. Ironic, isn't it?

  - A fix for X86_PAE which addresses once more an unsigned long
vs. phys_addr_t hickup.

Thanks,

tglx

-->
Andy Lutomirski (2):
  x86/entry/32: Add an ASM_CLAC to entry_SYSENTER_32
  x86/entry/compat: Add missing CLAC to entry_INT80_32

Bryan O'Donoghue (1):
  x86/platform/intel/quark: Change the kernel's IMR lock bit to false

Colin Ian King (1):
  x86/mpx: Fix off-by-one comparison with nr_registers

Dexuan Cui (1):
  x86/mm: Fix slow_virt_to_phys() for X86_PAE again


 arch/x86/entry/entry_32.S   |  1 +
 arch/x86/entry/entry_64_compat.S|  1 +
 arch/x86/mm/mpx.c   |  2 +-
 arch/x86/mm/pageattr.c  | 14 ++
 arch/x86/platform/intel-quark/imr.c |  4 ++--
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 77d8c5112900..bb3e376d0f33 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -294,6 +294,7 @@ sysenter_past_esp:
pushl   $__USER_DS  /* pt_regs->ss */
pushl   %ebp/* pt_regs->sp (stashed in bp) */
pushfl  /* pt_regs->flags (except IF = 0) */
+   ASM_CLAC/* Clear AC after saving FLAGS */
orl $X86_EFLAGS_IF, (%esp)  /* Fix IF */
pushl   $__USER_CS  /* pt_regs->cs */
pushl   $0  /* pt_regs->ip = 0 (placeholder) */
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index ff1c6d61f332..3c99040b 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -261,6 +261,7 @@ ENTRY(entry_INT80_compat)
 * Interrupts are off on entry.
 */
PARAVIRT_ADJUST_EXCEPTION_FRAME
+   ASM_CLAC/* Do this early to minimize exposure */
SWAPGS
 
/*
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index b2fd67da1701..ef05755a1900 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -123,7 +123,7 @@ static int get_reg_offset(struct insn *insn, struct pt_regs 
*regs,
break;
}
 
-   if (regno > nr_registers) {
+   if (regno >= nr_registers) {
WARN_ONCE(1, "decoded an instruction with an invalid register");
return -EINVAL;
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 2440814b0069..9cf96d82147a 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -419,24 +419,30 @@ pmd_t *lookup_pmd_address(unsigned long address)
 phys_addr_t slow_virt_to_phys(void *__virt_addr)
 {
unsigned long virt_addr = (unsigned long)__virt_addr;
-   unsigned long phys_addr, offset;
+   phys_addr_t phys_addr;
+   unsigned long offset;
enum pg_level level;
pte_t *pte;
 
pte = lookup_address(virt_addr, );
BUG_ON(!pte);
 
+   /*
+* pXX_pfn() returns unsigned long, which must be cast to phys_addr_t
+* before being left-shifted PAGE_SHIFT bits -- this trick is to
+* make 32-PAE kernel work correctly.
+*/
switch (level) {
case PG_LEVEL_1G:
-   phys_addr = pud_pfn(*(pud_t *)pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pud_pfn(*(pud_t *)pte) << PAGE_SHIFT;
offset = virt_addr & ~PUD_PAGE_MASK;
break;
case PG_LEVEL_2M:
-   phys_addr = pmd_pfn(*(pmd_t *)pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pmd_pfn(*(pmd_t *)pte) << PAGE_SHIFT;
offset = virt_addr & ~PMD_PAGE_MASK;
break;
default:
-   phys_addr = pte_pfn(*pte) << PAGE_SHIFT;
+   phys_addr = (phys_addr_t)pte_pfn(*pte) << PAGE_SHIFT;
offset = virt_addr & ~PAGE_MASK;
}
 
diff --git a/arch/x86/platform/intel-quark/imr.c 
b/arch/x86/platform/intel-quark/imr.c
index c61b6c332e97..bfadcd0f4944 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -592,14 +592,14 @@ static void __init imr_fixup_memmap(struct imr_device 
*idev)
end = (unsigned long)__end_rodata - 1;
 
/*
-* Setup a locked IMR around the physical extent of the kernel
+* Setup an unlocked IMR around the physical extent of the kernel
 * from the beginning of the .text secton to the end of the
 * .rodata section as one physically contiguous block.
 *
 * We don't round up @size since it is already PAGE_SIZE aligned.
 * 

[GIT pull] x86 updates for 4.5

2016-02-14 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

Two small fixlets for x86:

 - Prevent a KASAN false positive in thread_saved_pc()

 - Fix a 32-bit truncation problem in the x86 numa code

Thanks,

tglx

-->
Dmitry Vyukov (1):
  x86: Fix KASAN false positives in thread_saved_pc()

Ingo Molnar (1):
  x86/mm/numa: Fix 32-bit memblock range truncation bug on 32-bit NUMA 
kernels


 arch/x86/include/asm/processor.h | 2 +-
 arch/x86/mm/numa.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 2d5a50cb61a2..20c11d1aa4cc 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -766,7 +766,7 @@ extern unsigned long thread_saved_pc(struct task_struct 
*tsk);
  * Return saved PC of a blocked thread.
  * What is this good for? it will be always the scheduler or ret_from_fork.
  */
-#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8))
+#define thread_saved_pc(t) READ_ONCE_NOCHECK(*(unsigned long 
*)((t)->thread.sp - 8))
 
 #define task_pt_regs(tsk)  ((struct pt_regs *)(tsk)->thread.sp0 - 1)
 extern unsigned long KSTK_ESP(struct task_struct *task);
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index c3b3f653ed0c..d04f8094bc23 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -469,7 +469,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
 {
int i, nid;
nodemask_t numa_kernel_nodes = NODE_MASK_NONE;
-   unsigned long start, end;
+   phys_addr_t start, end;
struct memblock_region *r;
 
/*


[GIT pull] x86 updates for 4.5

2016-02-14 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

Two small fixlets for x86:

 - Prevent a KASAN false positive in thread_saved_pc()

 - Fix a 32-bit truncation problem in the x86 numa code

Thanks,

tglx

-->
Dmitry Vyukov (1):
  x86: Fix KASAN false positives in thread_saved_pc()

Ingo Molnar (1):
  x86/mm/numa: Fix 32-bit memblock range truncation bug on 32-bit NUMA 
kernels


 arch/x86/include/asm/processor.h | 2 +-
 arch/x86/mm/numa.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 2d5a50cb61a2..20c11d1aa4cc 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -766,7 +766,7 @@ extern unsigned long thread_saved_pc(struct task_struct 
*tsk);
  * Return saved PC of a blocked thread.
  * What is this good for? it will be always the scheduler or ret_from_fork.
  */
-#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8))
+#define thread_saved_pc(t) READ_ONCE_NOCHECK(*(unsigned long 
*)((t)->thread.sp - 8))
 
 #define task_pt_regs(tsk)  ((struct pt_regs *)(tsk)->thread.sp0 - 1)
 extern unsigned long KSTK_ESP(struct task_struct *task);
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index c3b3f653ed0c..d04f8094bc23 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -469,7 +469,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
 {
int i, nid;
nodemask_t numa_kernel_nodes = NODE_MASK_NONE;
-   unsigned long start, end;
+   phys_addr_t start, end;
struct memblock_region *r;
 
/*


[GIT pull] x86 updates for 4.5

2016-01-31 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 bit on the largish side due to a series of fixes for a regression in the x86
vector management which was introduced in 4.3. This work was started in
December already, but it took some time to fix all corner cases and a couple
of older bugs in that area which were detected while at it

Aside of that a few platform updates for intel-mid, quark and UV and two fixes
for in the mm code:
- Use proper types for pgprot values to avoid truncation
- Prevent a size truncation in the pageattr code when setting
  page attributes for large mappings.

Thanks,

tglx

-->
Alex Thorlton (1):
  x86/platform/UV: Remove EFI memmap quirk for UV2+

Andy Shevchenko (3):
  x86/platform/intel-mid: Enable 64-bit build
  x86/platform/intel-mid: Join string and fix SoC name
  x86/platform/quark: Print boundaries correctly

Jan Beulich (1):
  x86/mm: Fix types used in pgprot cacheability flags translations

Jiang Liu (2):
  x86/irq: Fix a race in x86_vector_free_irqs()
  x86/irq: Do not use apic_chip_data.old_domain as temporary buffer

Matt Fleming (1):
  x86/mm/pat: Avoid truncation when converting cpa->numpages to address

Thomas Gleixner (13):
  x86/irq: Call chip->irq_set_affinity in proper context
  x86/irq: Validate that irq descriptor is still active
  x86/irq: Reorganize the return path in assign_irq_vector
  x86/irq: Reorganize the search in assign_irq_vector
  x86/irq: Check vector allocation early
  x86/irq: Copy vectormask instead of an AND operation
  x86/irq: Get rid of code duplication
  x86/irq: Remove offline cpus from vector cleanup
  x86/irq: Clear move_in_progress before sending cleanup IPI
  x86/irq: Remove the cpumask allocation from send_cleanup_vector()
  x86/irq: Remove outgoing CPU from vector cleanup mask
  x86/irq: Call irq_force_move_complete with irq descriptor
  x86/irq: Plug vector cleanup race


 arch/x86/Kconfig|   3 +-
 arch/x86/include/asm/irq.h  |   5 +-
 arch/x86/include/asm/pgtable_types.h|   6 +-
 arch/x86/kernel/apic/io_apic.c  |   6 +-
 arch/x86/kernel/apic/vector.c   | 221 +---
 arch/x86/kernel/apic/x2apic_uv_x.c  |   5 +-
 arch/x86/kernel/head64.c|   8 ++
 arch/x86/kernel/irq.c   |  11 +-
 arch/x86/mm/pageattr.c  |   4 +-
 arch/x86/platform/efi/quirks.c  |  17 ++-
 arch/x86/platform/intel-mid/intel-mid.c |   8 +-
 arch/x86/platform/intel-quark/imr.c |  18 ++-
 12 files changed, 209 insertions(+), 103 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 258965d56beb..07459a6b417d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -495,11 +495,10 @@ config X86_INTEL_CE
 
 config X86_INTEL_MID
bool "Intel MID platform support"
-   depends on X86_32
depends on X86_EXTENDED_PLATFORM
depends on X86_PLATFORM_DEVICES
depends on PCI
-   depends on PCI_GOANY
+   depends on X86_64 || (PCI_GOANY && X86_32)
depends on X86_IO_APIC
select SFI
select I2C
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 881b4768644a..e7de5c9a4fbd 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -23,11 +23,13 @@ extern void irq_ctx_init(int cpu);
 
 #define __ARCH_HAS_DO_SOFTIRQ
 
+struct irq_desc;
+
 #ifdef CONFIG_HOTPLUG_CPU
 #include 
 extern int check_irq_vectors_for_cpu_disable(void);
 extern void fixup_irqs(void);
-extern void irq_force_complete_move(int);
+extern void irq_force_complete_move(struct irq_desc *desc);
 #endif
 
 #ifdef CONFIG_HAVE_KVM
@@ -37,7 +39,6 @@ extern void kvm_set_posted_intr_wakeup_handler(void 
(*handler)(void));
 extern void (*x86_platform_ipi_callback)(void);
 extern void native_init_IRQ(void);
 
-struct irq_desc;
 extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
 
 extern __visible unsigned int do_IRQ(struct pt_regs *regs);
diff --git a/arch/x86/include/asm/pgtable_types.h 
b/arch/x86/include/asm/pgtable_types.h
index a471cadb9630..79c91853e50e 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -363,20 +363,18 @@ static inline enum page_cache_mode 
pgprot2cachemode(pgprot_t pgprot)
 }
 static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
 {
+   pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
-   unsigned long val;
 
-   val = pgprot_val(pgprot);
pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
return new;
 }
 static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
 {
+   pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
-   

[GIT pull] x86 updates for 4.5

2016-01-31 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 bit on the largish side due to a series of fixes for a regression in the x86
vector management which was introduced in 4.3. This work was started in
December already, but it took some time to fix all corner cases and a couple
of older bugs in that area which were detected while at it

Aside of that a few platform updates for intel-mid, quark and UV and two fixes
for in the mm code:
- Use proper types for pgprot values to avoid truncation
- Prevent a size truncation in the pageattr code when setting
  page attributes for large mappings.

Thanks,

tglx

-->
Alex Thorlton (1):
  x86/platform/UV: Remove EFI memmap quirk for UV2+

Andy Shevchenko (3):
  x86/platform/intel-mid: Enable 64-bit build
  x86/platform/intel-mid: Join string and fix SoC name
  x86/platform/quark: Print boundaries correctly

Jan Beulich (1):
  x86/mm: Fix types used in pgprot cacheability flags translations

Jiang Liu (2):
  x86/irq: Fix a race in x86_vector_free_irqs()
  x86/irq: Do not use apic_chip_data.old_domain as temporary buffer

Matt Fleming (1):
  x86/mm/pat: Avoid truncation when converting cpa->numpages to address

Thomas Gleixner (13):
  x86/irq: Call chip->irq_set_affinity in proper context
  x86/irq: Validate that irq descriptor is still active
  x86/irq: Reorganize the return path in assign_irq_vector
  x86/irq: Reorganize the search in assign_irq_vector
  x86/irq: Check vector allocation early
  x86/irq: Copy vectormask instead of an AND operation
  x86/irq: Get rid of code duplication
  x86/irq: Remove offline cpus from vector cleanup
  x86/irq: Clear move_in_progress before sending cleanup IPI
  x86/irq: Remove the cpumask allocation from send_cleanup_vector()
  x86/irq: Remove outgoing CPU from vector cleanup mask
  x86/irq: Call irq_force_move_complete with irq descriptor
  x86/irq: Plug vector cleanup race


 arch/x86/Kconfig|   3 +-
 arch/x86/include/asm/irq.h  |   5 +-
 arch/x86/include/asm/pgtable_types.h|   6 +-
 arch/x86/kernel/apic/io_apic.c  |   6 +-
 arch/x86/kernel/apic/vector.c   | 221 +---
 arch/x86/kernel/apic/x2apic_uv_x.c  |   5 +-
 arch/x86/kernel/head64.c|   8 ++
 arch/x86/kernel/irq.c   |  11 +-
 arch/x86/mm/pageattr.c  |   4 +-
 arch/x86/platform/efi/quirks.c  |  17 ++-
 arch/x86/platform/intel-mid/intel-mid.c |   8 +-
 arch/x86/platform/intel-quark/imr.c |  18 ++-
 12 files changed, 209 insertions(+), 103 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 258965d56beb..07459a6b417d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -495,11 +495,10 @@ config X86_INTEL_CE
 
 config X86_INTEL_MID
bool "Intel MID platform support"
-   depends on X86_32
depends on X86_EXTENDED_PLATFORM
depends on X86_PLATFORM_DEVICES
depends on PCI
-   depends on PCI_GOANY
+   depends on X86_64 || (PCI_GOANY && X86_32)
depends on X86_IO_APIC
select SFI
select I2C
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 881b4768644a..e7de5c9a4fbd 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -23,11 +23,13 @@ extern void irq_ctx_init(int cpu);
 
 #define __ARCH_HAS_DO_SOFTIRQ
 
+struct irq_desc;
+
 #ifdef CONFIG_HOTPLUG_CPU
 #include 
 extern int check_irq_vectors_for_cpu_disable(void);
 extern void fixup_irqs(void);
-extern void irq_force_complete_move(int);
+extern void irq_force_complete_move(struct irq_desc *desc);
 #endif
 
 #ifdef CONFIG_HAVE_KVM
@@ -37,7 +39,6 @@ extern void kvm_set_posted_intr_wakeup_handler(void 
(*handler)(void));
 extern void (*x86_platform_ipi_callback)(void);
 extern void native_init_IRQ(void);
 
-struct irq_desc;
 extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
 
 extern __visible unsigned int do_IRQ(struct pt_regs *regs);
diff --git a/arch/x86/include/asm/pgtable_types.h 
b/arch/x86/include/asm/pgtable_types.h
index a471cadb9630..79c91853e50e 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -363,20 +363,18 @@ static inline enum page_cache_mode 
pgprot2cachemode(pgprot_t pgprot)
 }
 static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
 {
+   pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
-   unsigned long val;
 
-   val = pgprot_val(pgprot);
pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
return new;
 }
 static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
 {
+   pgprotval_t val = pgprot_val(pgprot);
pgprot_t new;
-   

[GIT pull] x86 updates for 4.4

2015-11-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 couple of fixes and updates related to x86:

 - Fix the W+X check regression on XEN

 - The real fix for the low identity map trainwreck

 - Probe legacy PIC early instead of unconditionally allocating legacy
   irqs

 - Add cpu verification to long mode entry

 - Adjust the cache topology to AMD Fam17H systems

 - Let Merrifield use the TSC across S3

Thanks,

tglx

-->
Andy Shevchenko (1):
  x86/cpu/intel: Enable X86_FEATURE_NONSTOP_TSC_S3 for Merrifield

Aravind Gopalakrishnan (1):
  x86/AMD: Fix last level cache topology for AMD Fam17h systems

Boris Ostrovsky (1):
  x86/mm: Skip the hypervisor range when walking PGD

Borislav Petkov (1):
  x86/cpu: Call verify_cpu() after having entered long mode too

Krzysztof Mazur (1):
  x86/setup: Fix low identity map for >= 2GB kernel range

Vitaly Kuznetsov (1):
  x86/irq: Probe for PIC presence before allocating descs for legacy IRQs


 arch/x86/include/asm/i8259.h  |  1 +
 arch/x86/kernel/apic/vector.c |  6 +-
 arch/x86/kernel/cpu/amd.c | 13 +
 arch/x86/kernel/cpu/intel.c   |  1 +
 arch/x86/kernel/head_64.S |  8 
 arch/x86/kernel/i8259.c   | 29 +
 arch/x86/kernel/setup.c   |  2 +-
 arch/x86/kernel/verify_cpu.S  | 12 +++-
 arch/x86/mm/dump_pagetables.c | 17 -
 9 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h
index ccffa53750a8..39bcefc20de7 100644
--- a/arch/x86/include/asm/i8259.h
+++ b/arch/x86/include/asm/i8259.h
@@ -60,6 +60,7 @@ struct legacy_pic {
void (*mask_all)(void);
void (*restore_mask)(void);
void (*init)(int auto_eoi);
+   int (*probe)(void);
int (*irq_pending)(unsigned int irq);
void (*make_irq)(unsigned int irq);
 };
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 836d11b92811..861bc59c8f25 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -361,7 +361,11 @@ int __init arch_probe_nr_irqs(void)
if (nr < nr_irqs)
nr_irqs = nr;
 
-   return nr_legacy_irqs();
+   /*
+* We don't know if PIC is present at this point so we need to do
+* probe() to get the right number of legacy IRQs.
+*/
+   return legacy_pic->probe();
 }
 
 #ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 4a70fc6d400a..a8816b325162 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -352,6 +352,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
 #ifdef CONFIG_SMP
unsigned bits;
int cpu = smp_processor_id();
+   unsigned int socket_id, core_complex_id;
 
bits = c->x86_coreid_bits;
/* Low order bits define the core id (index of core in socket) */
@@ -361,6 +362,18 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
/* use socket ID also for last level cache */
per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
amd_get_topology(c);
+
+   /*
+* Fix percpu cpu_llc_id here as LLC topology is different
+* for Fam17h systems.
+*/
+if (c->x86 != 0x17 || !cpuid_edx(0x8006))
+   return;
+
+   socket_id   = (c->apicid >> bits) - 1;
+   core_complex_id = (c->apicid & ((1 << bits) - 1)) >> 3;
+
+   per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id;
 #endif
 }
 
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 98a13db5f4be..209ac1e7d1f0 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -97,6 +97,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
switch (c->x86_model) {
case 0x27:  /* Penwell */
case 0x35:  /* Cloverview */
+   case 0x4a:  /* Merrifield */
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
break;
default:
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 1d40ca8a73f2..ffdc0e860390 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -65,6 +65,9 @@ startup_64:
 * tables and then reload them.
 */
 
+   /* Sanitize CPU configuration */
+   call verify_cpu
+
/*
 * Compute the delta between the address I am compiled to run at and the
 * address I am actually running at.
@@ -174,6 +177,9 @@ ENTRY(secondary_startup_64)
 * after the boot processor executes this code.
 */
 
+   /* Sanitize CPU configuration */
+   call verify_cpu
+
movq$(init_level4_pgt - __START_KERNEL_map), %rax
 1:
 
@@ -288,6 +294,8 @@ ENTRY(secondary_startup_64)

[GIT pull] x86 updates for 4.4

2015-11-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 couple of fixes and updates related to x86:

 - Fix the W+X check regression on XEN

 - The real fix for the low identity map trainwreck

 - Probe legacy PIC early instead of unconditionally allocating legacy
   irqs

 - Add cpu verification to long mode entry

 - Adjust the cache topology to AMD Fam17H systems

 - Let Merrifield use the TSC across S3

Thanks,

tglx

-->
Andy Shevchenko (1):
  x86/cpu/intel: Enable X86_FEATURE_NONSTOP_TSC_S3 for Merrifield

Aravind Gopalakrishnan (1):
  x86/AMD: Fix last level cache topology for AMD Fam17h systems

Boris Ostrovsky (1):
  x86/mm: Skip the hypervisor range when walking PGD

Borislav Petkov (1):
  x86/cpu: Call verify_cpu() after having entered long mode too

Krzysztof Mazur (1):
  x86/setup: Fix low identity map for >= 2GB kernel range

Vitaly Kuznetsov (1):
  x86/irq: Probe for PIC presence before allocating descs for legacy IRQs


 arch/x86/include/asm/i8259.h  |  1 +
 arch/x86/kernel/apic/vector.c |  6 +-
 arch/x86/kernel/cpu/amd.c | 13 +
 arch/x86/kernel/cpu/intel.c   |  1 +
 arch/x86/kernel/head_64.S |  8 
 arch/x86/kernel/i8259.c   | 29 +
 arch/x86/kernel/setup.c   |  2 +-
 arch/x86/kernel/verify_cpu.S  | 12 +++-
 arch/x86/mm/dump_pagetables.c | 17 -
 9 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h
index ccffa53750a8..39bcefc20de7 100644
--- a/arch/x86/include/asm/i8259.h
+++ b/arch/x86/include/asm/i8259.h
@@ -60,6 +60,7 @@ struct legacy_pic {
void (*mask_all)(void);
void (*restore_mask)(void);
void (*init)(int auto_eoi);
+   int (*probe)(void);
int (*irq_pending)(unsigned int irq);
void (*make_irq)(unsigned int irq);
 };
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 836d11b92811..861bc59c8f25 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -361,7 +361,11 @@ int __init arch_probe_nr_irqs(void)
if (nr < nr_irqs)
nr_irqs = nr;
 
-   return nr_legacy_irqs();
+   /*
+* We don't know if PIC is present at this point so we need to do
+* probe() to get the right number of legacy IRQs.
+*/
+   return legacy_pic->probe();
 }
 
 #ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 4a70fc6d400a..a8816b325162 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -352,6 +352,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
 #ifdef CONFIG_SMP
unsigned bits;
int cpu = smp_processor_id();
+   unsigned int socket_id, core_complex_id;
 
bits = c->x86_coreid_bits;
/* Low order bits define the core id (index of core in socket) */
@@ -361,6 +362,18 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
/* use socket ID also for last level cache */
per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
amd_get_topology(c);
+
+   /*
+* Fix percpu cpu_llc_id here as LLC topology is different
+* for Fam17h systems.
+*/
+if (c->x86 != 0x17 || !cpuid_edx(0x8006))
+   return;
+
+   socket_id   = (c->apicid >> bits) - 1;
+   core_complex_id = (c->apicid & ((1 << bits) - 1)) >> 3;
+
+   per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id;
 #endif
 }
 
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 98a13db5f4be..209ac1e7d1f0 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -97,6 +97,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
switch (c->x86_model) {
case 0x27:  /* Penwell */
case 0x35:  /* Cloverview */
+   case 0x4a:  /* Merrifield */
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
break;
default:
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 1d40ca8a73f2..ffdc0e860390 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -65,6 +65,9 @@ startup_64:
 * tables and then reload them.
 */
 
+   /* Sanitize CPU configuration */
+   call verify_cpu
+
/*
 * Compute the delta between the address I am compiled to run at and the
 * address I am actually running at.
@@ -174,6 +177,9 @@ ENTRY(secondary_startup_64)
 * after the boot processor executes this code.
 */
 
+   /* Sanitize CPU configuration */
+   call verify_cpu
+
movq$(init_level4_pgt - __START_KERNEL_map), %rax
 1:
 
@@ -288,6 +294,8 @@ ENTRY(secondary_startup_64)

[GIT pull] x86 updates for 4.3

2015-10-11 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

Change Matt Fleming's email address in the maintainers file.

Thanks,

tglx

-->
Matt Fleming (1):
  MAINTAINERS: Change Matt Fleming's email address


 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 60aacd88bd7f..43bd01e1a1f9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4003,7 +4003,7 @@ S:Maintained
 F: sound/usb/misc/ua101.c
 
 EXTENSIBLE FIRMWARE INTERFACE (EFI)
-M: Matt Fleming 
+M: Matt Fleming 
 L: linux-...@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
 S: Maintained
@@ -4018,7 +4018,7 @@ F:include/linux/efi*.h
 EFI VARIABLE FILESYSTEM
 M: Matthew Garrett 
 M: Jeremy Kerr 
-M: Matt Fleming 
+M: Matt Fleming 
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
 L: linux-...@vger.kernel.org
 S: Maintained
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT pull] x86 updates for 4.3

2015-10-11 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

Change Matt Fleming's email address in the maintainers file.

Thanks,

tglx

-->
Matt Fleming (1):
  MAINTAINERS: Change Matt Fleming's email address


 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 60aacd88bd7f..43bd01e1a1f9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4003,7 +4003,7 @@ S:Maintained
 F: sound/usb/misc/ua101.c
 
 EXTENSIBLE FIRMWARE INTERFACE (EFI)
-M: Matt Fleming 
+M: Matt Fleming 
 L: linux-...@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
 S: Maintained
@@ -4018,7 +4018,7 @@ F:include/linux/efi*.h
 EFI VARIABLE FILESYSTEM
 M: Matthew Garrett 
 M: Jeremy Kerr 
-M: Matt Fleming 
+M: Matt Fleming 
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
 L: linux-...@vger.kernel.org
 S: Maintained
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT pull] x86 updates for 4.2

2015-07-12 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

This updates contains:

  - The high latency PIT detection fix, which slipped through the
cracks for rc1

  - A regression fix for the early printk mechanism

  - The x86 part to plug irq/vector related hotplug races

  - Move the allocation of the espfix pages on cpu hotplug to non
atomic context. The current code triggers a might_sleep() warning.

  - A series of KASAN fixes addressing boot crashes and usability

  - A trivial typo fix for Kconfig help text

Thanks,

tglx

-->
Adrian Hunter (1):
  x86/tsc: Let high latency PIT fail fast in quick_pit_calibrate()

Alexander Popov (1):
  x86/kasan: Fix KASAN shadow region page tables

Andrey Ryabinin (5):
  x86/init: Clear 'init_level4_pgt' earlier
  x86/kasan: Flush TLBs after switching CR3
  x86/kasan: Fix boot crash on AMD processors
  x86/kasan: Add message about KASAN being initialized
  x86/kasan: Move KASAN_SHADOW_OFFSET to the arch Kconfig

Steven Rostedt (1):
  x86/earlyprintk: Allow early_printk() to use console style parameters 
like '115200n8'

Sébastien Hinderer (1):
  x86/kconfig: Fix typo in the CONFIG_CMDLINE_BOOL help text

Thomas Gleixner (3):
  x86/irq: Plug irq vector hotplug race
  x86/irq: Use proper locking in check_irq_vectors_for_cpu_disable()
  x86/irq: Retrieve irq data after locking irq_desc

Zhu Guihua (2):
  x86/espfix: Add 'cpu' parameter to init_espfix_ap()
  x86/espfix: Init espfix on the boot CPU side


 arch/x86/Kconfig   |  7 ++-
 arch/x86/include/asm/espfix.h  |  2 +-
 arch/x86/include/asm/kasan.h   |  8 ++-
 arch/x86/kernel/apic/vector.c  | 10 ++---
 arch/x86/kernel/early_printk.c |  4 +++-
 arch/x86/kernel/espfix_64.c| 28 ++---
 arch/x86/kernel/head64.c   | 10 -
 arch/x86/kernel/head_64.S  | 29 --
 arch/x86/kernel/irq.c  | 20 --
 arch/x86/kernel/smpboot.c  | 27 +++-
 arch/x86/kernel/tsc.c  | 11 +-
 arch/x86/mm/kasan_init_64.c| 47 +-
 lib/Kconfig.kasan  |  4 
 13 files changed, 116 insertions(+), 91 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 55bced17dc95..3dbb7e7909ca 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -254,6 +254,11 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
def_bool y
 
+config KASAN_SHADOW_OFFSET
+   hex
+   depends on KASAN
+   default 0xdc00
+
 config HAVE_INTEL_TXT
def_bool y
depends on INTEL_IOMMU && ACPI
@@ -2015,7 +2020,7 @@ config CMDLINE_BOOL
 
  To compile command line arguments into the kernel,
  set this option to 'Y', then fill in the
- the boot arguments in CONFIG_CMDLINE.
+ boot arguments in CONFIG_CMDLINE.
 
  Systems with fully functional boot loaders (i.e. non-embedded)
  should leave this option set to 'N'.
diff --git a/arch/x86/include/asm/espfix.h b/arch/x86/include/asm/espfix.h
index 99efebb2f69d..ca3ce9ab9385 100644
--- a/arch/x86/include/asm/espfix.h
+++ b/arch/x86/include/asm/espfix.h
@@ -9,7 +9,7 @@ DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
 DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);
 
 extern void init_espfix_bsp(void);
-extern void init_espfix_ap(void);
+extern void init_espfix_ap(int cpu);
 
 #endif /* CONFIG_X86_64 */
 
diff --git a/arch/x86/include/asm/kasan.h b/arch/x86/include/asm/kasan.h
index 8b22422fbad8..74a2a8dc9908 100644
--- a/arch/x86/include/asm/kasan.h
+++ b/arch/x86/include/asm/kasan.h
@@ -14,15 +14,11 @@
 
 #ifndef __ASSEMBLY__
 
-extern pte_t kasan_zero_pte[];
-extern pte_t kasan_zero_pmd[];
-extern pte_t kasan_zero_pud[];
-
 #ifdef CONFIG_KASAN
-void __init kasan_map_early_shadow(pgd_t *pgd);
+void __init kasan_early_init(void);
 void __init kasan_init(void);
 #else
-static inline void kasan_map_early_shadow(pgd_t *pgd) { }
+static inline void kasan_early_init(void) { }
 static inline void kasan_init(void) { }
 #endif
 
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 28eba2d38b15..f813261d9740 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -409,12 +409,6 @@ static void __setup_vector_irq(int cpu)
int irq, vector;
struct apic_chip_data *data;
 
-   /*
-* vector_lock will make sure that we don't run into irq vector
-* assignments that might be happening on another cpu in parallel,
-* while we setup our initial vector to irq mappings.
-*/
-   raw_spin_lock(_lock);
/* Mark the inuse vectors */
for_each_active_irq(irq) {
data = apic_chip_data(irq_get_irq_data(irq));
@@ 

[GIT pull] x86 updates for 4.2

2015-07-12 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

This updates contains:

  - The high latency PIT detection fix, which slipped through the
cracks for rc1

  - A regression fix for the early printk mechanism

  - The x86 part to plug irq/vector related hotplug races

  - Move the allocation of the espfix pages on cpu hotplug to non
atomic context. The current code triggers a might_sleep() warning.

  - A series of KASAN fixes addressing boot crashes and usability

  - A trivial typo fix for Kconfig help text

Thanks,

tglx

--
Adrian Hunter (1):
  x86/tsc: Let high latency PIT fail fast in quick_pit_calibrate()

Alexander Popov (1):
  x86/kasan: Fix KASAN shadow region page tables

Andrey Ryabinin (5):
  x86/init: Clear 'init_level4_pgt' earlier
  x86/kasan: Flush TLBs after switching CR3
  x86/kasan: Fix boot crash on AMD processors
  x86/kasan: Add message about KASAN being initialized
  x86/kasan: Move KASAN_SHADOW_OFFSET to the arch Kconfig

Steven Rostedt (1):
  x86/earlyprintk: Allow early_printk() to use console style parameters 
like '115200n8'

Sébastien Hinderer (1):
  x86/kconfig: Fix typo in the CONFIG_CMDLINE_BOOL help text

Thomas Gleixner (3):
  x86/irq: Plug irq vector hotplug race
  x86/irq: Use proper locking in check_irq_vectors_for_cpu_disable()
  x86/irq: Retrieve irq data after locking irq_desc

Zhu Guihua (2):
  x86/espfix: Add 'cpu' parameter to init_espfix_ap()
  x86/espfix: Init espfix on the boot CPU side


 arch/x86/Kconfig   |  7 ++-
 arch/x86/include/asm/espfix.h  |  2 +-
 arch/x86/include/asm/kasan.h   |  8 ++-
 arch/x86/kernel/apic/vector.c  | 10 ++---
 arch/x86/kernel/early_printk.c |  4 +++-
 arch/x86/kernel/espfix_64.c| 28 ++---
 arch/x86/kernel/head64.c   | 10 -
 arch/x86/kernel/head_64.S  | 29 --
 arch/x86/kernel/irq.c  | 20 --
 arch/x86/kernel/smpboot.c  | 27 +++-
 arch/x86/kernel/tsc.c  | 11 +-
 arch/x86/mm/kasan_init_64.c| 47 +-
 lib/Kconfig.kasan  |  4 
 13 files changed, 116 insertions(+), 91 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 55bced17dc95..3dbb7e7909ca 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -254,6 +254,11 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
def_bool y
 
+config KASAN_SHADOW_OFFSET
+   hex
+   depends on KASAN
+   default 0xdc00
+
 config HAVE_INTEL_TXT
def_bool y
depends on INTEL_IOMMU  ACPI
@@ -2015,7 +2020,7 @@ config CMDLINE_BOOL
 
  To compile command line arguments into the kernel,
  set this option to 'Y', then fill in the
- the boot arguments in CONFIG_CMDLINE.
+ boot arguments in CONFIG_CMDLINE.
 
  Systems with fully functional boot loaders (i.e. non-embedded)
  should leave this option set to 'N'.
diff --git a/arch/x86/include/asm/espfix.h b/arch/x86/include/asm/espfix.h
index 99efebb2f69d..ca3ce9ab9385 100644
--- a/arch/x86/include/asm/espfix.h
+++ b/arch/x86/include/asm/espfix.h
@@ -9,7 +9,7 @@ DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
 DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);
 
 extern void init_espfix_bsp(void);
-extern void init_espfix_ap(void);
+extern void init_espfix_ap(int cpu);
 
 #endif /* CONFIG_X86_64 */
 
diff --git a/arch/x86/include/asm/kasan.h b/arch/x86/include/asm/kasan.h
index 8b22422fbad8..74a2a8dc9908 100644
--- a/arch/x86/include/asm/kasan.h
+++ b/arch/x86/include/asm/kasan.h
@@ -14,15 +14,11 @@
 
 #ifndef __ASSEMBLY__
 
-extern pte_t kasan_zero_pte[];
-extern pte_t kasan_zero_pmd[];
-extern pte_t kasan_zero_pud[];
-
 #ifdef CONFIG_KASAN
-void __init kasan_map_early_shadow(pgd_t *pgd);
+void __init kasan_early_init(void);
 void __init kasan_init(void);
 #else
-static inline void kasan_map_early_shadow(pgd_t *pgd) { }
+static inline void kasan_early_init(void) { }
 static inline void kasan_init(void) { }
 #endif
 
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 28eba2d38b15..f813261d9740 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -409,12 +409,6 @@ static void __setup_vector_irq(int cpu)
int irq, vector;
struct apic_chip_data *data;
 
-   /*
-* vector_lock will make sure that we don't run into irq vector
-* assignments that might be happening on another cpu in parallel,
-* while we setup our initial vector to irq mappings.
-*/
-   raw_spin_lock(vector_lock);
/* Mark the inuse vectors */
for_each_active_irq(irq) {
data = apic_chip_data(irq_get_irq_data(irq));
@@ 

Re: [GIT pull] x86 updates for 3.11

2013-07-15 Thread Kees Cook
On Mon, Jul 15, 2013 at 1:45 PM, Thomas Gleixner  wrote:
> On Sat, 13 Jul 2013, H. Peter Anvin wrote:
>
>> Fail on me.  I got rushed and sloppy.  I really need to automate looking
>> for warnings pre-commit and not rely on Fengguang's robot.
>
> /me too. I took it for granted that this was tested by Ingos machinery
> w/o noticing that it went in just when Ingo left for a long
> weekend. So in my own rush to get out for the weekend I left out my
> usual smoke tests on that branch. Sorry about that.

I apologize; I was rushed as well. I've changed my build and test
procedures to more loudly present warnings.

-Kees

--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-15 Thread Thomas Gleixner
On Sat, 13 Jul 2013, H. Peter Anvin wrote:

> Fail on me.  I got rushed and sloppy.  I really need to automate looking
> for warnings pre-commit and not rely on Fengguang's robot.

/me too. I took it for granted that this was tested by Ingos machinery
w/o noticing that it went in just when Ingo left for a long
weekend. So in my own rush to get out for the weekend I left out my
usual smoke tests on that branch. Sorry about that.

Thanks,

tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-15 Thread Thomas Gleixner
On Sat, 13 Jul 2013, H. Peter Anvin wrote:

 Fail on me.  I got rushed and sloppy.  I really need to automate looking
 for warnings pre-commit and not rely on Fengguang's robot.

/me too. I took it for granted that this was tested by Ingos machinery
w/o noticing that it went in just when Ingo left for a long
weekend. So in my own rush to get out for the weekend I left out my
usual smoke tests on that branch. Sorry about that.

Thanks,

tglx


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-15 Thread Kees Cook
On Mon, Jul 15, 2013 at 1:45 PM, Thomas Gleixner t...@linutronix.de wrote:
 On Sat, 13 Jul 2013, H. Peter Anvin wrote:

 Fail on me.  I got rushed and sloppy.  I really need to automate looking
 for warnings pre-commit and not rely on Fengguang's robot.

 /me too. I took it for granted that this was tested by Ingos machinery
 w/o noticing that it went in just when Ingo left for a long
 weekend. So in my own rush to get out for the weekend I left out my
 usual smoke tests on that branch. Sorry about that.

I apologize; I was rushed as well. I've changed my build and test
procedures to more loudly present warnings.

-Kees

--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-13 Thread H. Peter Anvin
Fail on me.  I got rushed and sloppy.  I really need to automate looking
for warnings pre-commit and not rely on Fengguang's robot.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-13 Thread Linus Torvalds
On Sat, Jul 13, 2013 at 4:21 AM, Thomas Gleixner  wrote:
>
>* Guarantee IDT page alignment

What the F*CK, guys?

This piece-of-shit commit is marked for stable, but you clearly never
even test-compiled it, did you?

Because on x86-64 (the which is the only place where the patch
matters), I don't see how you could have avoided this honking huge
warning otherwise:

  arch/x86/kernel/traps.c:74:1: warning: braces around scalar
initializer [enabled by default]
   gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
   ^
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: braces around scalar
initializer [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: excess elements in scalar
initializer [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]

and I don't think this is compiler-specific, because that code is
crap. The declaration for gate_desc is very very different for 32-bit
and 64-bit x86 for whatever braindamaged reasons.

Seriously, WTF? I made the mistake of doing multiple merges
back-to-back with the intention of not doing a full allmodconfig build
in between them, and now I have to undo them all because this pull
request was full of unbelievable shit.

And why the hell was this marked for stable even *IF* it hadn't been
complete and utter tripe? It even has a comment in the commit message
about how this probably doesn't matter. So it's doubly crap: it's
*wrong*, and it didn't actually fix anything to begin with.

There aren't enough swear-words in the English language, so now I'll
have to call you perkeleen vittupää just to express my disgust and
frustration with this crap.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT pull] x86 updates for 3.11

2013-07-13 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

   * Guarantee IDT page alignment
   * Revert an UEFI patch which caused a regression
   * Add a missing check for EFI runtime services
   * Fix for an x86 erratum where read access to nonexisting MSRs does
 not result in a fault.

Thanks,

tglx

-->
H. Peter Anvin (1):
  x86, suspend: Handle CPUs which fail to #GP on RDMSR

Kees Cook (1):
  x86: Make sure IDT is page aligned

Matt Fleming (2):
  efivars: check for EFI_RUNTIME_SERVICES
  Revert "UEFI: Don't pass boot services regions to SetVirtualAddressMap()"

Xiong Zhou (1):
  x86/platform/ce4100: Add header file for reboot type


 arch/x86/kernel/acpi/sleep.c  |   18 --
 arch/x86/kernel/head_64.S |4 
 arch/x86/kernel/traps.c   |7 ++-
 arch/x86/platform/ce4100/ce4100.c |1 +
 arch/x86/platform/efi/efi.c   |7 ---
 drivers/firmware/efi/efivars.c|3 +++
 6 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 2a34aaf..3312010 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -48,9 +48,20 @@ int x86_acpi_suspend_lowlevel(void)
 #ifndef CONFIG_64BIT
native_store_gdt((struct desc_ptr *)>pmode_gdt);
 
+   /*
+* We have to check that we can write back the value, and not
+* just read it.  At least on 90 nm Pentium M (Family 6, Model
+* 13), reading an invalid MSR is not guaranteed to trap, see
+* Erratum X4 in "Intel Pentium M Processor on 90 nm Process
+* with 2-MB L2 Cache and Intel® Processor A100 and A110 on 90
+* nm process with 512-KB L2 Cache Specification Update".
+*/
if (!rdmsr_safe(MSR_EFER,
>pmode_efer_low,
-   >pmode_efer_high))
+   >pmode_efer_high) &&
+   !wrmsr_safe(MSR_EFER,
+   header->pmode_efer_low,
+   header->pmode_efer_high))
header->pmode_behavior |= (1 << WAKEUP_BEHAVIOR_RESTORE_EFER);
 #endif /* !CONFIG_64BIT */
 
@@ -61,7 +72,10 @@ int x86_acpi_suspend_lowlevel(void)
}
if (!rdmsr_safe(MSR_IA32_MISC_ENABLE,
>pmode_misc_en_low,
-   >pmode_misc_en_high))
+   >pmode_misc_en_high) &&
+   !wrmsr_safe(MSR_IA32_MISC_ENABLE,
+   header->pmode_misc_en_low,
+   header->pmode_misc_en_high))
header->pmode_behavior |=
(1 << WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE);
header->realmode_flags = acpi_realmode_flags;
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 5e4d8a8..317b8cc 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -514,10 +514,6 @@ ENTRY(phys_base)

.section .bss, "aw", @nobits
.align L1_CACHE_BYTES
-ENTRY(idt_table)
-   .skip IDT_ENTRIES * 16
-
-   .align L1_CACHE_BYTES
 ENTRY(debug_idt_table)
.skip IDT_ENTRIES * 16
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b0865e8..0952614 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -68,13 +68,10 @@
 #include 
 
 asmlinkage int system_call(void);
+#endif
 
-/*
- * The IDT has to be page-aligned to simplify the Pentium
- * F0 0F bug workaround.
- */
+/* The IDT has to be page-aligned to keep it aligned with its fixmap. */
 gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
-#endif
 
 DECLARE_BITMAP(used_vectors, NR_VECTORS);
 EXPORT_SYMBOL_GPL(used_vectors);
diff --git a/arch/x86/platform/ce4100/ce4100.c 
b/arch/x86/platform/ce4100/ce4100.c
index f8ab494..9962015 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index c8d5577..90f6ed1 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -931,13 +931,6 @@ void __init efi_enter_virtual_mode(void)
va = efi_ioremap(md->phys_addr, size,
 md->type, md->attribute);
 
-   if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
-   if (!va)
-   pr_err("ioremap of 0x%llX failed!\n",
-  (unsigned long long)md->phys_addr);
-   continue;
-   }
-
md->virt_addr = (u64) (unsigned long) va;
 
if (!va) {
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 8bd1bb6..8a7432a 100644
--- 

[GIT pull] x86 updates for 3.11

2013-07-13 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

   * Guarantee IDT page alignment
   * Revert an UEFI patch which caused a regression
   * Add a missing check for EFI runtime services
   * Fix for an x86 erratum where read access to nonexisting MSRs does
 not result in a fault.

Thanks,

tglx

--
H. Peter Anvin (1):
  x86, suspend: Handle CPUs which fail to #GP on RDMSR

Kees Cook (1):
  x86: Make sure IDT is page aligned

Matt Fleming (2):
  efivars: check for EFI_RUNTIME_SERVICES
  Revert UEFI: Don't pass boot services regions to SetVirtualAddressMap()

Xiong Zhou (1):
  x86/platform/ce4100: Add header file for reboot type


 arch/x86/kernel/acpi/sleep.c  |   18 --
 arch/x86/kernel/head_64.S |4 
 arch/x86/kernel/traps.c   |7 ++-
 arch/x86/platform/ce4100/ce4100.c |1 +
 arch/x86/platform/efi/efi.c   |7 ---
 drivers/firmware/efi/efivars.c|3 +++
 6 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 2a34aaf..3312010 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -48,9 +48,20 @@ int x86_acpi_suspend_lowlevel(void)
 #ifndef CONFIG_64BIT
native_store_gdt((struct desc_ptr *)header-pmode_gdt);
 
+   /*
+* We have to check that we can write back the value, and not
+* just read it.  At least on 90 nm Pentium M (Family 6, Model
+* 13), reading an invalid MSR is not guaranteed to trap, see
+* Erratum X4 in Intel Pentium M Processor on 90 nm Process
+* with 2-MB L2 Cache and Intel® Processor A100 and A110 on 90
+* nm process with 512-KB L2 Cache Specification Update.
+*/
if (!rdmsr_safe(MSR_EFER,
header-pmode_efer_low,
-   header-pmode_efer_high))
+   header-pmode_efer_high) 
+   !wrmsr_safe(MSR_EFER,
+   header-pmode_efer_low,
+   header-pmode_efer_high))
header-pmode_behavior |= (1  WAKEUP_BEHAVIOR_RESTORE_EFER);
 #endif /* !CONFIG_64BIT */
 
@@ -61,7 +72,10 @@ int x86_acpi_suspend_lowlevel(void)
}
if (!rdmsr_safe(MSR_IA32_MISC_ENABLE,
header-pmode_misc_en_low,
-   header-pmode_misc_en_high))
+   header-pmode_misc_en_high) 
+   !wrmsr_safe(MSR_IA32_MISC_ENABLE,
+   header-pmode_misc_en_low,
+   header-pmode_misc_en_high))
header-pmode_behavior |=
(1  WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE);
header-realmode_flags = acpi_realmode_flags;
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 5e4d8a8..317b8cc 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -514,10 +514,6 @@ ENTRY(phys_base)

.section .bss, aw, @nobits
.align L1_CACHE_BYTES
-ENTRY(idt_table)
-   .skip IDT_ENTRIES * 16
-
-   .align L1_CACHE_BYTES
 ENTRY(debug_idt_table)
.skip IDT_ENTRIES * 16
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b0865e8..0952614 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -68,13 +68,10 @@
 #include asm/setup.h
 
 asmlinkage int system_call(void);
+#endif
 
-/*
- * The IDT has to be page-aligned to simplify the Pentium
- * F0 0F bug workaround.
- */
+/* The IDT has to be page-aligned to keep it aligned with its fixmap. */
 gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
-#endif
 
 DECLARE_BITMAP(used_vectors, NR_VECTORS);
 EXPORT_SYMBOL_GPL(used_vectors);
diff --git a/arch/x86/platform/ce4100/ce4100.c 
b/arch/x86/platform/ce4100/ce4100.c
index f8ab494..9962015 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -14,6 +14,7 @@
 #include linux/module.h
 #include linux/serial_reg.h
 #include linux/serial_8250.h
+#include linux/reboot.h
 
 #include asm/ce4100.h
 #include asm/prom.h
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index c8d5577..90f6ed1 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -931,13 +931,6 @@ void __init efi_enter_virtual_mode(void)
va = efi_ioremap(md-phys_addr, size,
 md-type, md-attribute);
 
-   if (!(md-attribute  EFI_MEMORY_RUNTIME)) {
-   if (!va)
-   pr_err(ioremap of 0x%llX failed!\n,
-  (unsigned long long)md-phys_addr);
-   continue;
-   }
-
md-virt_addr = (u64) (unsigned long) va;
 
if (!va) {
diff --git 

Re: [GIT pull] x86 updates for 3.11

2013-07-13 Thread Linus Torvalds
On Sat, Jul 13, 2013 at 4:21 AM, Thomas Gleixner t...@linutronix.de wrote:

* Guarantee IDT page alignment

What the F*CK, guys?

This piece-of-shit commit is marked for stable, but you clearly never
even test-compiled it, did you?

Because on x86-64 (the which is the only place where the patch
matters), I don't see how you could have avoided this honking huge
warning otherwise:

  arch/x86/kernel/traps.c:74:1: warning: braces around scalar
initializer [enabled by default]
   gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
   ^
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: braces around scalar
initializer [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: excess elements in scalar
initializer [enabled by default]
  arch/x86/kernel/traps.c:74:1: warning: (near initialization for
‘idt_table[0].offset_low’) [enabled by default]

and I don't think this is compiler-specific, because that code is
crap. The declaration for gate_desc is very very different for 32-bit
and 64-bit x86 for whatever braindamaged reasons.

Seriously, WTF? I made the mistake of doing multiple merges
back-to-back with the intention of not doing a full allmodconfig build
in between them, and now I have to undo them all because this pull
request was full of unbelievable shit.

And why the hell was this marked for stable even *IF* it hadn't been
complete and utter tripe? It even has a comment in the commit message
about how this probably doesn't matter. So it's doubly crap: it's
*wrong*, and it didn't actually fix anything to begin with.

There aren't enough swear-words in the English language, so now I'll
have to call you perkeleen vittupää just to express my disgust and
frustration with this crap.

Linus
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates for 3.11

2013-07-13 Thread H. Peter Anvin
Fail on me.  I got rushed and sloppy.  I really need to automate looking
for warnings pre-commit and not rely on Fengguang's robot.

-hpa

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[git pull] x86 updates

2008-02-25 Thread Ingo Molnar

Linus, please pull the latest x86 git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

Note: three (well-tested) lguest fixlets are included as well.

Thanks,

Ingo

-->
Adrian Bunk (1):
  x86: don't make swapper_pg_pmd global

Ahmed S. Darwish (1):
  x86/lguest: fix pgdir pmd index calculation

Glauber Costa (1):
  x86: make c_idle.work have a static address.

H. Peter Anvin (5):
  x86: do not promote TM3x00/TM5x00 to i686-class
  x86: require family >= 6 if we are using P6 NOPs
  x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
  x86: add comments for NOPs
  x86: handle BIOSes which terminate e820 with CF=1 and no SMAP

Harvey Harrison (1):
  lguest: include function prototypes

Ingo Molnar (4):
  x86: make DEBUG_PAGEALLOC and CPA more robust
  x86: fix spontaneous reboot with allyesconfig bzImage
  x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE
  x86: fix execve with -fstack-protect

Joerg Roedel (1):
  x86: don't print a warning when MTRR are blank and running in KVM

Mikael Pettersson (1):
  x86: fix boot failure on 486 due to TSC breakage

Pavel Machek (2):
  x86: hpet fix docbook comment
  x86: notsc is ignored on common configurations

Priit Laes (1):
  x86: fix build on non-C locales.

Randy Dunlap (1):
  x86/mtrr: fix kernel-doc missing notation

Thomas Gleixner (2):
  x86: fix vsyscall wreckage
  x86: no robust/pi futex for real i386 CPUs

Tony Breeds (1):
  lguest: fix build breakage

Vegard Nossum (1):
  x86: don't save unreliable stack trace entries

Yinghai Lu (1):
  x86: remove double-checking empty zero pages debug

 arch/x86/Kconfig.cpu |   14 ++
 arch/x86/boot/memory.c   |9 +++-
 arch/x86/kernel/asm-offsets_32.c |4 +-
 arch/x86/kernel/cpu/common.c |2 +-
 arch/x86/kernel/cpu/mtrr/main.c  |9 +++-
 arch/x86/kernel/cpu/transmeta.c  |7 ---
 arch/x86/kernel/entry_64.S   |6 ++-
 arch/x86/kernel/head_32.S|2 +-
 arch/x86/kernel/head_64.S|   22 ++
 arch/x86/kernel/hpet.c   |4 +-
 arch/x86/kernel/process_64.c |6 +-
 arch/x86/kernel/setup_64.c   |2 +-
 arch/x86/kernel/smpboot_64.c |2 +-
 arch/x86/kernel/stacktrace.c |4 ++
 arch/x86/kernel/tsc_32.c |3 +-
 arch/x86/kernel/vsyscall_64.c|   52 +--
 arch/x86/lguest/boot.c   |   12 +-
 arch/x86/mm/init_64.c|   13 +-
 arch/x86/mm/pageattr.c   |   84 +++---
 arch/x86/vdso/Makefile   |2 +-
 include/asm-x86/futex.h  |7 +++
 include/asm-x86/lguest.h |   11 +
 include/asm-x86/nops.h   |   66 +-
 include/asm-x86/page_64.h|8 +++-
 24 files changed, 191 insertions(+), 160 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index e09a6b7..6d50064 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -377,6 +377,19 @@ config X86_OOSTORE
def_bool y
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
 
+#
+# P6_NOPs are a relatively minor optimization that require a family >=
+# 6 processor, except that it is broken on certain VIA chips.
+# Furthermore, AMD chips prefer a totally different sequence of NOPs
+# (which work on all CPUs).  As a result, disallow these if we're
+# compiling X86_GENERIC but not X86_64 (these NOPs do work on all
+# x86-64 capable chips); the list of processors in the right-hand clause
+# are the cores that benefit from this optimization.
+#
+config X86_P6_NOP
+   def_bool y
+   depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || 
MPENTIUMIII || MPENTIUMM || MCORE2 || PENTIUM4)
+
 config X86_TSC
def_bool y
depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || 
MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII 
|| M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || 
MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64
@@ -390,6 +403,7 @@ config X86_CMOV
 config X86_MINIMUM_CPU_FAMILY
int
default "64" if X86_64
+   default "6" if X86_32 && X86_P6_NOP
default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || 
X86_WP_WORKS_OK)
default "3"
 
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 3783539..e77d89f 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -37,6 +37,12 @@ static int detect_memory_e820(void)
  "=m" (*desc)
: "D" (desc), "d" (SMAP), "a" (0xe820));
 
+   /* BIOSes which terminate the chain with CF = 1 as opposed
+  to %ebx = 0 don't always report the SMAP signature on
+  the final, failing, probe. */
+   if (err)
+   break;
+
 

[git pull] x86 updates

2008-02-25 Thread Ingo Molnar

Linus, please pull the latest x86 git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

Note: three (well-tested) lguest fixlets are included as well.

Thanks,

Ingo

--
Adrian Bunk (1):
  x86: don't make swapper_pg_pmd global

Ahmed S. Darwish (1):
  x86/lguest: fix pgdir pmd index calculation

Glauber Costa (1):
  x86: make c_idle.work have a static address.

H. Peter Anvin (5):
  x86: do not promote TM3x00/TM5x00 to i686-class
  x86: require family = 6 if we are using P6 NOPs
  x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
  x86: add comments for NOPs
  x86: handle BIOSes which terminate e820 with CF=1 and no SMAP

Harvey Harrison (1):
  lguest: include function prototypes

Ingo Molnar (4):
  x86: make DEBUG_PAGEALLOC and CPA more robust
  x86: fix spontaneous reboot with allyesconfig bzImage
  x86: rename KERNEL_TEXT_SIZE = KERNEL_IMAGE_SIZE
  x86: fix execve with -fstack-protect

Joerg Roedel (1):
  x86: don't print a warning when MTRR are blank and running in KVM

Mikael Pettersson (1):
  x86: fix boot failure on 486 due to TSC breakage

Pavel Machek (2):
  x86: hpet fix docbook comment
  x86: notsc is ignored on common configurations

Priit Laes (1):
  x86: fix build on non-C locales.

Randy Dunlap (1):
  x86/mtrr: fix kernel-doc missing notation

Thomas Gleixner (2):
  x86: fix vsyscall wreckage
  x86: no robust/pi futex for real i386 CPUs

Tony Breeds (1):
  lguest: fix build breakage

Vegard Nossum (1):
  x86: don't save unreliable stack trace entries

Yinghai Lu (1):
  x86: remove double-checking empty zero pages debug

 arch/x86/Kconfig.cpu |   14 ++
 arch/x86/boot/memory.c   |9 +++-
 arch/x86/kernel/asm-offsets_32.c |4 +-
 arch/x86/kernel/cpu/common.c |2 +-
 arch/x86/kernel/cpu/mtrr/main.c  |9 +++-
 arch/x86/kernel/cpu/transmeta.c  |7 ---
 arch/x86/kernel/entry_64.S   |6 ++-
 arch/x86/kernel/head_32.S|2 +-
 arch/x86/kernel/head_64.S|   22 ++
 arch/x86/kernel/hpet.c   |4 +-
 arch/x86/kernel/process_64.c |6 +-
 arch/x86/kernel/setup_64.c   |2 +-
 arch/x86/kernel/smpboot_64.c |2 +-
 arch/x86/kernel/stacktrace.c |4 ++
 arch/x86/kernel/tsc_32.c |3 +-
 arch/x86/kernel/vsyscall_64.c|   52 +--
 arch/x86/lguest/boot.c   |   12 +-
 arch/x86/mm/init_64.c|   13 +-
 arch/x86/mm/pageattr.c   |   84 +++---
 arch/x86/vdso/Makefile   |2 +-
 include/asm-x86/futex.h  |7 +++
 include/asm-x86/lguest.h |   11 +
 include/asm-x86/nops.h   |   66 +-
 include/asm-x86/page_64.h|8 +++-
 24 files changed, 191 insertions(+), 160 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index e09a6b7..6d50064 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -377,6 +377,19 @@ config X86_OOSTORE
def_bool y
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6)  MTRR
 
+#
+# P6_NOPs are a relatively minor optimization that require a family =
+# 6 processor, except that it is broken on certain VIA chips.
+# Furthermore, AMD chips prefer a totally different sequence of NOPs
+# (which work on all CPUs).  As a result, disallow these if we're
+# compiling X86_GENERIC but not X86_64 (these NOPs do work on all
+# x86-64 capable chips); the list of processors in the right-hand clause
+# are the cores that benefit from this optimization.
+#
+config X86_P6_NOP
+   def_bool y
+   depends on (X86_64 || !X86_GENERIC)  (M686 || MPENTIUMII || 
MPENTIUMIII || MPENTIUMM || MCORE2 || PENTIUM4)
+
 config X86_TSC
def_bool y
depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || 
MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII 
|| M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || 
MGEODE_LX || MCORE2)  !X86_NUMAQ) || X86_64
@@ -390,6 +403,7 @@ config X86_CMOV
 config X86_MINIMUM_CPU_FAMILY
int
default 64 if X86_64
+   default 6 if X86_32  X86_P6_NOP
default 4 if X86_32  (X86_XADD || X86_CMPXCHG || X86_BSWAP || 
X86_WP_WORKS_OK)
default 3
 
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 3783539..e77d89f 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -37,6 +37,12 @@ static int detect_memory_e820(void)
  =m (*desc)
: D (desc), d (SMAP), a (0xe820));
 
+   /* BIOSes which terminate the chain with CF = 1 as opposed
+  to %ebx = 0 don't always report the SMAP signature on
+  the final, failing, probe. */
+   if (err)
+   break;
+
/* Some BIOSes 

Re: [GIT pull] x86 updates

2008-02-20 Thread Ingo Molnar

* Randy Dunlap <[EMAIL PROTECTED]> wrote:

> What happened to the kernel-doc x86/cpu/mtrr patch, which you applied, 
> according to your email reply...

you can see the latest & greatest arch/x86 patches in the 
x86.git#testing branch. Here is how you can track it:

   http://people.redhat.com/mingo/x86.git/README

your patch was added yesterday so it wasnt in the to-Linus branch of the 
tree yet.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates

2008-02-20 Thread Ingo Molnar

* Randy Dunlap [EMAIL PROTECTED] wrote:

 What happened to the kernel-doc x86/cpu/mtrr patch, which you applied, 
 according to your email reply...

you can see the latest  greatest arch/x86 patches in the 
x86.git#testing branch. Here is how you can track it:

   http://people.redhat.com/mingo/x86.git/README

your patch was added yesterday so it wasnt in the to-Linus branch of the 
tree yet.

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates

2008-02-19 Thread Thomas Gleixner
On Tue, 19 Feb 2008, Randy Dunlap wrote:

> On Wed, 20 Feb 2008 00:13:13 +0100 (CET) Thomas Gleixner wrote:
> 
> > Linus,
> > 
> > please pull x86 updates from:
> > 
> >   ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
> > master
> > 
> > The major part of this pull are sparse fixes, section fixups,
> > documentation updates and cleanups.
> 
> 
> Hi,
> What happened to the kernel-doc x86/cpu/mtrr patch, which you applied,
> according to your email reply...

It's still applied, is queued in the next batch.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates

2008-02-19 Thread Randy Dunlap
On Wed, 20 Feb 2008 00:13:13 +0100 (CET) Thomas Gleixner wrote:

> Linus,
> 
> please pull x86 updates from:
> 
>   ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
> master
> 
> The major part of this pull are sparse fixes, section fixups,
> documentation updates and cleanups.


Hi,
What happened to the kernel-doc x86/cpu/mtrr patch, which you applied,
according to your email reply...

---
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT pull] x86 updates

2008-02-19 Thread Thomas Gleixner
Linus,

please pull x86 updates from:

  ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git master

The major part of this pull are sparse fixes, section fixups,
documentation updates and cleanups.

The bugfix part is:

- fix the ioremap page_is_ram() protection
- exclude vsyscall files from stackprotect
- switch the iodelay back to 0x80 default
- fix vdso_install breakage

The vdso_install breakage fix from Sam solves the same problem in

arch/powerpc/Makefile

The patch came as bundle. Please let me know, if you want the powerpc
fix split out and merged via the powerpc tree.

Thanks,

tglx
---
Adrian Bunk (5):
  remove mca-pentium
  x86: make mxcsr_feature_mask static again
  x86: unexport io_delay_type
  x86: don't make irq_return global
  x86: don't make swapper_pg_fixmap global

Ahmed S. Darwish (1):
  x86: i8259A: remove redundant irq_descinitialization

Andi Kleen (1):
  x86: CPA: remove BUG_ON for LRU/Compound pages

Arjan van de Ven (2):
  x86: fix WARN_ON() message: teach page_is_ram() about the special 4Kb 
bios data page
  x86: fix page_is_ram() thinko

Cyrill Gorcunov (3):
  x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
  x86: lds - Use PAGE_SIZE instead of numeric constant
  x86: lds - Use THREAD_SIZE instead of numeric constant

H. Peter Anvin (1):
  x86: add pgd_large() on 64-bit, for consistency

Harvey Harrison (3):
  x86, kprobes: remove sparse warnings from x86
  x86: sparse error in efi_32.c
  x86: sparse warning in efi.c

Ingo Molnar (3):
  x86: exclude vsyscall files from stackprotect
  x86: clean up csum-wrappers_64.c some more
  x86: change IO delay back to 0x80

Li Zefan (1):
  x86: fix compile warning building without CONFIG_SYSCTL

Marcin Slusarz (1):
  x86: fix printout ugliness in cpu info printk

Mike Travis (1):
  x86: minor cleanup of comments in processor.h

Nick Andrew (1):
  x86: docs fixes to Documentation/i386/IO-APIC.txt

Paolo Ciarrocchi (2):
  x86: coding style fixes in arch/x86/lib/io_64.c
  x86: coding style fixes in arch/x86/lib/csum-wrappers_64.c

Sam Ravnborg (7):
  x86: fix section mismatch warning in setup_64.c:nearby_node
  x86: fix section mismatch in setup_64.c:srat_detect_node
  x86: fix section mismatch warning in topology.c:arch_register_cpu
  x86: fix section mismatch in srat_64.c:reserve_hotadd
  x86: fix section mismatch in head_64.S:initial_code
  x86: annotate pci/common.s:pci_scan_bus_with_sysdata with __devinit
  x86: fix vdso_install breaks user "make install"

 Documentation/i386/IO-APIC.txt  |   32 
 Documentation/kernel-parameters.txt |2 -
 arch/powerpc/Makefile   |2 +-
 arch/x86/Kconfig.debug  |2 +-
 arch/x86/Makefile   |2 +-
 arch/x86/kernel/Makefile|   10 ++-
 arch/x86/kernel/cpu/bugs.c  |8 --
 arch/x86/kernel/efi.c   |2 +-
 arch/x86/kernel/efi_32.c|1 +
 arch/x86/kernel/entry_32.S  |2 +-
 arch/x86/kernel/entry_64.S  |2 +-
 arch/x86/kernel/head_32.S   |2 +-
 arch/x86/kernel/head_64.S   |2 +-
 arch/x86/kernel/i387.c  |2 +-
 arch/x86/kernel/i8259_32.c  |   25 ++-
 arch/x86/kernel/io_delay.c  |1 -
 arch/x86/kernel/kprobes.c   |4 +-
 arch/x86/kernel/nmi_32.c|   21 ++---
 arch/x86/kernel/nmi_64.c|   21 ++---
 arch/x86/kernel/setup_32.c  |1 -
 arch/x86/kernel/setup_64.c  |6 +-
 arch/x86/kernel/topology.c  |2 +-
 arch/x86/kernel/vmlinux_32.lds.S|   26 +++---
 arch/x86/kernel/vmlinux_64.lds.S|   30 
 arch/x86/lib/csum-wrappers_64.c |  147 +++
 arch/x86/lib/io_64.c|   18 +++--
 arch/x86/mm/ioremap.c   |   24 --
 arch/x86/mm/pageattr.c  |5 -
 arch/x86/mm/srat_64.c   |3 +-
 arch/x86/pci/common.c   |2 +-
 arch/x86/power/hibernate_asm_64.S   |5 +-
 include/asm-x86/i387.h  |1 -
 include/asm-x86/pgtable_64.h|1 +
 include/asm-x86/processor.h |5 -
 34 files changed, 208 insertions(+), 211 deletions(-)
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/i386/IO-APIC.txt
index 435e69e..f951666 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/i386/IO-APIC.txt
@@ -1,12 +1,14 @@
 Most (all) Intel-MP compliant SMP boards have the so-called 'IO-APIC',
-which is an enhanced interrupt controller, it enables us to route
-hardware interrupts to multiple CPUs, or to CPU groups.
+which is an enhanced interrupt controller. It enables us to route
+hardware interrupts to multiple CPUs, or to CPU groups. Without an
+IO-APIC, interrupts from hardware will be delivered only to the
+CPU which boots the 

[GIT pull] x86 updates

2008-02-19 Thread Thomas Gleixner
Linus,

please pull x86 updates from:

  ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git master

The major part of this pull are sparse fixes, section fixups,
documentation updates and cleanups.

The bugfix part is:

- fix the ioremap page_is_ram() protection
- exclude vsyscall files from stackprotect
- switch the iodelay back to 0x80 default
- fix vdso_install breakage

The vdso_install breakage fix from Sam solves the same problem in

arch/powerpc/Makefile

The patch came as bundle. Please let me know, if you want the powerpc
fix split out and merged via the powerpc tree.

Thanks,

tglx
---
Adrian Bunk (5):
  remove mca-pentium
  x86: make mxcsr_feature_mask static again
  x86: unexport io_delay_type
  x86: don't make irq_return global
  x86: don't make swapper_pg_fixmap global

Ahmed S. Darwish (1):
  x86: i8259A: remove redundant irq_descinitialization

Andi Kleen (1):
  x86: CPA: remove BUG_ON for LRU/Compound pages

Arjan van de Ven (2):
  x86: fix WARN_ON() message: teach page_is_ram() about the special 4Kb 
bios data page
  x86: fix page_is_ram() thinko

Cyrill Gorcunov (3):
  x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
  x86: lds - Use PAGE_SIZE instead of numeric constant
  x86: lds - Use THREAD_SIZE instead of numeric constant

H. Peter Anvin (1):
  x86: add pgd_large() on 64-bit, for consistency

Harvey Harrison (3):
  x86, kprobes: remove sparse warnings from x86
  x86: sparse error in efi_32.c
  x86: sparse warning in efi.c

Ingo Molnar (3):
  x86: exclude vsyscall files from stackprotect
  x86: clean up csum-wrappers_64.c some more
  x86: change IO delay back to 0x80

Li Zefan (1):
  x86: fix compile warning building without CONFIG_SYSCTL

Marcin Slusarz (1):
  x86: fix printout ugliness in cpu info printk

Mike Travis (1):
  x86: minor cleanup of comments in processor.h

Nick Andrew (1):
  x86: docs fixes to Documentation/i386/IO-APIC.txt

Paolo Ciarrocchi (2):
  x86: coding style fixes in arch/x86/lib/io_64.c
  x86: coding style fixes in arch/x86/lib/csum-wrappers_64.c

Sam Ravnborg (7):
  x86: fix section mismatch warning in setup_64.c:nearby_node
  x86: fix section mismatch in setup_64.c:srat_detect_node
  x86: fix section mismatch warning in topology.c:arch_register_cpu
  x86: fix section mismatch in srat_64.c:reserve_hotadd
  x86: fix section mismatch in head_64.S:initial_code
  x86: annotate pci/common.s:pci_scan_bus_with_sysdata with __devinit
  x86: fix vdso_install breaks user make install

 Documentation/i386/IO-APIC.txt  |   32 
 Documentation/kernel-parameters.txt |2 -
 arch/powerpc/Makefile   |2 +-
 arch/x86/Kconfig.debug  |2 +-
 arch/x86/Makefile   |2 +-
 arch/x86/kernel/Makefile|   10 ++-
 arch/x86/kernel/cpu/bugs.c  |8 --
 arch/x86/kernel/efi.c   |2 +-
 arch/x86/kernel/efi_32.c|1 +
 arch/x86/kernel/entry_32.S  |2 +-
 arch/x86/kernel/entry_64.S  |2 +-
 arch/x86/kernel/head_32.S   |2 +-
 arch/x86/kernel/head_64.S   |2 +-
 arch/x86/kernel/i387.c  |2 +-
 arch/x86/kernel/i8259_32.c  |   25 ++-
 arch/x86/kernel/io_delay.c  |1 -
 arch/x86/kernel/kprobes.c   |4 +-
 arch/x86/kernel/nmi_32.c|   21 ++---
 arch/x86/kernel/nmi_64.c|   21 ++---
 arch/x86/kernel/setup_32.c  |1 -
 arch/x86/kernel/setup_64.c  |6 +-
 arch/x86/kernel/topology.c  |2 +-
 arch/x86/kernel/vmlinux_32.lds.S|   26 +++---
 arch/x86/kernel/vmlinux_64.lds.S|   30 
 arch/x86/lib/csum-wrappers_64.c |  147 +++
 arch/x86/lib/io_64.c|   18 +++--
 arch/x86/mm/ioremap.c   |   24 --
 arch/x86/mm/pageattr.c  |5 -
 arch/x86/mm/srat_64.c   |3 +-
 arch/x86/pci/common.c   |2 +-
 arch/x86/power/hibernate_asm_64.S   |5 +-
 include/asm-x86/i387.h  |1 -
 include/asm-x86/pgtable_64.h|1 +
 include/asm-x86/processor.h |5 -
 34 files changed, 208 insertions(+), 211 deletions(-)
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/i386/IO-APIC.txt
index 435e69e..f951666 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/i386/IO-APIC.txt
@@ -1,12 +1,14 @@
 Most (all) Intel-MP compliant SMP boards have the so-called 'IO-APIC',
-which is an enhanced interrupt controller, it enables us to route
-hardware interrupts to multiple CPUs, or to CPU groups.
+which is an enhanced interrupt controller. It enables us to route
+hardware interrupts to multiple CPUs, or to CPU groups. Without an
+IO-APIC, interrupts from hardware will be delivered only to the
+CPU which boots the 

Re: [GIT pull] x86 updates

2008-02-19 Thread Randy Dunlap
On Wed, 20 Feb 2008 00:13:13 +0100 (CET) Thomas Gleixner wrote:

 Linus,
 
 please pull x86 updates from:
 
   ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
 master
 
 The major part of this pull are sparse fixes, section fixups,
 documentation updates and cleanups.


Hi,
What happened to the kernel-doc x86/cpu/mtrr patch, which you applied,
according to your email reply...

---
~Randy
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT pull] x86 updates

2008-02-19 Thread Thomas Gleixner
On Tue, 19 Feb 2008, Randy Dunlap wrote:

 On Wed, 20 Feb 2008 00:13:13 +0100 (CET) Thomas Gleixner wrote:
 
  Linus,
  
  please pull x86 updates from:
  
ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
  master
  
  The major part of this pull are sparse fixes, section fixups,
  documentation updates and cleanups.
 
 
 Hi,
 What happened to the kernel-doc x86/cpu/mtrr patch, which you applied,
 according to your email reply...

It's still applied, is queued in the next batch.

Thanks,

tglx
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT Pull] x86 updates

2008-02-18 Thread Thomas Gleixner
Linus,

please pull x86 updates from

  ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

The updates are:

- fix the fallout of the CPA changes. This fixes the review issues
  and some other problems, which were discovered by extended
  testcases.

- fix for NUMA systems were node 0 is not online

- lguest build fix which Rusty asked us to merge

Thanks,
tglx
---

Rusty Russell (1):
  x86: fix lguest build failure

Thomas Gleixner (4):
  x86: CPA, fix alias checks
  x86: zap invalid and unused pmds in early boot
  x86: CPA no alias checking for _NX
  x86: CPA: avoid double checking of alias ranges

Yinghai Lu (1):
  x86: reenable support for system without on node0

 arch/x86/kernel/asm-offsets_32.c |6 +-
 arch/x86/kernel/head64.c |3 +
 arch/x86/kernel/head_64.S|7 +-
 arch/x86/mm/init_64.c|   27 +
 arch/x86/mm/numa_64.c|5 +-
 arch/x86/mm/pageattr.c   |  208 --
 include/asm-x86/pgtable_64.h |1 +
 7 files changed, 154 insertions(+), 103 deletions(-)
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index afd8446..a33d530 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -20,10 +20,8 @@
 
 #include 
 
-#ifdef CONFIG_LGUEST_GUEST
 #include 
 #include "../../../drivers/lguest/lg.h"
-#endif
 
 #define DEFINE(sym, val) \
 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -134,6 +132,10 @@ void foo(void)
BLANK();
OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);
OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);
+#endif
+
+#ifdef CONFIG_LGUEST
+   BLANK();
OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);
OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);
OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3);
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 24dbf56..ad24408 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -88,6 +88,9 @@ void __init x86_64_start_kernel(char * real_mode_data)
/* Make NULL pointers segfault */
zap_identity_mappings();
 
+   /* Cleanup the over mapped high alias */
+   cleanup_highmap();
+
for (i = 0; i < IDT_ENTRIES; i++) {
 #ifdef CONFIG_EARLY_PRINTK
set_intr_gate(i, _idt_handlers[i]);
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 09b38d5..53e5820 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -107,8 +107,13 @@ startup_64:
movq%rdx, 0(%rbx, %rax, 8)
 ident_complete:
 
-   /* Fixup the kernel text+data virtual addresses
+   /*
+* Fixup the kernel text+data virtual addresses. Note that
+* we might write invalid pmds, when the kernel is relocated
+* cleanup_highmap() fixes this up along with the mappings
+* beyond _end.
 */
+
leaqlevel2_kernel_pgt(%rip), %rdi
leaq4096(%rdi), %r8
/* See if it is a valid page table entry */
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index a4a9ccc..bb652f5 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -171,6 +171,33 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, 
pgprot_t prot)
__flush_tlb_one(vaddr);
 }
 
+/*
+ * The head.S code sets up the kernel high mapping from:
+ * __START_KERNEL_map to __START_KERNEL_map + KERNEL_TEXT_SIZE
+ *
+ * phys_addr holds the negative offset to the kernel, which is added
+ * to the compile time generated pmds. This results in invalid pmds up
+ * to the point where we hit the physaddr 0 mapping.
+ *
+ * We limit the mappings to the region from _text to _end.  _end is
+ * rounded up to the 2MB boundary. This catches the invalid pmds as
+ * well, as they are located before _text:
+ */
+void __init cleanup_highmap(void)
+{
+   unsigned long vaddr = __START_KERNEL_map;
+   unsigned long end = round_up((unsigned long)_end, PMD_SIZE) - 1;
+   pmd_t *pmd = level2_kernel_pgt;
+   pmd_t *last_pmd = pmd + PTRS_PER_PMD;
+
+   for (; pmd < last_pmd; pmd++, vaddr += PMD_SIZE) {
+   if (!pmd_present(*pmd))
+   continue;
+   if (vaddr < (unsigned long) _text || vaddr > end)
+   set_pmd(pmd, __pmd(0));
+   }
+}
+
 /* NOTE: this is meant to be run only at boot */
 void __init
 __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 1aecc65..59898fb 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -494,11 +494,13 @@ void __init numa_initmem_init(unsigned long start_pfn, 
unsigned long end_pfn)
int i;
 
nodes_clear(node_possible_map);
+   nodes_clear(node_online_map);
 
 #ifdef 

[GIT Pull] x86 updates

2008-02-18 Thread Thomas Gleixner
Linus,

please pull x86 updates from

  ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

The updates are:

- fix the fallout of the CPA changes. This fixes the review issues
  and some other problems, which were discovered by extended
  testcases.

- fix for NUMA systems were node 0 is not online

- lguest build fix which Rusty asked us to merge

Thanks,
tglx
---

Rusty Russell (1):
  x86: fix lguest build failure

Thomas Gleixner (4):
  x86: CPA, fix alias checks
  x86: zap invalid and unused pmds in early boot
  x86: CPA no alias checking for _NX
  x86: CPA: avoid double checking of alias ranges

Yinghai Lu (1):
  x86: reenable support for system without on node0

 arch/x86/kernel/asm-offsets_32.c |6 +-
 arch/x86/kernel/head64.c |3 +
 arch/x86/kernel/head_64.S|7 +-
 arch/x86/mm/init_64.c|   27 +
 arch/x86/mm/numa_64.c|5 +-
 arch/x86/mm/pageattr.c   |  208 --
 include/asm-x86/pgtable_64.h |1 +
 7 files changed, 154 insertions(+), 103 deletions(-)
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index afd8446..a33d530 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -20,10 +20,8 @@
 
 #include xen/interface/xen.h
 
-#ifdef CONFIG_LGUEST_GUEST
 #include linux/lguest.h
 #include ../../../drivers/lguest/lg.h
-#endif
 
 #define DEFINE(sym, val) \
 asm volatile(\n- #sym  %0  #val : : i (val))
@@ -134,6 +132,10 @@ void foo(void)
BLANK();
OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);
OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);
+#endif
+
+#ifdef CONFIG_LGUEST
+   BLANK();
OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);
OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);
OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3);
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 24dbf56..ad24408 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -88,6 +88,9 @@ void __init x86_64_start_kernel(char * real_mode_data)
/* Make NULL pointers segfault */
zap_identity_mappings();
 
+   /* Cleanup the over mapped high alias */
+   cleanup_highmap();
+
for (i = 0; i  IDT_ENTRIES; i++) {
 #ifdef CONFIG_EARLY_PRINTK
set_intr_gate(i, early_idt_handlers[i]);
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 09b38d5..53e5820 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -107,8 +107,13 @@ startup_64:
movq%rdx, 0(%rbx, %rax, 8)
 ident_complete:
 
-   /* Fixup the kernel text+data virtual addresses
+   /*
+* Fixup the kernel text+data virtual addresses. Note that
+* we might write invalid pmds, when the kernel is relocated
+* cleanup_highmap() fixes this up along with the mappings
+* beyond _end.
 */
+
leaqlevel2_kernel_pgt(%rip), %rdi
leaq4096(%rdi), %r8
/* See if it is a valid page table entry */
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index a4a9ccc..bb652f5 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -171,6 +171,33 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, 
pgprot_t prot)
__flush_tlb_one(vaddr);
 }
 
+/*
+ * The head.S code sets up the kernel high mapping from:
+ * __START_KERNEL_map to __START_KERNEL_map + KERNEL_TEXT_SIZE
+ *
+ * phys_addr holds the negative offset to the kernel, which is added
+ * to the compile time generated pmds. This results in invalid pmds up
+ * to the point where we hit the physaddr 0 mapping.
+ *
+ * We limit the mappings to the region from _text to _end.  _end is
+ * rounded up to the 2MB boundary. This catches the invalid pmds as
+ * well, as they are located before _text:
+ */
+void __init cleanup_highmap(void)
+{
+   unsigned long vaddr = __START_KERNEL_map;
+   unsigned long end = round_up((unsigned long)_end, PMD_SIZE) - 1;
+   pmd_t *pmd = level2_kernel_pgt;
+   pmd_t *last_pmd = pmd + PTRS_PER_PMD;
+
+   for (; pmd  last_pmd; pmd++, vaddr += PMD_SIZE) {
+   if (!pmd_present(*pmd))
+   continue;
+   if (vaddr  (unsigned long) _text || vaddr  end)
+   set_pmd(pmd, __pmd(0));
+   }
+}
+
 /* NOTE: this is meant to be run only at boot */
 void __init
 __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 1aecc65..59898fb 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -494,11 +494,13 @@ void __init numa_initmem_init(unsigned long start_pfn, 
unsigned long end_pfn)
int i;
 
nodes_clear(node_possible_map);
+   

Re: [git pull] x86 updates

2008-02-15 Thread Ingo Molnar

* Avi Kivity <[EMAIL PROTECTED]> wrote:

>> thanks, applied - this first looked like a KVM item, that's why i 
>> havent added it. [Btw., feel free to push it via kvm.git as well - as 
>> long as you are sure it does not break the build ;-) ]
>
> Yeah, I'm queuing it as well, it will get there one way or the other.

x86.git won that race ;-)

i've had a good deal of build testing done with that patch and there's 
no [bzImage-level] build breakage that i can report. Which is not a 
surprise, the quality of arch/x86/kvm/ is outstandingly high:

  $ code-quality arch/x86/kvm/

   errors   lines of code   errors/KLOC
  arch/x86/kvm/29   14566   1.9

as a comparison:

   errors   lines of code   errors/KLOC
  kernel/ 729   92796   7.8

see: http://redhat.com/~mingo/x86.git/code-quality . It's as arbitrary 
of a metric as all static code metrics, but the numbers it emits are 
surprisingly close to my personal estimation of the cleanliness of some 
in-kernel codebases i ran it again.

[ hint, try "code-quality kernel/sched.c" too ;-) ]

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-15 Thread Ingo Molnar

* Avi Kivity [EMAIL PROTECTED] wrote:

 thanks, applied - this first looked like a KVM item, that's why i 
 havent added it. [Btw., feel free to push it via kvm.git as well - as 
 long as you are sure it does not break the build ;-) ]

 Yeah, I'm queuing it as well, it will get there one way or the other.

x86.git won that race ;-)

i've had a good deal of build testing done with that patch and there's 
no [bzImage-level] build breakage that i can report. Which is not a 
surprise, the quality of arch/x86/kvm/ is outstandingly high:

  $ code-quality arch/x86/kvm/

   errors   lines of code   errors/KLOC
  arch/x86/kvm/29   14566   1.9

as a comparison:

   errors   lines of code   errors/KLOC
  kernel/ 729   92796   7.8

see: http://redhat.com/~mingo/x86.git/code-quality . It's as arbitrary 
of a metric as all static code metrics, but the numbers it emits are 
surprisingly close to my personal estimation of the cleanliness of some 
in-kernel codebases i ran it again.

[ hint, try code-quality kernel/sched.c too ;-) ]

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Balbir Singh
Avi Kivity wrote:
> Ingo Molnar wrote:
>> * Balbir Singh <[EMAIL PROTECTED]> wrote:
>>
>>  
>>> Ingo, could you also please consider the KVM build fix at
>>> http://marc.info/?l=linux-kernel=120262794315024=2 which has been
>>> acked by Avi. I suspect this patch should be route through git-x86
>>> since it affects arch/x86/Kconfig.
>>> 
>>
>> thanks, applied - this first looked like a KVM item, that's why i
>> havent added it. [Btw., feel free to push it via kvm.git as well - as
>> long as you are sure it does not break the build ;-) ]   
> 
> Yeah, I'm queuing it as well, it will get there one way or the other.
> 

Excellent! :)

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Avi Kivity

Ingo Molnar wrote:

* Balbir Singh <[EMAIL PROTECTED]> wrote:

  
Ingo, could you also please consider the KVM build fix at 
http://marc.info/?l=linux-kernel=120262794315024=2 which has been 
acked by Avi. I suspect this patch should be route through git-x86 
since it affects arch/x86/Kconfig.



thanks, applied - this first looked like a KVM item, that's why i havent 
added it. [Btw., feel free to push it via kvm.git as well - as long as 
you are sure it does not break the build ;-) ]	


Yeah, I'm queuing it as well, it will get there one way or the other.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Andi Kleen
On Thu, Feb 14, 2008 at 04:19:53PM +0100, Ingo Molnar wrote:
> 
> * Andi Kleen <[EMAIL PROTECTED]> wrote:
> 
> > Ingo Molnar <[EMAIL PROTECTED]> writes:
> > >
> > > Thomas Gleixner (1):
> > >   x86: EFI: fix use of unitialized variable and the cache logic
> > 
> > Your honor, I would like to register a differing opinion...
> 
> As i mentioned it (in the portion of my email that you clipped), there 
> are other pending CPA patches in x86.git:
> 
> > > [there are more CPA cleanups still brewing but none of that is 
> > > urgent.]
> 
> We didnt plan to push these secondary alias fixes out yet with 
> yesterday's push, and i disagree with you about their urgency.
> 
> > I submitted that fix originally in a different form, but it got 
> > finally stripped down to this. However in my opinion the full version 
> > of the patch is still needed, otherwise EFI still does the mapping 
> > wrong.
> 
> well, not really. Firtly, and most importantly, can you see any failures 
> on any real boxes?

I don't have any EFI boxes.

However with the one bug I found recently (set_memory_uc passed
in bytes for numpages) I doubt it was ever tested in the current
form in tree (perhaps it came from some merge mistake?)

> have little practical relevance today. Getting the _primary_ 

The original motivation for pageattr.c back in 2002 was a very real
problem with AGP cache corruption coming from the direct mapping aliases.

Also while I was still maintaining that code and occasionally broke
it :-] I usually got reports after 1-2 releases from people who were hitting 
real failures from the breakage (given a lot of that was the proprietary Nvidia
driver, but I see no reason it won't hit on completely free software too) 

So from practical experience I beg to disagree.


> alias right is the most important task of CPA and -git does that all 
> correctly. (we'd be seeing crashes left and right in -rc1 if it didnt)


No you don't see quick crashes left and right from alias attributes,
but subtle cache corruptions after a long time. That is because
it only causes problems when the CPU does some prefetching on
the wrong address and that typically takes some time to happen.

The typical symptom is that at some point (after many hours) 
someone's 3d driver errors out with some internal inconsistency when the 
3d card happened to be feed a corrupted cache line.

But I have no doubts that non 3d workloads will hit it eventually
too (just takes longer because they tend to move much less data) 

 
> Firstly, what we do currently incorrectly (and which is fixed in 
> x86.git) is that we do a __pa() on a vmalloc/ioremap-range address on 
> 64-bit in secondary alias discovery. But as i showed it to you days ago 

First before you started rewriting ioremap that all worked correctly[1]
since quite some releases. I fixed this originally long ago
(it was already in 2.6.12; I'm too lazy to search back further) 

So 2.6.25 would be the first kernel since at least 2.6.12 that 
would not do this correctly.

I polititely request that you do something about this regression
for .25.  Either apply my patches or fix it yourself in whatever
way you want. Just fix it.

[1] modulo the relatively minor problem of end_pfn_map sometimes
being a few pages off I recently sent a patch for.

> in my reply, while it will yield a "random" looking address, but that 
> address is a guaranteed-high physical address in the higher than 
> 0x4100 (i.e. 65TB+) physical range, so we'll just return 

Again 64bit efi_ioremap passes in a fixmap address.
And fixmap is >= the kernel mapping so __pa() will resolve it
to a physical address <= 2GB.

Your 65TB analysis assumed it passed in the vmalloc/ioremap range.
The analysis would be fine for that (although still dubious code).
Unfortunately it had a faulty starting point.

For 32bit it also was wrong I think for the more obscure __PAGE_OFFSET
splits. This is it likely was ok[1] for the default 3:1 but not e.g.
for 1:3.

[1] ok as in not clearly broken; not clean code.
 
> Secondly, your suggestion that inconsistent caching attribute aliases 
> are not permitted is incorrect. They are very much not allowed under 
> PAT, 

_PCD is PAT Even if you don't change the PAT MSRs ever setting
_PCD anywhere makes you a PAT user. And ioremap definitely sets
_PCD.

> and they are "nice to avoid" even on non-PAT (early CPU iterations 

It's not "nice to avoid". It's "if you don't avoid it your cache
will be eventually corrupted". And yes we've had this case 
in the past where it broke real setups.

> Anyway, please take a look at today's x86.git#mm:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git mm
> 
> it should handle secondary aliases correctly - but we are still working 
> on some other cleanups to make it complete.

Ok cpa_check_alias seems to be gone again. That's at least some progress.
And all the __pas are gone too. That's good.

I see you started to follow 

Re: [git pull] x86 updates

2008-02-14 Thread Ingo Molnar

* Balbir Singh <[EMAIL PROTECTED]> wrote:

> Ingo, could you also please consider the KVM build fix at 
> http://marc.info/?l=linux-kernel=120262794315024=2 which has been 
> acked by Avi. I suspect this patch should be route through git-x86 
> since it affects arch/x86/Kconfig.

thanks, applied - this first looked like a KVM item, that's why i havent 
added it. [Btw., feel free to push it via kvm.git as well - as long as 
you are sure it does not break the build ;-) ]

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Ingo Molnar

* Andi Kleen <[EMAIL PROTECTED]> wrote:

> Ingo Molnar <[EMAIL PROTECTED]> writes:
> >
> > Thomas Gleixner (1):
> >   x86: EFI: fix use of unitialized variable and the cache logic
> 
> Your honor, I would like to register a differing opinion...

As i mentioned it (in the portion of my email that you clipped), there 
are other pending CPA patches in x86.git:

> > [there are more CPA cleanups still brewing but none of that is 
> > urgent.]

We didnt plan to push these secondary alias fixes out yet with 
yesterday's push, and i disagree with you about their urgency.

> I submitted that fix originally in a different form, but it got 
> finally stripped down to this. However in my opinion the full version 
> of the patch is still needed, otherwise EFI still does the mapping 
> wrong.

well, not really. Firtly, and most importantly, can you see any failures 
on any real boxes?

I'd be surprised if you could see any failures, because secondary 
aliases have little practical relevance today. Getting the _primary_ 
alias right is the most important task of CPA and -git does that all 
correctly. (we'd be seeing crashes left and right in -rc1 if it didnt)

Secondary virtual alias discovery indeed has an ugly-looking but 
fortunately harmless bug in -git (fixed in x86.git#mm).

The fix is rather straightforward, but we want to test it some more. 
We'll push the fix probably before -rc2 though, in the next few days.

> On 64bit cpa will still change cache attributes on random low pages 
> and cause illegal caching attribute aliases on both 32bit and 64bit.

Well, this is moot with latest x86.git, but you are still wrong.

Firstly, what we do currently incorrectly (and which is fixed in 
x86.git) is that we do a __pa() on a vmalloc/ioremap-range address on 
64-bit in secondary alias discovery. But as i showed it to you days ago 
in my reply, while it will yield a "random" looking address, but that 
address is a guaranteed-high physical address in the higher than 
0x4100 (i.e. 65TB+) physical range, so we'll just return 
harmlessly from the filter function. So yes, it's very much ugly and 
unintended and we've been working on fixing it (and have fixed it).

Secondly, your suggestion that inconsistent caching attribute aliases 
are not permitted is incorrect. They are very much not allowed under 
PAT, and they are "nice to avoid" even on non-PAT (early CPU iterations 
sometimes have erratas in this area), but we always had them in one way 
or another - permanently and temporarily as well. What Linux still 
relies on fundamentally for cache attributes are the MTRR attributes.

Anyway, please take a look at today's x86.git#mm:

  git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git mm

it should handle secondary aliases correctly - but we are still working 
on some other cleanups to make it complete.

If anyone proves us wrong (with a specific example - what is mapped 
where, and what bad effect does it have, or if it's available a 
crashlog, etc.) we'll certainly reconsider.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Andi Kleen
Ingo Molnar <[EMAIL PROTECTED]> writes:
>
> Thomas Gleixner (1):
>   x86: EFI: fix use of unitialized variable and the cache logic

Your honor, I would like to register a differing opinion...

I submitted that fix originally in a different form, but it
got finally stripped down to this. However in my opinion
the full version of the patch is still needed, otherwise
EFI still does the mapping wrong.

Even with this patch EFI still passes in ioremap (on 32bit)  and fixmap (on 
64bit)
addresses to cpa which it will mishandle.

On 64bit cpa will still change cache attributes on random low pages and
cause illegal caching attribute aliases on both 32bit and 64bit.

See http://marc.info/?l=linux-kernel=120290071713708=2 for details.

git-x86#mm made some attempts to also fix this in pageattr.c which
fixed some parts of the problem on 64bit (static_protections should be
ok now),  but not all (alias handling still not good)  

See http://marc.info/?l=linux-kernel=120290203315953=2
for details

In particular the direct mapping cache alias handling for
ioremap/fixmap (and EFI uses that) is not correct on both 32bit and
64bit. 

Also all ioremaps have this same problem so all uncached mappings are
broken when the direct mapping happens to overlap them (common on
64bit with enough RAM).  Right now when you do a uncached ioremap the
direct mapping will not be changed, which causes illegal
conflicting caching aliasing.

My original patch above avoided that by not calling set_memory_uc()
for the EFI case, but I did not fix the general ioremap case for
other users yet (will send a patch later for this unless someone 
beats me to it)

Note even with ioremap generally fixed the original patch
http://marc.info/?l=linux-kernel=120284838904660=2
in its full form will be still needed to pass in the correct attribute 
to ioremap in the first place.

I would recommend to either mark EFI CONFIG_BROKEN for now 
or apply the complete patch I posted earlier 
http://marc.info/?l=linux-kernel=120284838904660=2
or fix it in some other way in pageattr.c as described in
http://marc.info/?l=linux-kernel=120290203315953=2 
(although that might be intrusive and I don't think such a change
would be a good idea at this stage of the release) 

And a separate patch fixing ioremap_nocache() will be needed too.

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Andi Kleen
Ingo Molnar [EMAIL PROTECTED] writes:

 Thomas Gleixner (1):
   x86: EFI: fix use of unitialized variable and the cache logic

Your honor, I would like to register a differing opinion...

I submitted that fix originally in a different form, but it
got finally stripped down to this. However in my opinion
the full version of the patch is still needed, otherwise
EFI still does the mapping wrong.

Even with this patch EFI still passes in ioremap (on 32bit)  and fixmap (on 
64bit)
addresses to cpa which it will mishandle.

On 64bit cpa will still change cache attributes on random low pages and
cause illegal caching attribute aliases on both 32bit and 64bit.

See http://marc.info/?l=linux-kernelm=120290071713708w=2 for details.

git-x86#mm made some attempts to also fix this in pageattr.c which
fixed some parts of the problem on 64bit (static_protections should be
ok now),  but not all (alias handling still not good)  

See http://marc.info/?l=linux-kernelm=120290203315953w=2
for details

In particular the direct mapping cache alias handling for
ioremap/fixmap (and EFI uses that) is not correct on both 32bit and
64bit. 

Also all ioremaps have this same problem so all uncached mappings are
broken when the direct mapping happens to overlap them (common on
64bit with enough RAM).  Right now when you do a uncached ioremap the
direct mapping will not be changed, which causes illegal
conflicting caching aliasing.

My original patch above avoided that by not calling set_memory_uc()
for the EFI case, but I did not fix the general ioremap case for
other users yet (will send a patch later for this unless someone 
beats me to it)

Note even with ioremap generally fixed the original patch
http://marc.info/?l=linux-kernelm=120284838904660w=2
in its full form will be still needed to pass in the correct attribute 
to ioremap in the first place.

I would recommend to either mark EFI CONFIG_BROKEN for now 
or apply the complete patch I posted earlier 
http://marc.info/?l=linux-kernelm=120284838904660w=2
or fix it in some other way in pageattr.c as described in
http://marc.info/?l=linux-kernelm=120290203315953w=2 
(although that might be intrusive and I don't think such a change
would be a good idea at this stage of the release) 

And a separate patch fixing ioremap_nocache() will be needed too.

-Andi
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Ingo Molnar

* Andi Kleen [EMAIL PROTECTED] wrote:

 Ingo Molnar [EMAIL PROTECTED] writes:
 
  Thomas Gleixner (1):
x86: EFI: fix use of unitialized variable and the cache logic
 
 Your honor, I would like to register a differing opinion...

As i mentioned it (in the portion of my email that you clipped), there 
are other pending CPA patches in x86.git:

  [there are more CPA cleanups still brewing but none of that is 
  urgent.]

We didnt plan to push these secondary alias fixes out yet with 
yesterday's push, and i disagree with you about their urgency.

 I submitted that fix originally in a different form, but it got 
 finally stripped down to this. However in my opinion the full version 
 of the patch is still needed, otherwise EFI still does the mapping 
 wrong.

well, not really. Firtly, and most importantly, can you see any failures 
on any real boxes?

I'd be surprised if you could see any failures, because secondary 
aliases have little practical relevance today. Getting the _primary_ 
alias right is the most important task of CPA and -git does that all 
correctly. (we'd be seeing crashes left and right in -rc1 if it didnt)

Secondary virtual alias discovery indeed has an ugly-looking but 
fortunately harmless bug in -git (fixed in x86.git#mm).

The fix is rather straightforward, but we want to test it some more. 
We'll push the fix probably before -rc2 though, in the next few days.

 On 64bit cpa will still change cache attributes on random low pages 
 and cause illegal caching attribute aliases on both 32bit and 64bit.

Well, this is moot with latest x86.git, but you are still wrong.

Firstly, what we do currently incorrectly (and which is fixed in 
x86.git) is that we do a __pa() on a vmalloc/ioremap-range address on 
64-bit in secondary alias discovery. But as i showed it to you days ago 
in my reply, while it will yield a random looking address, but that 
address is a guaranteed-high physical address in the higher than 
0x4100 (i.e. 65TB+) physical range, so we'll just return 
harmlessly from the filter function. So yes, it's very much ugly and 
unintended and we've been working on fixing it (and have fixed it).

Secondly, your suggestion that inconsistent caching attribute aliases 
are not permitted is incorrect. They are very much not allowed under 
PAT, and they are nice to avoid even on non-PAT (early CPU iterations 
sometimes have erratas in this area), but we always had them in one way 
or another - permanently and temporarily as well. What Linux still 
relies on fundamentally for cache attributes are the MTRR attributes.

Anyway, please take a look at today's x86.git#mm:

  git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git mm

it should handle secondary aliases correctly - but we are still working 
on some other cleanups to make it complete.

If anyone proves us wrong (with a specific example - what is mapped 
where, and what bad effect does it have, or if it's available a 
crashlog, etc.) we'll certainly reconsider.

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Andi Kleen
On Thu, Feb 14, 2008 at 04:19:53PM +0100, Ingo Molnar wrote:
 
 * Andi Kleen [EMAIL PROTECTED] wrote:
 
  Ingo Molnar [EMAIL PROTECTED] writes:
  
   Thomas Gleixner (1):
 x86: EFI: fix use of unitialized variable and the cache logic
  
  Your honor, I would like to register a differing opinion...
 
 As i mentioned it (in the portion of my email that you clipped), there 
 are other pending CPA patches in x86.git:
 
   [there are more CPA cleanups still brewing but none of that is 
   urgent.]
 
 We didnt plan to push these secondary alias fixes out yet with 
 yesterday's push, and i disagree with you about their urgency.
 
  I submitted that fix originally in a different form, but it got 
  finally stripped down to this. However in my opinion the full version 
  of the patch is still needed, otherwise EFI still does the mapping 
  wrong.
 
 well, not really. Firtly, and most importantly, can you see any failures 
 on any real boxes?

I don't have any EFI boxes.

However with the one bug I found recently (set_memory_uc passed
in bytes for numpages) I doubt it was ever tested in the current
form in tree (perhaps it came from some merge mistake?)

 have little practical relevance today. Getting the _primary_ 

The original motivation for pageattr.c back in 2002 was a very real
problem with AGP cache corruption coming from the direct mapping aliases.

Also while I was still maintaining that code and occasionally broke
it :-] I usually got reports after 1-2 releases from people who were hitting 
real failures from the breakage (given a lot of that was the proprietary Nvidia
driver, but I see no reason it won't hit on completely free software too) 

So from practical experience I beg to disagree.


 alias right is the most important task of CPA and -git does that all 
 correctly. (we'd be seeing crashes left and right in -rc1 if it didnt)


No you don't see quick crashes left and right from alias attributes,
but subtle cache corruptions after a long time. That is because
it only causes problems when the CPU does some prefetching on
the wrong address and that typically takes some time to happen.

The typical symptom is that at some point (after many hours) 
someone's 3d driver errors out with some internal inconsistency when the 
3d card happened to be feed a corrupted cache line.

But I have no doubts that non 3d workloads will hit it eventually
too (just takes longer because they tend to move much less data) 

 
 Firstly, what we do currently incorrectly (and which is fixed in 
 x86.git) is that we do a __pa() on a vmalloc/ioremap-range address on 
 64-bit in secondary alias discovery. But as i showed it to you days ago 

First before you started rewriting ioremap that all worked correctly[1]
since quite some releases. I fixed this originally long ago
(it was already in 2.6.12; I'm too lazy to search back further) 

So 2.6.25 would be the first kernel since at least 2.6.12 that 
would not do this correctly.

I polititely request that you do something about this regression
for .25.  Either apply my patches or fix it yourself in whatever
way you want. Just fix it.

[1] modulo the relatively minor problem of end_pfn_map sometimes
being a few pages off I recently sent a patch for.

 in my reply, while it will yield a random looking address, but that 
 address is a guaranteed-high physical address in the higher than 
 0x4100 (i.e. 65TB+) physical range, so we'll just return 

Again 64bit efi_ioremap passes in a fixmap address.
And fixmap is = the kernel mapping so __pa() will resolve it
to a physical address = 2GB.

Your 65TB analysis assumed it passed in the vmalloc/ioremap range.
The analysis would be fine for that (although still dubious code).
Unfortunately it had a faulty starting point.

For 32bit it also was wrong I think for the more obscure __PAGE_OFFSET
splits. This is it likely was ok[1] for the default 3:1 but not e.g.
for 1:3.

[1] ok as in not clearly broken; not clean code.
 
 Secondly, your suggestion that inconsistent caching attribute aliases 
 are not permitted is incorrect. They are very much not allowed under 
 PAT, 

_PCD is PAT Even if you don't change the PAT MSRs ever setting
_PCD anywhere makes you a PAT user. And ioremap definitely sets
_PCD.

 and they are nice to avoid even on non-PAT (early CPU iterations 

It's not nice to avoid. It's if you don't avoid it your cache
will be eventually corrupted. And yes we've had this case 
in the past where it broke real setups.

 Anyway, please take a look at today's x86.git#mm:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git mm
 
 it should handle secondary aliases correctly - but we are still working 
 on some other cleanups to make it complete.

Ok cpa_check_alias seems to be gone again. That's at least some progress.
And all the __pas are gone too. That's good.

I see you started to follow 
http://marc.info/?l=linux-kernelm=120290203315953w=2
too which is also good although I haven't checked if it's 

Re: [git pull] x86 updates

2008-02-14 Thread Avi Kivity

Ingo Molnar wrote:

* Balbir Singh [EMAIL PROTECTED] wrote:

  
Ingo, could you also please consider the KVM build fix at 
http://marc.info/?l=linux-kernelm=120262794315024w=2 which has been 
acked by Avi. I suspect this patch should be route through git-x86 
since it affects arch/x86/Kconfig.



thanks, applied - this first looked like a KVM item, that's why i havent 
added it. [Btw., feel free to push it via kvm.git as well - as long as 
you are sure it does not break the build ;-) ]	


Yeah, I'm queuing it as well, it will get there one way or the other.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-14 Thread Balbir Singh
Avi Kivity wrote:
 Ingo Molnar wrote:
 * Balbir Singh [EMAIL PROTECTED] wrote:

  
 Ingo, could you also please consider the KVM build fix at
 http://marc.info/?l=linux-kernelm=120262794315024w=2 which has been
 acked by Avi. I suspect this patch should be route through git-x86
 since it affects arch/x86/Kconfig.
 

 thanks, applied - this first looked like a KVM item, that's why i
 havent added it. [Btw., feel free to push it via kvm.git as well - as
 long as you are sure it does not break the build ;-) ]   
 
 Yeah, I'm queuing it as well, it will get there one way or the other.
 

Excellent! :)

-- 
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-13 Thread Balbir Singh
Ingo, could you also please consider the KVM build fix at
http://marc.info/?l=linux-kernel=120262794315024=2 which has been
acked by Avi. I suspect this patch should be route through git-x86
since it affects arch/x86/Kconfig.

Balbir

PS: Modified cc's to reduce the noise.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[git pull] x86 updates

2008-02-13 Thread Ingo Molnar

Linus, please pull the latest x86 git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

Shortlog and diffstat attached below.

low-key fixes and updates. 2.6.25-rc1 looks pretty solid so far in terms 
of arch/x86 with no major regression reported against the 1000+ x86.git 
commits. (no native kernel boot problem or runtime failure/crash - there 
was one paravirt boot crash report)

The gcc sigcontext.h header fixes, the Xen-guest boot fixes and the EFI 
fixes stand out. [there are more CPA cleanups still brewing but none of 
that is urgent.]

Ingo

-->
Andi Kleen (1):
  x86: CPA: fix gbpages support in try_preserve_large_page

Harvey Harrison (1):
  x86: pit_clockevent can be static

Huang, Ying (1):
  x86: EFI runtime code mapping enhancement

Ingo Molnar (1):
  x86: fix sigcontext.h user export

Jeremy Fitzhardinge (2):
  x86/early_ioremap: don't assume we're using swapper_pg_dir
  xen: unpin initial Xen pagetable once we're finished with it

Jody Belka (1):
  x86: fixup machine_ops reboot_{32|64}.c unification fallout

Thomas Gleixner (1):
  x86: EFI: fix use of unitialized variable and the cache logic

 arch/x86/kernel/efi.c|   12 +++
 arch/x86/kernel/efi_64.c |   32 
 arch/x86/kernel/i8253.c  |2 +-
 arch/x86/kernel/reboot.c |   46 +++--
 arch/x86/mm/ioremap.c|4 ++-
 arch/x86/mm/pageattr.c   |4 +-
 arch/x86/xen/enlighten.c |4 ++
 include/asm-x86/sigcontext.h |   66 ++
 8 files changed, 130 insertions(+), 40 deletions(-)

diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 32dd62b..cbdf9ba 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -384,9 +384,6 @@ static void __init runtime_code_page_mkexec(void)
efi_memory_desc_t *md;
void *p;
 
-   if (!(__supported_pte_mask & _PAGE_NX))
-   return;
-
/* Make EFI runtime service code area executable */
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
md = p;
@@ -428,9 +425,6 @@ void __init efi_enter_virtual_mode(void)
else
va = efi_ioremap(md->phys_addr, size);
 
-   if (md->attribute & EFI_MEMORY_WB)
-   set_memory_uc(md->virt_addr, size);
-
md->virt_addr = (u64) (unsigned long) va;
 
if (!va) {
@@ -439,6 +433,9 @@ void __init efi_enter_virtual_mode(void)
continue;
}
 
+   if (!(md->attribute & EFI_MEMORY_WB))
+   set_memory_uc(md->virt_addr, size);
+
systab = (u64) (unsigned long) efi_phys.systab;
if (md->phys_addr <= systab && systab < end) {
systab += md->virt_addr - md->phys_addr;
@@ -476,7 +473,8 @@ void __init efi_enter_virtual_mode(void)
efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
efi.reset_system = virt_efi_reset_system;
efi.set_virtual_address_map = virt_efi_set_virtual_address_map;
-   runtime_code_page_mkexec();
+   if (__supported_pte_mask & _PAGE_NX)
+   runtime_code_page_mkexec();
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
memmap.map = NULL;
 }
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index 09d5c23..d143a1e 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static pgd_t save_pgd __initdata;
 static unsigned long efi_flags __initdata;
@@ -43,22 +44,15 @@ static void __init early_mapping_set_exec(unsigned long 
start,
  unsigned long end,
  int executable)
 {
-   pte_t *kpte;
-   unsigned int level;
-
-   while (start < end) {
-   kpte = lookup_address((unsigned long)__va(start), );
-   BUG_ON(!kpte);
-   if (executable)
-   set_pte(kpte, pte_mkexec(*kpte));
-   else
-   set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX) & \
-   __supported_pte_mask));
-   if (level == PG_LEVEL_4K)
-   start = (start + PAGE_SIZE) & PAGE_MASK;
-   else
-   start = (start + PMD_SIZE) & PMD_MASK;
-   }
+   unsigned long num_pages;
+
+   start &= PMD_MASK;
+   end = (end + PMD_SIZE - 1) & PMD_MASK;
+   num_pages = (end - start) >> PAGE_SHIFT;
+   if (executable)
+   set_memory_x((unsigned long)__va(start), num_pages);
+   else
+   set_memory_nx((unsigned long)__va(start), num_pages);
 }
 
 static void __init early_runtime_code_mapping_set_exec(int executable)
@@ -74,7 +68,7 

[git pull] x86 updates

2008-02-13 Thread Ingo Molnar

Linus, please pull the latest x86 git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

Shortlog and diffstat attached below.

low-key fixes and updates. 2.6.25-rc1 looks pretty solid so far in terms 
of arch/x86 with no major regression reported against the 1000+ x86.git 
commits. (no native kernel boot problem or runtime failure/crash - there 
was one paravirt boot crash report)

The gcc sigcontext.h header fixes, the Xen-guest boot fixes and the EFI 
fixes stand out. [there are more CPA cleanups still brewing but none of 
that is urgent.]

Ingo

--
Andi Kleen (1):
  x86: CPA: fix gbpages support in try_preserve_large_page

Harvey Harrison (1):
  x86: pit_clockevent can be static

Huang, Ying (1):
  x86: EFI runtime code mapping enhancement

Ingo Molnar (1):
  x86: fix sigcontext.h user export

Jeremy Fitzhardinge (2):
  x86/early_ioremap: don't assume we're using swapper_pg_dir
  xen: unpin initial Xen pagetable once we're finished with it

Jody Belka (1):
  x86: fixup machine_ops reboot_{32|64}.c unification fallout

Thomas Gleixner (1):
  x86: EFI: fix use of unitialized variable and the cache logic

 arch/x86/kernel/efi.c|   12 +++
 arch/x86/kernel/efi_64.c |   32 
 arch/x86/kernel/i8253.c  |2 +-
 arch/x86/kernel/reboot.c |   46 +++--
 arch/x86/mm/ioremap.c|4 ++-
 arch/x86/mm/pageattr.c   |4 +-
 arch/x86/xen/enlighten.c |4 ++
 include/asm-x86/sigcontext.h |   66 ++
 8 files changed, 130 insertions(+), 40 deletions(-)

diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 32dd62b..cbdf9ba 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -384,9 +384,6 @@ static void __init runtime_code_page_mkexec(void)
efi_memory_desc_t *md;
void *p;
 
-   if (!(__supported_pte_mask  _PAGE_NX))
-   return;
-
/* Make EFI runtime service code area executable */
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
md = p;
@@ -428,9 +425,6 @@ void __init efi_enter_virtual_mode(void)
else
va = efi_ioremap(md-phys_addr, size);
 
-   if (md-attribute  EFI_MEMORY_WB)
-   set_memory_uc(md-virt_addr, size);
-
md-virt_addr = (u64) (unsigned long) va;
 
if (!va) {
@@ -439,6 +433,9 @@ void __init efi_enter_virtual_mode(void)
continue;
}
 
+   if (!(md-attribute  EFI_MEMORY_WB))
+   set_memory_uc(md-virt_addr, size);
+
systab = (u64) (unsigned long) efi_phys.systab;
if (md-phys_addr = systab  systab  end) {
systab += md-virt_addr - md-phys_addr;
@@ -476,7 +473,8 @@ void __init efi_enter_virtual_mode(void)
efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
efi.reset_system = virt_efi_reset_system;
efi.set_virtual_address_map = virt_efi_set_virtual_address_map;
-   runtime_code_page_mkexec();
+   if (__supported_pte_mask  _PAGE_NX)
+   runtime_code_page_mkexec();
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
memmap.map = NULL;
 }
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index 09d5c23..d143a1e 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -35,6 +35,7 @@
 #include asm/tlbflush.h
 #include asm/proto.h
 #include asm/efi.h
+#include asm/cacheflush.h
 
 static pgd_t save_pgd __initdata;
 static unsigned long efi_flags __initdata;
@@ -43,22 +44,15 @@ static void __init early_mapping_set_exec(unsigned long 
start,
  unsigned long end,
  int executable)
 {
-   pte_t *kpte;
-   unsigned int level;
-
-   while (start  end) {
-   kpte = lookup_address((unsigned long)__va(start), level);
-   BUG_ON(!kpte);
-   if (executable)
-   set_pte(kpte, pte_mkexec(*kpte));
-   else
-   set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX)  \
-   __supported_pte_mask));
-   if (level == PG_LEVEL_4K)
-   start = (start + PAGE_SIZE)  PAGE_MASK;
-   else
-   start = (start + PMD_SIZE)  PMD_MASK;
-   }
+   unsigned long num_pages;
+
+   start = PMD_MASK;
+   end = (end + PMD_SIZE - 1)  PMD_MASK;
+   num_pages = (end - start)  PAGE_SHIFT;
+   if (executable)
+   set_memory_x((unsigned long)__va(start), num_pages);
+   else
+   set_memory_nx((unsigned long)__va(start), num_pages);
 }
 
 static void __init early_runtime_code_mapping_set_exec(int 

Re: [git pull] x86 updates

2008-02-13 Thread Balbir Singh
Ingo, could you also please consider the KVM build fix at
http://marc.info/?l=linux-kernelm=120262794315024w=2 which has been
acked by Avi. I suspect this patch should be route through git-x86
since it affects arch/x86/Kconfig.

Balbir

PS: Modified cc's to reduce the noise.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Ingo Molnar

* Thomas Gleixner <[EMAIL PROTECTED]> wrote:

> On Sun, 10 Feb 2008, Linus Torvalds wrote:
> > On Sat, 9 Feb 2008, Randy Dunlap wrote:
> > 
> > So Thomas, don't do this. I don't like it. The same way I didn't like 
> > seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
> > things separate - git is *really* good at having multiple branches with 
> > different lines of development, use it that way (or send odd-ball misc 
> > patches just as emails).
> 
> Please accept my apologies.
> 
> I went through the content, pointed out the other two non x86 patches 
> and did not notice the vsprintf one. My bad.

and i'd like to apologize for the misleading Subject line which said 
"Subject: x86: ...". That i think made us miss the generic impact later 
on (we remind ourselves about non-arch/x86 patches via Subject line 
annotations and via looking at the diffstat before pull requests), and 
the accidentally missing diffstat just removed the last-line defense 
against such annotation mistakes.

btw., i was -->.<--- this close to removing this patch from x86.git 
altogether - because it had a bug (which already shows its 
non-obviousness) and i didnt think this complication was worth it. When 
that happened i took a really hard look at its correctness and 
worthiness and narrowly decided to keep it - but enforced an unusually 
long testing interval for this patch.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Thomas Gleixner
On Sun, 10 Feb 2008, Linus Torvalds wrote:
> On Sat, 9 Feb 2008, Randy Dunlap wrote:
> 
> So Thomas, don't do this. I don't like it. The same way I didn't like 
> seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
> things separate - git is *really* good at having multiple branches with 
> different lines of development, use it that way (or send odd-ball misc 
> patches just as emails).

Please accept my apologies. 

I went through the content, pointed out the other two non x86 patches
and did not notice the vsprintf one. My bad.

> PS. And no, maybe I don't always notice. I bet maintainers can slip things 
> by me all the time without me waking up to it. The fact that it sometimes 
> works doesn't mean that it's a good idea, though - it just means that if I 
> catch it, my level of trust goes down. 

I know. And I have no intention to sneak stuff in that way.

Conclusions:
1) add diffstat to the pull request generator
2) add alert about non x86 stuff to it and send it separate
3) postpone pull requests to the morning hours, even if time is short

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Linus Torvalds


On Sat, 9 Feb 2008, Randy Dunlap wrote:

> On Sun, 10 Feb 2008 00:24:50 +0100 (CET) Thomas Gleixner wrote:
> 
> > Linus,
> > 
> > please pull the pending x86 updates from:
> > 
> >   ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
> > master
> 
> Hi Thomas,
> can we please get diffstats with git pull requests?

Well, not only that, but I actually pulled it once, then ended up undoing 
my pull, and had to think twice about whether I want to pull it at all.

I do *not* like it when subsystem maintainers start mixing in stuff into 
their subsystem pull that has absolutely _zero_ to do with that subsystem. 
In this case, we have commit 9b706aee7d92d6ac3002547aea12e3eaa0a750ae, 
which calls itself "x86: trivial printk optimizations", but it really has 
nothing AT ALL to do with x86 except that it also did the same things to 
the bogus x86 version of those routines.

The thing is, trying to mix up things like that into a subsystem pull 
means that now I cannot trust the subsystem maintainer as much! And what 
should be a simple "git pull" becomes not just the pull, but also me 
having to then scrounge around in the result to see if I really want to do 
the pull in the first place.

That's the point where the subsystem maintainer just makes me do 
unnecessary extra and stupid work!

In other words: DO NOT DO THINGS LIKE THAT!

That vsnprintf() optimization looks ok, but it really doesn't have 
anything what-so-ever to do with x86, and some of it is rather dubious and 
too clever by half for its own good, for rather little gain. For example, 
we have:

+/* Works only for digits and letters, but small and fast */
+#define TOLOWER(x) ((x) | 0x20)

but then later on we have:

-   if (cp[0] == '0' && toupper(cp[1]) == 'X')
+   if (cp[0] == '0' && TOLOWER(cp[1]) == 'x')

where we now use that new TOLOWER() macro on a character that is *not* 
guaranteed to be a digit or a letter at all!

Does it work? Yes, it does happen to work. If it's a non-character or a 
non-letter, it will do essentially random things, but it will never turn 
that non-character/letter into 'x' unless it was 'X' or 'x' before. So 
yes, it works, but let's face it, that clever trick saved something like 
two instructions and a branch from a code-path that wasn't really even 
critical!

In general, I don't disagree with being clever. People enjoy tricks like 
that, and I don't really disagree with the patch. That's not the problem I 
have. The problem I have is that I shouldn't be taken by surprise by these 
things, and start having to worry whether I can trust the person who sends 
me mis-labeled patches without even warning me.

So I had this thing in my tree, went out to dinner, came back and decided 
I don't want to pull it after all. Did some other work, and decided I have 
the time to look through it, and then re-pulled it.

But I was *this* close to just deciding that "ok, I'm ready to release the 
-rc1 kernel, I don't need this kind of aggravation" and just decided to 
not bother pulling something dubious.

So Thomas, don't do this. I don't like it. The same way I didn't like 
seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
things separate - git is *really* good at having multiple branches with 
different lines of development, use it that way (or send odd-ball misc 
patches just as emails).

But it's merged now.

Linus

PS. And no, maybe I don't always notice. I bet maintainers can slip things 
by me all the time without me waking up to it. The fact that it sometimes 
works doesn't mean that it's a good idea, though - it just means that if I 
catch it, my level of trust goes down. 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Linus Torvalds


On Sat, 9 Feb 2008, Randy Dunlap wrote:

 On Sun, 10 Feb 2008 00:24:50 +0100 (CET) Thomas Gleixner wrote:
 
  Linus,
  
  please pull the pending x86 updates from:
  
ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 
  master
 
 Hi Thomas,
 can we please get diffstats with git pull requests?

Well, not only that, but I actually pulled it once, then ended up undoing 
my pull, and had to think twice about whether I want to pull it at all.

I do *not* like it when subsystem maintainers start mixing in stuff into 
their subsystem pull that has absolutely _zero_ to do with that subsystem. 
In this case, we have commit 9b706aee7d92d6ac3002547aea12e3eaa0a750ae, 
which calls itself x86: trivial printk optimizations, but it really has 
nothing AT ALL to do with x86 except that it also did the same things to 
the bogus x86 version of those routines.

The thing is, trying to mix up things like that into a subsystem pull 
means that now I cannot trust the subsystem maintainer as much! And what 
should be a simple git pull becomes not just the pull, but also me 
having to then scrounge around in the result to see if I really want to do 
the pull in the first place.

That's the point where the subsystem maintainer just makes me do 
unnecessary extra and stupid work!

In other words: DO NOT DO THINGS LIKE THAT!

That vsnprintf() optimization looks ok, but it really doesn't have 
anything what-so-ever to do with x86, and some of it is rather dubious and 
too clever by half for its own good, for rather little gain. For example, 
we have:

+/* Works only for digits and letters, but small and fast */
+#define TOLOWER(x) ((x) | 0x20)

but then later on we have:

-   if (cp[0] == '0'  toupper(cp[1]) == 'X')
+   if (cp[0] == '0'  TOLOWER(cp[1]) == 'x')

where we now use that new TOLOWER() macro on a character that is *not* 
guaranteed to be a digit or a letter at all!

Does it work? Yes, it does happen to work. If it's a non-character or a 
non-letter, it will do essentially random things, but it will never turn 
that non-character/letter into 'x' unless it was 'X' or 'x' before. So 
yes, it works, but let's face it, that clever trick saved something like 
two instructions and a branch from a code-path that wasn't really even 
critical!

In general, I don't disagree with being clever. People enjoy tricks like 
that, and I don't really disagree with the patch. That's not the problem I 
have. The problem I have is that I shouldn't be taken by surprise by these 
things, and start having to worry whether I can trust the person who sends 
me mis-labeled patches without even warning me.

So I had this thing in my tree, went out to dinner, came back and decided 
I don't want to pull it after all. Did some other work, and decided I have 
the time to look through it, and then re-pulled it.

But I was *this* close to just deciding that ok, I'm ready to release the 
-rc1 kernel, I don't need this kind of aggravation and just decided to 
not bother pulling something dubious.

So Thomas, don't do this. I don't like it. The same way I didn't like 
seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
things separate - git is *really* good at having multiple branches with 
different lines of development, use it that way (or send odd-ball misc 
patches just as emails).

But it's merged now.

Linus

PS. And no, maybe I don't always notice. I bet maintainers can slip things 
by me all the time without me waking up to it. The fact that it sometimes 
works doesn't mean that it's a good idea, though - it just means that if I 
catch it, my level of trust goes down. 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Thomas Gleixner
On Sun, 10 Feb 2008, Linus Torvalds wrote:
 On Sat, 9 Feb 2008, Randy Dunlap wrote:
 
 So Thomas, don't do this. I don't like it. The same way I didn't like 
 seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
 things separate - git is *really* good at having multiple branches with 
 different lines of development, use it that way (or send odd-ball misc 
 patches just as emails).

Please accept my apologies. 

I went through the content, pointed out the other two non x86 patches
and did not notice the vsprintf one. My bad.

 PS. And no, maybe I don't always notice. I bet maintainers can slip things 
 by me all the time without me waking up to it. The fact that it sometimes 
 works doesn't mean that it's a good idea, though - it just means that if I 
 catch it, my level of trust goes down. 

I know. And I have no intention to sneak stuff in that way.

Conclusions:
1) add diffstat to the pull request generator
2) add alert about non x86 stuff to it and send it separate
3) postpone pull requests to the morning hours, even if time is short

Thanks,

tglx
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git pull] x86 updates

2008-02-10 Thread Ingo Molnar

* Thomas Gleixner [EMAIL PROTECTED] wrote:

 On Sun, 10 Feb 2008, Linus Torvalds wrote:
  On Sat, 9 Feb 2008, Randy Dunlap wrote:
  
  So Thomas, don't do this. I don't like it. The same way I didn't like 
  seeing Ingo trying to mix in a kgdb pull into his x86 pull. Keep these 
  things separate - git is *really* good at having multiple branches with 
  different lines of development, use it that way (or send odd-ball misc 
  patches just as emails).
 
 Please accept my apologies.
 
 I went through the content, pointed out the other two non x86 patches 
 and did not notice the vsprintf one. My bad.

and i'd like to apologize for the misleading Subject line which said 
Subject: x86:  That i think made us miss the generic impact later 
on (we remind ourselves about non-arch/x86 patches via Subject line 
annotations and via looking at the diffstat before pull requests), and 
the accidentally missing diffstat just removed the last-line defense 
against such annotation mistakes.

btw., i was --.--- this close to removing this patch from x86.git 
altogether - because it had a bug (which already shows its 
non-obviousness) and i didnt think this complication was worth it. When 
that happened i took a really hard look at its correctness and 
worthiness and narrowly decided to keep it - but enforced an unusually 
long testing interval for this patch.

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >