Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6040061ybi; Wed, 29 May 2019 01:46:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyf1vIvEij9LxQq1rx7AJ801zgkE+PLbedCEBKOKifNPLtlNTT5MMLu7FjZ3wtvw63O1gG X-Received: by 2002:a65:500d:: with SMTP id f13mr62230661pgo.151.1559119618192; Wed, 29 May 2019 01:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559119618; cv=none; d=google.com; s=arc-20160816; b=ZXF2SxJb+iEAK1DliXvSF8y4fXPvyHD2QPSFq5CcI53WoeeQusJYa+S+AFfICJ+4Qn u5ag4gYWM8YzNirZX+8jp65pQ7ivxCWLQBslz395BD3afJeNuhdD8B4L0rkP7l/t9jN8 xK6h/j4jY6Wncc/R9GcEo5NOZhe6owAWKn8H0qlfq5obPkK4emhTu4tMFAO3onXswryn W5gbasiYHIaZMinhnEvPd7Z6axoz2tELJaKXFzqaYv/88qPmW4HF0cy9O+0eluJWu+7m nWJod+MXCmWsBvoJjxV/o/+zXqi2f9kJGkdnh8Ob0YX64gm65+ptWH8eCMy5KJsuVqP3 2voQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=yHYwU54umMELZAQMIPMJ37PnFVJnG63kxP1wbyaS+CM=; b=jZQeET17xR4FJ6tqg66mrL9Ef1wkIYyxHdP0Qb8XtnzWmo9BaORBLUvrIqDn85gynJ SeZo+25BXurF/daFuUTqBaawtF8JRX0cStUXoS10bOmI05FFrkwzijXLeHACngJl8kL/ C5XzkCZXGZlmnZ8YH5YJLvzSDXDc7Y9vSjqBF5JubxBcYhgqN5rGQ5J7MhRSaTgocVFx y1WVG0nOwQ7qgqk9eitMkw1p5qDp0/J2ofUIOui6LSPwzrx2n57o6vNorM8P03f1qlpj vRRqHQAHdklTmw8kWbKF2dZ3lj+HhB3ChCK2TqLP2uMWPFyFKXowZiXfvV+kXrbWIk69 vBqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=OduGwTVW; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=THK+d77n; 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=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si25713383pld.90.2019.05.29.01.46.43; Wed, 29 May 2019 01:46:58 -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; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=OduGwTVW; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=THK+d77n; 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=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726874AbfE2Iov (ORCPT + 99 others); Wed, 29 May 2019 04:44:51 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:49570 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbfE2Iop (ORCPT ); Wed, 29 May 2019 04:44:45 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4T8do5H017769; Wed, 29 May 2019 01:44:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=yHYwU54umMELZAQMIPMJ37PnFVJnG63kxP1wbyaS+CM=; b=OduGwTVWe8/YBsjormnIyGxEOqTjB0bimAy19N+JWUqdXTTw+GGDTZ3yb9lVhrE26slv ZfkGbjmpHBC1dM7MAYZf2uiAuePxqeDzu36+1ffS5UL5OrkyRm+OxH0XD8+iJRIqGMRO SPo4VIbI/0eDC0uhvFSro3dFNr92Oc38O1naE+x7NR5+MrHvHV/bV/YNzaHnU8zqrt+M As1/IuoczDqRjQZtjPfEVz1anCYV129PBh/CNNHx+bsjQci4ZmRDow6MR2WArUHAA5k+ mGdrRYfTKrn38rLvvFLjhtqf8nxaqJRvYoO0GnXe6jYC+TwWJUMWYOBSim2Pr42aPd+J zA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2sskp88p6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 29 May 2019 01:44:37 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 29 May 2019 01:44:36 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.53) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 29 May 2019 01:44:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yHYwU54umMELZAQMIPMJ37PnFVJnG63kxP1wbyaS+CM=; b=THK+d77n6PANHEDEJ7PwclhPhC67li/3eZe3OXn1wr9BMWraMduPdTDrGP1Xk+nDKQMKz7v6V/hsZ+qzGKYiz4sdXSfAFqYJYe0W9wgk3B1KUsP/dXJCN1akKFZC6Vea4QP+yG+IIgk4DNqRqw60duM86BWhWnG3h165QI6qm7E= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB3437.namprd18.prod.outlook.com (10.255.239.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.20; Wed, 29 May 2019 08:44:33 +0000 Received: from MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::7c9a:f3bf:fe2e:fe4a]) by MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::7c9a:f3bf:fe2e:fe4a%4]) with mapi id 15.20.1922.021; Wed, 29 May 2019 08:44:33 +0000 From: Robert Richter To: Borislav Petkov , Tony Luck , "James Morse" , Mauro Carvalho Chehab CC: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Robert Richter Subject: [PATCH 13/21] EDAC, ghes: Rework memory hierarchy detection Thread-Topic: [PATCH 13/21] EDAC, ghes: Rework memory hierarchy detection Thread-Index: AQHVFfq8/D/t80TYn0adLRIpgQ6mjA== Date: Wed, 29 May 2019 08:44:32 +0000 Message-ID: <20190529084344.28562-14-rrichter@marvell.com> References: <20190529084344.28562-1-rrichter@marvell.com> In-Reply-To: <20190529084344.28562-1-rrichter@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR01CA0046.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::23) To MN2PR18MB3408.namprd18.prod.outlook.com (2603:10b6:208:16c::25) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [78.54.13.57] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2743c187-3161-48a1-4158-08d6e411def9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MN2PR18MB3437; x-ms-traffictypediagnostic: MN2PR18MB3437: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:595; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(136003)(189003)(199004)(8936002)(4326008)(53936002)(50226002)(110136005)(107886003)(68736007)(36756003)(5660300002)(54906003)(11346002)(26005)(186003)(52116002)(2906002)(2616005)(476003)(446003)(6506007)(14454004)(66476007)(25786009)(478600001)(386003)(86362001)(486006)(81166006)(81156014)(8676002)(305945005)(316002)(7736002)(256004)(99286004)(76176011)(6512007)(6436002)(73956011)(64756008)(66446008)(66556008)(66066001)(3846002)(66946007)(1076003)(6486002)(102836004)(71190400001)(71200400001)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR18MB3437;H:MN2PR18MB3408.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zoK7d2nxjLTHwa7WJq9EFVYv+vHvhWG+DUyvdOlOAzbzFY87MBA2lvguq3crRT44lAiLPHAH9Iv4tyNXaGi1Nd3FP31q/b2x3YwONa/rbbMYPy17DwheGE/u7l8UlGephS/Djkd+AFD5IagKrWsT/3wDPCp5YWms7CaA+uwjwUAIh8jwgM29r6FXe452Ca/thVMDasnmRuUQ8+OYXHl/+L0UuCk+ewy6Nk0AuxIELNgJEuMKpcJqtYcXnrgl1g2InDCQdKHjLow2cakWj2EjW+qY4J2I89KgsAnTSvJivXZg1t50MXxLSDnPX975c1VwHdlcCbKKD5o+9yObecB2SZQGgHBK/o3BaDXE2oWulIdejdHGd4sBuoK8xO9x/kSURV7g800l4ZET1/4UWjW9uJtdMvr7L564Cb9/J1g2KAM= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2743c187-3161-48a1-4158-08d6e411def9 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 08:44:32.9630 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rrichter@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3437 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-29_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SW4gYSBsYXRlciBwYXRjaCB3ZSB3YW50IGFkZCBtb3JlIGluZm9ybWF0aW9uIGFib3V0IHRoZSBt ZW1vcnkNCmhpZXJhcmNoeSAoTlVNQSB0b3BvbG9neSwgRElNTSBsYWJlbCBpbmZvcm1hdGlvbiku IFJld29yayBtZW1vcnkNCmhpZXJhcmNoeSBkZXRlY3Rpb24gdG8gbWFrZSB0aGUgY29kZSBleHRl bmRhYmxlIGZvciB0aGlzLg0KDQpUaGUgZ2VuZXJhbCBhcHByb2FjaCBpcyByb3VnaGx5IGxpa2U6 DQoNCgltZW1faW5mb19zZXR1cCgpOw0KCWZvcl9lYWNoX25vZGUobmlkKSB7DQoJCW1jaSA9IGVk YWNfbWNfYWxsb2MobmlkKTsNCgkJbWNpX2FkZF9kaW1tX2luZm8obWNpKTsNCgkJZWRhY19tY19h ZGRfbWMobWNpKTsNCgl9Ow0KDQpUaGlzIHBhdGNoIGludHJvZHVjZXMgbWVtX2luZm9fc2V0dXAo KSBhbmQ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