Skip to contentSkip to conversation

x86 fixes and updates

GIT PULL Ingo Molnar 1 participant 1 message Mar 29, 2012

Subsystems (9)
x86 ACPI Library code MIPS +5 more subsystems
lore
Share & tools
lore
#0 lore raw

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

HEAD: 8abc3122aa02567bfe626cd13f4d34853c9b1225 x86/apic/amd: Be more verbose about LVT offset assignments

Note, the following ended up in x86/urgent:

out-of-topic modifications in x86-urgent-for-linus:
---------------------------------------------------
arch/mips/configs/db1300_defconfig # e335e3e: locking/kconfig: Simplify INLINE_

 arch/xtensa/configs/iss_defconfig  # e335e3e: locking/kconfig: Simplify INLINE_
 include/linux/spinlock_api_smp.h   # e335e3e: locking/kconfig: Simplify INLINE_
 kernel/Kconfig.locks               # e335e3e: locking/kconfig: Simplify INLINE_
 kernel/Kconfig.preempt             # e335e3e: locking/kconfig: Simplify INLINE_
 kernel/spinlock.c                  # e335e3e: locking/kconfig: Simplify INLINE_

not in core/urgent where it would normally be, to keep the dependencies simpler.

Thanks,

Ingo

------------------>
Alexander Gordeev (1):
x86/io_apic: Move and reenable irq only when CONFIG_GENERIC_PENDING_IRQ=y

Dan Carpenter (1):
x86, tls: Off by one limit check

Daniel Drake (1):
x86/olpc: Add debugfs interface for EC commands

Hugh Dickins (1):
x86: Stop recursive fault in print_context_stack after stack overflow

Ingo Molnar (1):
x86/kconfig: Update defconfigs

Jeremy Fitzhardinge (1):
x86/ioapic: Add io_apic_ops driver layer to allow interception

Raghavendra K T (1):
locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage

Randy Dunlap (1):
x86/kconfig: Remove CONFIG_TR=y from the defconfigs

Richard Weinberger (1):

      x86: Merge the x86_32 and x86_64 cpu_idle() functions

Robert Richter (1):
x86/apic/amd: Be more verbose about LVT offset assignments

Steffen Persvold (1):
x86/apic: Add separate apic_id_valid() functions for selected apic drivers

Yinghai Lu (1):
x86: Fix excessive MSR print out when show_msr is not specified

 Documentation/ABI/testing/debugfs-olpc |   16 +++
 arch/mips/configs/db1300_defconfig     |    2 +-
 arch/x86/configs/i386_defconfig        |   64 +++++---------
 arch/x86/configs/x86_64_defconfig      |   67 +++++---------
 arch/x86/include/asm/apic.h            |    2 +-
 arch/x86/include/asm/idle.h            |    1 +
 arch/x86/include/asm/io_apic.h         |    9 ++
 arch/x86/include/asm/x2apic.h          |    5 +
 arch/x86/kernel/acpi/boot.c            |    2 +-
 arch/x86/kernel/apic/apic.c            |   13 ++-
 arch/x86/kernel/apic/apic_numachip.c   |    3 +-
 arch/x86/kernel/apic/io_apic.c         |  159 ++++++++++++++++++++++----------
 arch/x86/kernel/apic/x2apic_cluster.c  |    2 +-
 arch/x86/kernel/apic/x2apic_phys.c     |    2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c     |    7 +-
 arch/x86/kernel/cpu/common.c           |    2 +-
 arch/x86/kernel/dumpstack.c            |    7 +-
 arch/x86/kernel/process.c              |  114 +++++++++++++++++++++++
 arch/x86/kernel/process_32.c           |   58 ------------
 arch/x86/kernel/process_64.c           |  107 ---------------------
 arch/x86/kernel/tls.c                  |    4 +-
 arch/x86/mm/srat.c                     |    2 +-
 arch/x86/platform/olpc/olpc.c          |   97 +++++++++++++++++++
 arch/xtensa/configs/iss_defconfig      |    2 +-
 include/linux/spinlock_api_smp.h       |    2 +-
 kernel/Kconfig.locks                   |    4 +-
 kernel/Kconfig.preempt                 |    1 +
 kernel/spinlock.c                      |    2 +-
 lib/Kconfig.debug                      |    1 +
 29 files changed, 436 insertions(+), 321 deletions(-)
 create mode 100644 Documentation/ABI/testing/debugfs-olpc
