[PATCH 4/4] arm64: mte: Use stage-2 NoTagAccess memory attribute if supported
Aneesh Kumar K.V
aneesh.kumar at kernel.org
Mon Oct 28 07:52:02 PDT 2024
Hi Oliver,
Thanks for reviewing the changes.
Oliver Upton <oliver.upton at linux.dev> writes:
> On Mon, Oct 28, 2024 at 03:10:14PM +0530, Aneesh Kumar K.V (Arm) wrote:
>
> NOTE: We could also use KVM_EXIT_MEMORY_FAULT for this. I chose to
> add a new EXIT type because this is arm64 specific exit type.
>
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
> ---
I have used KVM_EXIT_MEMORY_FAULT as part of the initial prototype.
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index 637efc055145..a8268a164c4d 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -178,6 +178,7 @@ struct kvm_xen_exit {
>> #define KVM_EXIT_NOTIFY 37
>> #define KVM_EXIT_LOONGARCH_IOCSR 38
>> #define KVM_EXIT_MEMORY_FAULT 39
>> +#define KVM_EXIT_ARM_NOTAG_ACCESS 40
>>
>> /* For KVM_EXIT_INTERNAL_ERROR */
>> /* Emulate instruction failed. */
>> @@ -446,6 +447,12 @@ struct kvm_run {
>> __u64 gpa;
>> __u64 size;
>> } memory_fault;
>> + /* KVM_EXIT_ARM_NOTAG_ACCESS */
>> + struct {
>> + __u64 flags;
>> + __u64 gpa;
>> + __u64 size;
>> + } notag_access;
>
> Can you please look into reusing the memory fault exit infrastructure?
>
> The entire point of that is for KVM to tell the VMM it cannot make
> forward progress because of ${SOMETHING} unexpected at the specified
> GPA. You can add a new flag that describes tag access.
>
The only reason I dropped the change was because the flag will be very much
arm64 specific. Based on your feedback, I will switch to
KVM_EXIT_MEMORY_FAULT in the next update.
-aneesh
More information about the linux-arm-kernel
mailing list