qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>, qemu-devel@nongnu.org
Cc: brijesh.singh@amd.com, ehabkost@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH for-4.1] target/i386: sev: Do not unpin ram device memory region
Date: Mon, 15 Jul 2019 20:29:29 +0200	[thread overview]
Message-ID: <e5f5a2f9-23a6-1fcb-d16a-1907825c4169@redhat.com> (raw)
In-Reply-To: <156320087103.2556.10983987500488190423.stgit@gimli.home>

On 15/07/19 16:28, Alex Williamson wrote:
> The commit referenced below skipped pinning ram device memory when
> ram blocks are added, we need to do the same when they're removed.
> 
> Cc: Brijesh Singh <brijesh.singh@amd.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Fixes: cedc0ad539af ("target/i386: sev: Do not pin the ram device memory region")
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>  target/i386/sev.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index 6dbdc3cdf10f..5ba1384ea1f6 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -161,6 +161,17 @@ sev_ram_block_removed(RAMBlockNotifier *n, void *host, size_t size)
>  {
>      int r;
>      struct kvm_enc_region range;
> +    ram_addr_t offset;
> +    MemoryRegion *mr;
> +
> +    /*
> +     * The RAM device presents a memory region that should be treated
> +     * as IO region and should not have been pinned.
> +     */
> +    mr = memory_region_from_host(host, &offset);
> +    if (mr && memory_region_is_ram_device(mr)) {
> +        return;
> +    }
>  
>      range.addr = (__u64)(unsigned long)host;
>      range.size = size;
> 

Queued, thanks.

Paolo


      parent reply	other threads:[~2019-07-15 18:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:28 [Qemu-devel] [PATCH for-4.1] target/i386: sev: Do not unpin ram device memory region Alex Williamson
2019-07-15 15:53 ` Singh, Brijesh
2019-07-15 18:29 ` 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=e5f5a2f9-23a6-1fcb-d16a-1907825c4169@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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;
as well as URLs for NNTP newsgroup(s).