FreeBSD/usr.sbin/bhyvectl/bhyvectl.c
/*
 * Reference Intel SDM Vol3 Section 24.6.9 MSR-Bitmap Address
 */
Reference Intel SDM Vol3 Section 24.6.9 MSR-Bitmap Address
Reference Intel SDM Vol3 Section 24 . 6 . 9 MSR - Bitmap Address
static void
dump_intel_msr_pm(const char *bitmap, int vcpu)
{
	int byte, bit, readable, writeable;
	uint32_t msr;
	for (msr = 0; msr < 0x2000; msr++) {
		byte = msr / 8;
		bit = msr & 0x7;
		readable = (bitmap[byte] & (1 << bit)) ? 0 : 1;
		writeable = (bitmap[2048 + byte] & (1 << bit)) ?  0 : 1;
		print_msr_pm(msr, vcpu, readable, writeable);
		byte += 1024;
		readable = (bitmap[byte] & (1 << bit)) ? 0 : 1;
		writeable = (bitmap[2048 + byte] & (1 << bit)) ?  0 : 1;
		print_msr_pm(msr + MSR_AMD6TH_START, vcpu, readable,
				writeable);
	}
}
static void dump_intel_msr_pm ( const char * bitmap , int vcpu ) { int byte , bit , readable , writeable ; uint32_t msr ; for ( msr = 0 ; msr < 0x2000 ; msr ++ ) { byte = msr / 8 ; bit = msr & 0x7 ; readable = ( bitmap [ byte ] & ( 1 << bit ) ) ? 0 : 1 ; writeable = ( bitmap [ 2048 + byte ] & ( 1 << bit ) ) ? 0 : 1 ; print_msr_pm ( msr , vcpu , readable , writeable ) ; byte += 1024 ; readable = ( bitmap [ byte ] & ( 1 << bit ) ) ? 0 : 1 ; writeable = ( bitmap [ 2048 + byte ] & ( 1 << bit ) ) ? 0 : 1 ; print_msr_pm ( msr + MSR_AMD6TH_START , vcpu , readable , writeable ) ; } }
Reference Intel SDM Vol3 Section 24.6.9 MSR-Bitmap Address
Reference Intel SDM Vol3 Section 24 . 6 . 9 MSR - Bitmap Address
/* Look at MSRs in the range 0x00000000 to 0x00001FFF */ /* Look at MSRs in the range 0xC0000000 to 0xC0001FFF */