From: Borislav Petkov <bp@alien8.de>
To: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org,
gleb@kernel.org, alex.williamson@redhat.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, wei@redhat.com,
sherry.hurwitz@amd.com
Subject: Re: [PART1 V5 07/13] KVM: x86: Detect and Initialize AVIC support
Date: Tue, 10 May 2016 11:14:47 +0200 [thread overview]
Message-ID: <20160510091447.GA16752@pd.tnic> (raw)
In-Reply-To: <1462388992-25242-8-git-send-email-Suravee.Suthikulpanit@amd.com>
On Wed, May 04, 2016 at 02:09:46PM -0500, Suravee Suthikulpanit wrote:
> This patch introduces AVIC-related data structure, and AVIC
> initialization code.
>
> There are three main data structures for AVIC:
> * Virtual APIC (vAPIC) backing page (per-VCPU)
> * Physical APIC ID table (per-VM)
> * Logical APIC ID table (per-VM)
>
> Currently, AVIC is disabled by default. Users can manually
> enable AVIC via kernel boot option kvm-amd.avic=1 or during
> kvm-amd module loading with parameter avic=1.
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> arch/x86/include/asm/kvm_host.h | 4 +
> arch/x86/include/asm/svm.h | 3 +
> arch/x86/kvm/svm.c | 224 +++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 230 insertions(+), 1 deletion(-)
...
> @@ -162,8 +173,19 @@ struct vcpu_svm {
>
> /* cached guest cpuid flags for faster access */
> bool nrips_enabled : 1;
> +
> + struct page *avic_backing_page;
> + u64 *avic_physical_id_cache;
> };
>
> +#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF)
> +#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31)
> +
> +#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK (0xFFULL)
> +#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12)
> +#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62)
> +#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63)
Those defines could be shortened a little. Maybe
#define AVIC_PHYSID_HOST_PHYS_MASK
#define AVIC_PHYSID_BACKING_PG_MASK
and so on...
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
next prev parent reply other threads:[~2016-05-10 9:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 19:09 [PART1 V5 00/13] KVM: x86: Introduce SVM AVIC support Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 01/13] KVM: x86: Misc LAPIC changes to expose helper functions Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 02/13] KVM: x86: Rename kvm_apic_get_reg to kvm_lapic_get_reg Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 03/13] KVM: x86: Introducing kvm_x86_ops VM init/destroy hooks Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 04/13] KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking hooks Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 05/13] KVM: split kvm_vcpu_wake_up from kvm_vcpu_kick Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 06/13] svm: Introduce new AVIC VMCB registers Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 07/13] KVM: x86: Detect and Initialize AVIC support Suravee Suthikulpanit
2016-05-09 10:27 ` Borislav Petkov
2016-05-10 9:14 ` Borislav Petkov [this message]
2016-05-10 14:43 ` Paolo Bonzini
2016-05-10 16:24 ` Borislav Petkov
2016-05-10 17:00 ` Paolo Bonzini
2016-05-10 17:06 ` Borislav Petkov
2016-05-04 19:09 ` [PART1 V5 08/13] svm: Add interrupt injection via AVIC Suravee Suthikulpanit
2016-05-10 9:19 ` Borislav Petkov
2016-05-10 14:50 ` Paolo Bonzini
2016-06-01 4:02 ` Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 09/13] svm: Add VMEXIT handlers for AVIC Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 10/13] KVM: x86: Introducing kvm_x86_ops.apicv_post_state_restore Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 11/13] svm: Do not expose x2APIC when enable AVIC Suravee Suthikulpanit
2016-05-04 19:09 ` [PART1 V5 12/13] svm: Do not intercept CR8 " Suravee Suthikulpanit
2016-05-10 15:12 ` Paolo Bonzini
2016-05-04 19:09 ` [PART1 V5 13/13] svm: Manage vcpu load/unload " Suravee Suthikulpanit
2016-05-10 15:43 ` Paolo Bonzini
2016-05-17 12:09 ` Paolo Bonzini
2016-06-01 18:18 ` Suravee Suthikulpanit
2016-06-01 18:37 ` Paolo Bonzini
2016-05-10 14:57 ` [PART1 V5 00/13] KVM: x86: Introduce SVM AVIC support Paolo Bonzini
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=20160510091447.GA16752@pd.tnic \
--to=bp@alien8.de \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=alex.williamson@redhat.com \
--cc=gleb@kernel.org \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sherry.hurwitz@amd.com \
--cc=wei@redhat.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