Skip to content

Commit

Permalink
x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer
Browse files Browse the repository at this point in the history
Use ghcb_set_sw_scratch() to set the GHCB scratch field, which will also
set the corresponding bit in the GHCB valid_bitmap field to denote that
sw_scratch is actually valid.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Link: https://lkml.kernel.org/r/ba84deabdf44a7a880454fb351d189c6ad79d4ba.1601041106.git.thomas.lendacky@amd.com
  • Loading branch information
Tom Lendacky authored and Borislav Petkov committed Sep 25, 2020
1 parent f5ed777 commit 0ddfb1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/sev-es.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0ddfb1c

Please sign in to comment.