From nobody Fri Dec 19 14:23:29 2025 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 D18EE2E6CA8 for ; Sat, 6 Dec 2025 21:42:07 +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=1765057328; cv=none; b=VD4ri1MkCYzoO88CK0YqOW8TXJINtMRF5BUpfAdID8GZoeuBaeFz3DXEo5NbMBGksbJw7jyI62u3hr4gvhlwb6EHbjMSqF52zYXvh5Go/IRZfJj2kMsliz2zWrAEE1kfpkmIUP3ew5qJ0GBYDy/YarQkgSwHCGBxlC77A0UO3qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765057328; c=relaxed/simple; bh=bynW1PXxVR1ef5FuIbdHtk/LjqESIuYfTS+rgwC+YEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l5bD4R9w5PHGGhP5uOWxuo6yOSGagQdKw8RirvAbtl7iyBcJiIxbWcug6hyUVSMAZAjghlNdoJa4kwBVz1tGlpvH6uWC8IhzrUYy+RRUIsKqu1Ne2NOgrh2ptga1jxirzSx5vXvaX5IhTNx977A4/gMo+dcrDtqAEG/gaBPHieA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bTLGk0UR; 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="bTLGk0UR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14972C16AAE; Sat, 6 Dec 2025 21:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765057327; bh=bynW1PXxVR1ef5FuIbdHtk/LjqESIuYfTS+rgwC+YEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bTLGk0UR09l0CSjvLvCzQSGKnIPFRz/YS7BkRseBKkhMy0p+Nm1m7CdV573dGDNak aqXaMiLGSeS5or4xOg/Uvw+GYDscHFT23ksIxcS9G+prO8EpHMPo2rpXxzd95xTZjs 4c2T3yu7sqpaNtoQChTVCXl7hJi0KDID2a3n/YNeS3OXDy9QmrLgn5g/sqakBHOFnA CRo+gFRsq3KAPc52aIUrXCtggYgH0jEkzg2VWZ4G2xb1HjkcZayAfDcVhNVGzTvi8x ABnDUskUzrDzOM6EdxBLv8pU/LfdEUDpnJjn8oeXwk96anfq++2KzmasTaPNivnonH AOG1vir6qENwg== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Peter Zijlstra , Borislav Petkov , Thomas Gleixner Subject: [PATCH 7/8] x86/asm: Remove newlines in alternatives Date: Sat, 6 Dec 2025 13:41:14 -0800 Message-ID: <1f7483f82da0f857ff01c6a8e906df088fb0aa05.1765044697.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparation for converting the alternative implementation to assembler macros, remove all newlines from alternative instructions. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/paravirt_types.h | 2 +- arch/x86/include/asm/processor.h | 2 +- arch/x86/include/asm/smap.h | 8 ++++---- arch/x86/include/asm/vmware.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/p= aravirt_types.h index 3502939415ad..a05fcc4f5172 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -249,7 +249,7 @@ extern struct paravirt_patch_template pv_ops; * don't need to bother with CFI prefixes. */ #define PARAVIRT_CALL \ - ANNOTATE_RETPOLINE_SAFE "\n\t" \ + ANNOTATE_RETPOLINE_SAFE "; " \ "call *%[paravirt_opptr];" =20 /* diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/proces= sor.h index a24c7805acdb..816dbddd7507 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -706,7 +706,7 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu) */ static __always_inline void amd_clear_divider(void) { - asm volatile(ALTERNATIVE("", "div %2\n\t", X86_BUG_DIV0) + asm volatile(ALTERNATIVE("", "div %2", X86_BUG_DIV0) :: "a" (0), "d" (0), "r" (1)); } =20 diff --git a/arch/x86/include/asm/smap.h b/arch/x86/include/asm/smap.h index 977bef14a0ab..d9d565024e3b 100644 --- a/arch/x86/include/asm/smap.h +++ b/arch/x86/include/asm/smap.h @@ -77,7 +77,7 @@ static __always_inline unsigned long smap_save(void) unsigned long flags; =20 asm volatile ("# smap_save\n\t" - ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "\n\t" + ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "", "pushf; pop %0; clac", X86_FEATURE_SMAP) : "=3Drm" (flags) : : "memory", "cc"); @@ -88,7 +88,7 @@ static __always_inline unsigned long smap_save(void) static __always_inline void smap_restore(unsigned long flags) { asm volatile ("# smap_restore\n\t" - ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "\n\t" + ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "", "push %0; popf", X86_FEATURE_SMAP) : : "g" (flags) : "memory", "cc"); @@ -101,9 +101,9 @@ static __always_inline void smap_restore(unsigned long = flags) ALTERNATIVE("", "stac", X86_FEATURE_SMAP) =20 #define ASM_CLAC_UNSAFE \ - ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "\n\t" "clac", X86_FEATURE_SM= AP) + ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "; clac", X86_FEATURE_SMAP) #define ASM_STAC_UNSAFE \ - ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "\n\t" "stac", X86_FEATURE_SM= AP) + ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "; stac", X86_FEATURE_SMAP) =20 #endif /* __ASSEMBLER__ */ =20 diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index c9cf43d5ef23..100fba7555bf 100644 --- a/arch/x86/include/asm/vmware.h +++ b/arch/x86/include/asm/vmware.h @@ -90,7 +90,7 @@ extern unsigned long vmware_tdx_hypercall(unsigned long c= md, * set. The high word of %edx may contain input data from the caller. */ #define VMWARE_HYPERCALL \ - ALTERNATIVE_2("movw %[port], %%dx\n\t" \ + ALTERNATIVE_2("movw %[port], %%dx; " \ "inl (%%dx), %%eax", \ "vmcall", X86_FEATURE_VMCALL, \ "vmmcall", X86_FEATURE_VMW_VMMCALL) --=20 2.52.0