> >> +}; > > > > If you set and clear PT_USER_MASK in svm_l2_ac_test() before calling > > into userspace you can remove init_test and uninit_test from the > > framework all together. That will simplify the code. > > > If clear user mask is called after userspace code, when #AC exception is > intercepted by L1, the control directly goes to L1 and it does not reach > clear_user_mask_all() function (called after user space code function run_in_user()). > > That is why I have added init_test and uninit_test function > Ah, that makes sense. Though IIUC, you are now moving the set/clear elsewhere, right? If so, it seems like init_test() and uninit_test() are no longer needed. > > Further, it would be nice to then hoist this framework and the one in > > vmx into a common x86 file, but looking at this that may be something > > to think about in the future. There would have to be wrappers when > > interacting with the vmc{s,b} and macros at the very least. > >