@@ -512,7 +512,7 @@ static int mmio_write(struct vcpu *vcpu, uint64_t wval)
512
512
return 0 ;
513
513
}
514
514
515
- static void vie_calc_bytereg (struct instr_emul_vie * vie ,
515
+ static void vie_calc_bytereg (const struct instr_emul_vie * vie ,
516
516
enum cpu_reg_name * reg , int * lhbr )
517
517
{
518
518
* lhbr = 0 ;
@@ -538,7 +538,7 @@ static void vie_calc_bytereg(struct instr_emul_vie *vie,
538
538
}
539
539
}
540
540
541
- static uint8_t vie_read_bytereg (struct vcpu * vcpu , struct instr_emul_vie * vie )
541
+ static uint8_t vie_read_bytereg (struct vcpu * vcpu , const struct instr_emul_vie * vie )
542
542
{
543
543
int lhbr ;
544
544
uint64_t val ;
@@ -561,7 +561,7 @@ static uint8_t vie_read_bytereg(struct vcpu *vcpu, struct instr_emul_vie *vie)
561
561
return reg_val ;
562
562
}
563
563
564
- static void vie_write_bytereg (struct vcpu * vcpu , struct instr_emul_vie * vie ,
564
+ static void vie_write_bytereg (struct vcpu * vcpu , const struct instr_emul_vie * vie ,
565
565
uint8_t byte )
566
566
{
567
567
uint64_t origval , val , mask ;
@@ -664,7 +664,7 @@ static uint64_t getcc(uint8_t opsize, uint64_t x, uint64_t y)
664
664
}
665
665
}
666
666
667
- static int emulate_mov (struct vcpu * vcpu , struct instr_emul_vie * vie )
667
+ static int emulate_mov (struct vcpu * vcpu , const struct instr_emul_vie * vie )
668
668
{
669
669
int error ;
670
670
uint8_t size ;
@@ -780,7 +780,7 @@ static int emulate_mov(struct vcpu *vcpu, struct instr_emul_vie *vie)
780
780
return error ;
781
781
}
782
782
783
- static int emulate_movx (struct vcpu * vcpu , struct instr_emul_vie * vie )
783
+ static int emulate_movx (struct vcpu * vcpu , const struct instr_emul_vie * vie )
784
784
{
785
785
int error ;
786
786
uint8_t size ;
@@ -980,7 +980,7 @@ static int get_gva_di_check(struct vcpu *vcpu, struct instr_emul_vie *vie,
980
980
* For MOVs instruction, we always check RDI during instruction decoding phase.
981
981
* And access RSI without any check during instruction emulation phase.
982
982
*/
983
- static int emulate_movs (struct vcpu * vcpu , struct instr_emul_vie * vie )
983
+ static int emulate_movs (struct vcpu * vcpu , const struct instr_emul_vie * vie )
984
984
{
985
985
uint64_t src_gva , gpa , val = 0UL ;
986
986
uint64_t * dst_hva , * src_hva ;
@@ -1067,7 +1067,7 @@ static int emulate_movs(struct vcpu *vcpu, struct instr_emul_vie *vie)
1067
1067
return error ;
1068
1068
}
1069
1069
1070
- static int emulate_stos (struct vcpu * vcpu , struct instr_emul_vie * vie )
1070
+ static int emulate_stos (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1071
1071
{
1072
1072
int error , repeat ;
1073
1073
uint8_t opsize = vie -> opsize ;
@@ -1121,7 +1121,7 @@ static int emulate_stos(struct vcpu *vcpu, struct instr_emul_vie *vie)
1121
1121
return 0 ;
1122
1122
}
1123
1123
1124
- static int emulate_test (struct vcpu * vcpu , struct instr_emul_vie * vie )
1124
+ static int emulate_test (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1125
1125
{
1126
1126
int error ;
1127
1127
uint8_t size ;
@@ -1187,7 +1187,7 @@ static int emulate_test(struct vcpu *vcpu, struct instr_emul_vie *vie)
1187
1187
return error ;
1188
1188
}
1189
1189
1190
- static int emulate_and (struct vcpu * vcpu , struct instr_emul_vie * vie )
1190
+ static int emulate_and (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1191
1191
{
1192
1192
int error ;
1193
1193
uint8_t size ;
@@ -1275,7 +1275,7 @@ static int emulate_and(struct vcpu *vcpu, struct instr_emul_vie *vie)
1275
1275
return error ;
1276
1276
}
1277
1277
1278
- static int emulate_or (struct vcpu * vcpu , struct instr_emul_vie * vie )
1278
+ static int emulate_or (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1279
1279
{
1280
1280
int error ;
1281
1281
uint8_t size ;
@@ -1366,7 +1366,7 @@ static int emulate_or(struct vcpu *vcpu, struct instr_emul_vie *vie)
1366
1366
return error ;
1367
1367
}
1368
1368
1369
- static int emulate_cmp (struct vcpu * vcpu , struct instr_emul_vie * vie )
1369
+ static int emulate_cmp (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1370
1370
{
1371
1371
int error ;
1372
1372
uint8_t size ;
@@ -1458,7 +1458,7 @@ static int emulate_cmp(struct vcpu *vcpu, struct instr_emul_vie *vie)
1458
1458
return error ;
1459
1459
}
1460
1460
1461
- static int emulate_sub (struct vcpu * vcpu , struct instr_emul_vie * vie )
1461
+ static int emulate_sub (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1462
1462
{
1463
1463
int error ;
1464
1464
uint8_t size ;
@@ -1512,7 +1512,7 @@ static int emulate_sub(struct vcpu *vcpu, struct instr_emul_vie *vie)
1512
1512
return error ;
1513
1513
}
1514
1514
1515
- static int emulate_group1 (struct vcpu * vcpu , struct instr_emul_vie * vie )
1515
+ static int emulate_group1 (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1516
1516
{
1517
1517
int error ;
1518
1518
@@ -1534,7 +1534,7 @@ static int emulate_group1(struct vcpu *vcpu, struct instr_emul_vie *vie)
1534
1534
return error ;
1535
1535
}
1536
1536
1537
- static int emulate_bittest (struct vcpu * vcpu , struct instr_emul_vie * vie )
1537
+ static int emulate_bittest (struct vcpu * vcpu , const struct instr_emul_vie * vie )
1538
1538
{
1539
1539
uint64_t val , rflags , bitmask ;
1540
1540
int error ;
@@ -1664,7 +1664,7 @@ static int vie_init(struct instr_emul_vie *vie, struct vcpu *vcpu)
1664
1664
return 0 ;
1665
1665
}
1666
1666
1667
- static int vie_peek (struct instr_emul_vie * vie , uint8_t * x )
1667
+ static int vie_peek (const struct instr_emul_vie * vie , uint8_t * x )
1668
1668
{
1669
1669
1670
1670
if (vie -> num_processed < vie -> num_valid ) {
0 commit comments