From: Wei Liu <wei.liu@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Andrew Cooper <andrew.cooper3@citrix.com>,
Mukesh Rathor <mrathor@linux.microsoft.com>,
Uros Bizjak <ubizjak@gmail.com>, Wei Liu <wei.liu@kernel.org>,
linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v3] x86/hyperv: Use __naked attribute to fix stackless C function
Date: Wed, 4 Mar 2026 05:50:27 +0000 [thread overview]
Message-ID: <20260304055027.GA1903516@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <20260302164530.50005-2-ardb@kernel.org>
On Mon, Mar 02, 2026 at 05:45:31PM +0100, Ard Biesheuvel wrote:
> hv_crash_c_entry() is a C function that is entered without a stack,
> and this is only allowed for functions that have the __naked attribute,
> which informs the compiler that it must not emit the usual prologue and
> epilogue or emit any other kind of instrumentation that relies on a
> stack frame.
>
> So split up the function, and set the __naked attribute on the initial
> part that sets up the stack, GDT, IDT and other pieces that are needed
> for ordinary C execution. Given that function calls are not permitted
> either, use the existing long return coded in an asm() block to call the
> second part of the function, which is an ordinary function that is
> permitted to call other functions as usual.
>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> # asm parts, not hv parts
> Reviewed-by: Mukesh Rathor <mrathor@linux.microsoft.com>
> Acked-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Wei Liu <wei.liu@kernel.org>
> Cc: linux-hyperv@vger.kernel.org
> Fixes: 94212d34618c ("x86/hyperv: Implement hypervisor RAM collection into vmcore")
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Applied to hyperv-fixes. Thanks Ard!
prev parent reply other threads:[~2026-03-04 5:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 16:45 [PATCH v3] x86/hyperv: Use __naked attribute to fix stackless C function Ard Biesheuvel
2026-03-04 5:50 ` Wei Liu [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=20260304055027.GA1903516@liuwe-devbox-debian-v2.local \
--to=wei.liu@kernel.org \
--cc=andrew.cooper3@citrix.com \
--cc=ardb@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mrathor@linux.microsoft.com \
--cc=ubizjak@gmail.com \
--cc=x86@kernel.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