Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7732241ybl; Thu, 16 Jan 2020 04:49:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzPZ0ogrD3BhtN0kBPkgQyqPPL6Ct7VRQjWIwYoueam1A8+Bse+4lSVurlJbJGTx/y02ew8 X-Received: by 2002:a9d:730e:: with SMTP id e14mr1720828otk.62.1579178944335; Thu, 16 Jan 2020 04:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579178944; cv=none; d=google.com; s=arc-20160816; b=P4zhxuOsQLwCy/a3mtiij3/TMeh9nJdHSrKAa2bxlX7KA6gfuOGKapg3Srj11EVvz8 WYVZkppW6fYkReWjV55e3hWmu6QKTcnuPWsRxT1g8IRz4OidOuEPpj5L+4M253hGvu1d nokDXVgRrKtaHE+Buh5lf91SwbSQ44z0Y9bhnIKPpsZbyn8DcC4YhbgLdjFNeY34ar6W Wkja6wLIvFBAMoZGKc/bcPNQF5qGQlt6jAQz9Ug0BqQLhBD4Op6zNV6FDPU7f16Gw3Sk Y8YRpges3rK7XlHCP7C8P3s5C5+ax9w6RyuoBcHLD0Ea40BET20j7/5JctuLIQQs55lc f9mw== 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=HMFT2HSPp4D/9Q1jS9IQFd1j8hNvPmVwMxajL10LyKI=; b=KvEcBSTgXiNbt17bAtIlUs5D7iX3BxUv1wA0axprxW+CGDZ/oH47r6Ea3deK1K7MJQ 1GsW8wJziXylGWznf44Cip/cvtmqzGPnzOCI0Awu77fFNXDFVPMj2nwyT3PIjx+lIW35 YYr296s4BgWYxtkhUBkVvZ9jCIpO28mIa+JmvS6PEfsk15osq9tWJvoXj6dhG2+MhOz0 L/0MBQPTHowOycHKC1dUY5LUF9m02CfQS/IEkeTZeflandMn6dvlwpLzQ9yU3ic6F7br 9ADUmGeCwS+QzHEEV95553kn8SG2ewKEjh4ciscYrr2PliBD+hslZoVBEWTqDDTTv37e ABjw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si13199762oti.247.2020.01.16.04.48.52; Thu, 16 Jan 2020 04:49:04 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgAPMq5 (ORCPT + 99 others); Thu, 16 Jan 2020 07:46:57 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9638 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726440AbgAPMq5 (ORCPT ); Thu, 16 Jan 2020 07:46:57 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 91DA06A5E57719B433F2; Thu, 16 Jan 2020 20:46:54 +0800 (CST) Received: from DESKTOP-1NISPDV.china.huawei.com (10.173.221.248) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 16 Jan 2020 20:46:48 +0800 From: Zengruan Ye To: , , , , , CC: , , , , , , , , , , , , , Subject: [PATCH v3 4/8] KVM: arm64: Add SMCCC paravirtualised lock calls Date: Thu, 16 Jan 2020 20:46:22 +0800 Message-ID: <20200116124626.1155-5-yezengruan@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20200116124626.1155-1-yezengruan@huawei.com> References: <20200116124626.1155-1-yezengruan@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.173.221.248] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add two new SMCCC compatible hypercalls for PV lock features: * ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID: 0x86000001 - KVM_PV_LOCK_FEATURES: 0 - KVM_PV_LOCK_PREEMPTED: 1 Also add the header file which defines the ABI for the paravirtualized lock features we're about to add. Signed-off-by: Zengruan Ye --- arch/arm64/include/asm/pvlock-abi.h | 16 ++++++++++++++++ include/linux/arm-smccc.h | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 arch/arm64/include/asm/pvlock-abi.h diff --git a/arch/arm64/include/asm/pvlock-abi.h b/arch/arm64/include/asm/pvlock-abi.h new file mode 100644 index 000000000000..06e0c3d7710a --- /dev/null +++ b/arch/arm64/include/asm/pvlock-abi.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright(c) 2019 Huawei Technologies Co., Ltd + * Author: Zengruan Ye + */ + +#ifndef __ASM_PVLOCK_ABI_H +#define __ASM_PVLOCK_ABI_H + +struct pvlock_vcpu_state { + __le64 preempted; + /* Structure must be 64 byte aligned, pad to that size */ + u8 padding[56]; +} __packed; + +#endif diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index 2b2c295c9109..081be5f6a6be 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -394,14 +394,24 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, /* KVM "vendor specific" services */ #define ARM_SMCCC_KVM_FUNC_FEATURES 0 +#define ARM_SMCCC_KVM_FUNC_PV_LOCK 1 #define ARM_SMCCC_KVM_FUNC_FEATURES_2 127 #define ARM_SMCCC_KVM_NUM_FUNCS 128 +#define KVM_PV_LOCK_FEATURES 0 +#define KVM_PV_LOCK_PREEMPTED 1 + #define ARM_SMCCC_VENDOR_HYP_KVM_FEATURES_FUNC_ID \ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ ARM_SMCCC_SMC_32, \ ARM_SMCCC_OWNER_VENDOR_HYP, \ ARM_SMCCC_KVM_FUNC_FEATURES) +#define ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_VENDOR_HYP, \ + ARM_SMCCC_KVM_FUNC_PV_LOCK) + #endif /*__ASSEMBLY__*/ #endif /*__LINUX_ARM_SMCCC_H*/ -- 2.19.1