mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
hv: refine the address used in sbl multiboot code
Update the structure definition to define the address type (HVA vs HPA vs GPA) explicitly. Convert address to HVA before access the GPA/HPA type of address. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
@@ -30,21 +30,21 @@ struct vm_hw_info {
|
||||
};
|
||||
|
||||
struct sw_linux {
|
||||
void *ramdisk_src_addr;
|
||||
void *ramdisk_load_addr;
|
||||
void *ramdisk_src_addr; /* HVA */
|
||||
void *ramdisk_load_addr; /* GPA */
|
||||
uint32_t ramdisk_size;
|
||||
void *bootargs_src_addr;
|
||||
void *bootargs_load_addr;
|
||||
void *bootargs_src_addr; /* HVA */
|
||||
void *bootargs_load_addr; /* GPA */
|
||||
uint32_t bootargs_size;
|
||||
void *dtb_src_addr;
|
||||
void *dtb_load_addr;
|
||||
void *dtb_src_addr; /* HVA */
|
||||
void *dtb_load_addr; /* GPA */
|
||||
uint32_t dtb_size;
|
||||
};
|
||||
|
||||
struct sw_kernel_info {
|
||||
void *kernel_src_addr;
|
||||
void *kernel_load_addr;
|
||||
void *kernel_entry_addr;
|
||||
void *kernel_src_addr; /* HVA */
|
||||
void *kernel_load_addr; /* GPA */
|
||||
void *kernel_entry_addr; /* GPA */
|
||||
uint32_t kernel_size;
|
||||
};
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#define HVA2HPA(x) ((uint64_t)(x))
|
||||
/* gpa --> hpa -->hva */
|
||||
#define GPA2HVA(vm, x) HPA2HVA(gpa2hpa(vm, x))
|
||||
#define HVA2GPA(vm, x) hpa2gpa(vm, HVA2HPA(x))
|
||||
#endif /* !ASSEMBLER */
|
||||
|
||||
#endif /* HYPERVISOR_H */
|
||||
|
Reference in New Issue
Block a user