diff options
author | Dr. David Alan Gilbert | 2020-01-30 18:50:46 +0100 |
---|---|---|
committer | Eduardo Habkost | 2020-03-18 00:48:10 +0100 |
commit | 4ba59be1d6d8c57941841a505cb4656628d582d0 (patch) | |
tree | b4c13871339e5ca316976d42c870ae6a43d3a789 /hw/core | |
parent | hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs (diff) | |
download | qemu-4ba59be1d6d8c57941841a505cb4656628d582d0.tar.gz qemu-4ba59be1d6d8c57941841a505cb4656628d582d0.tar.xz qemu-4ba59be1d6d8c57941841a505cb4656628d582d0.zip |
machine/memory encryption: Disable mem merge
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>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/machine.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) |