Documentation/ABI/testing/debugfs-olpc new file +16 -0
new file mode 100644
index 0000000..bd76cc6
@@ -0,0 +1,16 @@
+What:		/sys/kernel/debug/olpc-ec/cmd
+Date:		Dec 2011
+KernelVersion:	3.4
+Contact:	[email protected]
+Description:
+
+A generic interface for executing OLPC Embedded Controller commands and
+reading their responses.
+
+To execute a command, write data with the format: CC:N A A A A
+CC is the (hex) command, N is the count of expected reply bytes, and A A A A
+are optional (hex) arguments.
+
+To read the response (if any), read from the generic node after executing
+a command. Hex reply bytes will be returned, *whether or not* they came from
+the immediately previous command.
arch/mips/configs/db1300_defconfig +1 -1
index c38b190..3590ab5 100644
@@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
-CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
 CONFIG_INLINE_READ_UNLOCK=y
 CONFIG_INLINE_READ_UNLOCK_IRQ=y
arch/x86/configs/i386_defconfig +22 -42

163 lines not on this page · raw message

arch/x86/configs/x86_64_defconfig +23 -44

178 lines not on this page · raw message

arch/x86/include/asm/apic.h +1 -1
index a9371c9..d3eaac4 100644
@@ -535,7 +535,7 @@ static inline unsigned int read_apic_id(void)
 
 static inline int default_apic_id_valid(int apicid)
 {
-	return x2apic_mode || (apicid < 255);
+	return (apicid < 255);
 }
 
 extern void default_setup_apic_routing(void);
arch/x86/include/asm/idle.h +1 -0
index f49253d7..c5d1785 100644
@@ -14,6 +14,7 @@ void exit_idle(void);
 #else /* !CONFIG_X86_64 */
 static inline void enter_idle(void) { }
 static inline void exit_idle(void) { }
+static inline void __exit_idle(void) { }
 #endif /* CONFIG_X86_64 */
 
 void amd_e400_remove_cpu(int cpu);
arch/x86/include/asm/io_apic.h +9 -0
index 690d1cc..2c4943d 100644
@@ -21,6 +21,15 @@
 #define IO_APIC_REDIR_LEVEL_TRIGGER	(1 << 15)
 #define IO_APIC_REDIR_MASKED		(1 << 16)
 
+struct io_apic_ops {
+	void		(*init)  (void);
+	unsigned int	(*read)  (unsigned int apic, unsigned int reg);
+	void		(*write) (unsigned int apic, unsigned int reg, unsigned int value);
+	void		(*modify)(unsigned int apic, unsigned int reg, unsigned int value);
+};
+
+void __init set_io_apic_ops(const struct io_apic_ops *);
+
 /*
  * The structure of the IO-APIC:
  */
arch/x86/include/asm/x2apic.h +5 -0
index 6bf5b8e..92e54ab 100644
@@ -18,6 +18,11 @@ static const struct cpumask *x2apic_target_cpus(void)
 	return cpu_online_mask;
 }
 
+static int x2apic_apic_id_valid(int apicid)
+{
+	return 1;
+}
+
 static int x2apic_apic_id_registered(void)
 {
 	return 1;
arch/x86/kernel/acpi/boot.c +1 -1
index 406ed77..0f42c2f 100644
@@ -239,7 +239,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
 	 * to not preallocating memory for all NR_CPUS
 	 * when we use CPU hotplug.
 	 */
-	if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled)
+	if (!apic->apic_id_valid(apic_id) && enabled)
 		printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
 	else
 		acpi_register_lapic(apic_id, enabled);
