Skip to content

Commit 61e5ddc

Browse files
mike-travisIngo Molnar
authored andcommitted
x86/platform/uv: Save OEM_ID from ACPI MADT probe
Save the OEM_ID and OEM_TABLE_ID passed to the apic driver probe function for later use. Also, convert the char list arg passed from the kernel to a true null-terminated string. Signed-off-by: Mike Travis <[email protected]> Reviewed-by: Steve Wahl <[email protected]> Reviewed-by: Dimitri Sivanich <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Hedi Berriche <[email protected]> Cc: Justin Ernst <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent da0c9ea commit 61e5ddc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/memory.h>
1515
#include <linux/export.h>
1616
#include <linux/pci.h>
17+
#include <linux/acpi.h>
1718

1819
#include <asm/e820/api.h>
1920
#include <asm/uv/uv_mmrs.h>
@@ -31,6 +32,10 @@ static u64 gru_dist_base, gru_first_node_paddr = -1LL, gru_last_node_paddr;
3132
static u64 gru_dist_lmask, gru_dist_umask;
3233
static union uvh_apicid uvh_apicid;
3334

35+
/* Unpack OEM/TABLE ID's to be NULL terminated strings */
36+
static u8 oem_id[ACPI_OEM_ID_SIZE + 1];
37+
static u8 oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
38+
3439
/* Information derived from CPUID: */
3540
static struct {
3641
unsigned int apicid_shift;
@@ -248,11 +253,20 @@ static void __init uv_set_apicid_hibit(void)
248253
}
249254
}
250255

251-
static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
256+
static void __init uv_stringify(int len, char *to, char *from)
257+
{
258+
/* Relies on 'to' being NULL chars so result will be NULL terminated */
259+
strncpy(to, from, len-1);
260+
}
261+
262+
static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
252263
{
253264
int pnodeid;
254265
int uv_apic;
255266

267+
uv_stringify(sizeof(oem_id), oem_id, _oem_id);
268+
uv_stringify(sizeof(oem_table_id), oem_table_id, _oem_table_id);
269+
256270
if (strncmp(oem_id, "SGI", 3) != 0) {
257271
if (strncmp(oem_id, "NSGI", 4) == 0) {
258272
uv_hubless_system = true;

0 commit comments

Comments
 (0)