Lines Matching +full:vm +full:- +full:map
1 // SPDX-License-Identifier: GPL-2.0-only
3 /* hypercalls: Check the ARM64's psuedo-firmware bitmap register interface.
6 * via the psuedo-firmware bitmap register. This includes the registers'
7 * read/write behavior before and after the VM has started, and if the
12 #include <linux/arm-smccc.h>
27 uint64_t max_feat_bit; /* Bit that represents the upper limit of the feature-map */
102 smccc_hvc(hc_info->func_id, hc_info->arg1, 0, 0, 0, 0, 0, 0, &res); in guest_test_hvc()
109 res.a0, hc_info->func_id, hc_info->arg1, stage); in guest_test_hvc()
114 res.a0, hc_info->func_id, hc_info->arg1, stage); in guest_test_hvc()
160 vm_userspace_mem_region_add(vcpu->vm, VM_MEM_SRC_ANONYMOUS, ST_GPA_BASE, 1, gpages, 0); in steal_time_init()
176 vcpu_get_reg(vcpu, reg_info->reg, &val); in test_fw_regs_before_vm_start()
177 TEST_ASSERT(val == FW_REG_ULIMIT_VAL(reg_info->max_feat_bit), in test_fw_regs_before_vm_start()
179 reg_info->reg, FW_REG_ULIMIT_VAL(reg_info->max_feat_bit), val); in test_fw_regs_before_vm_start()
181 /* Test a 'write' by disabling all the features of the register map */ in test_fw_regs_before_vm_start()
182 ret = __vcpu_set_reg(vcpu, reg_info->reg, 0); in test_fw_regs_before_vm_start()
185 reg_info->reg, errno); in test_fw_regs_before_vm_start()
187 vcpu_get_reg(vcpu, reg_info->reg, &val); in test_fw_regs_before_vm_start()
189 "Expected all the features to be cleared for reg: 0x%lx\n", reg_info->reg); in test_fw_regs_before_vm_start()
195 if (reg_info->max_feat_bit < 63) { in test_fw_regs_before_vm_start()
196 ret = __vcpu_set_reg(vcpu, reg_info->reg, BIT(reg_info->max_feat_bit + 1)); in test_fw_regs_before_vm_start()
199 errno, reg_info->reg); in test_fw_regs_before_vm_start()
214 * Before starting the VM, the test clears all the bits. in test_fw_regs_after_vm_start()
217 vcpu_get_reg(vcpu, reg_info->reg, &val); in test_fw_regs_after_vm_start()
220 reg_info->reg); in test_fw_regs_after_vm_start()
223 * Since the VM has run at least once, KVM shouldn't allow modification of in test_fw_regs_after_vm_start()
227 ret = __vcpu_set_reg(vcpu, reg_info->reg, FW_REG_ULIMIT_VAL(reg_info->max_feat_bit)); in test_fw_regs_after_vm_start()
229 …"Unexpected behavior or return value (%d) while setting a feature while VM is running for reg: 0x%… in test_fw_regs_after_vm_start()
230 errno, reg_info->reg); in test_fw_regs_after_vm_start()
236 struct kvm_vm *vm; in test_vm_create() local
238 vm = vm_create_with_one_vcpu(vcpu, guest_code); in test_vm_create()
242 return vm; in test_vm_create()
245 static void test_guest_stage(struct kvm_vm **vm, struct kvm_vcpu **vcpu) in test_guest_stage() argument
251 /* Sync the stage early, the VM might be freed below. */ in test_guest_stage()
253 sync_global_to_guest(*vm, stage); in test_guest_stage()
260 /* Start a new VM so that all the features are now enabled by default */ in test_guest_stage()
261 kvm_vm_free(*vm); in test_guest_stage()
262 *vm = test_vm_create(vcpu); in test_guest_stage()
275 struct kvm_vm *vm; in test_run() local
279 vm = test_vm_create(&vcpu); in test_run()
288 test_guest_stage(&vm, &vcpu); in test_run()
301 kvm_vm_free(vm); in test_run()