qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, ehabkost@redhat.com,
	marcel.apfelbaum@gmail.com, brijesh.singh@amd.com
Cc: aarcange@redhat.com
Subject: Re: [PATCH] machine/memory encryption: Disable mem merge
Date: Thu, 30 Jan 2020 20:33:35 +0100	[thread overview]
Message-ID: <2596f4f2-fb41-d8a1-a3e8-043f4edd88e0@redhat.com> (raw)
In-Reply-To: <20200130175046.85850-1-dgilbert@redhat.com>

On 1/30/20 6:50 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> When a host is running with memory encryption, the memory isn't visible
> to the host kernel; attempts to merge that memory are futile because
> what it's really comparing is encrypted memory, usually encrypted
> with different keys.
> 
> Automatically turn mem-merge off when memory encryption is specified.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1796356
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>   hw/core/machine.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 3e288bfceb..029e1f85b8 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -419,6 +419,14 @@ static void machine_set_memory_encryption(Object *obj, const char *value,
>   
>       g_free(ms->memory_encryption);
>       ms->memory_encryption = g_strdup(value);
> +
> +    /*
> +     * With memory encryption, the host can't see the real contents of RAM,
> +     * so there's no point in it trying to merge areas.
> +     */
> +    if (value) {
> +        machine_set_mem_merge(obj, false, errp);

Using the helper is cleaner than accessing ms->mem_merge.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> +    }
>   }
>   
>   static bool machine_get_nvdimm(Object *obj, Error **errp)
> 



  reply	other threads:[~2020-01-30 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 17:50 [PATCH] machine/memory encryption: Disable mem merge Dr. David Alan Gilbert (git)
2020-01-30 19:33 ` Philippe Mathieu-Daudé [this message]
2020-03-09 20:47 ` Eduardo Habkost

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=2596f4f2-fb41-d8a1-a3e8-043f4edd88e0@redhat.com \
    --to=philmd@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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).