Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6114148ybi; Wed, 31 Jul 2019 08:33:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwY9k2nsVLPIE8Qp3OzMcYOLVlPKOVkSUUz10RHOuH7rOa7iyNBStJURsyFy8wyqbQwm1nC X-Received: by 2002:a62:cec4:: with SMTP id y187mr47567101pfg.84.1564587221385; Wed, 31 Jul 2019 08:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564587221; cv=none; d=google.com; s=arc-20160816; b=ZuzTVnoDAPk5tl+4WMr18zQw2GGy29dbxqMTTtqfYgZyP7bexyonLk75oONb0gKUia 5X1SMSwvhmRsEAvsYg2J0GsxKl3zsNT4GQhTsh65OiQNVV/i5TMswEOf2RyZLG07C45q ldHfYBWREXFwrpuPn5/SQhzEPP+XaRHJWZc2YFjJ0kx/EMJCK9Axs8easfvQTJj1an9+ a2+xfSzMwSguHy1tRujs9Aoy/kDM+DhWieif3+K0ZwhkgX39yYhNZzEcoVAdJR0lWxG9 0aeIqXzvWBOCW4WOmpC112WwgiVvSAayGoc7rl1LDl5AemmsGLJTqbs6CHeGkUbi1Vu4 7tcQ== 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 :dkim-signature; bh=fyWNol/pClGETI/+3Fy8S0o8APly1L7wYaUOInJ7cro=; b=Jo3zifzyw2Dz5tDRnRg/n01/VM5oXe31UZG7CokOw60VU+VBm3T9PzUJ4sesM59s80 IWFIrDja69xixM413hbgQPTCtpRjPsWv1XMPkkX6Y45oBBF0lYOrigqkiEBKIRWEoTdM Kj2hgGb/KfIIofFzEvxqMg9tinc4UUg40Uki/x2gYvDAzkSJLv4VQOXYiV38+q3To+A3 NR5kw5GHFg0Tv2NuZtP0jwo45VW46PVKqKx83hu1AmHBnWJy5pJyPGYxS/yLztwFE3Og d2YA6/3h/roBAZAvuAAFa8CiNQOhNc/zTI/vxV+yiM7ie8fKNJBCzfYGodkDApYtoNPD CuTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=0D+e9OKI; 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 x16si33125059plr.214.2019.07.31.08.33.26; Wed, 31 Jul 2019 08:33:41 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=0D+e9OKI; 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 S1729006AbfGaPXv (ORCPT + 99 others); Wed, 31 Jul 2019 11:23:51 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:35772 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbfGaPXu (ORCPT ); Wed, 31 Jul 2019 11:23:50 -0400 Received: by mail-ed1-f67.google.com with SMTP id w20so66041720edd.2 for ; Wed, 31 Jul 2019 08:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fyWNol/pClGETI/+3Fy8S0o8APly1L7wYaUOInJ7cro=; b=0D+e9OKImyb4sTdS3DaGli2ESSvrhwMepoaeber6sOi6xNQeOXqjqOnb/1KIv5eA0x eNNtaJSwMUTdya3x65wpEduqQWVFqNJxowmsYurkJg6idVmOJAgynHTMtURvl6pRH+lp /AXQs/PGw3QMUYeGMcitYEalW7K8jjmrvIDBQFxHoyvKOlQjQp1wt8RvB40She7x5nMN Km17y2HW/2HnGsAkyXDWsXdzi+suKv/3bNL7rEATTZ6hOD/1GmoI3RxM+fG1oxMgjoTb i0NcERRrgjS3qiNo560qZowGrKNWVHk2bwOr/TVDT1ncGB5cnkrBEBAJUPDEPQtBhvsJ S6vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fyWNol/pClGETI/+3Fy8S0o8APly1L7wYaUOInJ7cro=; b=C5fYBNeLiifJdll5IjlVOtgIdTB8dhJVT7PpwdfUv4rYzhAdRldtAzzVPiJYgnX3t/ GS2qpr81euhxC0VO4izEoFmFlAdMqQu7F9f6lojIOtEdFrNiagoOE6XOYQdk9RPoDxbp WLhdh4XQauplEbU7N9zkH3qthZr6obagAI/WJd4nbmagw+Y/hUOstZRXIQmTteU/XPfW eyBSiRKDw1h9hRIerwWaS/V0pmLKlKoB9vemptEE+VFPnNNjypccDab0enu8QJDv3UY1 7HEA/bXF1g11nU081uxLp4EXP43CGOjC2hu6Vx3T+8T25fg3+HHrSwzkRm0CufueGHew BUxg== X-Gm-Message-State: APjAAAUWBSVh5ryAZuhhF0/O3JRaaL53vZKjFYQ6zw3Z5NnCfX/5m3Zv /xB44aRaSY4GJFCycDDOPqA= X-Received: by 2002:a50:b388:: with SMTP id s8mr106143247edd.15.1564586629069; Wed, 31 Jul 2019 08:23:49 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id f24sm16699742edt.82.2019.07.31.08.23.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jul 2019 08:23:47 -0700 (PDT) From: "Kirill A. Shutemov" X-Google-Original-From: "Kirill A. Shutemov" Received: by box.localdomain (Postfix, from userid 1000) id E1BE61045F9; Wed, 31 Jul 2019 18:08:16 +0300 (+03) 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: [PATCHv2 35/59] acpi/hmat: Determine existence of an ACPI HMAT Date: Wed, 31 Jul 2019 18:07:49 +0300 Message-Id: <20190731150813.26289-36-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190731150813.26289-1-kirill.shutemov@linux.intel.com> References: <20190731150813.26289-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 fc1e7d4648bf..d27f4d17dfb3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1335,4 +1335,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.21.0