From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 90B191FF17E for ; Thu, 13 Nov 2025 16:50:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1198621A5C; Thu, 13 Nov 2025 16:51:35 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Thu, 13 Nov 2025 16:51:07 +0100 Message-ID: <20251113155127.591195-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251113155127.591195-1-f.ebner@proxmox.com> References: <20251113155127.591195-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1763049064704 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server v2 1/3] close #5291: support disabling KSM for specific VMs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 --- 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