From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852AbcBLOQz (ORCPT ); Fri, 12 Feb 2016 09:16:55 -0500 Received: from mail.skyhub.de ([78.46.96.112]:52700 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752447AbcBLOQx (ORCPT ); Fri, 12 Feb 2016 09:16:53 -0500 Date: Fri, 12 Feb 2016 15:16:50 +0100 From: Borislav Petkov To: Suravee Suthikulpanit Cc: joro@8bytes.org, alex.williamson@redhat.com, gleb@kernel.org, pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com Subject: Re: [PART1 RFC 6/9] svm: Add interrupt injection via AVIC Message-ID: <20160212141650.GB4504@pd.tnic> References: <1455285574-27892-1-git-send-email-suravee.suthikulpanit@amd.com> <1455285574-27892-7-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1455285574-27892-7-git-send-email-suravee.suthikulpanit@amd.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 12, 2016 at 08:59:31PM +0700, Suravee Suthikulpanit wrote: > From: Suravee Suthikulpanit > > VINTR is not supported when enable AVIC. Therefore, we need to inject > interrupt via APIC backing page instead. Also, adding AVIC doorbell > support to signal running vcpu to check IRR for injected interrupts. > > This patch also introduces kvm_x86_ops.apicv_intr_pending() to allow SVM > to provide a function hook to query AVIC interrupt pending status. > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/include/asm/kvm_host.h | 2 + > arch/x86/include/asm/msr-index.h | 1 + > arch/x86/kvm/lapic.c | 3 +- > arch/x86/kvm/svm.c | 110 +++++++++++++++++++++++++++++++++++++-- > arch/x86/kvm/x86.c | 4 +- > 5 files changed, 114 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 7b78328..a7c8852 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -973,6 +973,8 @@ struct kvm_x86_ops { > void (*post_block)(struct kvm_vcpu *vcpu); > int (*update_pi_irte)(struct kvm *kvm, unsigned int host_irq, > uint32_t guest_irq, bool set); > + > + bool (*apicv_intr_pending)(struct kvm_vcpu *vcpu); > }; > > struct kvm_arch_async_pf { > diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h > index b05402e..605b869 100644 > --- a/arch/x86/include/asm/msr-index.h > +++ b/arch/x86/include/asm/msr-index.h > @@ -284,6 +284,7 @@ > #define MSR_AMD64_TSC_RATIO 0xc0000104 > #define MSR_AMD64_NB_CFG 0xc001001f > #define MSR_AMD64_PATCH_LOADER 0xc0010020 > +#define MSR_AMD64_AVIC_DOORBELL 0xc001011b AFAICT, that MSR is being used only in arch/x86/kvm/lapic.c Please add it there. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.