From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbbIQXS6 (ORCPT ); Thu, 17 Sep 2015 19:18:58 -0400 Received: from mga03.intel.com ([134.134.136.65]:6761 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbbIQXS4 (ORCPT ); Thu, 17 Sep 2015 19:18:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,549,1437462000"; d="scan'208";a="647156801" From: "Wu, Feng" To: Paolo Bonzini , =?utf-8?B?UmFkaW0gS3I/bcOhPw==?= CC: "alex.williamson@redhat.com" , "joro@8bytes.org" , "mtosatti@redhat.com" , "eric.auger@linaro.org" , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Wu, Feng" Subject: RE: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu() Thread-Topic: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu() Thread-Index: AQHQ8WIALW+X30Bh70qlL8ORGX2cDp5BWxGA Date: Thu, 17 Sep 2015 23:18:42 +0000 Message-ID: References: <1442393409-2623-1-git-send-email-feng.wu@intel.com> <1442393409-2623-4-git-send-email-feng.wu@intel.com> <55F934F5.7040605@redhat.com> <55FA8AED.6090700@redhat.com> <55FACD35.1030602@redhat.com> <20150917155821.GB2573@potion.brq.redhat.com> <55FAE395.4000008@redhat.com> In-Reply-To: <55FAE395.4000008@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 t8HNJ2nA013340 > -----Original Message----- > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > Sent: Friday, September 18, 2015 12:00 AM > To: Radim Krčmář > Cc: Wu, Feng; alex.williamson@redhat.com; joro@8bytes.org; > mtosatti@redhat.com; eric.auger@linaro.org; kvm@vger.kernel.org; > iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v8 03/13] KVM: Define a new interface > kvm_intr_is_single_vcpu() > > > > On 17/09/2015 17:58, Radim Krčmář wrote: > > For interrupts from MSI and IOxAPIC: > > - Flat logical interrupts are delivered as if we had natural > > (CPU0<->bit0, CPU1<->bit1, ...) flat logical xAPIC for first 8 VCPUs. > > - Cluster logical doesn't work much, it's interpreted like flat logical. > > I didn't care about xAPIC cluster because Linux, the sole user of our > > paravirtualized x2APIC, doesn't configure it. > > > > I'll paste kvm_apic_mda() source for better explanation: > > > > static u32 kvm_apic_mda(unsigned int dest_id, struct kvm_lapic *source, > > struct kvm_lapic > *target) > > { > > bool ipi = source != NULL; > > bool x2apic_mda = apic_x2apic_mode(ipi ? source : target); > > > > if (!ipi && dest_id == APIC_BROADCAST && x2apic_mda) > > return X2APIC_BROADCAST; > > > > return x2apic_mda ? dest_id : SET_APIC_DEST_FIELD(dest_id); > > } > > > > MSI/IOxAPIC interrupt means that source is NULL and if the target is in > > x2APIC mode, the original 'dest_id' is returned as mda => a flat logical > > xAPIC to 0x0f will get interpreted as (cluster) logical x2APIC 0xf in > > kvm_apic_match_logical_addr(). > > xAPIC address are only 8 bit long so they always get delivered to x2APIC > > cluster 0, where first 16 bits work like xAPIC flat logical mode. > > Ok, I was wondering whether this was the correct interpretation. Thanks! Paolo, I don't think Radim clarify your concern, right? Since mda is 8-bit, it is wrong with mda >> 16, this is your concern, right? Thanks, Feng > > Paolo {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I