Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4392464ybp; Mon, 7 Oct 2019 07:50:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaUEgkBMBK0lhmXHX8ciTwmZynN/xm25hRgO25V0JbYhmadCYtkzkVBvjvDgoj85TFw7WB X-Received: by 2002:a50:eb41:: with SMTP id z1mr29090925edp.261.1570459850355; Mon, 07 Oct 2019 07:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570459850; cv=none; d=google.com; s=arc-20160816; b=i/F3DOtWEa5Js1REJ4zl9IFNB44LmXn5bBtwmcmCyULXZ+HUxkNckJdIeij0O77YDD Tk7UgdSEwdG4YFkhSDrqqKED0UIPylPXkRlKF9d+NShQeMfww6b8f0E9OdSmY10zbwaM yY3DEUDpZcLRPTwenWxDoOokmS8G4coH2E93jSjIVnBqb1mCPlocNZ6hZHX7QseGSRbb 3sy1nJm+WIIijVJHGEDtK1eebv0oXGcg00Ga2Sg8CuHbjXj/BymESVwjM0Dl87szvNWu yKpXelj3YAHXkHlczpirK6/kZythfmeHpdVJN5DdXaSxPJOj+qZP8AE4ihqjLC+xtt5y ZG/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=9Mf/db4gnPafBMp8PrS0ap6W1Ed52ar1Pv+wHYlynAg=; b=Cvqiv4WwCyajv9+dPpwJVOwlu4CEZQpDIEEF6ke8DE4AGDQbm8DQYEV/P9FBCgvXQv WX+22Ze05olkllClxxoXRhdc8fUhTqKlp2UsD9OobvBTC1ZB6P3j5b37oGXoW98SU9GK Y13cofRmCNTLLdVIFbab6g3WR2uW5DwNR6ptcSwKq7Mz0BksJiVnqx24jNU8cXHiRnEG 5u2TPxW6SVOZzzMPGKzDoRncQdX0y7nyflgouLBGEg5nza7qLU0BSu188XKhQ1C/gmLL MRQhBDWRN46tOw5MRgfMHt0GqAxWOcASzmnt3F9t6AkiKNtx/sErmE/U5Am9V1rNkP+Z ncrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si8258544edq.84.2019.10.07.07.50.26; Mon, 07 Oct 2019 07:50:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728844AbfJGOt4 (ORCPT + 99 others); Mon, 7 Oct 2019 10:49:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44539 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728764AbfJGOtu (ORCPT ); Mon, 7 Oct 2019 10:49:50 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iHUKO-0006E3-DR; Mon, 07 Oct 2019 16:49:36 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 55D351C079B; Mon, 7 Oct 2019 16:49:32 +0200 (CEST) Date: Mon, 07 Oct 2019 14:49:32 -0000 From: "tip-bot2 for Mike Travis" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/platform/uv: Save OEM_ID from ACPI MADT probe Cc: Mike Travis , Steve Wahl , Dimitri Sivanich , Andrew Morton , Borislav Petkov , Christoph Hellwig , "H. Peter Anvin" , Hedi Berriche , Justin Ernst , Linus Torvalds , Peter Zijlstra , Russ Anderson , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org In-Reply-To: <20190910145839.732237241@stormcage.eag.rdlabs.hpecorp.net> References: <20190910145839.732237241@stormcage.eag.rdlabs.hpecorp.net> MIME-Version: 1.0 Message-ID: <157045977229.9978.6327888558896438069.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/platform branch of tip: Commit-ID: 61e5ddca9c2a312f933bf5b12bc08484189fefe6 Gitweb: https://git.kernel.org/tip/61e5ddca9c2a312f933bf5b12bc08484189fefe6 Author: Mike Travis AuthorDate: Tue, 10 Sep 2019 09:58:40 -05:00 Committer: Ingo Molnar CommitterDate: Mon, 07 Oct 2019 13:42:09 +02:00 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 Reviewed-by: Steve Wahl Reviewed-by: Dimitri Sivanich Cc: Andrew Morton Cc: Borislav Petkov Cc: Christoph Hellwig Cc: H. Peter Anvin Cc: Hedi Berriche Cc: Justin Ernst Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Russ Anderson Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190910145839.732237241@stormcage.eag.rdlabs.hpecorp.net Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/x2apic_uv_x.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index e6230af..66b38a6 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -31,6 +32,10 @@ static u64 gru_dist_base, gru_first_node_paddr = -1LL, gru_last_node_paddr; static u64 gru_dist_lmask, gru_dist_umask; static union uvh_apicid uvh_apicid; +/* Unpack OEM/TABLE ID's to be NULL terminated strings */ +static u8 oem_id[ACPI_OEM_ID_SIZE + 1]; +static u8 oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1]; + /* Information derived from CPUID: */ static struct { unsigned int apicid_shift; @@ -248,11 +253,20 @@ static void __init uv_set_apicid_hibit(void) } } -static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static void __init uv_stringify(int len, char *to, char *from) +{ + /* Relies on 'to' being NULL chars so result will be NULL terminated */ + strncpy(to, from, len-1); +} + +static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id) { int pnodeid; int uv_apic; + uv_stringify(sizeof(oem_id), oem_id, _oem_id); + uv_stringify(sizeof(oem_table_id), oem_table_id, _oem_table_id); + if (strncmp(oem_id, "SGI", 3) != 0) { if (strncmp(oem_id, "NSGI", 4) == 0) { uv_hubless_system = true;