mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
KVM: arm64: Test that SMC64 arch calls are reserved
Assert that the SMC64 view of the Arm architecture range is reserved by KVM and cannot be filtered by userspace. Signed-off-by: Oliver Upton <oliver.upton@linux.dev> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230408121732.3411329-3-oliver.upton@linux.dev
This commit is contained in:
parent
5a23ad6510
commit
00e0c94711
|
|
@ -99,6 +99,7 @@ static void test_filter_reserved_range(void)
|
|||
{
|
||||
struct kvm_vcpu *vcpu;
|
||||
struct kvm_vm *vm = setup_vm(&vcpu);
|
||||
uint32_t smc64_fn;
|
||||
int r;
|
||||
|
||||
r = __set_smccc_filter(vm, ARM_SMCCC_ARCH_WORKAROUND_1,
|
||||
|
|
@ -106,6 +107,13 @@ static void test_filter_reserved_range(void)
|
|||
TEST_ASSERT(r < 0 && errno == EEXIST,
|
||||
"Attempt to filter reserved range should return EEXIST");
|
||||
|
||||
smc64_fn = ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64,
|
||||
0, 0);
|
||||
|
||||
r = __set_smccc_filter(vm, smc64_fn, 1, KVM_SMCCC_FILTER_DENY);
|
||||
TEST_ASSERT(r < 0 && errno == EEXIST,
|
||||
"Attempt to filter reserved range should return EEXIST");
|
||||
|
||||
kvm_vm_free(vm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user