Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2231378rwb; Mon, 7 Nov 2022 10:42:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM5DtztVGuejXyPZocs2Ephsic1MudXZmu2a9HuNPyXOp2xmND6QVOrBwah+4kZBEe1rogMp X-Received: by 2002:a63:a13:0:b0:440:a593:b79f with SMTP id 19-20020a630a13000000b00440a593b79fmr43609333pgk.557.1667846528720; Mon, 07 Nov 2022 10:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667846528; cv=none; d=google.com; s=arc-20160816; b=tqY17AcDtSxD+Mqakg23c7axz+b8NSK6EpEbQn5En1crPwAkkKFdx1yTcFglq6fk7j IzucfkvFIA/jL/lunK/ALMlB9UZxAcLZyapX4Ehb7btGHk2RQiNKhF+bAXUmXkfIeFYL lk+ZPrA8jqlGoPPzfH+dObu2yHUc9AYtDS8DDeTwnmFmo8YrnzCtsGQ7ngJxKtrGgmRO qTg3IAUgDmOHvHCio33MsysZfrYnIacavmXe0L09ny7LrBs0G97ByW0PbpPTcVNqaw6C 17fv8zruHQucLvGDiHhwl3JyL0Iv0EEGVl72M4zPkZlKDt//DH+fV903Ye1zX0Lapu+D m5Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=uOpqPDyTUSiqcW9AE9ZFTA2+wjqaCyh2aCjJrDKlnbA=; b=WFv1y/E6FIZ0EhYHHjlIDm3yo1eaqDcUodEeTeYWqQyABnWn83lMtsLV5lMaWVNm/o KxLBRw/oNbLiXLw3KYTCha1cple2sZ8dT8dkIPfjGs/8XDKv11EKUF/Cmlvk6/KIbtcj IaZmf8RUjYyY6y8OOxDszn8o3vp/cuaXNZl8oBv5xYh1458q2WsozHkeVYfGSx4tcDIf BjobI7/Ut8ZQyuQgeFbaiyNPdxFmFkdVIrL/suK34TONWH16u+W+hLqUMXIKwifmEOAk bDXzv+xZQR+fhn8E9lvHaI5l5glMD/35o0GqhocFKck69LPccJi7YlE17UD4Hv8z4Lpp YUJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mdr1STT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot8-20020a17090b3b4800b0020243dc975bsi18856961pjb.116.2022.11.07.10.41.56; Mon, 07 Nov 2022 10:42:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mdr1STT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232893AbiKGSLj (ORCPT + 94 others); Mon, 7 Nov 2022 13:11:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbiKGSLQ (ORCPT ); Mon, 7 Nov 2022 13:11:16 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC65252AD for ; Mon, 7 Nov 2022 10:09:15 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id j15so17460081wrq.3 for ; Mon, 07 Nov 2022 10:09:15 -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=uOpqPDyTUSiqcW9AE9ZFTA2+wjqaCyh2aCjJrDKlnbA=; b=mdr1STT8vj0QFWGZb2RRYOAyG3zzA5ctn5Ll2oh1jN5x8qIbZ8lIg5mKdBcxOTCOmu bhpe6oylW71uAfxcyvBrWzh3aU/CPHIOm7uUe1zYlp3oqZKL+xYdLOUoHGGH0/O/Nt10 1tX20jYa4kPHhD6ivBX7xK38FuWE3g0ETVfJ87Mu9wQfDsnl3AognWL4fxNL8jDH197K M5k/J+xmwkq7g0msatKv59uOl6d9TbVxkEueQ+cjNtxXI1ST9N5AsvAd42hsnHOj3wpk bhPsPwfcio7B1y5dR20zt1HUa3QoxZ1Mn4PaXLSR2j3ruXUaddUa0m9/fXqo6VyQN2om UBWg== 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=uOpqPDyTUSiqcW9AE9ZFTA2+wjqaCyh2aCjJrDKlnbA=; b=GFdvK38pl6M34hejPCdKilNRgaOEqtL5GU5oTiCiK7RsB3XjBv+x1Nqt3jzUQqTHmd 6cpp5p/O3ImEfqnrXG2Wb2+T+VGFwSZ7tBrAkWaCTo+X9bYNVCzyMuxAY2XAdaMRYMEN AwK/LckjSpHTMU3acz449XG7un3rzXQPpOwRSGcts73xOBZ2k0d+WdR/w9OPUnWLg0bv 4PAOzvfm6gguM0RgoPde/PsiJuoDHNDUpviTT7dCdvu4FSveKyRGebn0h8qjydoI8E+T VO6UMMl4p9uIDPTqXKxpA8DfgvWIIQ6iZBWwYFzvu2AHMCFnmm9kcQEHVsbhH5fxWBwn VmRA== X-Gm-Message-State: ACrzQf0yqMcQEfhamtoNzInv/l4ViveHQhMfeKjZFz1RVBCZ2cHscmkc Ize/9Om7tPUJm1q+yMSJ4LUd9v0ivgw/ZA== X-Received: by 2002:adf:dc06:0:b0:236:f36f:8263 with SMTP id t6-20020adfdc06000000b00236f36f8263mr18865909wri.522.1667844554317; Mon, 07 Nov 2022 10:09:14 -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 g12-20020adffc8c000000b0022cd96b3ba6sm9140588wrr.90.2022.11.07.10.09.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 10:09:13 -0800 (PST) Message-ID: Date: Mon, 7 Nov 2022 18:09:13 +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 3/6] KVM: arm64: Support pvlock preempted via shared structure 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-4-usama.arif@bytedance.com> <8735au3ap2.fsf@stealth> From: Usama Arif In-Reply-To: <8735au3ap2.fsf@stealth> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2022 18:02, Punit Agrawal wrote: > Usama Arif writes: > >> Implement the service call for configuring a shared structure between a >> VCPU and the hypervisor in which the hypervisor can tell whether the >> VCPU is running or not. >> >> The preempted field is zero if the VCPU is not preempted. >> Any other value means the VCPU has been preempted. >> >> Signed-off-by: Zengruan Ye >> Signed-off-by: Usama Arif >> --- >> Documentation/virt/kvm/arm/hypercalls.rst | 3 ++ >> arch/arm64/include/asm/kvm_host.h | 18 ++++++++++ >> arch/arm64/include/uapi/asm/kvm.h | 1 + >> arch/arm64/kvm/Makefile | 2 +- >> arch/arm64/kvm/arm.c | 8 +++++ >> arch/arm64/kvm/hypercalls.c | 8 +++++ >> arch/arm64/kvm/pvlock.c | 43 +++++++++++++++++++++++ >> tools/arch/arm64/include/uapi/asm/kvm.h | 1 + >> 8 files changed, 83 insertions(+), 1 deletion(-) >> create mode 100644 arch/arm64/kvm/pvlock.c >> >> diff --git a/Documentation/virt/kvm/arm/hypercalls.rst b/Documentation/virt/kvm/arm/hypercalls.rst >> index 3e23084644ba..872a16226ace 100644 >> --- a/Documentation/virt/kvm/arm/hypercalls.rst >> +++ b/Documentation/virt/kvm/arm/hypercalls.rst >> @@ -127,6 +127,9 @@ The pseudo-firmware bitmap register are as follows: >> Bit-1: KVM_REG_ARM_VENDOR_HYP_BIT_PTP: >> The bit represents the Precision Time Protocol KVM service. >> >> + Bit-2: KVM_REG_ARM_VENDOR_HYP_BIT_PV_LOCK: >> + The bit represents the Paravirtualized lock service. >> + >> Errors: >> >> ======= ============================================================= >> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h >> index 45e2136322ba..18303b30b7e9 100644 >> --- a/arch/arm64/include/asm/kvm_host.h >> +++ b/arch/arm64/include/asm/kvm_host.h >> @@ -417,6 +417,11 @@ struct kvm_vcpu_arch { >> u64 last_steal; >> gpa_t base; >> } steal; >> + >> + /* Guest PV lock state */ >> + struct { >> + gpa_t base; >> + } pv; > > Using "pv" for the structure isn't quite describing the usage well. It'd > be better to call it "pv_lock" or "pvlock" at the least. > Yes makes sense, will change in next patchset, Thanks. > [...] >