| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common
 On 11/08/2020 00:34, Stefano Stabellini wrote: On Mon, 10 Aug 2020, Julien Grall wrote:On 07/08/2020 00:48, Stefano Stabellini wrote:On Thu, 6 Aug 2020, Julien Grall wrote:On 06/08/2020 01:37, Stefano Stabellini wrote:On Wed, 5 Aug 2020, Julien Grall wrote:On 04/08/2020 20:11, Stefano Stabellini wrote:On Tue, 4 Aug 2020, Julien Grall wrote:On 04/08/2020 12:10, Oleksandr wrote:On 04.08.20 10:45, Paul Durrant wrote: Are you sure about this? However, when the operating system access 0x1100, it will issue a read to 0x3eff0100. Xen will trap the read to 0x3eff0100 and send it to QEMU. QEMU has to know that 0x3eff0000-0x3eff1000 is the alias to the PIO aperture and that 0x3eff0100 correspond to PCI device foobar. Similarly, QEMU has also to know the address range of the MMIO aperture and its remappings, if any (it is possible to have address remapping for MMIO addresses too.) I think today this information is "built-in" QEMU, not configurable. It works fine because *I think* the PCI aperture is pretty much the same on x86 boards, at least the one supported by QEMU for Xen.Well on x86, the OS will access PIO using inb/outb. So the address received by Xen is 0x1000-0x2000 and then forwarded to the DM using the PIO type.On ARM, I think we should explicitly declare the PCI MMIO aperture and its alias/address-remapping. When we do that, we can also declare the PIO aperture and its alias/address-remapping.Well yes, we need to define PCI MMIO and PCI I/O region because the guest OS needs to know them.[1] (see below)However, I am unsure how this would help us to solve the question whether access to the PCI I/O aperture should be sent as a PIO or MMIO. Per what you wrote, the PCI I/O Bar would be configured with the range 0x1000-0x2000. So a device emulator (this may not be QEMU and only emulate one PCI device!!) will only see that range. How does the device-emulator then know that it needs to watch the region 0x3eff0000-0x3eff1000?It would know because the PCI PIO aperture, together with the alias, are specified [1]. Are you suggesting fix it in the ABI or pass it as runtime information to the Device Emulator? It feels to me that it would be easier/make more sense if the DM only say "I want to watch the PIO range 0x1000-0x2000". So Xen would be in charge to do the translation between the OS view and the DM view. This also means a DM would be completely arch-agnostic. This would follow the HW where you can plug your PCI card on any HW.As you know, PIO access is actually not modelled by QEMU for ARM targets. I worry about the long term stability of it, given that it is untested. I.e. qemu-system-aarch64 could have a broken PIO emulation and nobody would find out except for us when we send ioreqs to it. There are multiple references of PIO in the QEMU for Arm (see hw/arm/virt.c). So what do you mean by not modelled? Thinking from a Xen/Emulator interface on ARM, is it wise to rely on an access-type that doesn't exist on the architecture? The architecture doesn't define an instruction to access PIO, however this doesn't mean such access doesn't exist on the platform. For instance, PCI device may have I/O BAR. On Arm64, the hostbridge will be responsible to do the translation between the MMIO access to a PIO access for the PCI device. I have the impression that we disagree in what the Device Emulator is meant to do. IHMO, the goal of the device emulator is to emulate a device in an arch-agnostic way. Cheers, -- Julien Grall 
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |