Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5288837yba; Wed, 8 May 2019 10:44:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqypghXQgXXxVmNIx69c06/oG/RQHF4oVxXsfJratSKRE6vCg110wzjDCHNOm7q75UqIBh+J X-Received: by 2002:a17:902:aa91:: with SMTP id d17mr5152323plr.251.1557337451722; Wed, 08 May 2019 10:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557337451; cv=none; d=google.com; s=arc-20160816; b=nlqaHC/PXrg7vADqzwrg9N+2AodUBVzBhpg7P7m5f5ZTPRUOFp/oBAduHcQVIwp9DA iPP5177s0X4lsTOY24Y9NDcnRpjLHzR9NWXuMSeBw3AtE0QZM7ED+fJj/E7Sl0QfLGvR ZiERCo/+E8VBaNSeDicG0OpOj/H2VDZHJUFD5qHTyB+nU0vaQRekYC6UpPprE9rqukVx hR0TieBxk8MtTIl/d9An41oynXDpW/R4g9GFJL/Ukw3OkygystO4Xxr752TXzpnIlr3N solrdAjlXutt2v/FVHAJ4tnuVQa6F8CZiTgPYjAnkcZYSyGtNVaVmuQXd16PRSq2JlyO ENdA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bMhGYPvhch86dLFBTwNjwlU0ss5Zx9fxnvAxoB5kLBo=; b=TNMPtldTXCuiRqis2w8IhYMVmQkdOHKxw5Sf1UYgbNAt1/a18Vr1TYx+0RyW7xvGzy wlXFrpqdUQtOS/rOFDDQAD78XOwWiY9kcLGD45Sy/LZh8YGtxEZnmQszH0ihtcTTH+p4 4y5aYskbsk5tJSgsWy4Nkg93X8yBU+4SckbFsbo0psMUmtDhlpu0O879FDqcShhXdIDP QmoDL1wVezfqhmODUmupBu8SpLe1ZqCBoeYfsZCvUTiv90X6IyELBab42UIDSr6ALssQ RSZI6hQ5Kiw77I3DxwlYKBJ9rYuPlzZVTRcib848MojAtzg9CDoVFSO4JRFycnJIgxYe fb0Q== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si25977185pfv.48.2019.05.08.10.43.56; Wed, 08 May 2019 10:44:11 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbfEHOpM (ORCPT + 99 others); Wed, 8 May 2019 10:45:12 -0400 Received: from mga07.intel.com ([134.134.136.100]:33088 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728352AbfEHOor (ORCPT ); Wed, 8 May 2019 10:44:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2019 07:44:46 -0700 X-ExtLoop1: 1 Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 May 2019 07:44:41 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 5EB75BC1; Wed, 8 May 2019 17:44:30 +0300 (EEST) From: "Kirill A. Shutemov" To: Andrew Morton , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , David Howells Cc: Kees Cook , Dave Hansen , Kai Huang , Jacob Pan , Alison Schofield , linux-mm@kvack.org, kvm@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" Subject: [PATCH, RFC 34/62] acpi/hmat: Determine existence of an ACPI HMAT Date: Wed, 8 May 2019 17:43:54 +0300 Message-Id: <20190508144422.13171-35-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190508144422.13171-1-kirill.shutemov@linux.intel.com> References: <20190508144422.13171-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alison Schofield Platforms that need to confirm the presence of an HMAT table can use this function that simply reports the HMATs existence. This is added in support of the Multi-Key Total Memory Encryption (MKTME), a feature on future Intel platforms. These platforms will need to confirm an HMAT is present at init time. Signed-off-by: Alison Schofield Signed-off-by: Kirill A. Shutemov --- drivers/acpi/hmat/hmat.c | 13 +++++++++++++ include/linux/acpi.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/drivers/acpi/hmat/hmat.c b/drivers/acpi/hmat/hmat.c index 96b7d39a97c6..38e3341f569f 100644 --- a/drivers/acpi/hmat/hmat.c +++ b/drivers/acpi/hmat/hmat.c @@ -664,3 +664,16 @@ static __init int hmat_init(void) return 0; } subsys_initcall(hmat_init); + +bool acpi_hmat_present(void) +{ + struct acpi_table_header *tbl; + acpi_status status; + + status = acpi_get_table(ACPI_SIG_HMAT, 0, &tbl); + if (ACPI_FAILURE(status)) + return false; + + acpi_put_table(tbl); + return true; +} diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 75078fc9b6b3..fe3ad4ca5bb3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1339,4 +1339,8 @@ acpi_platform_notify(struct device *dev, enum kobject_action action) } #endif +#ifdef CONFIG_X86_INTEL_MKTME +extern bool acpi_hmat_present(void); +#endif /* CONFIG_X86_INTEL_MKTME */ + #endif /*_LINUX_ACPI_H*/ -- 2.20.1