arch/x86/kernel/apic/apic.c +9 -4
index 2eec05b..11544d8 100644
@@ -383,20 +383,25 @@ static inline int eilvt_entry_is_changeable(unsigned int old, unsigned int new)
 
 static unsigned int reserve_eilvt_offset(int offset, unsigned int new)
 {
-	unsigned int rsvd;			/* 0: uninitialized */
+	unsigned int rsvd, vector;
 
 	if (offset >= APIC_EILVT_NR_MAX)
 		return ~0;
 
-	rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED;
+	rsvd = atomic_read(&eilvt_offsets[offset]);
 	do {
-		if (rsvd &&
-		    !eilvt_entry_is_changeable(rsvd, new))
+		vector = rsvd & ~APIC_EILVT_MASKED;	/* 0: unassigned */
+		if (vector && !eilvt_entry_is_changeable(vector, new))
 			/* may not change if vectors are different */
 			return rsvd;
 		rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new);
 	} while (rsvd != new);
 
+	rsvd &= ~APIC_EILVT_MASKED;
+	if (rsvd && rsvd != vector)
+		pr_info("LVT offset %d assigned for vector 0x%02x\n",
+			offset, rsvd);
+
 	return new;
 }
 
arch/x86/kernel/apic/apic_numachip.c +1 -2
index d9ea5f3..899803e 100644
@@ -229,11 +229,10 @@ static int __init numachip_system_init(void)
 }
 early_initcall(numachip_system_init);
 
-static int __cpuinit numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
 	if (!strncmp(oem_id, "NUMASC", 6)) {
 		numachip_system = 1;
-		setup_force_cpu_cap(X86_FEATURE_X2APIC);
 		return 1;
 	}
 
arch/x86/kernel/apic/io_apic.c +112 -47

258 lines not on this page · raw message

arch/x86/kernel/apic/x2apic_cluster.c +1 -1
index 9193713..48f3103 100644
@@ -213,7 +213,7 @@ static struct apic apic_x2apic_cluster = {
 	.name				= "cluster x2apic",
 	.probe				= x2apic_cluster_probe,
 	.acpi_madt_oem_check		= x2apic_acpi_madt_oem_check,
-	.apic_id_valid			= default_apic_id_valid,
+	.apic_id_valid			= x2apic_apic_id_valid,
 	.apic_id_registered		= x2apic_apic_id_registered,
 
 	.irq_delivery_mode		= dest_LowestPrio,
arch/x86/kernel/apic/x2apic_phys.c +1 -1
index bcd1db6..8a778db 100644
@@ -119,7 +119,7 @@ static struct apic apic_x2apic_phys = {
 	.name				= "physical x2apic",
 	.probe				= x2apic_phys_probe,
 	.acpi_madt_oem_check		= x2apic_acpi_madt_oem_check,
-	.apic_id_valid			= default_apic_id_valid,
+	.apic_id_valid			= x2apic_apic_id_valid,
 	.apic_id_registered		= x2apic_apic_id_registered,
 
 	.irq_delivery_mode		= dest_Fixed,
arch/x86/kernel/apic/x2apic_uv_x.c +6 -1
index fc47714..87bfa69 100644
@@ -266,6 +266,11 @@ static void uv_send_IPI_all(int vector)
 	uv_send_IPI_mask(cpu_online_mask, vector);
 }
 
+static int uv_apic_id_valid(int apicid)
+{
+	return 1;
+}
+
 static int uv_apic_id_registered(void)
 {
 	return 1;
@@ -351,7 +356,7 @@ static struct apic __refdata apic_x2apic_uv_x = {
 	.name				= "UV large system",
 	.probe				= uv_probe,
 	.acpi_madt_oem_check		= uv_acpi_madt_oem_check,
-	.apic_id_valid			= default_apic_id_valid,
+	.apic_id_valid			= uv_apic_id_valid,
 	.apic_id_registered		= uv_apic_id_registered,
 
 	.irq_delivery_mode		= dest_Fixed,
arch/x86/kernel/cpu/common.c +1 -1
index ade9c79..b240323 100644
@@ -998,7 +998,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
 	else
 		printk(KERN_CONT "\n");
 
-	__print_cpu_msr();
+	print_cpu_msr(c);
 }
 
 void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c)
arch/x86/kernel/dumpstack.c +5 -2
index 4025fe4..90bf130 100644
@@ -37,13 +37,16 @@ print_ftrace_graph_addr(unsigned long addr, void *data,
 			const struct stacktrace_ops *ops,
 			struct thread_info *tinfo, int *graph)
 {
-	struct task_struct *task = tinfo->task;
+	struct task_struct *task;
 	unsigned long ret_addr;
-	int index = task->curr_ret_stack;
+	int index;
 
 	if (addr != (unsigned long)return_to_handler)
 		return;
 
+	task = tinfo->task;
+	index = task->curr_ret_stack;
+
 	if (!task->ret_stack || index < *graph)
 		return;
 
arch/x86/kernel/process.c +114 -0

132 lines not on this page · raw message

arch/x86/kernel/process_32.c +0 -58

88 lines not on this page · raw message

arch/x86/kernel/process_64.c +0 -107

133 lines not on this page · raw message

arch/x86/kernel/tls.c +2 -2
index 6bb7b85..bcfec2d 100644
@@ -163,7 +163,7 @@ int regset_tls_get(struct task_struct *target, const struct user_regset *regset,
 {
 	const struct desc_struct *tls;
 
-	if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
+	if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
 	    (pos % sizeof(struct user_desc)) != 0 ||
 	    (count % sizeof(struct user_desc)) != 0)
 		return -EINVAL;
@@ -198,7 +198,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES];
 	const struct user_desc *info;
 
-	if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
+	if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
 	    (pos % sizeof(struct user_desc)) != 0 ||
 	    (count % sizeof(struct user_desc)) != 0)
 		return -EINVAL;
arch/x86/mm/srat.c +1 -1
index 1c1c4f4..efb5b4b 100644
@@ -70,7 +70,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	pxm = pa->proximity_domain;
 	apic_id = pa->apic_id;
-	if (!cpu_has_x2apic && (apic_id >= 0xff)) {
+	if (!apic->apic_id_valid(apic_id)) {
 		printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n",
 			 pxm, apic_id);
 		return;
arch/x86/platform/olpc/olpc.c +97 -0

121 lines not on this page · raw message

arch/xtensa/configs/iss_defconfig +1 -1
index f932b30..ddab37b 100644
@@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop"
 # CONFIG_INLINE_SPIN_LOCK_BH is not set
 # CONFIG_INLINE_SPIN_LOCK_IRQ is not set
 # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
-CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
 # CONFIG_INLINE_SPIN_UNLOCK_BH is not set
 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
 # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
include/linux/spinlock_api_smp.h +1 -1
index e253ccd..51df117 100644
@@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock)
 #endif
 
-#ifdef CONFIG_INLINE_SPIN_UNLOCK
+#ifndef CONFIG_UNINLINE_SPIN_UNLOCK
 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock)
 #endif
 
