public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Naveen N Rao <naveen@kernel.org>
Cc: Manali Shukla <manali.shukla@amd.com>,
	kvm@vger.kernel.org,  linux-perf-users@vger.kernel.org,
	linux-doc@vger.kernel.org,  pbonzini@redhat.com, nikunj@amd.com,
	bp@alien8.de, peterz@infradead.org,  mingo@redhat.com,
	mizhang@google.com, thomas.lendacky@amd.com,
	 ravi.bangoria@amd.com, Sandipan.Das@amd.com
Subject: Re: [PATCH v2 03/12] KVM: Add KVM_GET_EXT_LAPIC and KVM_SET_EXT_LAPIC for extapic
Date: Wed, 14 Jan 2026 13:59:24 -0800	[thread overview]
Message-ID: <aWgRvCdPsAFHRwcU@google.com> (raw)
In-Reply-To: <jf2zfqo6jrrcdkdatztiijmf7tgkho7bks4q4oaegiqpeflrkj@7blq6f5ck2hf>

On Tue, Dec 16, 2025, Naveen N Rao wrote:
> On Mon, Sep 01, 2025 at 10:51:46AM +0530, Manali Shukla wrote:
> > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> > index 6aa40ee05a4a..0653718a4f04 100644
> > --- a/Documentation/virt/kvm/api.rst
> > +++ b/Documentation/virt/kvm/api.rst
> > @@ -2048,6 +2048,18 @@ error.
> >  Reads the Local APIC registers and copies them into the input argument.  The
> >  data format and layout are the same as documented in the architecture manual.
> >  
> > +::
> > +
> > +  #define KVM_APIC_EXT_REG_SIZE 0x540

As discussed in PUCK, just go the full 0x1000 bytes, and do:

#define KVM_GET_LAPIC2            _IOR(KVMIO,  0x8e, struct kvm_lapic_state2)
#define KVM_SET_LAPIC2            _IOW(KVMIO,  0x8f, struct kvm_lapic_state2)

> > +  struct kvm_ext_lapic_state {
> > +	__DECLARE_FLEX_ARRAY(__u8, regs);
> > +  };
> > +
> > +Applications should use KVM_GET_EXT_LAPIC ioctl if extended APIC is
> > +enabled. KVM_GET_EXT_LAPIC reads Local APIC registers with extended
> > +APIC register space located at offsets 400h-530h and copies them into input
> > +argument.
> 
> I suppose the reason for using a flex array was for addressing review 
> comments on the previous version -- to make the new APIs extensible so 
> that they can accommodate any future changes to the extended APIC 
> register space.
> 
> I wonder if it would be better to introduce a KVM extension, say 
> KVM_CAP_EXT_LAPIC (along the lines of KVM_CAP_PMU_CAPABILITY).

Please figure out a different name than "ext_lapic".  Verbatim from the SDM
(minus a closing parenthesis)

  the xAPIC architecture) is an extension of the APIC architecture

and

  EXTENDED XAPIC (X2APIC)
  The x2APIC architecture extends the xAPIC architecture

There's zero chance I'm going to remember which "extended" we're talking about. 

KVM_CAP_X2APIC_API further muddies the waters, so maybe something absurd and
arbitrary like KVM_CAP_LAPIC2?  The capability doesn't have to strictly follow
the naming of the underlying feature(s) it supports.

  reply	other threads:[~2026-01-14 21:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01  5:16 [PATCH v2 00/12] Implement support for IBS virtualization Manali Shukla
2025-09-01  5:19 ` [PATCH v2 01/12] perf/amd/ibs: Fix race condition in IBS Manali Shukla
2025-09-01  5:21 ` [PATCH v2 02/12] KVM: x86: Refactor APIC register mask handling to support extended APIC registers Manali Shukla
2025-10-06 16:12   ` Naveen N Rao
2025-10-13  5:53     ` Manali Shukla
2025-09-01  5:21 ` [PATCH v2 03/12] KVM: Add KVM_GET_EXT_LAPIC and KVM_SET_EXT_LAPIC for extapic Manali Shukla
2025-12-16 14:21   ` Naveen N Rao
2026-01-14 21:59     ` Sean Christopherson [this message]
2026-01-22 14:53       ` Manali Shukla
2025-09-01  5:22 ` [PATCH v2 04/12] x86/cpufeatures: Add CPUID feature bit for Extended LVT Manali Shukla
2025-09-08 13:39   ` Naveen N Rao
2025-09-17 15:34     ` Manali Shukla
2025-10-08  6:58       ` Naveen N Rao
2025-10-13  5:36         ` Manali Shukla
2025-09-01  5:22 ` [PATCH v2 05/12] KVM: x86: Add emulation support for Extented LVT registers Manali Shukla
2025-09-08 13:41   ` Naveen N Rao
2025-09-17 12:57     ` Manali Shukla
2025-10-08  7:00       ` Naveen N Rao
2025-10-13  5:38         ` Manali Shukla
2025-09-01  5:23 ` [PATCH v2 06/12] x86/cpufeatures: Add CPUID feature bit for VIBS in SVM/SEV guests Manali Shukla
2025-09-10 13:01   ` Nikunj A Dadhania
2025-09-17 15:40     ` Manali Shukla
2025-09-01  5:23 ` [PATCH v2 07/12] KVM: x86/cpuid: Add a KVM-only leaf for IBS capabilities Manali Shukla
2025-09-01  5:24 ` [PATCH v2 08/12] KVM: x86: Extend CPUID range to include new leaf Manali Shukla
2025-09-01  5:24 ` [PATCH v2 09/12] KVM: SVM: Extend VMCB area for virtualized IBS registers Manali Shukla
2025-09-01  5:25 ` [PATCH v2 10/12] KVM: SVM: Add support for IBS Virtualization Manali Shukla
2025-10-08  7:30   ` Naveen N Rao
2025-09-01  5:26 ` [PATCH v2 11/12] perf/x86/amd: Enable VPMU passthrough capability for IBS PMU Manali Shukla
2025-09-01  5:26 ` [PATCH v2 12/12] perf/x86/amd: Remove exclude_guest check from perf_ibs_init() Manali Shukla

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=aWgRvCdPsAFHRwcU@google.com \
    --to=seanjc@google.com \
    --cc=Sandipan.Das@amd.com \
    --cc=bp@alien8.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=manali.shukla@amd.com \
    --cc=mingo@redhat.com \
    --cc=mizhang@google.com \
    --cc=naveen@kernel.org \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=thomas.lendacky@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