@@ -233,7 +233,7 @@ static enum cpu_reg_name gpr_map[16] = {
233
233
CPU_REG_R15
234
234
};
235
235
236
- static uint64_t size2mask [] = {
236
+ static uint64_t size2mask [9 ] = {
237
237
[1 ] = 0xffUL ,
238
238
[2 ] = 0xffffUL ,
239
239
[4 ] = 0xffffffffUL ,
@@ -433,10 +433,10 @@ emulate_mov(struct vcpu *vcpu, uint64_t gpa, struct vie *vie,
433
433
switch (vie -> op .op_byte ) {
434
434
case 0x88U :
435
435
/*
436
- * MOV byte from reg (ModRM:reg) to mem (ModRM:r/m)
437
- * 88/r: mov r/m8, r8
438
- * REX + 88/r: mov r/m8, r8 (%ah, %ch, %dh, %bh not available)
439
- */
436
+ * MOV byte from reg (ModRM:reg) to mem (ModRM:r/m)
437
+ * 88/r: mov r/m8, r8
438
+ * REX + 88/r: mov r/m8, r8 (%ah, %ch, %dh, %bh not available)
439
+ */
440
440
size = 1U ; /* override for byte operation */
441
441
error = vie_read_bytereg (vcpu , vie , & byte );
442
442
if (error == 0 ) {
@@ -1312,7 +1312,8 @@ emulate_stack_op(struct vcpu *vcpu, uint64_t mmio_gpa, struct vie *vie,
1312
1312
pr_err ("TODO: inject ss exception" );
1313
1313
}
1314
1314
1315
- if (vie_alignment_check (paging -> cpl , size , cr0 , rflags , stack_gla ) != 0 ) {
1315
+ if (vie_alignment_check (paging -> cpl , size , cr0 , rflags , stack_gla )
1316
+ != 0 ) {
1316
1317
/*vm_inject_ac(vcpu, 0);*/
1317
1318
pr_err ("TODO: inject ac exception" );
1318
1319
return 0 ;
@@ -1545,7 +1546,8 @@ vmm_emulate_instruction(struct vcpu *vcpu, uint64_t gpa, struct vie *vie,
1545
1546
}
1546
1547
1547
1548
int
1548
- vie_alignment_check (uint8_t cpl , uint8_t size , uint64_t cr0 , uint64_t rf , uint64_t gla )
1549
+ vie_alignment_check (uint8_t cpl , uint8_t size , uint64_t cr0 , uint64_t rf ,
1550
+ uint64_t gla )
1549
1551
{
1550
1552
ASSERT (size == 1U || size == 2U || size == 4U || size == 8U ,
1551
1553
"%s: invalid size %hhu" , __func__ , size );
@@ -1589,8 +1591,8 @@ vie_size2mask(uint8_t size)
1589
1591
1590
1592
int
1591
1593
vie_calculate_gla (enum vm_cpu_mode cpu_mode , enum cpu_reg_name seg ,
1592
- struct seg_desc * desc , uint64_t offset , uint8_t length , uint8_t addrsize ,
1593
- uint32_t prot , uint64_t * gla )
1594
+ struct seg_desc * desc , uint64_t offset , uint8_t length ,
1595
+ uint8_t addrsize , uint32_t prot , uint64_t * gla )
1594
1596
{
1595
1597
uint64_t firstoff , low_limit , high_limit , segbase ;
1596
1598
uint8_t glasize ;
@@ -1652,11 +1654,11 @@ vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum cpu_reg_name seg,
1652
1654
* #GP on a write access to a code segment or a
1653
1655
* read-only data segment.
1654
1656
*/
1655
- if ((type & 0x8U ) != 0U ) { /* code segment */
1657
+ if ((type & 0x8U ) != 0U ) { /* code segment */
1656
1658
return -1 ;
1657
1659
}
1658
1660
1659
- if ((type & 0xAU ) == 0U ) { /* read-only data seg */
1661
+ if ((type & 0xAU ) == 0U ) { /* read-only data seg */
1660
1662
return -1 ;
1661
1663
}
1662
1664
}
0 commit comments