From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 393D928726D; Fri, 27 Feb 2026 21:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772229021; cv=none; b=c4LUL6igSXEsESn7RyAB07mFOLGCmctsrOWaRwkF/KOB91rQxn8OcjlJOWnl604WeGwVFf7PUbONrI6Xl0RVmGdxYfhlZk3uRYiHAlKLjumUVAw2xOA0NIeWNqMv61kfWFgnrucKQdg7FnyqbyzjGgkYntv+pAb7jTdqxaxKajg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772229021; c=relaxed/simple; bh=NIe3uwFB3ZDCcUT+N2V9tHPzuFm+qj6ja4upwPZjqPI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PT9h6naKifFUJUt2WTnskJHtfL9qOZuLYenGJ5lCbUZEOZ1flfyHnXo+zcJQg1yOLghfW0RA1KTMl2J/Wyzy+8YK5XGHeJeSfOkFvmVDtWUHIiPACrEzoJwXqiNPo2Hf/dvpYuGjWvIgVLdEPuiH8t5RgsIdqtNtQVrYuV1MkFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CsSt0mNJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CsSt0mNJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97935C116C6; Fri, 27 Feb 2026 21:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772229020; bh=NIe3uwFB3ZDCcUT+N2V9tHPzuFm+qj6ja4upwPZjqPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CsSt0mNJ5m5gLXm0JiSiVjlkv2teNisip5hU/vLMw6tg6U240Gswe0MKHD9xVLJUM krvnpaBWhUEUaMyBPj3LZ7e1cY7DWhZ9VqoehGLohg6bzvfZAcUPXDi2N/VaMJ8gJt flmj9gbsQ3GptDKtdE+5yOhKICYr4IlT3mEYR8suXeKRU/Lmoeo1UMOnnlRwohudkI JeojyyLzPR6q4Ee4/YiQcYwdnwhC3b2hCw1xFUeG9Ty6UqPpjAXWfm1e63hB4XlXoz UbyeXI5dJU+5Fx12CNFQwk9qxMYDvz4goXRRgAklH7iDrHRmKclRck1LbjmWC3dIzT Lr+zsX02toSdg== Date: Fri, 27 Feb 2026 21:50:19 +0000 From: Wei Liu To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Mukesh Rathor , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Uros Bizjak , linux-hyperv@vger.kernel.org Subject: Re: [RFT PATCH] x86/hyperv: Use __naked attribute to fix stackless C function Message-ID: <20260227215019.GB976651@liuwe-devbox-debian-v2.local> References: <20260226095056.46410-2-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260226095056.46410-2-ardb+git@google.com> On Thu, Feb 26, 2026 at 10:50:57AM +0100, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > 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. > > Fixes: 94212d34618c ("x86/hyperv: Implement hypervisor RAM collection into vmcore") > Signed-off-by: Ard Biesheuvel Ard, thank you for the patch. For avoidance of doubt, I expect another version to be sent. We will review and test the new version on our side. Wei