From: Chao Gao <chao.gao@intel.com>
To: "Suthikulpanit, Suravee" <suravee.suthikulpanit@amd.com>
Cc: qemu-devel@nongnu.org,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Maxim Levitsky" <mlevitsk@redhat.com>,
"Sean Christopherson" <seanjc@google.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
mst@redhat.com, "Grimm, Jon" <jon.grimm@amd.com>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
"Roth, Michael" <Michael.Roth@amd.com>,
"Wei Huang" <wei.huang2@amd.com>
Subject: Re: [RFC] KVM / QEMU: Introduce Interface for Querying APICv Info
Date: Fri, 20 May 2022 13:26:49 +0800 [thread overview]
Message-ID: <20220520052644.GA15937@gao-cwp> (raw)
In-Reply-To: <7e0d22fa-b9b0-ad1a-3a37-a450ec5d73e8@amd.com>
On Fri, May 20, 2022 at 10:30:40AM +0700, Suthikulpanit, Suravee wrote:
>Hi All,
>
>Currently, we don't have a good way to check whether APICV is active on a VM.
>Normally, For AMD SVM AVIC, users either have to check for trace point, or using
>"perf kvm stat live" to catch AVIC-related #VMEXIT.
>
>For KVM, I would like to propose introducing a new IOCTL interface (i.e. KVM_GET_APICV_INFO),
>where user-space tools (e.g. QEMU monitor) can query run-time information of APICv for VM and vCPUs
>such as APICv inhibit reason flags.
>
>For QEMU, we can leverage the "info lapic" command, and append the APICV information after
>all LAPIC register information:
>
>For example:
>
>----- Begin Snippet -----
>(qemu) info lapic 0
>dumping local APIC state for CPU 0
>
>LVT0 0x00010700 active-hi edge masked ExtINT (vec 0)
>LVT1 0x00000400 active-hi edge NMI
>LVTPC 0x00010000 active-hi edge masked Fixed (vec 0)
>LVTERR 0x000000fe active-hi edge Fixed (vec 254)
>LVTTHMR 0x00010000 active-hi edge masked Fixed (vec 0)
>LVTT 0x000400ee active-hi edge tsc-deadline Fixed (vec 238)
>Timer DCR=0x0 (divide by 2) initial_count = 0 current_count = 0
>SPIV 0x000001ff APIC enabled, focus=off, spurious vec 255
>ICR 0x000000fd physical edge de-assert no-shorthand
>ICR2 0x00000005 cpu 5 (X2APIC ID)
>ESR 0x00000000
>ISR (none)
>IRR (none)
>
>APR 0x00 TPR 0x00 DFR 0x0f LDR 0x00PPR 0x00
>
>APICV vm inhibit: 0x10 <-- HERE
>APICV vcpu inhibit: 0 <-- HERE
>
>------ End Snippet ------
>
>Otherwise, we can have APICv-specific info command (e.g. info apicv).
I think this information can be added to kvm per-vm/vcpu debugfs. Then no
qemu change is needed.
next prev parent reply other threads:[~2022-05-20 5:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 3:30 [RFC] KVM / QEMU: Introduce Interface for Querying APICv Info Suthikulpanit, Suravee
2022-05-20 5:26 ` Chao Gao [this message]
2022-05-20 5:51 ` Suravee Suthikulpanit
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=20220520052644.GA15937@gao-cwp \
--to=chao.gao@intel.com \
--cc=Michael.Roth@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=berrange@redhat.com \
--cc=imammedo@redhat.com \
--cc=jon.grimm@amd.com \
--cc=kvm@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seanjc@google.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=wei.huang2@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox