Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933150AbbLOBw1 (ORCPT ); Mon, 14 Dec 2015 20:52:27 -0500 Received: from mga09.intel.com ([134.134.136.24]:16866 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932947AbbLOBwV (ORCPT ); Mon, 14 Dec 2015 20:52:21 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,429,1444719600"; d="scan'208";a="871535013" From: "Wu, Feng" To: =?utf-8?B?UmFkaW0gS3JjbcOhcg==?= CC: "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Wu, Feng" Subject: RE: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts Thread-Topic: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts Thread-Index: AQHRIKFx7uN6i1xR7ke/FgyVZroC0p7CcuHA///okICAATpioIAB5dSAgAX5PfA= Date: Tue, 15 Dec 2015 01:52:10 +0000 Message-ID: References: <1447037208-75615-1-git-send-email-feng.wu@intel.com> <20151116190314.GA12245@potion.brq.redhat.com> <20151209145343.GB2672@potion.brq.redhat.com> <20151211143751.GA28788@potion.brq.redhat.com> In-Reply-To: <20151211143751.GA28788@potion.brq.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id tBF1qWWZ030080 Content-Length: 2512 Lines: 56 > -----Original Message----- > From: kvm-owner@vger.kernel.org [mailto:kvm-owner@vger.kernel.org] On > Behalf Of Radim Krcmár > Sent: Friday, December 11, 2015 10:38 PM > To: Wu, Feng > Cc: pbonzini@redhat.com; kvm@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted- > interrupts > > 2015-12-10 01:52+0000, Wu, Feng: > >> From: Radim Krčmář [mailto:rkrcmar@redhat.com] > >> (Physical xAPIC+x2APIC mode is still somewhat reasonable and xAPIC CPUs > >> start with LDR=0, which means that operating system doesn't need to > >> utilize mixed mode, as defined by KVM, when switching to x2APIC.) > > > > I think you mean Physical xAPIC+Physical x2APIC mode, right? For physical > > mode, we don't use LDR in any case, do we? So in physical mode, we only > > use the APIC ID, that is why they can be mixed, is my understanding correct? > > Yes. (Technically, physical and logical addressing is always active in > APIC, but xAPIC must have nonzero LDR to accept logical interrupts[1].) > If all xAPIC LDRs are zero, KVM doesn't enter a "mixed mode" even if > some are xAPIC and some x2APIC [2]. > > 1: Real LAPICs probably do not accept broadcasts on APICs where LDR=0, > KVM LAPICs do, but lowest priority broadcast is not allowed anyway, > so PI doesn't care. > > 2: KVM allows OS-writeable APIC ID, which complicates things and real > hardware probably doesn't allow it because of that ... we'd be saner > with RO APIC ID, but it's not that bad. (And no major OS does it :]) > > >> the system uses cluster xAPIC, OS should set DFR before LDR, which > >> doesn't trigger mixed mode either.) > > > > Just curious, if the APIC is software disabled and it is in xAPIC mode. OS sets > > different value for DFR for different APICs, then when OS sets LDR, KVM can > > trigger mixed flat and cluster mode, right? > > Exactly. > APICs with zeroed LDR are ignored, so KVM will use the slow-path for > delivery (= trigger mixed mode) at the moment the first APIC with > different DFR is configured. Thanks a lot for your explanation! Thanks, Feng > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?