kernel/Kconfig.locks +2 -2
index 5068e2a..2251882 100644
@@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE
 	def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
 		 ARCH_INLINE_SPIN_LOCK_IRQSAVE
 
-config INLINE_SPIN_UNLOCK
-	def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK)
+config UNINLINE_SPIN_UNLOCK
+	bool
 
 config INLINE_SPIN_UNLOCK_BH
 	def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
kernel/Kconfig.preempt +1 -0
index 24e7cb0..3f9c974 100644
@@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY
 config PREEMPT
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	select PREEMPT_COUNT
+	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
 	  all kernel code (that is not executing in a critical section)
kernel/spinlock.c +1 -1
index 84c7d96..5cdd806 100644
@@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock)
 EXPORT_SYMBOL(_raw_spin_lock_bh);
 #endif
 
-#ifndef CONFIG_INLINE_SPIN_UNLOCK
+#ifdef CONFIG_UNINLINE_SPIN_UNLOCK
 void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock)
 {
 	__raw_spin_unlock(lock);
lib/Kconfig.debug +1 -0
index 05037dc..f32a41f 100644
@@ -499,6 +499,7 @@ config RT_MUTEX_TESTER
 config DEBUG_SPINLOCK
 	bool "Spinlock and rw-lock debugging: basic checks"
 	depends on DEBUG_KERNEL
+	select UNINLINE_SPIN_UNLOCK
 	help
 	  Say Y here and build SMP to catch missing spinlock initialization
 	  and certain other kinds of spinlock errors commonly made.  This is