From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 547BF1A1E06 for ; Fri, 2 Sep 2016 14:18:44 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5CC77F7AD; Fri, 2 Sep 2016 21:18:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-76.phx2.redhat.com [10.3.116.76]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u82LIfHp019651; Fri, 2 Sep 2016 17:18:42 -0400 To: liang yan References: <563A8509.4010102@hpe.com> Cc: "James, Andrew" , edk2-devel@ml01.01.org, qemu-devel@nongnu.org, Ard Biesheuvel From: Laszlo Ersek Message-ID: <686ad786-b05b-a138-f7cc-d15a467ecd72@redhat.com> Date: Fri, 2 Sep 2016 23:18:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <563A8509.4010102@hpe.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 02 Sep 2016 21:18:43 +0000 (UTC) Subject: Re: Could not add PCI device with big memory to aarch64 VMs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 21:18:44 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 11/04/15 23:22, liang yan wrote: > Hello, Laszlo, > > (1)I am trying to add ivshmem device(PCI device with big memory) to my > aarch64 vm. > So far, I could find device information from vm. But it seems vm did not > create > correct resource file for this device. Do you have any idea that this > happens? > > I used the upstream EDK2 to build my UEFI firmware. > > There are three BARs for this device, and memory map is assigned too, > but only one > resource file is created. > > My qemu supports ACPI 5.1 and the command line is : > > -device ivshmem,size=256M,chardev=ivshmem,msi=on,ioeventfd=on \ > -chardev socket,path=/tmp/ivshmem_socket,id=ivshmem \ > > The lspci information: > > 00:00.0 Host bridge: Red Hat, Inc. Device 0008 > Subsystem: Red Hat, Inc Device 1100 > Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- > Stepping- SERR- FastB2B- DisINTx- > Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- > SERR- > 00:01.0 RAM memory: Red Hat, Inc Inter-VM shared memory > Subsystem: Red Hat, Inc QEMU Virtual Machine > Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- > Stepping- SERR- FastB2B- DisINTx- > Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- > SERR- Interrupt: pin A routed to IRQ 255 > Region 0: Memory at 20001000 (32-bit, non-prefetchable) [disabled] > [size=256] > Region 1: Memory at 20000000 (32-bit, non-prefetchable) [disabled] > [size=4K] > Region 2: Memory at 10000000 (64-bit, prefetchable) [disabled] > [size=256M] > Capabilities: [40] MSI-X: Enable- Count=1 Masked- > Vector table: BAR=1 offset=00000000 > PBA: BAR=1 offset=00000800 > > Boot information: > > [ 2.380924] pci 0000:00:01.0: BAR 2: assigned [mem > 0x10000000-0x1fffffff 64bit pref] > [ 2.382836] pci 0000:00:01.0: BAR 1: assigned [mem > 0x20000000-0x20000fff] > [ 2.383557] pci 0000:00:01.0: BAR 0: assigned [mem > 0x20001000-0x200010ff] > > > Files under /sys/devices/pci0000:00/0000:00:01.0 > > broken_parity_status devspec local_cpus resource > class dma_mask_bits modalias subsystem > config driver_override msi_bus subsystem_device > consistent_dma_mask_bits enable power subsystem_vendor > d3cold_allowed irq remove uevent > device local_cpulist rescan vendor > > Information for resource: > > 0x0000000020001000 0x00000000200010ff 0x0000000000040200 > 0x0000000020000000 0x0000000020000fff 0x0000000000040200 > 0x0000000010000000 0x000000001fffffff 0x000000000014220c > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > > > > > (2)It also has a problem that once I use a memory bigger than 256M for > ivshmem, it could not get through UEFI, > the error message is > > PciBus: Discovered PCI @ [00|01|00] > BAR[0]: Type = Mem32; Alignment = 0xFFF; Length = 0x100; Offset = > 0x10 > BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset > = 0x14 > BAR[2]: Type = PMem64; Alignment = 0x3FFFFFFF; Length = > 0x40000000; Offset = 0x18 > > PciBus: HostBridge->SubmitResources() - Success > ASSERT > /home/liang/studio/edk2/ArmVirtPkg/PciHostBridgeDxe/PciHostBridge.c(449): ((BOOLEAN)(0==1)) > > > I am wandering if there are memory limitation for pcie devices under > Qemu environment? > > > Just thank you in advance and any information would be appreciated. Now that Ard fixed (commit range 0b09c212a8ae..646a9e5b799b), this use case should work. Thanks Laszlo