From nobody Sun Feb 8 14:12:41 2026 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 A6BFF1F4176 for ; Sat, 10 Jan 2026 00:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768006142; cv=none; b=BCfFyaPV5ruhFUocYcrzqP3dCSCxiYV/2dORNhuyV2uFCzvIFBvqX7e4ef7fB2ZxtmDm1TwEgzGXXZgBycRe5OWPnD0fXJptyaz0VviK/Nl7UrxahAOLyXJssbXegU8aOMOcrPdtCT4PNKeO/mzLftT+/IFJCczYFeUMod6yz4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768006142; c=relaxed/simple; bh=SojqqcISYboX1cXFJdxfxa5hH/87y+nEjPAVkWtudds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SCOTEd89lZQHOwrd+gYXd9BpaGny7LB4R/w6MpEjwxcXA8yGU4nBo+xqRtoVhHDSrAdi1rj2eFXbMl1GYziIqJrxpHhYvWs+3rj/7uWNlK9moIn+UI4Ea3PuCSpV7KA6PzbjGE6uaSu4xE4HPg9wIRhNptSgJqiAooKOg9hD2Ms= 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=Uw5lN4l/; arc=none smtp.client-ip=95.215.58.186 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="Uw5lN4l/" 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=1768006129; 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: in-reply-to:in-reply-to:references:references; bh=6RhzJ2LrOmxGEQ8FXigQpB+k9CuoXxfE/3uJFqEvpSU=; b=Uw5lN4l/2onD4fYJQz79PRUP27iaa4TgEKy1ODanK/eRZ5isk4K8dngwg6Xgr80hFHBaa/ vClt4diw2RaAjAjUGudQRQXTofkz3Z+cfi8QijKEI5DHOyZbFkrdGVk/UsquoCGuF+dlwc xuK76vtesl/FxRao/PzUphB483kC/9c= 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 4/4] RFC: KVM: SVM: WARN if VMSAVE/VMLOAD are not intercepted or virtualized Date: Sat, 10 Jan 2026 00:48:21 +0000 Message-ID: <20260110004821.3411245-5-yosry.ahmed@linux.dev> In-Reply-To: <20260110004821.3411245-1-yosry.ahmed@linux.dev> References: <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: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Signed-off-by: Yosry Ahmed --- arch/x86/kvm/svm/svm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index f1b032114406..983ae98133e9 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1387,6 +1387,14 @@ static void svm_prepare_switch_to_guest(struct kvm_v= cpu *vcpu) if (svm->guest_state_loaded) return; =20 + /* + * Without virtual VMSAVE/VMLOAD, the instruction would directly access + * host physical addresses, so make sure they are intercepted. + */ + if (!(svm->vmcb->control.virt_ext & VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK)) + WARN_ON_ONCE(!svm_is_intercept(svm, INTERCEPT_VMSAVE) || + !svm_is_intercept(svm, INTERCEPT_VMLOAD)); + /* * Save additional host state that will be restored on VMEXIT (sev-es) * or subsequent vmload of host save area. --=20 2.52.0.457.g6b5491de43-goog