On Mon, Apr 25, 2022, Paolo Bonzini wrote: > On 4/25/22 13:44, Manali Shukla wrote: > > If __setup_vm() is changed to setup_vm(), KUT will build tests with > > PT_USER_MASK set on all PTEs. It is a better idea to move nNPT tests > > to their own file so that tests don't need to fiddle with page tables midway. > > Sorry, I have already asked this but I don't understand: why is it > problematic to have PT_USER_MASK set on all PTEs, since you have a patch (3) > to "allow nSVM tests to run with PT_USER_MASK enabled"? svm_npt_rsvd_bits_test() intentionally sets hCR4.SMEP=1 to verify that KVM doesn't consume the host's value for the guest. Having USER set on PTEs causes the test to hit SMEP violations.