]> Git Repo - linux.git/commitdiff
x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer
authorTom Lendacky <[email protected]>
Fri, 25 Sep 2020 13:38:26 +0000 (08:38 -0500)
committerBorislav Petkov <[email protected]>
Fri, 25 Sep 2020 15:12:41 +0000 (17:12 +0200)
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 <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Joerg Roedel <[email protected]>
Link: https://lkml.kernel.org/r/ba84deabdf44a7a880454fb351d189c6ad79d4ba.1601041106.git.thomas.lendacky@amd.com
arch/x86/kernel/sev-es.c

index 6fcfdd32769f0efae0ed61ea55a927a2dd32919a..4a96726fbaf88b4d079a7d1e3ca6857d51fc27ff 100644 (file)
@@ -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);
 }
This page took 0.063035 seconds and 4 git commands to generate.