All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "KarimAllah Ahmed" <karahmed@amazon.de>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Properly check if "page" is valid in kvm_vcpu_unmap
Date: Wed, 10 Jul 2019 16:25:44 +0200	[thread overview]
Message-ID: <1b62d552-b82f-a194-bad1-cb6a08475bba@redhat.com> (raw)
In-Reply-To: <1562749993-12840-1-git-send-email-karahmed@amazon.de>

On 10/07/19 11:13, KarimAllah Ahmed wrote:
> The field "page" is initialized to KVM_UNMAPPED_PAGE when it is not used
> (i.e. when the memory lives outside kernel control). So this check will
> always end up using kunmap even for memremap regions.
> 
> Fixes: e45adf665a53 ("KVM: Introduce a new guest mapping API")
> Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
> ---
>  virt/kvm/kvm_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 2f2d24a..e629766 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1790,7 +1790,7 @@ void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map,
>  	if (!map->hva)
>  		return;
>  
> -	if (map->page)
> +	if (map->page != KVM_UNMAPPED_PAGE)
>  		kunmap(map->page);
>  #ifdef CONFIG_HAS_IOMEM
>  	else
> 

Queued, thanks.

Paolo

      reply	other threads:[~2019-07-10 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  9:13 [PATCH] KVM: Properly check if "page" is valid in kvm_vcpu_unmap KarimAllah Ahmed
2019-07-10 14:25 ` Paolo Bonzini [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=1b62d552-b82f-a194-bad1-cb6a08475bba@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=karahmed@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.