* [PATCH] x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer
@ 2020-09-25 13:38 Tom Lendacky
2020-09-25 13:41 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Tom Lendacky @ 2020-09-25 13:38 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
Joerg Roedel
From: Tom Lendacky <thomas.lendacky@amd.com>
Use ghcb_set_sw_scratch() to set the GHCB scratch field, which will also
set the corresponding bit in the GHCB valid_bitmap field.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
arch/x86/kernel/sev-es.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c
index 6fcfdd32769f..4a96726fbaf8 100644
--- a/arch/x86/kernel/sev-es.c
+++ b/arch/x86/kernel/sev-es.c
@@ -751,7 +751,7 @@ static enum es_result vc_do_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt,
/* Can never be greater than 8 */
exit_info_2 = bytes;
- ghcb->save.sw_scratch = ghcb_pa + offsetof(struct ghcb, shared_buffer);
+ ghcb_set_sw_scratch(ghcb, ghcb_pa + offsetof(struct ghcb, shared_buffer));
return sev_es_ghcb_hv_call(ghcb, ctxt, exit_code, exit_info_1, exit_info_2);
}
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer
2020-09-25 13:38 [PATCH] x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer Tom Lendacky
@ 2020-09-25 13:41 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2020-09-25 13:41 UTC (permalink / raw)
To: Tom Lendacky
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
H. Peter Anvin
On Fri, Sep 25, 2020 at 08:38:26AM -0500, Tom Lendacky wrote:
> From: Tom Lendacky <thomas.lendacky@amd.com>
>
> Use ghcb_set_sw_scratch() to set the GHCB scratch field, which will also
> set the corresponding bit in the GHCB valid_bitmap field.
>
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> arch/x86/kernel/sev-es.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c
> index 6fcfdd32769f..4a96726fbaf8 100644
> --- a/arch/x86/kernel/sev-es.c
> +++ b/arch/x86/kernel/sev-es.c
> @@ -751,7 +751,7 @@ static enum es_result vc_do_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt,
> /* Can never be greater than 8 */
> exit_info_2 = bytes;
>
> - ghcb->save.sw_scratch = ghcb_pa + offsetof(struct ghcb, shared_buffer);
> + ghcb_set_sw_scratch(ghcb, ghcb_pa + offsetof(struct ghcb, shared_buffer));
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Thanks for catching this!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-25 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 13:38 [PATCH] x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer Tom Lendacky
2020-09-25 13:41 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).