Re: [PATCH v4 18/43] arm64: RME: Handle realm enter/exit

From: Steven Price
Date: Thu Aug 22 2024 - 11:06:22 EST


On 22/08/2024 04:58, Aneesh Kumar K.V wrote:
> Steven Price <steven.price@xxxxxxx> writes:
>
>> + /* Exit to VMM to complete the change */
>> + kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false,
>> + ripas == 1);
>> +
>
>
> s/1/RMI_RAM ?

Ah, good spot - I must have missed that when I added the definitions.

> May be we can make it an enum like rsi_ripas

I guess that makes sense - I tend to avoid enums where the value is
controlled by something external, but here it makes some sense.

Thanks,

Steve

> modified arch/arm64/include/asm/rmi_smc.h
> @@ -62,9 +62,11 @@
> #define RMI_ERROR_REC 3
> #define RMI_ERROR_RTT 4
>
> -#define RMI_EMPTY 0
> -#define RMI_RAM 1
> -#define RMI_DESTROYED 2
> +enum rmi_ripas {
> + RMI_EMPTY,
> + RMI_RAM,
> + RMI_DESTROYED,
> +};
>
> #define RMI_NO_MEASURE_CONTENT 0
> #define RMI_MEASURE_CONTENT 1
> modified arch/arm64/kvm/rme-exit.c
> @@ -112,7 +112,7 @@ static int rec_exit_ripas_change(struct kvm_vcpu *vcpu)
>
> /* Exit to VMM to complete the change */
> kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false,
> - ripas == 1);
> + ripas == RMI_RAM);
>
> return 0;
> }