Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5731930ybe; Tue, 10 Sep 2019 08:02:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqznW2LdIJa55UKYDMKlYl9zvNXJRi9UraZgeOyfjh/wQ1+iMC8lyNw76zDjtufp1kiwlpfQ X-Received: by 2002:a17:906:529a:: with SMTP id c26mr25531573ejm.232.1568127774696; Tue, 10 Sep 2019 08:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568127774; cv=none; d=google.com; s=arc-20160816; b=BsR6u2rUMhUCIUYpGD6021NePxO1xLZNsf/38Tc4i4hqQDeyqrAqDhdo4wey1+GlM5 poJV2p6qO49F+UIAb8WL9um77Vzpu41PT1o19Ivl8Fgv1cSRJ9qQJaXOrsbyiPfKvhYm kp15D/J40G5aBvWZw9NKB3hHGafY63+WXaD/74jY+vNKwodPVCe3j0mTU76UZMhnhgqe ubIHTA5zmP6XHLRSAtgmWlqplAh8yMtutaX7gp3J1YIa9Z/YhFkkoJIpNNBebbCwJLja qUeQw+4NnZNuH19WyJMCKS2zcNUzXCGZC/osjVG8bCW/08kpYaVUz1SX9FdwlA2PEchw Iv4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:subject:cc:to:from :date:user-agent:references:message-id; bh=EzF/DK0WjIJjb9JT4cVhQ2QXbXMq1ytLZ1YBra4N3JU=; b=QbKeCBWbZ6mWcZWsC0D7icpLGROZ579E+QHIs16b/38EuT/KD/M737DSFfetKRoT1k A5eFekh+Gly1UHb974qxnMdc4MVR0HzxyUsv7owd6vR4G+GQnCL3Q5V3Dp1NSQDeI6gk aIvTJJcUEdlG9n+8wNXdldOSxx+WD2Bn7K6dcKOYIT9rcURudLENsioheDhT7kpwASZl Ybk39x2NJwgxLC4bQcG7OS4TAj6pY9B1/Q+UcKIXeuhGKVrxlOS6Pd+/bP56vB2kMsDb d+F/TARzDnrDtVayNadN8DgfreRmSCcirFUQGd84ydcFHjmGhXYOLa9rl34IbJqRZaEA 4hZA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b27si9236038eje.123.2019.09.10.08.02.22; Tue, 10 Sep 2019 08:02:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405943AbfIJPAY (ORCPT + 99 others); Tue, 10 Sep 2019 11:00:24 -0400 Received: from mx0a-002e3701.pphosted.com ([148.163.147.86]:32249 "EHLO mx0a-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405519AbfIJPAR (ORCPT ); Tue, 10 Sep 2019 11:00:17 -0400 Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8AEpgQx006956; Tue, 10 Sep 2019 15:00:01 GMT Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 2ux7qqnhnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2019 15:00:01 +0000 Received: from stormcage.eag.rdlabs.hpecorp.net (stormcage.eag.rdlabs.hpecorp.net [128.162.236.70]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id EA71BBD; Tue, 10 Sep 2019 14:59:58 +0000 (UTC) Received: by stormcage.eag.rdlabs.hpecorp.net (Postfix, from userid 5508) id 82B40201FCF15; Tue, 10 Sep 2019 09:59:58 -0500 (CDT) Message-Id: <20190910145839.732237241@stormcage.eag.rdlabs.hpecorp.net> References: <20190910145839.604369497@stormcage.eag.rdlabs.hpecorp.net> User-Agent: quilt/0.46-1 Date: Tue, 10 Sep 2019 09:58:40 -0500 From: Mike Travis To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Borislav Petkov , Christoph Hellwig Cc: Dimitri Sivanich , Russ Anderson , Hedi Berriche , Steve Wahl , Justin Ernst , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] x86/platform/uv: Save OEM_ID from ACPI MADT probe Content-Disposition: inline; filename=save-oem_id X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-10_10:2019-09-10,2019-09-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 suspectscore=0 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=765 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909100144 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kernel/apic/x2apic_uv_x.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) --- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c +++ linux/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_no 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(v } } -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; --