From: Joerg Roedel <joro@8bytes.org>
To: Alexey Kardashevskiy <aik@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
kvm@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Sean Christopherson <seanjc@google.com>,
Jiri Kosina <jkosina@suse.cz>, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [Question PATCH kernel] x86/amd/sev/nmi+vc: Fix stack handling (why is this happening?)
Date: Mon, 30 Jan 2023 10:17:32 +0100 [thread overview]
Message-ID: <Y9eLLGug11f+kOb+@8bytes.org> (raw)
In-Reply-To: <Y9UolYXFzvocxIcn@8bytes.org>
On Sat, Jan 28, 2023 at 02:52:23PM +0100, Joerg Roedel wrote:
> Yeah, something like this will be the fix. I am still thinking about
> the right place to put the volatile to make it explicit to the situation
> we are encountering here (which is SEV-ES specific).
>
> Best would be an explicit barrier in C code between sev_es_ist_enter()
> and the DR7 read, but all barriers I tried to far only seem to affect
> memory instructions and had no influence on the DR7 read (which is
> obviously not considered as a memory read by the compiler).
>
> The best place to put the barrier is in the sev_es_ist_enter() inline
> function, right after the static_call to __sev_es_ist_enter().
Okay, after some investigation I was not able to find a compiler barrier
which affects DR7 read ordering. This leaves us with the only solution
of directly forbidding DR7 register access re-ordering by adding a
volatile to the asm, like you did before.
I will send a fix later today.
Regards,
Joerg
next prev parent reply other threads:[~2023-01-30 9:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 3:56 [Question PATCH kernel] x86/amd/sev/nmi+vc: Fix stack handling (why is this happening?) Alexey Kardashevskiy
2023-01-27 9:08 ` Peter Zijlstra
2023-01-27 10:37 ` Joerg Roedel
2023-01-27 11:56 ` Alexey Kardashevskiy
2023-01-27 12:59 ` Joerg Roedel
2023-01-27 17:25 ` Joerg Roedel
2023-01-28 11:24 ` Alexey Kardashevskiy
2023-01-28 13:52 ` Joerg Roedel
2023-01-30 9:17 ` Joerg Roedel [this message]
2023-01-30 17:30 ` H. Peter Anvin
2023-01-30 18:04 ` Borislav Petkov
2023-01-31 8:57 ` Joerg Roedel
2023-01-31 15:53 ` Sean Christopherson
2023-01-31 16:00 ` Joerg Roedel
2023-01-31 16:47 ` Sean Christopherson
2023-01-27 12:13 ` Alexey Kardashevskiy
2023-01-27 12:41 ` Peter Zijlstra
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=Y9eLLGug11f+kOb+@8bytes.org \
--to=joro@8bytes.org \
--cc=aik@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@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