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>
This commit is contained in:
Peter Fang 2019-06-23 00:12:11 -07:00 committed by wenlingz
parent 12955fa80f
commit c787aaa328
1 changed files with 6 additions and 1 deletions

View File

@ -773,9 +773,14 @@ int hugetlb_setup_memory(struct vmctx *ctx)
/* map ept for biosmem */
if (ctx->biosmem > 0) {
/*
* The High BIOS region can behave as RAM and be
* modified by the boot firmware itself (e.g. OVMF
* NV data storage region).
*/
if (vm_map_memseg_vma(ctx, ctx->biosmem, 4 * GB - ctx->biosmem,
(uint64_t)(ctx->baseaddr + 4 * GB - ctx->biosmem),
PROT_READ | PROT_EXEC) < 0)
PROT_ALL) < 0)
goto err;
}