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 42FE2C2D0CD for ; Tue, 17 Dec 2019 14:21:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 237A121775 for ; Tue, 17 Dec 2019 14:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728908AbfLQOVr (ORCPT ); Tue, 17 Dec 2019 09:21:47 -0500 Received: from foss.arm.com ([217.140.110.172]:38616 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728573AbfLQOVq (ORCPT ); Tue, 17 Dec 2019 09:21:46 -0500 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 DD7E31FB; Tue, 17 Dec 2019 06:21:45 -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 E29473F719; Tue, 17 Dec 2019 06:21:43 -0800 (PST) Date: Tue, 17 Dec 2019 14:21:39 +0000 From: Steven Price To: "yezengruan@huawei.com" Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "maz@kernel.org" , James Morse , "linux@armlinux.org.uk" , Suzuki Poulose , "julien.thierry.kdev@gmail.com" , Catalin Marinas , Mark Rutland , "will@kernel.org" , "daniel.lezcano@linaro.org" Subject: Re: [PATCH 1/5] KVM: arm64: Document PV-lock interface Message-ID: <20191217142138.GA38811@arm.com> References: <20191217135549.3240-1-yezengruan@huawei.com> <20191217135549.3240-2-yezengruan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191217135549.3240-2-yezengruan@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 17, 2019 at 01:55:45PM +0000, yezengruan@huawei.com wrote: > From: Zengruan Ye > > Introduce a paravirtualization interface for KVM/arm64 to obtain the vcpu > is currently running or not. > > A hypercall interface is provided for the guest to interrogate the > hypervisor's support for this interface and the location of the shared > memory structures. > > Signed-off-by: Zengruan Ye > --- > Documentation/virt/kvm/arm/pvlock.rst | 31 +++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 Documentation/virt/kvm/arm/pvlock.rst > > diff --git a/Documentation/virt/kvm/arm/pvlock.rst b/Documentation/virt/kvm/arm/pvlock.rst > new file mode 100644 > index 000000000000..eec0c36edf17 > --- /dev/null > +++ b/Documentation/virt/kvm/arm/pvlock.rst > @@ -0,0 +1,31 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +Paravirtualized lock support for arm64 > +====================================== > + > +KVM/arm64 provids some hypervisor service calls to support a paravirtualized > +guest obtaining the vcpu is currently running or not. > + > +Two new SMCCC compatible hypercalls are defined: > + > +* PV_LOCK_FEATURES: 0xC5000040 > +* PV_LOCK_PREEMPTED: 0xC5000041 These values are in the "Standard Hypervisor Service Calls" section of SMCCC - so is there a document that describes this features such that other OSes or hypervisors can implement it? I'm also not entirely sure of the process of ensuring that the IDs picked are non-conflicting. Otherwise if this is a KVM specific interface this should probably belong within the "Vendor Specific Hypervisor Service Calls" section along with some probing that the hypervisor is actually KVM. Although I don't see anything KVM specific. > + > +The existence of the PV_LOCK hypercall should be probed using the SMCCC 1.1 > +ARCH_FEATURES mechanism before calling it. > + > +PV_LOCK_FEATURES > + ============= ======== ========== > + Function ID: (uint32) 0xC5000040 > + PV_call_id: (uint32) The function to query for support. > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the relevant > + PV-lock feature is supported by the hypervisor. > + ============= ======== ========== > + > +PV_LOCK_PREEMPTED > + ============= ======== ========== > + Function ID: (uint32) 0xC5000041 > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the IPA of > + this vcpu's pv data structure is configured by > + the hypervisor. > + ============= ======== ========== >From the code it looks like there's another argument for this SMC - the physical address (or IPA) of a struct pvlock_vcpu_state. This structure also needs to be described as it is part of the ABI. Steve 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 50D7DC2D0CD for ; Tue, 17 Dec 2019 14:21:51 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id CE8D721739 for ; Tue, 17 Dec 2019 14:21:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE8D721739 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 2E3514A54B; Tue, 17 Dec 2019 09:21:50 -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 ks1E6Pjuou4f; Tue, 17 Dec 2019 09:21:48 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E29814A4F7; Tue, 17 Dec 2019 09:21:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AD41C4A4F7 for ; Tue, 17 Dec 2019 09:21:47 -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 Oi-bIKZrAQsd for ; Tue, 17 Dec 2019 09:21:46 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4B0B24A36B for ; Tue, 17 Dec 2019 09:21:46 -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 DD7E31FB; Tue, 17 Dec 2019 06:21:45 -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 E29473F719; Tue, 17 Dec 2019 06:21:43 -0800 (PST) Date: Tue, 17 Dec 2019 14:21:39 +0000 From: Steven Price To: "yezengruan@huawei.com" Subject: Re: [PATCH 1/5] KVM: arm64: Document PV-lock interface Message-ID: <20191217142138.GA38811@arm.com> References: <20191217135549.3240-1-yezengruan@huawei.com> <20191217135549.3240-2-yezengruan@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191217135549.3240-2-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:45PM +0000, yezengruan@huawei.com wrote: > From: Zengruan Ye > > Introduce a paravirtualization interface for KVM/arm64 to obtain the vcpu > is currently running or not. > > A hypercall interface is provided for the guest to interrogate the > hypervisor's support for this interface and the location of the shared > memory structures. > > Signed-off-by: Zengruan Ye > --- > Documentation/virt/kvm/arm/pvlock.rst | 31 +++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 Documentation/virt/kvm/arm/pvlock.rst > > diff --git a/Documentation/virt/kvm/arm/pvlock.rst b/Documentation/virt/kvm/arm/pvlock.rst > new file mode 100644 > index 000000000000..eec0c36edf17 > --- /dev/null > +++ b/Documentation/virt/kvm/arm/pvlock.rst > @@ -0,0 +1,31 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +Paravirtualized lock support for arm64 > +====================================== > + > +KVM/arm64 provids some hypervisor service calls to support a paravirtualized > +guest obtaining the vcpu is currently running or not. > + > +Two new SMCCC compatible hypercalls are defined: > + > +* PV_LOCK_FEATURES: 0xC5000040 > +* PV_LOCK_PREEMPTED: 0xC5000041 These values are in the "Standard Hypervisor Service Calls" section of SMCCC - so is there a document that describes this features such that other OSes or hypervisors can implement it? I'm also not entirely sure of the process of ensuring that the IDs picked are non-conflicting. Otherwise if this is a KVM specific interface this should probably belong within the "Vendor Specific Hypervisor Service Calls" section along with some probing that the hypervisor is actually KVM. Although I don't see anything KVM specific. > + > +The existence of the PV_LOCK hypercall should be probed using the SMCCC 1.1 > +ARCH_FEATURES mechanism before calling it. > + > +PV_LOCK_FEATURES > + ============= ======== ========== > + Function ID: (uint32) 0xC5000040 > + PV_call_id: (uint32) The function to query for support. > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the relevant > + PV-lock feature is supported by the hypervisor. > + ============= ======== ========== > + > +PV_LOCK_PREEMPTED > + ============= ======== ========== > + Function ID: (uint32) 0xC5000041 > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the IPA of > + this vcpu's pv data structure is configured by > + the hypervisor. > + ============= ======== ========== >From the code it looks like there's another argument for this SMC - the physical address (or IPA) of a struct pvlock_vcpu_state. This structure also needs to be described as it is part of the ABI. Steve _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 E7A83C43603 for ; Tue, 17 Dec 2019 14:21:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB2DF21739 for ; Tue, 17 Dec 2019 14:21:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uxWepnOX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB2DF21739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4PwCKm9qJ87DWP6KxO6dXAScDM8AUr8TRBSwaHKI8Ws=; b=uxWepnOXntubzm EDDl3o8aVwgfCy53tI/z2/X9K/sCfQT1fS7lpKo9DUCOq9JqLcVlI+TRQfOPZK2o11Qta6I2KGwW9 YiJBXQaoMYH+fJN8KdV4paMMKFDiLYPWaGYf3FXfFDBnhgVftnNZr+5mPnUKDUV/OmW+IWCfIk61/ ufKNEoAwp6PXSdpAs/l8LWr0HhpouDnZSOM4CT1eWGJc6Hun8FJGs0T4d6dhQ94IGSmWYtC8SdX5P QPRfpJ2hz763ys19/iJVt3V/lGFSaHUU/Ci3GuBADiOnn5FHxV6AC7Hm9ZcrRPKzE8qMCgJA6aA8F /ZzYjHe5LTnZ3mX4UHIA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihDjU-00046f-2W; Tue, 17 Dec 2019 14:21:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihDjQ-00045b-QF for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2019 14:21:50 +0000 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 DD7E31FB; Tue, 17 Dec 2019 06:21:45 -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 E29473F719; Tue, 17 Dec 2019 06:21:43 -0800 (PST) Date: Tue, 17 Dec 2019 14:21:39 +0000 From: Steven Price To: "yezengruan@huawei.com" Subject: Re: [PATCH 1/5] KVM: arm64: Document PV-lock interface Message-ID: <20191217142138.GA38811@arm.com> References: <20191217135549.3240-1-yezengruan@huawei.com> <20191217135549.3240-2-yezengruan@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191217135549.3240-2-yezengruan@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191217_062148_939602_F2736D6B X-CRM114-Status: GOOD ( 19.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "daniel.lezcano@linaro.org" , "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "maz@kernel.org" , Suzuki Poulose , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , James Morse , "julien.thierry.kdev@gmail.com" , Catalin Marinas , "linux@armlinux.org.uk" , "will@kernel.org" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 17, 2019 at 01:55:45PM +0000, yezengruan@huawei.com wrote: > From: Zengruan Ye > > Introduce a paravirtualization interface for KVM/arm64 to obtain the vcpu > is currently running or not. > > A hypercall interface is provided for the guest to interrogate the > hypervisor's support for this interface and the location of the shared > memory structures. > > Signed-off-by: Zengruan Ye > --- > Documentation/virt/kvm/arm/pvlock.rst | 31 +++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 Documentation/virt/kvm/arm/pvlock.rst > > diff --git a/Documentation/virt/kvm/arm/pvlock.rst b/Documentation/virt/kvm/arm/pvlock.rst > new file mode 100644 > index 000000000000..eec0c36edf17 > --- /dev/null > +++ b/Documentation/virt/kvm/arm/pvlock.rst > @@ -0,0 +1,31 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +Paravirtualized lock support for arm64 > +====================================== > + > +KVM/arm64 provids some hypervisor service calls to support a paravirtualized > +guest obtaining the vcpu is currently running or not. > + > +Two new SMCCC compatible hypercalls are defined: > + > +* PV_LOCK_FEATURES: 0xC5000040 > +* PV_LOCK_PREEMPTED: 0xC5000041 These values are in the "Standard Hypervisor Service Calls" section of SMCCC - so is there a document that describes this features such that other OSes or hypervisors can implement it? I'm also not entirely sure of the process of ensuring that the IDs picked are non-conflicting. Otherwise if this is a KVM specific interface this should probably belong within the "Vendor Specific Hypervisor Service Calls" section along with some probing that the hypervisor is actually KVM. Although I don't see anything KVM specific. > + > +The existence of the PV_LOCK hypercall should be probed using the SMCCC 1.1 > +ARCH_FEATURES mechanism before calling it. > + > +PV_LOCK_FEATURES > + ============= ======== ========== > + Function ID: (uint32) 0xC5000040 > + PV_call_id: (uint32) The function to query for support. > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the relevant > + PV-lock feature is supported by the hypervisor. > + ============= ======== ========== > + > +PV_LOCK_PREEMPTED > + ============= ======== ========== > + Function ID: (uint32) 0xC5000041 > + Return value: (int64) NOT_SUPPORTED (-1) or SUCCESS (0) if the IPA of > + this vcpu's pv data structure is configured by > + the hypervisor. > + ============= ======== ========== >From the code it looks like there's another argument for this SMC - the physical address (or IPA) of a struct pvlock_vcpu_state. This structure also needs to be described as it is part of the ABI. Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel