Re: [Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-06-23 Thread Roger Pau Monne
On Fri, Jun 23, 2017 at 02:58:28AM -0600, Jan Beulich wrote: > >>> On 22.06.17 at 19:13, wrote: > > On Fri, May 19, 2017 at 09:21:56AM -0600, Jan Beulich wrote: > >> >>> On 27.04.17 at 16:35, wrote: > >> > +static int vpci_modify_bars(struct pci_dev *pdev, const bool map) > >> > +{ > >> > +st

Re: [Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-06-23 Thread Jan Beulich
>>> On 22.06.17 at 19:13, wrote: > On Fri, May 19, 2017 at 09:21:56AM -0600, Jan Beulich wrote: >> >>> On 27.04.17 at 16:35, wrote: >> > +static int vpci_modify_bars(struct pci_dev *pdev, const bool map) >> > +{ >> > +struct vpci_header *header = &pdev->vpci->header; >> > +unsigned int i;

Re: [Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-06-22 Thread Roger Pau Monne
On Fri, May 19, 2017 at 09:21:56AM -0600, Jan Beulich wrote: > >>> On 27.04.17 at 16:35, wrote: > > +static int vpci_modify_bars(struct pci_dev *pdev, const bool map) > > +{ > > +struct vpci_header *header = &pdev->vpci->header; > > +unsigned int i; > > +int rc = 0; > > + > > +for

Re: [Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-05-22 Thread Julien Grall
Hi, On 19/05/17 16:21, Jan Beulich wrote: On 27.04.17 at 16:35, wrote: +VPCI_BAR_MEM64_LO, +VPCI_BAR_MEM64_HI, +} type; +/* Hardware address. */ +paddr_t paddr; +/* Guest address where the BAR should be mapped. */

Re: [Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-05-19 Thread Jan Beulich
>>> On 27.04.17 at 16:35, wrote: > +static int vpci_modify_bars(struct pci_dev *pdev, const bool map) > +{ > +struct vpci_header *header = &pdev->vpci->header; > +unsigned int i; > +int rc = 0; > + > +for ( i = 0; i < ARRAY_SIZE(header->bars); i++ ) > +{ > +paddr_t gadd

[Xen-devel] [PATCH v3 5/9] xen/vpci: add handlers to map the BARs

2017-04-27 Thread Roger Pau Monne
Introduce a set of handlers that trap accesses to the PCI BARs and the command register, in order to emulate BAR sizing and BAR relocation. The command handler is used to detect changes to bit 2 (response to memory space accesses), and maps/unmaps the BARs of the device into the guest p2m. The BA