From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 515331FF16E for ; Mon, 17 Feb 2025 16:05:27 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5CCC52B7F0; Mon, 17 Feb 2025 16:05:21 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 17 Feb 2025 16:04:42 +0100 Message-Id: <20250217150444.142182-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250217150444.142182-1-f.ebner@proxmox.com> References: <20250217150444.142182-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.045 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 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 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 --- 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