FreeBSD/sys/amd64/vmm/amd/svm.c
/*
 * Allow vcpu to read or write the 'msr' without trapping into the hypervisor.
 */
Allow vcpu to read or write the 'msr' without trapping into the hypervisor.
Allow vcpu to read or write the ' msr ' without trapping into the hypervisor .
static void
svm_msr_perm(uint8_t *perm_bitmap, uint64_t msr, bool read, bool write)
{
	int index, bit, error;
	error = svm_msr_index(msr, &index, &bit);
	KASSERT(error == 0, ("%s: invalid msr %#lx", __func__, msr));
	KASSERT(index >= 0 && index < SVM_MSR_BITMAP_SIZE,
	    ("%s: invalid index %d for msr %#lx", __func__, index, msr));
	KASSERT(bit >= 0 && bit <= 6, ("%s: invalid bit position %d "
	    "msr %#lx", __func__, bit, msr));
	if (read)
		perm_bitmap[index] &= ~(1UL << bit);
	if (write)
		perm_bitmap[index] &= ~(2UL << bit);
}
static void svm_msr_perm ( uint8_t * perm_bitmap , uint64_t msr , bool read , bool write ) { int index , bit , error ; error = svm_msr_index ( msr , & index , & bit ) ; KASSERT ( error == 0 , ( " " , __func__ , msr ) ) ; KASSERT ( index >= 0 && index < SVM_MSR_BITMAP_SIZE , ( " " , __func__ , index , msr ) ) ; KASSERT ( bit >= 0 && bit <= 6 , ( " " " " , __func__ , bit , msr ) ) ; if ( read ) perm_bitmap [ index ] &= ~ ( 1UL << bit ) ; if ( write ) perm_bitmap [ index ] &= ~ ( 2UL << bit ) ; }
Allow vcpu to read or write the 'msr' without trapping into the hypervisor.
Allow vcpu to read or write the ' msr ' without trapping into the hypervisor .