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 B11B53E3D90 for ; Fri, 11 Sep 2026 02:31:09 +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=1789093870; cv=none; b=MKeV1KfT3t/4PgGV7APDL1QeJxuv+I9+JDqmxdxrhWvhHNBQHeP+azhHd+lbCMKgxS7aSrdsnk3t6E+8pARB9YzKLmV9fEF18PvtBZ4BOk99yYWT18jVMkaF86vBKC1vfpmt/PTY4w03cmXzApuRYyCYwkF5GedWeuAFsvBd/ao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789093870; c=relaxed/simple; bh=6yr938s+dFLuHxDsjs4JTCa0S1m0/qeupcdlXs+Xzj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W72+870y5oJ6mvtsLWEMJHD56fdy7eUXbyXo2/fulrjaTfMcXReufFLT635Y0vxpsYNJ0krA4V4HhBGW4y0u9buLIC3VCZwtG3GwvpiwiYPJ8f0W/qBy8t0W9yOCmuYE6v36WfoKGk6SlFRegXmD/oMqPcBnIJ3/FzWl43OG9FI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lcZ6Ioqg; 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="lcZ6Ioqg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F123D1F00893; Fri, 11 Sep 2026 02:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789093869; bh=3uiKudPbgtas8i0+DZdt1pk73opu3QQl5KnIKQpw5h4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lcZ6IoqgLR26Bee/DJwjoLqXRyLpb8jv3DnsaVCd0pOCoYvHmeHZSDPn+XXxxfsyv JNQW47HlrOjIgLCuMvrFMYMqf8L3SZ15bjNQmTqCP2wjCLRasIeHzYPqM3w3ceR8AN n7kAtFh1JiiY/Uv81UwukpOV7z+qfTpC9jK0H1a11lT3yweSTRdA/R8YAuuzYeE6M9 63wD+Ce/Y3VePxCMltMmic3gY9choNuRbt7Sw4gcmtk7InAhCInZ3ykPO8/8l+vJZX FSHLvF/zz1FBjwowopIsUnKu9gwnkyXEVPvcfh9NhWLFQeYGyLVHC5siO6QbCgglDW tw3cwu1vTeQDw== From: Sasha Levin To: stable@vger.kernel.org Cc: Sean Christopherson , Yosry Ahmed , Kai Huang , Paolo Bonzini , Sasha Levin Subject: [PATCH 7.2.y 3/5] KVM: x86: Rename __{g,s}et_sregs2() => kvm_vcpu_ioctl_x86_{g,s}et_sregs2() Date: Thu, 10 Sep 2026 22:31:03 -0400 Message-ID: <20260911023105.76544-3-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260911023105.76544-1-sashal@kernel.org> References: <2026090910-manned-fang-c784@gregkh> <20260911023105.76544-1-sashal@kernel.org> 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: 184bd464bdb6 ("KVM: x86: Check EFER validity on KVM_SET_SREGS*") 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 955e341745f02..5fa457b1e08ea 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: @@ -12210,7 +12212,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; @@ -12478,7 +12481,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