mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv: hypercall: add support to change guest page write permission
Add hcall_change_vm_page_wp_perm to change guest one page write permission. Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -228,6 +228,18 @@ int32_t hcall_set_vm_memory_region(struct vm *vm, uint16_t vmid, uint64_t param)
|
||||
*/
|
||||
int32_t hcall_set_vm_memory_regions(struct vm *vm, uint64_t param);
|
||||
|
||||
/**
|
||||
* @brief change guest memory page write permission
|
||||
*
|
||||
* @param vm Pointer to VM data structure
|
||||
* @param vmid ID of the VM
|
||||
* @param param guest physical address. This gpa points to
|
||||
* struct wp_data
|
||||
*
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int32_t hcall_write_protect_page(struct vm *vm, uint16_t vmid, uint64_t param);
|
||||
|
||||
/**
|
||||
* @brief remap PCI MSI interrupt
|
||||
*
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#define HC_VM_SET_MEMORY_REGION _HC_ID(HC_ID, HC_ID_MEM_BASE + 0x00UL)
|
||||
#define HC_VM_GPA2HPA _HC_ID(HC_ID, HC_ID_MEM_BASE + 0x01UL)
|
||||
#define HC_VM_SET_MEMORY_REGIONS _HC_ID(HC_ID, HC_ID_MEM_BASE + 0x02UL)
|
||||
#define HC_VM_WRITE_PROTECT_PAGE _HC_ID(HC_ID, HC_ID_MEM_BASE + 0x03UL)
|
||||
|
||||
/* PCI assignment*/
|
||||
#define HC_ID_PCI_BASE 0x50UL
|
||||
@@ -109,6 +110,7 @@
|
||||
struct vm_memory_region {
|
||||
#define MR_ADD 0U
|
||||
#define MR_DEL 2U
|
||||
#define MR_MODIFY 3U
|
||||
/** set memory region type: MR_ADD or MAP_DEL */
|
||||
uint32_t type;
|
||||
|
||||
@@ -148,6 +150,24 @@ struct set_regions {
|
||||
uint64_t regions_gpa;
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
/**
|
||||
* @brief Info to change guest one page write protect permission
|
||||
*
|
||||
* the parameter for HC_VM_WRITE_PROTECT_PAGE hypercall
|
||||
*/
|
||||
struct wp_data {
|
||||
/** set page write protect permission.
|
||||
* ture: set the wp; flase: clear the wp
|
||||
*/
|
||||
uint8_t set;
|
||||
|
||||
/** Reserved */
|
||||
uint64_t pad:56;
|
||||
|
||||
/** the guest physical address of the page to change */
|
||||
uint64_t gpa;
|
||||
} __aligned(8);
|
||||
|
||||
/**
|
||||
* Setup parameter for share buffer, used for HC_SETUP_SBUF hypercall
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user