All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 09/12] KVM: selftests: Add basic stress test for save+restore and #PF handling
Date: Tue, 28 Jul 2026 07:53:06 -0700	[thread overview]
Message-ID: <amjCUgcjRRWH2zRO@google.com> (raw)
In-Reply-To: <20260727235228.1007324-10-yosry@kernel.org>

On Mon, Jul 27, 2026, Yosry Ahmed wrote:
> diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
> index 88c6c8046ddec..e67b1e9893f68 100644
> --- a/tools/testing/selftests/kvm/Makefile.kvm
> +++ b/tools/testing/selftests/kvm/Makefile.kvm
> @@ -112,6 +112,7 @@ TEST_GEN_PROGS_x86 += x86/set_sregs_test
>  TEST_GEN_PROGS_x86 += x86/smaller_maxphyaddr_emulation_test
>  TEST_GEN_PROGS_x86 += x86/smm_test
>  TEST_GEN_PROGS_x86 += x86/state_test
> +TEST_GEN_PROGS_x86 += x86/save_restore_pf_stress_test

Sort alphabetically (I'm guessing you forgot to move this when renaming from
stress_xxx to save_xxx).

>  TEST_GEN_PROGS_x86 += x86/vmx_preemption_timer_test
>  TEST_GEN_PROGS_x86 += x86/svm_vmcall_test
>  TEST_GEN_PROGS_x86 += x86/svm_int_ctl_test
> diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
> index 06d9ba1c4df33..2889782b0016b 100644
> --- a/tools/testing/selftests/kvm/include/x86/processor.h
> +++ b/tools/testing/selftests/kvm/include/x86/processor.h
> @@ -614,6 +614,15 @@ static inline void set_cr0(u64 val)
>  	__asm__ __volatile__("mov %0, %%cr0" : : "r" (val) : "memory");
>  }
>  
> +static inline u64 get_cr2(void)
> +{
> +	u64 cr2;
> +
> +	__asm__ __volatile__("mov %%cr2, %[cr2]"
> +			     : /* output */ [cr2]"=r"(cr2));

Drop the "/* output */" comment, if the reader doesn't know how asm constraints
work *and* can't deduce that it's an output given the function name and return
value, then they probably shouldn't be reading this code.

Oh, yeesh, all of these getters have that silly comment.  Drop it here, I'll send
a patch to remove those bad examples.

> +	return cr2;
> +}
> +

  reply	other threads:[~2026-07-28 14:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 23:52 [PATCH v4 00/12] KVM: selftests: Stress save+restore and #PF (ft. nested) Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 01/12] KVM: selftests: Use __stringify() instead of custom XSTR() macros Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 02/12] KVM: selftests: Fix RAX and RFLAGS VMCB offsets when running L2 Yosry Ahmed
2026-07-28  0:07   ` sashiko-bot
2026-07-28  0:29     ` Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 03/12] KVM: selftests: Rework GPR registers switching for SVM (and fix offsets) Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 04/12] KVM: selftests: Handle rflags save/restore for SVM in guest_regs Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 05/12] KVM: selftests: Reuse GPR switching logic for nVMX Yosry Ahmed
2026-07-28  0:05   ` sashiko-bot
2026-07-28  0:30     ` Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 06/12] KVM: selftests: Drop HORRIFIC_L2_UCALL_CLOBBER_HACK Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 07/12] KVM: selftests: Add a blank line before logging assertion failures Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 08/12] KVM: selftests: Expose PTE masks to guests as part of an MMU Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 09/12] KVM: selftests: Add basic stress test for save+restore and #PF handling Yosry Ahmed
2026-07-28 14:53   ` Sean Christopherson [this message]
2026-07-27 23:52 ` [PATCH v4 10/12] KVM: selftests: Trigger save+restore randomly in the #PF stress test Yosry Ahmed
2026-07-28 14:58   ` Sean Christopherson
2026-07-27 23:52 ` [PATCH v4 11/12] KVM: selftests: Support running stress save+restore and #PF test in L2 Yosry Ahmed
2026-07-28 14:43   ` Sean Christopherson
2026-07-28 17:44     ` Yosry Ahmed
2026-07-27 23:52 ` [PATCH v4 12/12] KVM: selftests: Trigger L2->L1 exits stress save+restore and #PF test Yosry Ahmed
2026-07-28  0:09   ` sashiko-bot
2026-07-28  0:31     ` Yosry Ahmed
2026-07-28 15:07 ` [PATCH v4 00/12] KVM: selftests: Stress save+restore and #PF (ft. nested) Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amjCUgcjRRWH2zRO@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yosry@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.