public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v2 1/3] close #5291: support disabling KSM for specific VMs
Date: Thu, 13 Nov 2025 16:51:07 +0100	[thread overview]
Message-ID: <20251113155127.591195-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20251113155127.591195-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>
---
 src/PVE/QemuServer.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 128b8f47..af333e50 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -731,6 +731,13 @@ EODESCR
             "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 = {
@@ -3781,6 +3788,8 @@ sub config_to_command {
         push @$machineFlags, 'kernel_irqchip=split';
     }
 
+    push @$machineFlags, 'mem-merge=off' if defined($conf->{'allow-ksm'}) && !$conf->{'allow-ksm'};
+
     PVE::QemuServer::Virtiofs::config($conf, $vmid, $devices);
 
     push @$cmd, @$devices;
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-11-13 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 15:51 [pve-devel] [PATCH-SERIES qemu-server/manager/docs v2 0/3] " Fiona Ebner
2025-11-13 15:51 ` Fiona Ebner [this message]
2025-11-13 15:51 ` [pve-devel] [PATCH manager v2 2/3] close #5291: ui: qemu: memory edit: " Fiona Ebner
2025-11-13 15:51 ` [pve-devel] [PATCH docs v2 3/3] kernel samepage merging: describe how to disable for a specific VM Fiona Ebner

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=20251113155127.591195-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal