From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [PULL 06/13] machine/memory encryption: Disable mem merge
Date: Tue, 17 Mar 2020 21:17:41 -0400 [thread overview]
Message-ID: <20200318011748.2104336-7-ehabkost@redhat.com> (raw)
In-Reply-To: <20200318011748.2104336-1-ehabkost@redhat.com>
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>
Message-Id: <20200130175046.85850-1-dgilbert@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@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 9e8c06036f..4778bc6b08 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -425,6 +425,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);
+ }
}
static bool machine_get_nvdimm(Object *obj, Error **errp)
--
2.24.1
next prev parent reply other threads:[~2020-03-18 1:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 1:17 [PULL 00/13] x86 and machine queue for 5.0 soft freeze Eduardo Habkost
2020-03-18 1:17 ` [PULL 01/13] target/i386: Add Denverton-v2 (no MPX) CPU model Eduardo Habkost
2020-03-18 1:17 ` [PULL 02/13] target/i386: Add new property note to versioned CPU models Eduardo Habkost
2020-03-18 1:17 ` [PULL 03/13] i386: Add missing cpu feature bits in EPYC model Eduardo Habkost
2020-03-18 1:17 ` [PULL 04/13] i386: Add 2nd Generation AMD EPYC processors Eduardo Habkost
2020-03-18 1:17 ` [PULL 05/13] hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs Eduardo Habkost
2020-03-18 1:17 ` Eduardo Habkost [this message]
2020-03-18 1:17 ` [PULL 07/13] cpu: Use DeviceClass reset instead of a special CPUClass reset Eduardo Habkost
2020-03-18 7:59 ` Philippe Mathieu-Daudé
2020-03-18 1:17 ` [PULL 08/13] hw/i386: Introduce X86CPUTopoInfo to contain topology info Eduardo Habkost
2020-03-18 1:17 ` [PULL 09/13] hw/i386: Consolidate topology functions Eduardo Habkost
2020-03-18 1:17 ` [PULL 10/13] machine: Add SMP Sockets in CpuTopology Eduardo Habkost
2020-03-18 1:17 ` [PULL 11/13] hw/i386: Remove unnecessary initialization in x86_cpu_new Eduardo Habkost
2020-03-18 1:17 ` [PULL 12/13] hw/i386: Update structures to save the number of nodes per package Eduardo Habkost
2020-03-18 1:17 ` [PULL 13/13] hw/i386: Rename apicid_from_topo_ids to x86_apicid_from_topo_ids Eduardo Habkost
2020-03-19 15:30 ` [PULL 00/13] x86 and machine queue for 5.0 soft freeze Peter Maydell
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=20200318011748.2104336-7-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).