mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: mshv: fix GVA translation flags
Original we checked for R and W, but that code path never got executed. It is now understood that we can only get here when we execute code. Fix the permission flags. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -1526,8 +1526,10 @@ impl<'a> MshvEmulatorContext<'a> {
|
|||||||
return Ok(self.map.1);
|
return Ok(self.map.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: More fine-grained control for the flags
|
// We can only get into here when executing guest code. Check for R and X permissions. In
|
||||||
let flags = HV_TRANSLATE_GVA_VALIDATE_READ | HV_TRANSLATE_GVA_VALIDATE_WRITE;
|
// the future if we have other use cases, we may want to allow the caller to specify the
|
||||||
|
// flags.
|
||||||
|
let flags = HV_TRANSLATE_GVA_VALIDATE_READ | HV_TRANSLATE_GVA_VALIDATE_EXECUTE;
|
||||||
|
|
||||||
let (gpa, result_code) = self
|
let (gpa, result_code) = self
|
||||||
.vcpu
|
.vcpu
|
||||||
|
|||||||
Reference in New Issue
Block a user