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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BC787C433FE for ; Mon, 7 Nov 2022 18:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ELSQ330RG2pVMwukvi2q8AZ40zZcbZeVGsNFQVgXsYk=; b=EoYtJBOYGgfpaG z/EqGq9ylxouu2tJQKRGsV6Emg2M5+t1rc/gJfhVPMs6A2vpQn8ChXfCmDt0zexD4CnmgCOJOofw3 4Lz4nWDdWz8BdOsSkpN9BzxG4QnM/SDQo0UJ9+Hs/leYRjLnCNVUNRpKQPMVFn1vnvW1YMqODk8I7 o7+PURUusaoDuqQBZUzPR5FopHTJ4G8xgjVuupvEr0RI9VOaNrag5pWa0V+l9a/MOvIQGBzoW6Y4Z 2filBIlYZmTdOsRzS8JnwFdrzfpZdiqszomNldQPEpclMWsMfjrpqqtpK9w+JUwK6Pyb873Pu06P5 NmsCc29OvcCYvzNtnCDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os6Yc-00H3pA-Vi; Mon, 07 Nov 2022 18:09:16 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os6Ue-00H1yW-VH for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 18:05:10 +0000 Received: by mail-wm1-x334.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso10178067wma.1 for ; Mon, 07 Nov 2022 10:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Gix4kQCW8Z4JM85AwAtCPZnOkOivM313FvF7kbWiWq0=; b=DXy71LDtU0EoyrfIGmmciQOnFX8VVxM5fj06HrkbDiknlRP/l2NtTfkYJHCIv6FCLa d3UymtM4nMKQv3auDg15bEEiYl7q64OVgabttD5pgT2j569P5TttC+wAM8bh4GBckaIp DelKnF7Wg8rzPmSNE23I5ZHx4y5ojdLLO0NMnseiAnRudEfvtzEn8Fx3lJNOTQ6+v2rX AJn4x7vbTUa2d4qPZrPZsjGLDXGKm18Q6fOr+LJT3HGu2OUzUKDXqRhaEDKhqDb9qHMd 1IQVeg4k+lzrdwk3GOV5oHkvgUKYJ/KbL14Wj5AxhsSheExkj65neVGsp1ZUYshJPuZ+ yC+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gix4kQCW8Z4JM85AwAtCPZnOkOivM313FvF7kbWiWq0=; b=g+yxyCcioRUzOrS26Im3/VpaBcL0umWvN7DY/2Ssm4i1/wYI7xpFdTkT5AsLrkgUky yV6+79f+9yTserkd/jwj5sjxeVkG4i/e7qn+vd+zYZH3qjQQNVf4ph/FO72Io4PRJ92q YANljbFUbiQwl9uM25Abrq3pbmH0/guOn9sWMNPc6pc9an6OUm1rr38wrNVKxnjqz1pp IAZiq1nZzq1eA/2oKHJxShfu4W1j0pwdkpGQbWcAdu6fTO51lolloL+LZMycEMg8LpLM eQTOukdOyZs+qC76+yPj2T+kqHpb65+8clNzeCmIl1ThZfgSqfDFVA7Nm/5zyd37csF6 WPPw== X-Gm-Message-State: ACrzQf1X8v/KKU/zoKUrXtXdPIMECmhdoA8maPEAGiFGWrzKo2Mw8ed2 L8U+++2/TyX7Ik8zZCvFVsLxng== X-Google-Smtp-Source: AMsMyM6PIMZL/CchhWwggUhd4+4tCOaRIODBuhqs5nYrUTHI4qAjb0xTYz6rrjqPbzDo/aw6NO5FFQ== X-Received: by 2002:a05:600c:1d96:b0:3cf:7cdb:fbc2 with SMTP id p22-20020a05600c1d9600b003cf7cdbfbc2mr25000939wms.37.1667844302576; Mon, 07 Nov 2022 10:05:02 -0800 (PST) Received: from ?IPV6:2a02:6b6a:b4d7:0:ebf7:de38:f6bc:8fe8? ([2a02:6b6a:b4d7:0:ebf7:de38:f6bc:8fe8]) by smtp.gmail.com with ESMTPSA id z3-20020adfe543000000b0023538fb27c1sm7766791wrm.85.2022.11.07.10.05.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 10:05:01 -0800 (PST) Message-ID: <5ad52760-4320-028c-aa8a-aeeba6097847@bytedance.com> Date: Mon, 7 Nov 2022 18:05:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [v2 1/6] KVM: arm64: Document PV-lock interface Content-Language: en-US To: Punit Agrawal 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, linux@armlinux.org.uk, yezengruan@huawei.com, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, steven.price@arm.com, mark.rutland@arm.com, bagasdotme@gmail.com, fam.zheng@bytedance.com, liangma@liangbit.com References: <20221104062105.4119003-1-usama.arif@bytedance.com> <20221104062105.4119003-2-usama.arif@bytedance.com> <87k0463axq.fsf@stealth> From: Usama Arif In-Reply-To: <87k0463axq.fsf@stealth> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_100509_073857_88882FF6 X-CRM114-Status: GOOD ( 21.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/11/2022 17:56, Punit Agrawal wrote: > Hi Usama, > > Usama Arif writes: > >> Introduce a paravirtualization interface for KVM/arm64 to obtain whether >> the VCPU is currently running or not. >> >> The PV lock structure of the guest is allocated by user space. >> >> A hypercall interface is provided for the guest to interrogate the >> location of the shared memory structures. >> >> Signed-off-by: Zengruan Ye >> Signed-off-by: Usama Arif >> --- >> Documentation/virt/kvm/arm/index.rst | 1 + >> Documentation/virt/kvm/arm/pvlock.rst | 52 +++++++++++++++++++++++++ >> Documentation/virt/kvm/devices/vcpu.rst | 25 ++++++++++++ >> 3 files changed, 78 insertions(+) >> create mode 100644 Documentation/virt/kvm/arm/pvlock.rst >> >> diff --git a/Documentation/virt/kvm/arm/index.rst b/Documentation/virt/kvm/arm/index.rst >> index e84848432158..b8499dc00a6a 100644 >> --- a/Documentation/virt/kvm/arm/index.rst >> +++ b/Documentation/virt/kvm/arm/index.rst >> @@ -10,4 +10,5 @@ ARM >> hyp-abi >> hypercalls >> pvtime >> + pvlock >> ptp_kvm >> diff --git a/Documentation/virt/kvm/arm/pvlock.rst b/Documentation/virt/kvm/arm/pvlock.rst >> new file mode 100644 >> index 000000000000..d3c391b16d36 >> --- /dev/null >> +++ b/Documentation/virt/kvm/arm/pvlock.rst >> @@ -0,0 +1,52 @@ >> +.. SPDX-License-Identifier: GPL-2.0 >> + >> +Paravirtualized lock support for arm64 >> +====================================== >> + >> +KVM/arm64 provides a hypervisor service call for paravirtualized guests to >> +determine whether a VCPU is currently running or not. >> + >> +A new SMCCC compatible hypercall is defined: >> + >> +* ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID: 0xC6000002 >> + >> +ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID >> + >> + ============= ======== ========================================== >> + Function ID: (uint32) 0xC6000002 >> + Return value: (int64) IPA of the pv lock data structure for this >> + VCPU. On failure: >> + NOT_SUPPORTED (-1) >> + ============= ======== ========================================== >> + >> +The IPA returned by PV_LOCK_PREEMPTED should be mapped by the guest as normal >> +memory with inner and outer write back caching attributes, in the inner >> +shareable domain. >> + >> +PV_LOCK_PREEMPTED returns the structure for the calling VCPU. >> + >> +PV lock state >> +------------- >> + >> +The structure pointed to by the PV_LOCK_PREEMPTED hypercall is as follows: >> + >> ++-----------+-------------+-------------+---------------------------------+ >> +| Field | Byte Length | Byte Offset | Description | >> ++===========+=============+=============+=================================+ >> +| preempted | 8 | 0 | Indicate if the VCPU that owns | >> +| | | | this struct is running or not. | >> +| | | | Non-zero values mean the VCPU | >> +| | | | has been preempted. Zero means | >> +| | | | the VCPU is not preempted. | >> ++-----------+-------------+-------------+---------------------------------+ >> + >> +The preempted field will be updated to 1 by the hypervisor prior to scheduling >> +a VCPU. When the VCPU is scheduled out, the preempted field will be updated >> +to 0 by the hypervisor. > > The text above doesn't match the description in the table. Please update > the texts to align them with the code. > Will make it clearer in the next revision. Thanks. > [...] > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel