[PATCH v6 1/4] kvm: arm64: introduce new flag for non-cacheable IO memory

Ankit Agrawal ankita at nvidia.com
Fri Feb 9 06:10:51 PST 2024


>> +	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.


More information about the linux-arm-kernel mailing list