From: "Hanne-Lotta Mäenpää" <hannelotta@gmail.com>
To: Clark Williams <clrkwllms@kernel.org>, stable@vger.kernel.org
Cc: bpf@vger.kernel.org, x86@ekrnel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v2 2/2] KVM: VMX: guard regparm(0) on vmread_error_trampoline for x86_32 only
Date: Wed, 17 Jun 2026 14:20:12 +0300 [thread overview]
Message-ID: <09f69783-3eca-4318-b09b-78e6730e899c@gmail.com> (raw)
In-Reply-To: <20260617011303.3969027-3-clrkwllms@kernel.org>
On 6/17/26 4:13 AM, Clark Williams wrote:
> [ Upstream commit 0b5e7a16a0a79a3742f0df9e45bca46f01b40e6a ]
>
> regparm(0) overrides the kernel's -mregparm=3 convention on x86-32 so
> that vmread_error_trampoline receives its arguments on the stack, matching
> the inline asm callers that push args before the call. On x86-64 the
> attribute is a no-op and newer GCC now emits -Wattributes for it, which
> becomes a build error under -Werror. Guard it with CONFIG_X86_32.
>
> [ clrkwllms: the upstream commit redesigns the trampoline declaration as
> an opaque symbol; this simpler approach guards the regparm(0) attribute
> with CONFIG_X86_32 since the attribute is only meaningful on x86-32. ]
>
> Assisted-by: Claude:claude-sonnet-4.6
> Signed-off-by: Clark Williams <clrkwllms@kernel.org>
> ---
> arch/x86/kvm/vmx/vmx_ops.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h
> index 5edab28dfb2e..50328be40b2b 100644
> --- a/arch/x86/kvm/vmx/vmx_ops.h
> +++ b/arch/x86/kvm/vmx/vmx_ops.h
> @@ -11,8 +11,11 @@
> #include "../x86.h"
>
> void vmread_error(unsigned long field, bool fault);
> -__attribute__((regparm(0))) void vmread_error_trampoline(unsigned long field,
> - bool fault);
> +/* regparm(0) overrides -mregparm=3 so args are stack-passed, matching asm callers */
> +#ifdef CONFIG_X86_32
> +__attribute__((regparm(0)))
> +#endif
> +void vmread_error_trampoline(unsigned long field, bool fault);
> void vmwrite_error(unsigned long field, unsigned long value);
> void vmclear_error(struct vmcs *vmcs, u64 phys_addr);
> void vmptrld_error(struct vmcs *vmcs, u64 phys_addr);
Hi,
I've sent a backport patch for this commit, see here:
https://lore.kernel.org/lkml/20260617105100.22094-1-hannelotta@gmail.com/
The commit applies cleanly without any modifications, and compiles
without errors with gcc-16, and boots.
For commits that apply cleanly, you can simply use:
git cherry-pick -s -x <commit-id>
And after that
git commit --amend
to add the required [ Upstream commit <commit-id> ] line.
I wasn't able to see other compilation errors for v6.1.175 using gcc-16.
I tried with allyesconfig and my local config.
Hope this helps.
Best regards,
Hanne-Lotta Mäenpää
prev parent reply other threads:[~2026-06-17 11:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 1:13 [PATCH v2 0/2] linux-6.1.y: fix build errors with newer GCC/glibc Clark Williams
2026-06-17 1:13 ` [PATCH v2 1/2] tools/lib/bpf: fix const-qualifier discard in resolve_full_path Clark Williams
2026-06-17 3:10 ` Alexei Starovoitov
2026-06-17 1:13 ` [PATCH v2 2/2] KVM: VMX: guard regparm(0) on vmread_error_trampoline for x86_32 only Clark Williams
2026-06-17 11:20 ` Hanne-Lotta Mäenpää [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=09f69783-3eca-4318-b09b-78e6730e899c@gmail.com \
--to=hannelotta@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=clrkwllms@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=x86@ekrnel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox