From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB310C43603 for ; Tue, 17 Dec 2019 14:28:58 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 8177021D7D for ; Tue, 17 Dec 2019 14:28:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8177021D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 21FE84A7F0; Tue, 17 Dec 2019 09:28:57 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XURAParu+JZf; Tue, 17 Dec 2019 09:28:55 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DBF4F4A54B; Tue, 17 Dec 2019 09:28:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8C6B64A54B for ; Tue, 17 Dec 2019 09:28:54 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o3wu9S7FJU2B for ; Tue, 17 Dec 2019 09:28:53 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2CEF34A2E7 for ; Tue, 17 Dec 2019 09:28:53 -0500 (EST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F3E71FB; Tue, 17 Dec 2019 06:28:52 -0800 (PST) Received: from arm.com (e112269-lin.cambridge.arm.com [10.1.196.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A44063F67D; Tue, 17 Dec 2019 06:28:50 -0800 (PST) Date: Tue, 17 Dec 2019 14:28:48 +0000 From: Steven Price To: "yezengruan@huawei.com" Subject: Re: [PATCH 2/5] KVM: arm64: Implement PV_LOCK_FEATURES call Message-ID: <20191217142848.GB38811@arm.com> References: <20191217135549.3240-1-yezengruan@huawei.com> <20191217135549.3240-3-yezengruan@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191217135549.3240-3-yezengruan@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: "daniel.lezcano@linaro.org" , "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "maz@kernel.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , Catalin Marinas , "linux@armlinux.org.uk" , "will@kernel.org" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, Dec 17, 2019 at 01:55:46PM +0000, yezengruan@huawei.com wrote: > From: Zengruan Ye > > This provides a mechanism for querying which paravirtualized lock > features are available in this hypervisor. > > 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 | 13 +++++++++++++ > virt/kvm/arm/hypercalls.c | 3 +++ > 3 files changed, 32 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; Somewhere we need to document when 'preempted' is. It looks like it's a 1-bit field from the later patches. > + /* 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..59e65a951959 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -377,5 +377,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_STANDARD_HYP, \ > + 0x40) > + > +#define ARM_SMCCC_HV_PV_LOCK_PREEMPTED \ > + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ > + ARM_SMCCC_SMC_64, \ > + ARM_SMCCC_OWNER_STANDARD_HYP, \ > + 0x41) > + > #endif /*__ASSEMBLY__*/ > #endif /*__LINUX_ARM_SMCCC_H*/ > diff --git a/virt/kvm/arm/hypercalls.c b/virt/kvm/arm/hypercalls.c > index 550dfa3e53cd..ff13871fd85a 100644 > --- a/virt/kvm/arm/hypercalls.c > +++ b/virt/kvm/arm/hypercalls.c > @@ -52,6 +52,9 @@ int kvm_hvc_call_handler(struct kvm_vcpu *vcpu) > case ARM_SMCCC_HV_PV_TIME_FEATURES: > val = SMCCC_RET_SUCCESS; > break; > + case ARM_SMCCC_HV_PV_LOCK_FEATURES: > + val = SMCCC_RET_SUCCESS; > + break; Ideally you wouldn't report that PV_LOCK_FEATURES exists until the actual hypercalls are wired up to avoid breaking a bisect. Steve > } > break; > case ARM_SMCCC_HV_PV_TIME_FEATURES: > -- > 2.19.1 > > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm