All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Naveen N Rao (AMD)" <naveen@kernel.org>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	 Vasant Hegde <vasant.hegde@amd.com>,
	 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [RFC kvm-unit-tests PATCH 2/4] x86/apic: Disable PIT for x2apic test to allow SVM AVIC to be tested
Date: Tue, 3 Jun 2025 16:53:48 -0700	[thread overview]
Message-ID: <aD-LDPPQ6elCrDdH@google.com> (raw)
In-Reply-To: <6aba109b9ac7e883d00b74d084e58f37acd805e3.1740479886.git.naveen@kernel.org>

On Tue, Feb 25, 2025, Naveen N Rao (AMD) wrote:
> SVM AVIC is inhibited if kvm-pit is enabled in the default "reinject"
> mode. Commit f5cfdd33cb21 ("x86/apic: Add test config to allow running
> apic tests against SVM's AVIC") disabled PIT in xapic test to allow AVIC
> to be tested. However, since then, AVIC has been enabled to work in
> x2apic mode, but still requires PIT to either be disabled or set to
> "discard".
> 
> Update x2apic test to disable PIT so that AVIC can be exercized with
> x2apic.
> 
> Signed-off-by: Naveen N Rao (AMD) <naveen@kernel.org>
> ---
>  x86/unittests.cfg | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/x86/unittests.cfg b/x86/unittests.cfg
> index 8d046e6d7356..35fb88c3cb79 100644
> --- a/x86/unittests.cfg
> +++ b/x86/unittests.cfg
> @@ -14,10 +14,11 @@ extra_params = -cpu qemu64,+x2apic,+tsc-deadline -machine kernel_irqchip=split
>  arch = x86_64
>  groups = apic
>  
> +# Don't create a Programmable Interval Timer (PIT, a.k.a 8254) to allow testing SVM's AVIC
>  [x2apic]
>  file = apic.flat
>  smp = 2
> -extra_params = -cpu qemu64,+x2apic,+tsc-deadline
> +extra_params = -cpu qemu64,+x2apic,+tsc-deadline -machine pit=off

Similar to the split IRQ chip, playing whack-a-mole to disable the PIT in every
test where (x2)AVIC might be interesting is rather silly.  The realmode test
uses the PIT, but AFAICT it doesn't need re-injection, i.e. we can simply disable
re-injection mode to get the same effect, e.g.

    qemu-429929  [233] ...1. 16531.028284: kvm_apicv_inhibit_changed: set reason=9, inhibits=0x200 PIT_REINJ
    qemu-429929  [233] ...1. 16531.028311: kvm_apicv_inhibit_changed: cleared reason=9, inhibits=0x0

I'll send a patch.

>  arch = x86_64
>  timeout = 30
>  groups = apic
> -- 
> 2.48.1
> 

  reply	other threads:[~2025-06-03 23:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 10:40 [RFC kvm-unit-tests PATCH 0/4] x86/apic: SVM AVIC tests and some cleanups Naveen N Rao (AMD)
2025-02-25 10:40 ` [RFC kvm-unit-tests PATCH 1/4] x86/apic: Move ioapic tests together and add them to apic test group Naveen N Rao (AMD)
2025-02-25 10:40 ` [RFC kvm-unit-tests PATCH 2/4] x86/apic: Disable PIT for x2apic test to allow SVM AVIC to be tested Naveen N Rao (AMD)
2025-06-03 23:53   ` Sean Christopherson [this message]
2025-02-25 10:40 ` [RFC kvm-unit-tests PATCH 3/4] x86/apic: Disable PIT for ioapic " Naveen N Rao (AMD)
2025-02-25 10:40 ` [RFC kvm-unit-tests PATCH 4/4] x86/apic: Add test for xapic-split Naveen N Rao (AMD)
2025-03-04 20:33   ` 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=aD-LDPPQ6elCrDdH@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=naveen@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /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.