From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 499BC163 for ; Sun, 22 Dec 2024 11:03:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734865406; cv=none; b=abASwV5KbzSVur8EVw0ODDaBZPXODEIbj23h6dvuE/o2fgCRhlTH8j7vzKc4EwdNQcJFPCJoNGhS+olDoQkd+hNwC9tvhEJ4SptrTK5v3xKxsviRwwp2e2h1dlOZoI9LrqmSJ19T439qf2I478uvWRR3yoTMSt5RWG1VXAPCj24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734865406; c=relaxed/simple; bh=IEosLXYbcJEat/4a1iaeXc+WXAlU+8FMJ66QdLuJoNQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YMUWXeEj9iTHLCRNZl4k/H4t0vz2mXfnrhltaVGAMAyPQZNfbeTaQzMBLWFYqHiOoylAu7R1LX4Y24zHNHulOPHNBhDknSA3V/GSPyWQ02JnGDYUI3NDdK3lb3B18DrfCyF2XXMXTg6MWPU+fXoli380de0pXMxnI5ONOhRY3Lc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=QBeTg9tz; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QBeTg9tz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UfSJd9yWHd+1AU6yVOJyPDw3hvjAtQB3QTQpB7n+Iqg=; b=QBeTg9tzgw0L6w6wI5O71j56Lf m5OjTqU1prtkQSz0p3QrqjwiEtBsGZGWShY/GCzX+BKIiS67VWjJOvLnnq3hBi7i8E5RmBcYsJghB Xldoy7rC79YxuPznHNdgZ7dZJ0jCiHuxTejJXlwWCUtiSMgTJGrKUXh6vGI2/Fuhd5F1yb7n/nfzI GpWzccVngsM7AZvaWwUmotsOYN9UzoJlLtgF1Y8D3YwP/SgJXsJytDetxPQhINyU6CNuWFoxNl1VU piQdurjn9HJkO745B0vWVLobYK0SGhAQLAMBqSDAlrO3Qkrb6QlcMdix8g9FI5onLHw9Sp9jSdCET jJl0PGLA==; Received: from 77-249-17-89.cable.dynamic.v4.ziggo.nl ([77.249.17.89] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tPJjm-000000066ct-22Kb; Sun, 22 Dec 2024 11:03:06 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A04A13003AF; Sun, 22 Dec 2024 12:03:05 +0100 (CET) Date: Sun, 22 Dec 2024 12:03:05 +0100 From: Peter Zijlstra To: Andrew Cooper Cc: LKML , Alex Zenla , Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Juergen Gross , stable@kernel.org Subject: Re: [PATCH] x86/static-call: Remove early_boot_irqs_disabled check to fix Xen PVH dom0 Message-ID: <20241222110305.GR11133@noisy.programming.kicks-ass.net> References: <20241221211046.6475-1-andrew.cooper3@citrix.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20241221211046.6475-1-andrew.cooper3@citrix.com> On Sat, Dec 21, 2024 at 09:10:46PM +0000, Andrew Cooper wrote: > __static_call_update_early() has a check for early_boot_irqs_disabled, but > is used before early_boot_irqs_disabled is set up in start_kernel(). > > Xen PV has always special cased early_boot_irqs_disabled, but Xen PVH does > not and falls over the BUG when booting as dom0. > > It is very suspect that early_boot_irqs_disabled starts as 0, becomes 1 for > a time, then becomes 0 again, but as this needs backporting to fix a > breakage in a security fix, dropping the BUG_ON() is the far safer option. Agreed. > Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates") > Reported-by: Alex Zenla > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219620 > Suggested-by: Peter Zijlstra > Tested-by: Alex Zenla > Signed-off-by: Andrew Cooper Acked-by: Peter Zijlstra (Intel) > --- > arch/x86/kernel/static_call.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c > index 9eed0c144dad..9e51242ed125 100644 > --- a/arch/x86/kernel/static_call.c > +++ b/arch/x86/kernel/static_call.c > @@ -175,7 +175,6 @@ EXPORT_SYMBOL_GPL(arch_static_call_transform); > noinstr void __static_call_update_early(void *tramp, void *func) > { > BUG_ON(system_state != SYSTEM_BOOTING); > - BUG_ON(!early_boot_irqs_disabled); > BUG_ON(static_call_initialized); > __text_gen_insn(tramp, JMP32_INSN_OPCODE, tramp, func, JMP32_INSN_SIZE); > sync_core(); > > base-commit: e84a3bf7f4aa669c05e3884497774148ac111468 > -- > 2.39.5 >