Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9820989ybl; Thu, 26 Dec 2019 06:00:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwOjZfkH9uzXokBRGs1CDcbPYFDCeoekqWF+wa/Fqo1A3uWh4+/5ljjYqyPDF7L/nEWxfzE X-Received: by 2002:a9d:10b:: with SMTP id 11mr44357696otu.222.1577368838199; Thu, 26 Dec 2019 06:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577368838; cv=none; d=google.com; s=arc-20160816; b=RZJ1JdQZ24IdMyXIg08VZXMlLc8HNzTloNVZVhEuOI2q9HKtFMBn7AkHptwI2Vi/PG KopT5iLyeQFDrC+RRQMs56u++rlCZ0aRbyYwEYPQ+bP92mbgH5N7UYViwUgAHvA+58o9 4kihY9azwjq4Xl8Jgvrv9A6GQQ8YiNbqyejaKXk+3HHCsuTtC+U/v98fXG74RVWo8Asp Fep0fyEGC+YGdkCOqTY2D4vTnE5fVHfvkXeBj7lE6a6TyCg4A+WWYugTFa3lWzpgg3w5 AC7T/BNzLAtc8vnkwGwEODehgVrv0vlijXI4gPYEMstDg9mrq358nwX0+/IICTr+Whac EO2w== 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=xN2i3eUYzgs2ZUze4CUf13s2M2F1GeUT3vTE1uQXkIQ=; b=bbwRrQotasAWdek1fk9AJ/gKfrGADYoyuvgQ9UFanJlqcUN9IVx1EcPzren06Oa/dX uzYXGUQeJwJAgeeQEaKc/ZpC51GuNUHqNHe7Qr5gJisIDfNfmxo+XZXDAhCdCdY2aV9M U1CL9zzgCFxciY84uOSn/idwvapSdhIJTmDgUMUS3biIxGnjB92neYWrg2PIveDdM+h9 vRBtrkLdSyD44SYRXOx/hwWqpYSShZuYmxwR4v9OY+M4Fj5EsQLC29QK3FIuACmduxfk 6R+M+yFS/qjsTR+lPU4WpbcA09eGLhS+n93vKofZdsM5gNsL3MK3HONlBltaJWnz3xBk 6xgQ== 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 v3si13566501oif.122.2019.12.26.06.00.26; Thu, 26 Dec 2019 06:00:38 -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 S1726741AbfLZN7G (ORCPT + 99 others); Thu, 26 Dec 2019 08:59:06 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8628 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726597AbfLZN7G (ORCPT ); Thu, 26 Dec 2019 08:59:06 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 99B37949AB90627C46AF; Thu, 26 Dec 2019 21:59:02 +0800 (CST) Received: from DESKTOP-1NISPDV.china.huawei.com (10.173.221.248) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 26 Dec 2019 21:58:53 +0800 From: Zengruan Ye To: , , , , , CC: , , , , , , , , , , Subject: [PATCH v2 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls Date: Thu, 26 Dec 2019 21:58:29 +0800 Message-ID: <20191226135833.1052-3-yezengruan@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20191226135833.1052-1-yezengruan@huawei.com> References: <20191226135833.1052-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: PV_LOCK_FEATURES: 0xC6000020 PV_LOCK_PREEMPTED: 0xC6000021 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 | 14 ++++++++++++++ 2 files changed, 30 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 59494df0f55b..3a5c6b35492f 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -46,6 +46,7 @@ #define ARM_SMCCC_OWNER_OEM 3 #define ARM_SMCCC_OWNER_STANDARD 4 #define ARM_SMCCC_OWNER_STANDARD_HYP 5 +#define ARM_SMCCC_OWNER_VENDOR_HYP 6 #define ARM_SMCCC_OWNER_TRUSTED_APP 48 #define ARM_SMCCC_OWNER_TRUSTED_APP_END 49 #define ARM_SMCCC_OWNER_TRUSTED_OS 50 @@ -377,5 +378,18 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, ARM_SMCCC_OWNER_STANDARD_HYP, \ 0x21) +/* Paravirtualised lock calls */ +#define ARM_SMCCC_HV_PV_LOCK_FEATURES \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_VENDOR_HYP, \ + 0x20) + +#define ARM_SMCCC_HV_PV_LOCK_PREEMPTED \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_VENDOR_HYP, \ + 0x21) + #endif /*__ASSEMBLY__*/ #endif /*__LINUX_ARM_SMCCC_H*/ -- 2.19.1