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 46C564BEE54; Sat, 12 Sep 2026 09:37:55 +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=1789205876; cv=none; b=OH/LgsUXhr9BPnkys6O16TnmEznUFC7RHMsJ8ak2HWE1jMNj2Hdxkb36bWGW7hZg4BwbeMmep9WGC554rUPGhLQ69q4gSOmWQVBwxZF7VVQNVcKMW9rXacgGMzGsAKhzFp1pPFm6JoyVuBF9aU6GFJbICH8wi8DAKA03BCkm6ZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789205876; c=relaxed/simple; bh=H1VDCYDkPjWyhoU3wj2YK/zRqL/1U47jUbZQPTf8kqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UIMIhKtG4oS2BQovC+NwNglpMUjuMOGjnj/93JePLA5UCj1xbJciGHDtbFMzRy2TGUxxHx9zW7JxUeOLfoVtyZV2aQsw66t34FUbvYhIqGFs+9SwJ7jYXfybrplKUe+QySqOhJqb/+xaOR2qBrS8Nozh/htKdJbNG+4yOKecCTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QJPmdT4h; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QJPmdT4h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D86A71F000FF; Sat, 12 Sep 2026 09:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789205875; bh=jCD4jJjnvp1SiUJCejoFoXVFp8tOqavDPvGDU1S5Ce8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QJPmdT4hM1RY4c7mE4d+fToWKA7DXoWSzBC27CHAg3HXlG2P/b49RQwgUtqeZZPh7 kswxU2nJNQzaY3jsjM4Kt6B59gSmf1zAQvjrRYIQ2EVh4m3vBwrQFrPoaftsdpEmFs T26QK6kH7ejwTI6pxe7LbgeNxzzvj9OoN3xRuV1k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yosry Ahmed , Sean Christopherson , Kai Huang , Paolo Bonzini , Sasha Levin Subject: [PATCH 6.18 0089/1518] KVM: x86: Rename __{g,s}et_sregs2() => kvm_vcpu_ioctl_x86_{g,s}et_sregs2() Date: Sat, 12 Sep 2026 08:37:38 +0200 Message-ID: <20260912065625.479007174@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -124,8 +124,10 @@ static void store_regs(struct kvm_vcpu * static int sync_regs(struct kvm_vcpu *vcpu); static int kvm_vcpu_do_singlestep(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); @@ -6653,7 +6655,7 @@ long kvm_arch_vcpu_ioctl(struct file *fi 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; @@ -6672,7 +6674,7 @@ long kvm_arch_vcpu_ioctl(struct file *fi 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: @@ -12157,7 +12159,8 @@ static void __get_sregs(struct kvm_vcpu (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; @@ -12425,7 +12428,8 @@ static int __set_sregs(struct kvm_vcpu * 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;