From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2LDb-0006EF-Nn for qemu-devel@nongnu.org; Fri, 27 Nov 2015 10:45:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2LDa-0006hD-KO for qemu-devel@nongnu.org; Fri, 27 Nov 2015 10:45:51 -0500 Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:33993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2LDa-0006h9-Fq for qemu-devel@nongnu.org; Fri, 27 Nov 2015 10:45:50 -0500 Received: by vkbs1 with SMTP id s1so70691245vkb.1 for ; Fri, 27 Nov 2015 07:45:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <5fc3dbe99380a9c82c3758af219ad13aac831b67.1448359515.git.p.fedin@samsung.com> References: <5fc3dbe99380a9c82c3758af219ad13aac831b67.1448359515.git.p.fedin@samsung.com> From: Peter Maydell Date: Fri, 27 Nov 2015 15:45:30 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC PATCH v3 3/5] kvm_arm: Pass requester ID to MSI routing functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: Diana Craciun , Shlomo Pongratz , Shlomo Pongratz , QEMU Developers On 24 November 2015 at 10:13, Pavel Fedin wrote: > Introduce global kvm_arm_msi_use_devid flag and pass device IDs in > kvm_arch_fixup_msi_route(). Device IDs are required by the ITS. > > Signed-off-by: Pavel Fedin > --- > target-arm/kvm.c | 6 ++++++ > target-arm/kvm_arm.h | 3 +++ > 2 files changed, 9 insertions(+) > > diff --git a/target-arm/kvm.c b/target-arm/kvm.c > index 79ef4c6..0e46930 100644 > --- a/target-arm/kvm.c > +++ b/target-arm/kvm.c > @@ -23,6 +23,7 @@ > #include "cpu.h" > #include "internals.h" > #include "hw/arm/arm.h" > +#include "hw/pci/pci.h" > #include "exec/memattrs.h" > > const KVMCapabilityInfo kvm_arch_required_capabilities[] = { > @@ -30,6 +31,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { > }; > > static bool cap_has_mp_state; > +bool kvm_arm_msi_use_devid; > > int kvm_arm_vcpu_init(CPUState *cs) > { > @@ -607,6 +609,10 @@ int kvm_arm_vgic_probe(void) > int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, > uint64_t address, uint32_t data, PCIDevice *dev) > { > + if (kvm_arm_msi_use_devid) { > + route->flags = KVM_MSI_VALID_DEVID; I think we should OR in this flag (it doesn't make any difference right now since all the callers to this function set the flags to 0 before the call, but conceptually I think it makes more sense). > + route->u.msi.devid = pci_requester_id(dev); > + } Is there anything that would go wrong if we just always set the u.msi.devid and the VALID_DEVID flag? (ie do we need the kvm_arm_msi_use_devid bool?) > return 0; > } > > diff --git a/target-arm/kvm_arm.h b/target-arm/kvm_arm.h > index 0ec221b..181ff37 100644 > --- a/target-arm/kvm_arm.h > +++ b/target-arm/kvm_arm.h > @@ -120,6 +120,9 @@ bool write_kvmstate_to_list(ARMCPU *cpu); > void kvm_arm_reset_vcpu(ARMCPU *cpu); > > #ifdef CONFIG_KVM > + > +extern bool kvm_arm_msi_use_devid; > + > /** > * kvm_arm_create_scratch_host_vcpu: > * @cpus_to_try: array of QEMU_KVM_ARM_TARGET_* values (terminated with > -- > 2.4.4 > thanks -- PMM