From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CF05643B6ED for ; Fri, 11 Sep 2026 10:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789123288; cv=none; b=WUL6o05yceaL+wI1NN+YTujcULJFLG3VBwntYwCKcp+lcF1PJe4QlrvRoQKMsIeMblILEFjX2l7k9vGsbBbuH2BPIJ3cqPc1NTSoVCvZolJtg3+hptV3ymiyeCeo4yTJMVIr4CFLcgP8TV6r2mOcpT1UFhG8X8AYSZ2Mquq/dV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789123288; c=relaxed/simple; bh=Va8SnBFEUoPhD3gJ05ZfkSM0Oq+1sAR+B0khdaQI7jM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r1OKemYnQEhHwD7wvRTl18Pjb4hVqr2f/HaEVIKxmwtvvlQTz3Ai2duOtf22uSTw97VvIW7xVLu9eVBitGs6xnAVK+LxvhbXcuz0cxQa0IvzWUClIb0vje3OlsLC9kx57IaV8CzMavItqMsZYmnarqRwnt+V194PtTWtKQSJJ3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nzQBgO4C; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nzQBgO4C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0C901F000FF; Fri, 11 Sep 2026 10:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789123286; bh=GU0I+/bMDZB4njkF8/BtkmIRJbpotOmXmHPp4B0TAtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nzQBgO4COomPPjpLGmBpeuvGdNOo1Rfesh1T56q05szKiXRh5pRphtJXvHWccmw5Q eFs1uU8GKwQIs/ASqc3wGA0RLuNqF095fX6yFpkxqQnlPpsIxw3p7LKXeFSBvyly53 x9XoTDHQOTkUTdLzQdWLkpL3XFezy/E5ILyfewbUO6QkxgZDsgphJq7Cg+r0GBl9rq ERWgPQURDU9Tmk9wAuM2WkvPo3J6/6hkUGUnh1Dyq3wn47iVnZsB5nLmXhgn/wU6fa MVKLfk3kMpR+ZtsTaEfFP7VKw85uga+nM6p243NoJqpin4LkWh0SDWkOIPePCB2PQ8 w2IGF19CMQjQw== From: Sasha Levin To: stable@vger.kernel.org Cc: Sean Christopherson , Yosry Ahmed , Kai Huang , Paolo Bonzini , Sasha Levin Subject: [PATCH 7.2.y 1/9] KVM: x86: Rename __{g,s}et_sregs2() => kvm_vcpu_ioctl_x86_{g,s}et_sregs2() Date: Fri, 11 Sep 2026 06:41:15 -0400 Message-ID: <20260911104123.189614-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026090914-waviness-supermom-9b84@gregkh> References: <2026090914-waviness-supermom-9b84@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Christopherson [ Upstream commit bd130c8d72a1c7dde5523b3f3fae9867eafaa1dc ] Rename the KVM_{G,S}ET_SREGS2 helpers in anticipation of moving them out of x86.c (while leaving the ioctl dispatch behind). Having globally visible APIs named __{g,s}et_sregs2() would be "fine", but ugly, given that __{g,s}et_sregs() will NOT be globally visible. As a bonus, this makes it a bit more obvious that the helpers implement newer versions of kvm_arch_vcpu_ioctl_set_sregs(). No functional change intended. Cc: Yosry Ahmed Signed-off-by: Sean Christopherson Reviewed-by: Kai Huang Message-ID: <20260613000329.732085-4-seanjc@google.com> Signed-off-by: Paolo Bonzini Stable-dep-of: e62392bf39eb ("KVM: x86: Disallow EFER.LME and EFER.LMA if long mode is not supported") Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 47cb9eba113b1..55d064c89c148 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -133,8 +133,10 @@ static void __kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); static void store_regs(struct kvm_vcpu *vcpu); static int sync_regs(struct kvm_vcpu *vcpu); -static int __set_sregs2(struct kvm_vcpu *vcpu, struct kvm_sregs2 *sregs2); -static void __get_sregs2(struct kvm_vcpu *vcpu, struct kvm_sregs2 *sregs2); +static int kvm_vcpu_ioctl_x86_set_sregs2(struct kvm_vcpu *vcpu, + struct kvm_sregs2 *sregs2); +static void kvm_vcpu_ioctl_x86_get_sregs2(struct kvm_vcpu *vcpu, + struct kvm_sregs2 *sregs2); static DEFINE_MUTEX(vendor_module_lock); static void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); @@ -6623,7 +6625,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, r = -ENOMEM; if (!u.sregs2) goto out; - __get_sregs2(vcpu, u.sregs2); + kvm_vcpu_ioctl_x86_get_sregs2(vcpu, u.sregs2); r = -EFAULT; if (copy_to_user(argp, u.sregs2, sizeof(struct kvm_sregs2))) goto out; @@ -6642,7 +6644,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, u.sregs2 = NULL; goto out; } - r = __set_sregs2(vcpu, u.sregs2); + r = kvm_vcpu_ioctl_x86_set_sregs2(vcpu, u.sregs2); break; } case KVM_HAS_DEVICE_ATTR: @@ -12215,7 +12217,8 @@ static void __get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) (unsigned long *)sregs->interrupt_bitmap); } -static void __get_sregs2(struct kvm_vcpu *vcpu, struct kvm_sregs2 *sregs2) +static void kvm_vcpu_ioctl_x86_get_sregs2(struct kvm_vcpu *vcpu, + struct kvm_sregs2 *sregs2) { int i; @@ -12483,7 +12486,8 @@ static int __set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) return 0; } -static int __set_sregs2(struct kvm_vcpu *vcpu, struct kvm_sregs2 *sregs2) +static int kvm_vcpu_ioctl_x86_set_sregs2(struct kvm_vcpu *vcpu, + struct kvm_sregs2 *sregs2) { int mmu_reset_needed = 0; bool valid_pdptrs = sregs2->flags & KVM_SREGS2_FLAGS_PDPTRS_VALID; -- 2.53.0