public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Keqian Zhu <zhukeqian1@huawei.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Cc: Marc Zyngier <maz@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	wanghaibin.wang@huawei.com
Subject: Re: [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time
Date: Mon, 17 Aug 2020 10:53:08 +0100	[thread overview]
Message-ID: <41523036-7492-d554-e256-32f42959684d@arm.com> (raw)
In-Reply-To: <20200817033729.10848-4-zhukeqian1@huawei.com>

On 17/08/2020 04:37, Keqian Zhu wrote:
> There is a lock version kvm_write_guest. Use it to simplify code.
> 
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>   arch/arm64/kvm/pvtime.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c
> index f7b52ce..2b24e7f 100644
> --- a/arch/arm64/kvm/pvtime.c
> +++ b/arch/arm64/kvm/pvtime.c
> @@ -55,7 +55,6 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
>   	struct pvclock_vcpu_stolen_time init_values = {};
>   	struct kvm *kvm = vcpu->kvm;
>   	u64 base = vcpu->arch.steal.base;
> -	int idx;
>   
>   	if (base == GPA_INVALID)
>   		return base;
> @@ -66,10 +65,7 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
>   	 */
>   	vcpu->arch.steal.steal = 0;
>   	vcpu->arch.steal.last_steal = current->sched_info.run_delay;
> -
> -	idx = srcu_read_lock(&kvm->srcu);
> -	kvm_write_guest(kvm, base, &init_values, sizeof(init_values));
> -	srcu_read_unlock(&kvm->srcu, idx);
> +	kvm_write_guest_lock(kvm, base, &init_values, sizeof(init_values));
>   
>   	return base;
>   }
> 


      parent reply	other threads:[~2020-08-17  9:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17  3:37 [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST Keqian Zhu
2020-08-17  3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
2020-08-17  8:47   ` Andrew Jones
2020-08-17  9:02     ` zhukeqian
2020-08-17  9:39   ` Steven Price
2020-08-17  3:37 ` [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type Keqian Zhu
2020-08-17  7:39   ` Marc Zyngier
2020-08-17  8:43     ` zhukeqian
2020-08-17  9:49       ` Steven Price
2020-08-17 10:56         ` zhukeqian
2020-08-17  3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
2020-08-17  8:52   ` Andrew Jones
2020-08-17  9:53   ` Steven Price [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41523036-7492-d554-e256-32f42959684d@arm.com \
    --to=steven.price@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=zhukeqian1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox