Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1614404rbb; Mon, 26 Feb 2024 15:52:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsx8h858rYVZEC+X85jywOX2upqF34aLtmxMr9GJ2Kw6M79uUIHfbCW+fMC/NlMsuBGj//K8sX5pVff2XYwveqvQ/mbVKyT4eMg1Apdw== X-Google-Smtp-Source: AGHT+IFwqFWGixvX+QQY6kmRGmiljvD4DReOvkK9JRwXJhXeUiOgi43mz/1TO2RcwYLWH9KeB4Yn X-Received: by 2002:a0c:e24b:0:b0:68f:2f35:4b3d with SMTP id x11-20020a0ce24b000000b0068f2f354b3dmr609544qvl.35.1708991563661; Mon, 26 Feb 2024 15:52:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708991563; cv=pass; d=google.com; s=arc-20160816; b=Hw0oFWdFXtF4PE6FCoiCFsufRRvhvW7linK9pa3hLTvwCWtHjo6FeRL6ogEd+pfeKN 5SBXFFc+9Hgnr90hzKYg7h6p270ymWqsvA8UtheGjx+bjE3syhLYZTMhXryOJxe/qoNp V4/SJ1kqVgcKOhYmgZi/IjvzToe7NSUmNNGTX6JpEYf9opD1aoToV542TOmbq6CODGZP kOFbtz80cis+l1sSYxwMEtuJ5HhCewz5cdP4IbBenYLsDThj0/L16i3u/qxqjMix9ckw B6GLqZbv44S2qDZPBujIW/R9euIMRbcgreMChjPJl1Q0dy7ebv2QOM5DZftkC6/mWkws jb2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=KYuxNfHytXCiu750xUqMLTeHDN76m54tB8hq/19FVdM=; fh=/SW4r5cWHmOVQk4Z9jg6TjPU2RamqwhieJHWWEMeL/U=; b=UF5ydQfys1JVx0o1xxrQD/4zSPau9qRVU4xUoVGCuL/KATuhx56taOMDM8nP0W/A0N 9TsD69obQODdDG832XHV+aBJjWpl2dnflFWG/KBL9aO4a2mRR5+WSoOlK6gMeXAJtiny TXWGlm4C5IWWL5wkWlVR+XrNEOORgnw4DvCNtqrtnYJ6pCTNeSCYtXUQl5opAVkKH/yW 29Q23TlFR7rIVmMXu3gQh40XHvZJcjooeYW2xXHaiuVt5dV71Vvah4t8n9Ma9KKUGreH BQMxvpcwYxpjw4jYfbD7QP+Y67DmvLS08re0pczdxECeqX8Q69GUgQSxlCUXbmir61WR l4TA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eKmUSclU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jv6-20020a05621429e600b0068f13cbbc3asi6326645qvb.83.2024.02.26.15.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 15:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eKmUSclU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C4161C22CD3 for ; Mon, 26 Feb 2024 23:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29099135A5C; Mon, 26 Feb 2024 23:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eKmUSclU" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 658AE1E894 for ; Mon, 26 Feb 2024 23:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708991557; cv=none; b=t0xJF52DaffL8nMiS257jBwGLE1Kyap0+kHL5uzfnGxdg1cGusyaviz6cIdnti0UyLpmj0sqZeUH3SHeb7i54OFtyHHjBOjkYdVbQ6hbm6V5CqDGkxB4c/ss0QJLkf98t0g1m7VDRrfLXSAGP6JC+08C+X7kLAx1PsoH0o4s2Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708991557; c=relaxed/simple; bh=XIVySJ6fBrUqstD49rkPpA3Y2psGokotiQmfXjTagF0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=qZ6mIpuchOR89awBO0bkhCAjSOvpjh2Swd3TYShPlZ32vs7DnXNZrrDUfEiz/KCt16VVnPRmZQxPX2OSBrt199NSSFiAOkdbYPe1IcDDrJUEHoYEVS4b8mGte07ujVgbgnDP+INF6JIG8skehWOz4aWxKX9JafyR83JLUUl26YY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eKmUSclU; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708991555; x=1740527555; h=date:from:to:cc:subject:message-id:mime-version; bh=XIVySJ6fBrUqstD49rkPpA3Y2psGokotiQmfXjTagF0=; b=eKmUSclUeXutWPjCmdUxo/PKMYZ5zh4wDlXnrlhGoTI6fgvJVcldNW/t geD2asjt0yNApa9/+Jtb9JSBg9TS+yEK74KEDdPmkaE4KN5d4455UmHIz KKl+8Ov0GBOHEbHaDvxa1fwUP0TeIS4jtVA0xcCNM/FzZiQBW2gZfC3sM 2bbbrV6SruGBUAfocZswn3J322Bw00I2clCUTgL6Hr2W9hwdT7eX4c+3y +cWaEohXImGpyYe3FawuXEhX+7KaIXBG4449/hi/HNcPUoesecslF4Aae o+rTeR8FvdEUnChl0Ewe5d5qhxyQJ2gnozYSUXvZWS2hFSdPDqBS9j83z g==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3179668" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="3179668" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 15:52:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="11511965" Received: from jhaqq-mobl1.amr.corp.intel.com (HELO desk) ([10.209.17.170]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 15:52:35 -0800 Date: Mon, 26 Feb 2024 15:52:33 -0800 From: Pawan Gupta To: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: Daniel Sneddon , Nikolay Borisov , linux-kernel@vger.kernel.org, Pawan Gupta Subject: [PATCH] x86/bugs: Use fixed addressing for VERW operand Message-ID: <20240226-verw-arg-fix-v1-1-7b37ee6fd57d@linux.intel.com> X-B4-Tracking: v=1; b=H4sIAPAj3WUC/x2MQQqAIBAAvxJ7bsEszPpKdBDbbC8WK1gg/T3pO AMzBRIJU4K5KSCUOfEZK3RtA/5wMRDyVhm00oPS2mAmudFJwJ0fHCfjTK+s9cMGNbmEqv53y/q +H0StzMheAAAA X-Mailer: b4 0.12.3 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 Macro used for MDS mitigation executes VERW with relative addressing for the operand. This is unnecessary and creates a problem for backports on older kernels that don't support relocations in alternatives. Relocation support was added by commit 270a69c4485d ("x86/alternative: Support relocations in alternatives"). Also asm for fixed addressing is much more cleaner than relative RIP addressing. Simplify the asm by using fixed addressing for VERW operand. Fixes: baf8361e5455 ("x86/bugs: Add asm helpers for executing VERW") Reported-by: Nikolay Borisov Closes: https://lore.kernel.org/lkml/20558f89-299b-472e-9a96-171403a83bd6@suse.com/ Signed-off-by: Pawan Gupta --- arch/x86/include/asm/nospec-branch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 2aa52cab1e46..ab19c7f1167b 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -323,7 +323,7 @@ * Note: Only the memory operand variant of VERW clears the CPU buffers. */ .macro CLEAR_CPU_BUFFERS - ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF + ALTERNATIVE "", __stringify(verw mds_verw_sel), X86_FEATURE_CLEAR_CPU_BUF .endm #else /* __ASSEMBLY__ */ --- base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b change-id: 20240226-verw-arg-fix-796a63088c4d