struct svm_io_info {
- uint_t type : 1 PACKED; // (0=out, 1=in)
- uint_t rsvd : 1 PACKED; // Must be Zero
- uint_t str : 1 PACKED; // string based io
- uint_t rep : 1 PACKED; // repeated io
- uint_t sz8 : 1 PACKED; // 8 bit op size
- uint_t sz16 : 1 PACKED; // 16 bit op size
- uint_t sz32 : 1 PACKED; // 32 bit op size
- uint_t addr16 : 1 PACKED; // 16 bit addr
- uint_t addr32 : 1 PACKED; // 32 bit addr
- uint_t addr64 : 1 PACKED; // 64 bit addr
- uint_t rsvd2 : 6 PACKED; // Should be Zero
- uint16_t port PACKED; // port number
-};
+ uint_t type : 1; // (0=out, 1=in)
+ uint_t rsvd : 1; // Must be Zero
+ uint_t str : 1; // string based io
+ uint_t rep : 1; // repeated io
+ uint_t sz8 : 1; // 8 bit op size
+ uint_t sz16 : 1; // 16 bit op size
+ uint_t sz32 : 1; // 32 bit op size
+ uint_t addr16 : 1; // 16 bit addr
+ uint_t addr32 : 1; // 32 bit addr
+ uint_t addr64 : 1; // 64 bit addr
+ uint_t rsvd2 : 6; // Should be Zero
+ uint16_t port; // port number
+} __attribute__((packed));
int v3_init_svm_io_map(struct guest_info * info);
-void set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
+void v3_set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
vmcb_seg->selector = seg->selector;
vmcb_seg->limit = seg->limit;
vmcb_seg->base = seg->base;
}
-void get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
+void v3_get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
seg->selector = vmcb_seg->selector;
seg->limit = vmcb_seg->limit;
seg->base = vmcb_seg->base;
}
-void set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
+void v3_set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
- set_vmcb_segment(&(guest_area->cs), &(segs->cs));
- set_vmcb_segment(&(guest_area->ds), &(segs->ds));
- set_vmcb_segment(&(guest_area->es), &(segs->es));
- set_vmcb_segment(&(guest_area->fs), &(segs->fs));
- set_vmcb_segment(&(guest_area->gs), &(segs->gs));
- set_vmcb_segment(&(guest_area->ss), &(segs->ss));
- set_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
- set_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
- set_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
- set_vmcb_segment(&(guest_area->tr), &(segs->tr));
+ v3_set_vmcb_segment(&(guest_area->cs), &(segs->cs));
+ v3_set_vmcb_segment(&(guest_area->ds), &(segs->ds));
+ v3_set_vmcb_segment(&(guest_area->es), &(segs->es));
+ v3_set_vmcb_segment(&(guest_area->fs), &(segs->fs));
+ v3_set_vmcb_segment(&(guest_area->gs), &(segs->gs));
+ v3_set_vmcb_segment(&(guest_area->ss), &(segs->ss));
+ v3_set_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
+ v3_set_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
+ v3_set_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
+ v3_set_vmcb_segment(&(guest_area->tr), &(segs->tr));
}
-void get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
+void v3_get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
- get_vmcb_segment(&(guest_area->cs), &(segs->cs));
- get_vmcb_segment(&(guest_area->ds), &(segs->ds));
- get_vmcb_segment(&(guest_area->es), &(segs->es));
- get_vmcb_segment(&(guest_area->fs), &(segs->fs));
- get_vmcb_segment(&(guest_area->gs), &(segs->gs));
- get_vmcb_segment(&(guest_area->ss), &(segs->ss));
- get_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
- get_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
- get_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
- get_vmcb_segment(&(guest_area->tr), &(segs->tr));
+ v3_get_vmcb_segment(&(guest_area->cs), &(segs->cs));
+ v3_get_vmcb_segment(&(guest_area->ds), &(segs->ds));
+ v3_get_vmcb_segment(&(guest_area->es), &(segs->es));
+ v3_get_vmcb_segment(&(guest_area->fs), &(segs->fs));
+ v3_get_vmcb_segment(&(guest_area->gs), &(segs->gs));
+ v3_get_vmcb_segment(&(guest_area->ss), &(segs->ss));
+ v3_get_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
+ v3_get_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
+ v3_get_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
+ v3_get_vmcb_segment(&(guest_area->tr), &(segs->tr));
}