>> + default: >> + WARN_ON_ONCE(1); > > Return -EINVAL? Sure. >> > + case KVM_PGTABLE_PROT_NORMAL_NC: >> > + attr = KVM_S2_MEMATTR(pgt, NORMAL_NC); >> > + break; >> >> Does it make sense to allow executable here as well? I don't think it's >> harmful but not sure there's a use-case for it either. > > Ah, we should just return EINVAL for that too. > > I get that the memory attribute itself is not problematic, but since > we're only using this thing for MMIO it'd be a rather massive > bug in KVM... We reject attempts to do this earlier in user_mem_abort(). Ack, will change to test executable and return -EINVAL in that case.