public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	stable@vger.kernel.org, Alyssa Milburn <alyssa.milburn@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Nikolay Borisov <nborisov@suse.com>
Subject: Re: [PATCH 6.7.y 1/6] x86/bugs: Add asm helpers for executing VERW
Date: Tue, 27 Feb 2024 10:42:17 +0100	[thread overview]
Message-ID: <fd8f2df0-563e-4f5c-aca4-bc92a14e9426@kernel.org> (raw)
In-Reply-To: <abc65c4d-4731-4234-b8a2-5eaa4e5a52e7@kernel.org>

On 27. 02. 24, 9:41, Jiri Slaby wrote:
>> Also, RIP-relative addressing was a requirement only for the initial
>> versions of the series, where the VERW operand was pointing within the
>> macro. For performance gains, later versions switched to the
>> implementation in which all VERW sites were pointing to single memory
>> location. With that, RIP-relative addressing could be droped in favor of
>> fixed addresses.
>>
>>> Will this work at all (it looks like verw would now touch random
>>> memory)?
>>
>> AFAIK, all memory operand variants of VERW have the CPU buffer clearing
>> behavior. I will confirm this with the CPU architects.
> 
> I might be too dumb to understand this, so sorry if the below does not 
> make sense. Neither I cannot see "why it works" in the minor patch you 
> sent (and incorporated here). You only explain it's easier for backports 
> and "was needed in earlier versions".
> 
> But verw can #PF (and actually used to before Nik invented the jmp 
> workaround in the SUSE backport). I assume it's the case when the store 
> of the segment (mds_verw_sel) cannot be accessed/read. Now, with fixed 
> addressing this works unless KASLR is employed. If it is, the fixed 
> address of mds_verw_sel no longer points to the correct memory. Or what 
> am I missing?

The assembler generates a relocation for the fixed address anyway. And 
the linker resolves it as rip-relative. At least the pair from my 
binutils-2.42.

But if it generates a rip-relative address, is < 6.5 with no support of 
rip-rel in alternatives still fine?

Another question: can we rely on the assembler to generate a relocation 
and on the linker to resolve it as rip-relative?

thanks,
-- 
js
suse labs


  reply	other threads:[~2024-02-27  9:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  5:00 [PATCH 6.7.y 0/6] Delay VERW - 6.7.y backport Pawan Gupta
2024-02-27  5:00 ` [PATCH 6.7.y 1/6] x86/bugs: Add asm helpers for executing VERW Pawan Gupta
2024-02-27  7:40   ` Jiri Slaby
2024-02-27  7:47     ` Greg KH
2024-02-27  8:29       ` Pawan Gupta
2024-02-27  8:27     ` Pawan Gupta
2024-02-27  8:41       ` Jiri Slaby
2024-02-27  9:42         ` Jiri Slaby [this message]
2024-02-27  5:01 ` [PATCH 6.7.y 2/6] x86/entry_64: Add VERW just before userspace transition Pawan Gupta
2024-02-27  5:01 ` [PATCH 6.7.y 3/6] x86/entry_32: " Pawan Gupta
2024-02-27  5:01 ` [PATCH 6.7.y 4/6] x86/bugs: Use ALTERNATIVE() instead of mds_user_clear static key Pawan Gupta
2024-02-27  5:01 ` [PATCH 6.7.y 5/6] KVM/VMX: Use BT+JNC, i.e. EFLAGS.CF to select VMRESUME vs. VMLAUNCH Pawan Gupta
2024-02-27  5:01 ` [PATCH 6.7.y 6/6] KVM/VMX: Move VERW closer to VMentry for MDS mitigation Pawan Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd8f2df0-563e-4f5c-aca4-bc92a14e9426@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=alyssa.milburn@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=nborisov@suse.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox