From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/3] close #5291: support disabling KSM for specific VMs
Date: Mon, 17 Feb 2025 16:04:42 +0100 [thread overview]
Message-ID: <20250217150444.142182-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250217150444.142182-1-f.ebner@proxmox.com>
KSM exposes a guest's virtual memory to side-channel attacks. Add a VM
configuration option to disable KSM for specific VMs that need to be
protected against such attacks. This makes it possible to still
benefit from KSM for other processes on the host rather than needing
to turn of KSM completely.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
PVE/QemuServer.pm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 808c0e1c..018cdf18 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -723,6 +723,13 @@ EODESCR
description => "List of host cores used to execute guest processes, for example: 0,5,8-11",
optional => 1,
},
+ 'allow-ksm' => {
+ type => 'boolean',
+ description => "Allow memory pages of this guest to be merged via KSM (Kernel Samepage"
+ ." Merging).",
+ optional => 1,
+ default => 1,
+ },
};
my $cicustom_fmt = {
@@ -3994,6 +4001,8 @@ sub config_to_command {
push @$machineFlags, 'confidential-guest-support=sev0';
}
+ push @$machineFlags, 'mem-merge=off' if defined($conf->{'allow-ksm'}) && !$conf->{'allow-ksm'};
+
push @$cmd, @$devices;
push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags);
push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags);
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-02-17 15:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 15:04 [pve-devel] [PATCH qemu-server/manager/docs 0/3] " Fiona Ebner
2025-02-17 15:04 ` Fiona Ebner [this message]
2025-02-17 15:04 ` [pve-devel] [PATCH manager 2/3] close #5291: ui: qemu: memory edit: " Fiona Ebner
2025-02-17 15:04 ` [pve-devel] [PATCH docs 3/3] kernel samepage merging: describe how to disable for a specific VM Fiona Ebner
2025-02-18 12:39 ` [pve-devel] [PATCH qemu-server/manager/docs 0/3] close #5291: support disabling KSM for specific VMs Friedrich Weber
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=20250217150444.142182-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.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.