Re: [PATCH] KVM: SVM: fix calls to is_intercept
From: Paolo Bonzini
Date:  Tue Jun 09 2020 - 04:09:43 EST
On 09/06/20 09:30, Maxim Levitsky wrote:
> And if I understand correctly that bug didn't affect anything I tested
> because your recent patches started to avoid the usage of the interrupt
> window unless L1 clears the usage of the interrupt intercept which is
> rare.
> 
> Looks correct to me, and I guess this could have being avoided have C
> enforced the enumeration types.
Yes, another possibility could be to unify SVM_EXIT_* and INTERCEPT_*
enums.  For example we could have something like
	union {
		u32 all[5];
		struct {
			u32 cr, dr, exceptions;
		};
	} intercept;
and use __set/clear/test_bit_le() in set/clr/is_intercept.
Paolo