From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EFD519D071 for ; Sat, 10 Jan 2026 00:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768006134; cv=none; b=sWC8OjBLX1DHLliE1dJN8sZNgP7aZAG7k+zOUJKYPHyWtHD9NE7l70ipjWFpu6FdINqvuPKIGmg99XyA4+yaemvNSf2+O2wDCof7V+OQKWmyD4kkylLZJxnxr9xZ5H+itlK52qlOCpZx5l2GyktyiR5SjqCgkFd5JHiVRkbW6gI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768006134; c=relaxed/simple; bh=lG8dW8PIr0m2yCiTqjfQSbBUxLhSe6xTy+qzKr9px4A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=O1ynRsSKZdeE1aQzqtEQyfGVdU4Kn6zKyRSnG3p/DwJNCbW8whoD2U8oIepk0NzB6ZIFfkMmblQvNbBfLMhOl1Edgbhr2+xh1D6pd4+bvN9QV01+Fe+V9BUfpJksP6w8ZZofFS2baOgjYbMj6I4pGkN9paKFWKvw4rDnP3EQ5Ts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uu4r54eR; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uu4r54eR" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768006121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GM4LB/x+7ag1lds0sM/ImZ1OlQOTfGEECkRo4fRqTDA=; b=uu4r54eRMCbmKZHAbpaSlHDKSRS9H6nQamzQaBfIgdksM7E9exSx91mi9jM8/Kzz2YwmpP o+G+Z/trnNiB6jezrLYliB4Nq1NVkzmNzMcJNTiNI20b6k3opGtPeQ7Z5C+amSQj2JVX5+ mWqXSAd7FdOPmJJYWIqzkjoggTLYgv0= From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , Kevin Cheng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH 0/4] KVM: nSVM: nested VMSAVE/VMLOAD fixes Date: Sat, 10 Jan 2026 00:48:17 +0000 Message-ID: <20260110004821.3411245-1-yosry.ahmed@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT A couple of fixes for nested VMLOAD/VMSAVE and a selftest that verifies correct behavior. The test fails without patch 1. Patch 4 is a proposed added WARNING, I am not sure if such warnings are generally acceptable and if that's the correct place for it (hence RFC), but I think it's useful to WARN if VMSAVE/VMLOAD are neither intercepted nor virtualized by the CPU, because it means that the guest is directly accessing host memory with them, a massive security hole. The warning doesn't fire with or without the fixes, but at some point I thought there might be such a security bug, and having a warning will give me some peace of mind. Yosry Ahmed (4): KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc KVM: selftests: Add a selftests for nested VMLOAD/VMSAVE RFC: KVM: SVM: WARN if VMSAVE/VMLOAD are not intercepted or virtualized arch/x86/kvm/svm/svm.c | 23 +- tools/testing/selftests/kvm/Makefile.kvm | 1 + .../selftests/kvm/include/x86/processor.h | 1 + .../kvm/x86/nested_vmsave_vmload_test.c | 197 ++++++++++++++++++ 4 files changed, 218 insertions(+), 4 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c -- 2.52.0.457.g6b5491de43-goog