>> /* CMM relies on PGSTE to work, however huge pages have no PGSTE */ >> >> You should also check for "kvm->mm->context.uses_gmap_hpage" when >> enabling CMMA using the capability. > > You mean the mem ctrl? I already do that, or do I miss something here? I missed it, sorry for that. > > - if (!kvm->created_vcpus) { > + if (kvm->created_vcpus) > + ret = -EBUSY; > + else if (kvm->mm->context.uses_gmap_hpage) > + ret = -EINVAL; > + else { > kvm->arch.use_cmma = 1; > >> >>> + r = -EINVAL; >>> + else { >>> + r = 0; >>> + kvm->mm->context.uses_gmap_hpage = 1; >>> + /* They would complicate matters too much. */ >> >> Dito, please describe why this is complicated (or even impossible) >> >> /* we might have to create fake 4k page tables and have to hinder the HW >> from accessing these ... > > /* > > > > * We might have to create fake 4k page > > > > * tables. To avoid that the hardware works on > > > > * them we emulate these instructions. > > > > */ > ... hardware works on the stale PGSTE ... -- Thanks, David / dhildenb