Skip to content

Commit

Permalink
Revert "KVM: selftests: Allow slot modification stress test with quir…
Browse files Browse the repository at this point in the history
…k disabled"

Revert memslot_modification_stress_test's KVM_X86_QUIRK_SLOT_ZAP_ALL
testcase, as the quirk is being removed, i.e. the KVM side of things is
being reverted.

This reverts commit 218f641.

Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Sep 27, 2024
1 parent d20ebaf commit dec356f
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions tools/testing/selftests/kvm/memslot_modification_stress_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ struct test_params {
useconds_t delay;
uint64_t nr_iterations;
bool partition_vcpu_memory_access;
bool disable_slot_zap_quirk;
};

static void run_test(enum vm_guest_mode mode, void *arg)
Expand All @@ -90,13 +89,6 @@ static void run_test(enum vm_guest_mode mode, void *arg)
vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,
VM_MEM_SRC_ANONYMOUS,
p->partition_vcpu_memory_access);
#ifdef __x86_64__
if (p->disable_slot_zap_quirk)
vm_enable_cap(vm, KVM_CAP_DISABLE_QUIRKS2, KVM_X86_QUIRK_SLOT_ZAP_ALL);

pr_info("Memslot zap quirk %s\n", p->disable_slot_zap_quirk ?
"disabled" : "enabled");
#endif

pr_info("Finished creating vCPUs\n");

Expand All @@ -115,12 +107,11 @@ static void run_test(enum vm_guest_mode mode, void *arg)
static void help(char *name)
{
puts("");
printf("usage: %s [-h] [-m mode] [-d delay_usec] [-q]\n"
printf("usage: %s [-h] [-m mode] [-d delay_usec]\n"
" [-b memory] [-v vcpus] [-o] [-i iterations]\n", name);
guest_modes_help();
printf(" -d: add a delay between each iteration of adding and\n"
" deleting a memslot in usec.\n");
printf(" -q: Disable memslot zap quirk.\n");
printf(" -b: specify the size of the memory region which should be\n"
" accessed by each vCPU. e.g. 10M or 3G.\n"
" Default: 1G\n");
Expand All @@ -146,7 +137,7 @@ int main(int argc, char *argv[])

guest_modes_append_default();

while ((opt = getopt(argc, argv, "hm:d:qb:v:oi:")) != -1) {
while ((opt = getopt(argc, argv, "hm:d:b:v:oi:")) != -1) {
switch (opt) {
case 'm':
guest_modes_cmdline(optarg);
Expand All @@ -169,12 +160,6 @@ int main(int argc, char *argv[])
case 'i':
p.nr_iterations = atoi_positive("Number of iterations", optarg);
break;
case 'q':
p.disable_slot_zap_quirk = true;

TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) &
KVM_X86_QUIRK_SLOT_ZAP_ALL);
break;
case 'h':
default:
help(argv[0]);
Expand Down

0 comments on commit dec356f

Please sign in to comment.