Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: intel-gfx@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Intel-gfx] [FYI PATCH] i915: kvmgt: the KVM mmu_lock is now an rwlock
Date: Tue, 9 Feb 2021 09:05:21 +0800	[thread overview]
Message-ID: <20210209010521.GB2043@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <20210208113437.94661-1-pbonzini@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2676 bytes --]

On 2021.02.08 06:34:37 -0500, Paolo Bonzini wrote:
> Adjust the KVMGT page tracking callbacks.
> 
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Zhi Wang <zhi.a.wang@intel.com>
> Cc: intel-gvt-dev@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

Thanks for that!

Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>

>  drivers/gpu/drm/i915/gvt/kvmgt.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 60f1a386dd06..b4348256ae95 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -1703,7 +1703,7 @@ static int kvmgt_page_track_add(unsigned long handle, u64 gfn)
>  		return -EINVAL;
>  	}
>  
> -	spin_lock(&kvm->mmu_lock);
> +	write_lock(&kvm->mmu_lock);
>  
>  	if (kvmgt_gfn_is_write_protected(info, gfn))
>  		goto out;
> @@ -1712,7 +1712,7 @@ static int kvmgt_page_track_add(unsigned long handle, u64 gfn)
>  	kvmgt_protect_table_add(info, gfn);
>  
>  out:
> -	spin_unlock(&kvm->mmu_lock);
> +	write_unlock(&kvm->mmu_lock);
>  	srcu_read_unlock(&kvm->srcu, idx);
>  	return 0;
>  }
> @@ -1737,7 +1737,7 @@ static int kvmgt_page_track_remove(unsigned long handle, u64 gfn)
>  		return -EINVAL;
>  	}
>  
> -	spin_lock(&kvm->mmu_lock);
> +	write_lock(&kvm->mmu_lock);
>  
>  	if (!kvmgt_gfn_is_write_protected(info, gfn))
>  		goto out;
> @@ -1746,7 +1746,7 @@ static int kvmgt_page_track_remove(unsigned long handle, u64 gfn)
>  	kvmgt_protect_table_del(info, gfn);
>  
>  out:
> -	spin_unlock(&kvm->mmu_lock);
> +	write_unlock(&kvm->mmu_lock);
>  	srcu_read_unlock(&kvm->srcu, idx);
>  	return 0;
>  }
> @@ -1772,7 +1772,7 @@ static void kvmgt_page_track_flush_slot(struct kvm *kvm,
>  	struct kvmgt_guest_info *info = container_of(node,
>  					struct kvmgt_guest_info, track_node);
>  
> -	spin_lock(&kvm->mmu_lock);
> +	write_lock(&kvm->mmu_lock);
>  	for (i = 0; i < slot->npages; i++) {
>  		gfn = slot->base_gfn + i;
>  		if (kvmgt_gfn_is_write_protected(info, gfn)) {
> @@ -1781,7 +1781,7 @@ static void kvmgt_page_track_flush_slot(struct kvm *kvm,
>  			kvmgt_protect_table_del(info, gfn);
>  		}
>  	}
> -	spin_unlock(&kvm->mmu_lock);
> +	write_unlock(&kvm->mmu_lock);
>  }
>  
>  static bool __kvmgt_vgpu_exist(struct intel_vgpu *vgpu, struct kvm *kvm)
> -- 
> 2.26.2
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-02-09  1:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 11:34 [Intel-gfx] [FYI PATCH] i915: kvmgt: the KVM mmu_lock is now an rwlock Paolo Bonzini
2021-02-08 17:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-02-08 22:26 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-02-09  1:05 ` Zhenyu Wang [this message]
2021-02-09  3:17 ` [Intel-gfx] [FYI PATCH] " kernel test robot
2021-02-09  7:56 ` kernel test robot

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=20210209010521.GB2043@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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