From patchwork Fri Nov 8 18:49:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 178928 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3122869ilf; Fri, 8 Nov 2019 10:53:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxbR2xaz73z26vMJeQDs4XNMgTjsEePWRXy+vxqwtkmSQeVsFMEXXfrqU4nKfm5vV8rNL3n X-Received: by 2002:a50:fa4a:: with SMTP id c10mr11976078edq.51.1573239200223; Fri, 08 Nov 2019 10:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573239200; cv=none; d=google.com; s=arc-20160816; b=XTo2+rbBWYOobJXYAADUC/0PefQmW7k95uHp1VcIvnDaS0Z9ueJ/NmAhJQYnmePwFX lMmAV12whRxuYbaCcBczaz3uaDHYzsNszS3NlDSD3j9D+q4rsVD01S/kQICYw1SS97Wr uPYTi/1cK/vBbJZXf9Q/R3wP8yLJho2v9sxIY5wJhIBlkrWj+4pTJO2+l7ZyahME107D ZqSn/GZ0zshUtFH6xxnbu1hRb5tAlIVE+g4K8AjBohz1VRo8DQ0K0QZTXev0Dwnaeiig vBbffdkrI1zeWsuLFPTKacvq2Co77zNiE0I+ThVFACzzYSX55y09zwaKDhC0sDGyoKsc +wRQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kwrq5y5M+rqYeUQWRGOgEGzpKeJ6j9ribeQVMNkzUA4=; b=B3tSwE9YwqnGcEYQkHFUw38YaJrsQS2Er3p+ut4HGkvij+g0QGA7ew6q1c8QRDA+YX CHkpoM6qUHMg1D8w3PW0C0dkpNjnALWH2dNh88jtCsBedJRO2lLwbpNIY1r84ckFW95E 0eAVtlrz1VztFrWXt0H3T529G2Zan12BEPvfx+/X/NbcrtIPPZzlL7EHwtkE7WlEgM9M BfWW3PW2eniNX3rgyI223rW9SJvkkFVWIhJUZKj2THXyq4mr4NDYPGivubKeIjG59j3+ +8wUlMl0KOkWk3JnBD1kWx8oFMu6WcAE50ehi/PiBgX7IjabrI8z7ezS1emOerjJhEmE x7hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iX4tZrDM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si1526887eja.96.2019.11.08.10.53.20; Fri, 08 Nov 2019 10:53:20 -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=iX4tZrDM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732246AbfKHSxS (ORCPT + 14 others); Fri, 8 Nov 2019 13:53:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:49842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732122AbfKHSxR (ORCPT ); Fri, 8 Nov 2019 13:53:17 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 612BA21924; Fri, 8 Nov 2019 18:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239196; bh=AUWUl9y/HXQGf4YubuBpfo8aTTh0j9s1D++vVwfuq8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iX4tZrDMhcz+jfe8YLvX7VETYTpHP00UNyxJ+PT4Vk/2WFSxty0DxAtC5XOnWDMIp 3UcRvGCZafUBYNwEYumLCv4iR3ira5jPP2t+fCoGnusIphJPzUVpQDQVHEcXHNDBgh 3nseEteNnYoWAQC/UjGIokkYfoR3qFZLkxDFcocI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ard Biesheuvel , Christoffer Dall , Marc Zyngier , Catalin Marinas , Greg Hackmann , Ard Biesheuvel , Mark Rutland Subject: [PATCH 4.4 31/75] arm/arm64: KVM: Advertise SMCCC v1.1 Date: Fri, 8 Nov 2019 19:49:48 +0100 Message-Id: <20191108174739.963545191@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174708.135680837@linuxfoundation.org> References: <20191108174708.135680837@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 Signed-off-by: Greg Kroah-Hartman --- include/linux/arm-smccc.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) --- 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 l unsigned long a5, unsigned long a6, unsigned long a7, struct arm_smccc_res *res); +#endif /*__ASSEMBLY__*/ #endif /*__LINUX_ARM_SMCCC_H*/