* [PATCH 1/3] Numachip: fixes
@ 2014-10-15 12:53 Daniel J Blueman
2014-10-15 12:53 ` [PATCH 2/3] Numachip: drop unuseful code Daniel J Blueman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Daniel J Blueman @ 2014-10-15 12:53 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bjorn Helgaas
Cc: Daniel J Blueman, x86, linux-kernel, linux-pci, Steffen Persvold
Fix APIC declaration to be consistent with definition; this addresses
a compilation failure with the development branch of GCC, see:
https://bugzilla.kernel.org/show_bug.cgi?id=78251
Fix 16-bit APIC ID truncation and redundant APIC ICR idle polling
for IPI to self (AMD64 APICs are documented in the system developer
manuals to queue APIC writes).
Finally, add safe function to check if Numachip is detected, to be
used elsewhere.
Candidate for stable.
Signed-off-by: Daniel J Blueman <daniel@numascale.com>
Reviewed-by: Steffen Persvold <sp@numascale.com>
---
arch/x86/include/asm/numachip/numachip.h | 9 +++++++++
arch/x86/kernel/apic/apic_numachip.c | 12 ++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/numachip/numachip.h b/arch/x86/include/asm/numachip/numachip.h
index 1c6f7f6..3e1f4f9 100644
--- a/arch/x86/include/asm/numachip/numachip.h
+++ b/arch/x86/include/asm/numachip/numachip.h
@@ -16,4 +16,13 @@
extern int __init pci_numachip_init(void);
+#ifdef CONFIG_X86_NUMACHIP
+extern bool is_numachip_system(void);
+#else
+static inline bool is_numachip_system(void)
+{
+ return 0;
+}
+#endif
+
#endif /* _ASM_X86_NUMACHIP_NUMACHIP_H */
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index ae91539..4156470 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -30,9 +30,13 @@
#include <asm/apic_flat_64.h>
#include <asm/pgtable.h>
-static int numachip_system __read_mostly;
+static bool numachip_system __read_mostly;
+static const struct apic apic_numachip __refconst;
-static const struct apic apic_numachip __read_mostly;
+bool is_numachip_system(void)
+{
+ return numachip_system;
+}
static unsigned int get_apic_id(unsigned long x)
{
@@ -40,7 +44,7 @@ static unsigned int get_apic_id(unsigned long x)
unsigned int id;
rdmsrl(MSR_FAM10H_NODE_ID, value);
- id = ((x >> 24) & 0xffU) | ((value << 2) & 0x3f00U);
+ id = ((x >> 24) & 0xffU) | ((value << 2) & 0xff00U);
return id;
}
@@ -145,7 +149,7 @@ static void numachip_send_IPI_all(int vector)
static void numachip_send_IPI_self(int vector)
{
- __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
+ apic_write(APIC_SELF_IPI, vector);
}
static int __init numachip_probe(void)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] Numachip: drop unuseful code
2014-10-15 12:53 [PATCH 1/3] Numachip: fixes Daniel J Blueman
@ 2014-10-15 12:53 ` Daniel J Blueman
2014-10-15 12:53 ` [PATCH 3/3] Numachip: use 2GB memory block size Daniel J Blueman
2014-10-16 7:17 ` [PATCH 1/3] Numachip: fixes Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Daniel J Blueman @ 2014-10-15 12:53 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bjorn Helgaas
Cc: Daniel J Blueman, x86, linux-kernel, linux-pci, Steffen Persvold
Drop printing that serves no purpose, as it's printing fixed or
known values, and mark constant structure appropriately.
Signed-off-by: Daniel J Blueman <daniel@numascale.com>
Reviewed-by: Steffen Persvold <sp@numascale.com>
---
arch/x86/kernel/apic/apic_numachip.c | 22 +++-------------------
arch/x86/pci/numachip.c | 2 +-
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index 4156470..ee2052d 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -157,20 +157,8 @@ static int __init numachip_probe(void)
return apic == &apic_numachip;
}
-static void __init map_csrs(void)
-{
- printk(KERN_INFO "NumaChip: Mapping local CSR space (%016llx - %016llx)\n",
- NUMACHIP_LCSR_BASE, NUMACHIP_LCSR_BASE + NUMACHIP_LCSR_SIZE - 1);
- init_extra_mapping_uc(NUMACHIP_LCSR_BASE, NUMACHIP_LCSR_SIZE);
-
- printk(KERN_INFO "NumaChip: Mapping global CSR space (%016llx - %016llx)\n",
- NUMACHIP_GCSR_BASE, NUMACHIP_GCSR_BASE + NUMACHIP_GCSR_SIZE - 1);
- init_extra_mapping_uc(NUMACHIP_GCSR_BASE, NUMACHIP_GCSR_SIZE);
-}
-
static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
{
-
if (c->phys_proc_id != node) {
c->phys_proc_id = node;
per_cpu(cpu_llc_id, smp_processor_id()) = node;
@@ -179,19 +167,15 @@ static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
static int __init numachip_system_init(void)
{
- unsigned int val;
-
if (!numachip_system)
return 0;
+ init_extra_mapping_uc(NUMACHIP_LCSR_BASE, NUMACHIP_LCSR_SIZE);
+ init_extra_mapping_uc(NUMACHIP_GCSR_BASE, NUMACHIP_GCSR_SIZE);
+
x86_cpuinit.fixup_cpu_id = fixup_cpu_id;
x86_init.pci.arch_init = pci_numachip_init;
- map_csrs();
-
- val = read_lcsr(CSR_G0_NODE_IDS);
- printk(KERN_INFO "NumaChip: Local NodeID = %08x\n", val);
-
return 0;
}
early_initcall(numachip_system_init);
diff --git a/arch/x86/pci/numachip.c b/arch/x86/pci/numachip.c
index 7307d9d..2e565e6 100644
--- a/arch/x86/pci/numachip.c
+++ b/arch/x86/pci/numachip.c
@@ -103,7 +103,7 @@ static int pci_mmcfg_write_numachip(unsigned int seg, unsigned int bus,
return 0;
}
-const struct pci_raw_ops pci_mmcfg_numachip = {
+static const struct pci_raw_ops pci_mmcfg_numachip = {
.read = pci_mmcfg_read_numachip,
.write = pci_mmcfg_write_numachip,
};
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] Numachip: use 2GB memory block size
2014-10-15 12:53 [PATCH 1/3] Numachip: fixes Daniel J Blueman
2014-10-15 12:53 ` [PATCH 2/3] Numachip: drop unuseful code Daniel J Blueman
@ 2014-10-15 12:53 ` Daniel J Blueman
2014-10-16 7:17 ` [PATCH 1/3] Numachip: fixes Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Daniel J Blueman @ 2014-10-15 12:53 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bjorn Helgaas
Cc: Daniel J Blueman, x86, linux-kernel, linux-pci, Steffen Persvold
Use appropriate memory block size to reduce sysfs entry
creation time by 16x.
Boot-tested with the four permutations of X86_UV and X86_NUMACHIP.
Signed-off-by: Daniel J Blueman <daniel@numascale.com>
Reviewed-by: Steffen Persvold <sp@numascale.com>
---
arch/x86/mm/init_64.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 5621c47..727f940 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -53,6 +53,7 @@
#include <asm/cacheflush.h>
#include <asm/init.h>
#include <asm/uv/uv.h>
+#include <asm/numachip/numachip.h>
#include <asm/setup.h>
#include "mm_internal.h"
@@ -1235,9 +1236,9 @@ static unsigned long probe_memory_block_size(void)
/* start from 2g */
unsigned long bz = 1UL<<31;
-#ifdef CONFIG_X86_UV
- if (is_uv_system()) {
- printk(KERN_INFO "UV: memory block size 2GB\n");
+#ifdef CONFIG_X86_64
+ if (is_uv_system() || is_numachip_system()) {
+ pr_info("Memory block size 2GB for large-SMP system\n");
return 2UL * 1024 * 1024 * 1024;
}
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] Numachip: fixes
2014-10-15 12:53 [PATCH 1/3] Numachip: fixes Daniel J Blueman
2014-10-15 12:53 ` [PATCH 2/3] Numachip: drop unuseful code Daniel J Blueman
2014-10-15 12:53 ` [PATCH 3/3] Numachip: use 2GB memory block size Daniel J Blueman
@ 2014-10-16 7:17 ` Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2014-10-16 7:17 UTC (permalink / raw)
To: Daniel J Blueman
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bjorn Helgaas, x86,
linux-kernel, linux-pci, Steffen Persvold
* Daniel J Blueman <daniel@numascale.com> wrote:
> Fix APIC declaration to be consistent with definition; this
> addresses a compilation failure with the development branch of
> GCC, see: https://bugzilla.kernel.org/show_bug.cgi?id=78251
>
> Fix 16-bit APIC ID truncation and redundant APIC ICR idle
> polling for IPI to self (AMD64 APICs are documented in the
> system developer manuals to queue APIC writes).
>
> Finally, add safe function to check if Numachip is detected, to
> be used elsewhere.
This should be 3 patches.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-16 7:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-15 12:53 [PATCH 1/3] Numachip: fixes Daniel J Blueman
2014-10-15 12:53 ` [PATCH 2/3] Numachip: drop unuseful code Daniel J Blueman
2014-10-15 12:53 ` [PATCH 3/3] Numachip: use 2GB memory block size Daniel J Blueman
2014-10-16 7:17 ` [PATCH 1/3] Numachip: fixes Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).