From nobody Wed Dec 17 20:50:16 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 E1E90229B2D for ; Fri, 14 Mar 2025 21:42:00 +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=1741988521; cv=none; b=q2kJgk44VZrrQlZnVc4uwb6YJMjqbfaa1M26ekraucypHxBT2TfDPls98pKh//SMkOKI0f0zFrxxhMAUjcy3i+XlVBH6nrzmEwCKPZCrmFgRb2+vo2uOcMcaFp+aQH9Mh0XZPYJzwfZcv32cx/695ESc/ZtGtGuaw6OnDjGGW68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741988521; c=relaxed/simple; bh=SwyNGWtwQgHOApJI6bIB7Y2YZV2fZzV/abNiCm9lxKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZTPF5xAa4ltAFmJ6agUDYmSosGiMIuXQsxYASDYPHybLzNtbp6MwyIuDULG6lgH4gMNag+Oefn3EI6NexBuENFdWTUHAK6g0OplRMFg9540cHiUXuSmR8XqZ4TDE01NmIr7UfKVoarWg9LyQ5jE818pJSY/cv91vkhg+iiAQoYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mkAEvpgF; 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="mkAEvpgF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B87C4CEED; Fri, 14 Mar 2025 21:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741988520; bh=SwyNGWtwQgHOApJI6bIB7Y2YZV2fZzV/abNiCm9lxKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mkAEvpgFyJI9gYhec+b37dyVF5dYFBk8pOV34YLpBDnjAheJGY/+qR28TEQLkYk0G dS4T1jpmZW+aXWmdH9Jf9Ky3pKngBiIDFfa3QFRs4ue5HhoqeKjTfBoSXE8oX+fkJx T476dnurSeVW5kHkvkDqJ3aI+fd8aU71laYyVaMvSAXDujTJYBJU+PwTuswcECs9ts 7o1D20TD3Lx66+EdE+XzvVLTIaahBIQ7Jd+3uFGsovbNLODC8Ym0ucNRNU7dL6YIT+ 48Mp4AAeSapbsGNnCuJReaEUXFR31DqBobSfg2fv4ZLaAXsaU0r88sZf1+puvhJHz9 NP8+CkTad3g1Q== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , Uros Bizjak , Andrew Cooper , Ingo Molnar Subject: [PATCH 11/20] x86/alternative: Make alternative() a wrapper around alternative_io() Date: Fri, 14 Mar 2025 14:41:24 -0700 Message-ID: <7861339dadc2bfff65634db421ca0fc81d468c1e.1741988314.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.48.1 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" To reduce the number of independent implementations, make alternative() and alternative_2() wrappers around alternative_io() and alternative_2_io() respectively. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/alternative.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alte= rnative.h index 0acbb013e7ae..92014d56e3aa 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -204,10 +204,10 @@ static inline int alternatives_text_reserved(void *st= art, void *end) * without volatile and memory clobber. */ #define alternative(oldinstr, newinstr, ft_flags) \ - asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memo= ry") + alternative_io(oldinstr, newinstr, ft_flags,,) =20 #define alternative_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2= ) \ - asm_inline volatile(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinst= r2, ft_flags2) ::: "memory") + alternatve_2_io(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2,,) =20 /* * Alternative inline assembly with input. --=20 2.48.1