int index = get_bitmap_index(msr);
uint_t major = index / 4;
uint_t minor = (index % 4) * 2;
- uchar_t val = 0;
- uchar_t mask = 0x3;
+ uint8_t val = 0;
+ uint8_t mask = 0x3;
uint8_t * bitmap = (uint8_t *)(vm->msr_map.arch_data);
- if (hook_reads) {
+ if (index == -1) {
+ PrintError("MSR (0x%x) out of bitmap range\n", msr);
+ return 0;
+ }
+
+ if (hook_reads != 0) {
val |= 0x1;
}
- if (hook_writes) {
+ if (hook_writes != 0) {
val |= 0x2;
}
int v3_msr_unhandled_read(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data) {
V3_Print("Palacios: Unhandled MSR Read (MSR=0x%x) - returning zero\n", msr);
- dst->lo=dst->hi=0;
+
+ dst->value = 0;
+
// should produce GPF for unsupported msr
return 0;
}