Skip to content

Commit c787aaa

Browse files
peterfangwenlingz
authored andcommitted
dm: allow High BIOS to be modifiable by the guest
In order to support OVMF NV storage writeback, the High BIOS region in the guest will behave as RAM and can be modified by OVMF itself. Give the guest write permission to this page. Tracked-On: #3413 Signed-off-by: Peter Fang <peter.fang@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 12955fa commit c787aaa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

devicemodel/core/hugetlb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,14 @@ int hugetlb_setup_memory(struct vmctx *ctx)
773773

774774
/* map ept for biosmem */
775775
if (ctx->biosmem > 0) {
776+
/*
777+
* The High BIOS region can behave as RAM and be
778+
* modified by the boot firmware itself (e.g. OVMF
779+
* NV data storage region).
780+
*/
776781
if (vm_map_memseg_vma(ctx, ctx->biosmem, 4 * GB - ctx->biosmem,
777782
(uint64_t)(ctx->baseaddr + 4 * GB - ctx->biosmem),
778-
PROT_READ | PROT_EXEC) < 0)
783+
PROT_ALL) < 0)
779784
goto err;
780785
}
781786

0 commit comments

Comments
 (0)