From patchwork Fri Nov 8 12:35:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 178894 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2636362ilf; Fri, 8 Nov 2019 04:36:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxCmVVASKVMNtoojOGBemN+DG+1hCn3wzr8/JohyGfhSWxAjQofqpIgwZfoKd9IXVntRGjB X-Received: by 2002:a50:8dc5:: with SMTP id s5mr9882028edh.115.1573216586798; Fri, 08 Nov 2019 04:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573216586; cv=none; d=google.com; s=arc-20160816; b=X2ywfia3n4TA/6YItfyw29knt3cRzWU5duazexJGmOWDb6oUMOqMthQQhnEN0jqt4r c2OVqeeF/taoGnqnyyN3t9UoGE7bAuatFV/YcRcLfr0cPJriMqIcDkY5oGDe1xLCiJpt JnCVm8qKLxnq+hEfcoEu4i/ShoPsiHY8H3Mx1VVBALcAkVtzyuqN9XmhCtYVeU9KbxDx oMsqpjsxKsK+rgOpePeMAgmybrQlwafHktXu9vuhq6Rd2xzGF4Q+LB6mIJlKPTXkDkrX K9QK3MUpnubKQtROoDbLfkdOhk8dDfBIQ7Ib+OY4qVgmz0LUTULYayoS3QcDFMoW8DsE UTDQ== 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=K42O/6QyhR54vhMT4trmRz//ZUyyAahk1VRmkKV19y8=; b=1DLEd5oUWCsRu9+RCzLX1NoArcPY8XRjD3igNrU+Go08vX92nTC+p9TcXeQ5j4LX1Q OFn80vCBNrFGnrEhCavSm9Pb9oRQmjrjtCC6SAGoOijDWj6YInGJeojFO5shajFFX+JT j4oEa60SDvngyy9WfDad/iJiTieEd4vkeGAkJM520Vi06X7x39Hw5BIehvUr7pcA4dFR WYttXAjC/N9oAEBVUxIs4HPc2izS9+YTIXIs6OoCLSKJst2DBwU4Bsx+jrNEesFi4cVf W4adGLLWTdS/liPbLaBP8Z4sgLR/xrWU1nM430hvBRK8wep2wQVITRQjnIl7C+osCHa+ kaDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v5KuRm2y; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si3411305ejc.315.2019.11.08.04.36.26; Fri, 08 Nov 2019 04:36:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=v5KuRm2y; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbfKHMg0 (ORCPT + 14 others); Fri, 8 Nov 2019 07:36:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:43954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfKHMgZ (ORCPT ); Fri, 8 Nov 2019 07:36:25 -0500 Received: from localhost.localdomain (lfbn-mar-1-550-151.w90-118.abo.wanadoo.fr [90.118.131.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A8C0222CE; Fri, 8 Nov 2019 12:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573216585; bh=O3Df2egrqzPiGFuLv9Icx067z6DRVdx5E5+uXkzuBQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v5KuRm2yEPH+KoabBEDtgYBV/Xk7mZFV5Qe5ui0HT1R3EJmxs6N4jCy3l2DdmOWIi 6Keq67Ex9hQWkFkKzxEUqEZ5JvaSxAgrXxcoG674KpK+HtPuEtn+/3Ar/OyVUpT2gz ROgkWqgwkSaORbT4HimRnpYm630wwAOxRLfJFZv8= From: Ard Biesheuvel To: stable@vger.kernel.org Cc: linus.walleij@linaro.org, rmk+kernel@armlinux.org.uk, Mark Rutland , Ard Biesheuvel Subject: [PATCH for-stable-4.4 08/50] arm/arm64: KVM: Advertise SMCCC v1.1 Date: Fri, 8 Nov 2019 13:35:12 +0100 Message-Id: <20191108123554.29004-9-ardb@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108123554.29004-1-ardb@kernel.org> References: <20191108123554.29004-1-ardb@kernel.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Rutland From: Marc Zyngier commit 09e6be12effdb33bf7210c8867bbd213b66a499e upstream. The new SMC Calling Convention (v1.1) allows for a reduced overhead when calling into the firmware, and provides a new feature discovery mechanism. Make it visible to KVM guests. Tested-by: Ard Biesheuvel Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Catalin Marinas [v4.9: account for files moved to virt/ upstream] Signed-off-by: Mark Rutland [v4.9 backport] Tested-by: Greg Hackmann Signed-off-by: Greg Kroah-Hartman [ardb: restrict to include/linux/arm-smccc.h, drop KVM bits] Signed-off-by: Ard Biesheuvel --- include/linux/arm-smccc.h | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index b5abfda80465..8bf047eab116 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -14,9 +14,6 @@ #ifndef __LINUX_ARM_SMCCC_H #define __LINUX_ARM_SMCCC_H -#include -#include - /* * This file provides common defines for ARM SMC Calling Convention as * specified in @@ -60,6 +57,24 @@ #define ARM_SMCCC_OWNER_TRUSTED_OS 50 #define ARM_SMCCC_OWNER_TRUSTED_OS_END 63 +#define ARM_SMCCC_VERSION_1_0 0x10000 +#define ARM_SMCCC_VERSION_1_1 0x10001 + +#define ARM_SMCCC_VERSION_FUNC_ID \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + 0, 0) + +#define ARM_SMCCC_ARCH_FEATURES_FUNC_ID \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + 0, 1) + +#ifndef __ASSEMBLY__ + +#include +#include + /** * struct arm_smccc_res - Result from SMC/HVC call * @a0-a3 result values from registers 0 to 3 @@ -101,4 +116,5 @@ asmlinkage void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a5, unsigned long a6, unsigned long a7, struct arm_smccc_res *res); +#endif /*__ASSEMBLY__*/ #endif /*__LINUX_ARM_SMCCC_H*/