Re: [Xen-devel] [PATCH v10 07/11] vpci/bars: add handlers to map the BARs

2018-03-20 Thread Jan Beulich
>>> On 20.03.18 at 12:12, wrote: > On Mon, Mar 19, 2018 at 10:18:34AM -0600, Jan Beulich wrote: >> >>> On 16.03.18 at 14:30, wrote: >> > +static int modify_bars(const struct pci_dev *pdev, bool map, bool >> > rom_only) >> > +{ >> > +struct

Re: [Xen-devel] [PATCH v10 07/11] vpci/bars: add handlers to map the BARs

2018-03-20 Thread Roger Pau Monné
On Mon, Mar 19, 2018 at 10:18:34AM -0600, Jan Beulich wrote: > >>> On 16.03.18 at 14:30, wrote: > > +static int modify_bars(const struct pci_dev *pdev, bool map, bool rom_only) > > +{ > > +struct vpci_header *header = >vpci->header; > > +struct rangeset *mem =

Re: [Xen-devel] [PATCH v10 07/11] vpci/bars: add handlers to map the BARs

2018-03-19 Thread Jan Beulich
>>> On 16.03.18 at 14:30, wrote: > +static int map_range(unsigned long s, unsigned long e, void *data, > + unsigned long *c) > +{ > +const struct map_data *map = data; > +int rc; > + > +for ( ; ; ) > +{ > +unsigned long size = e -

Re: [Xen-devel] [PATCH v10 07/11] vpci/bars: add handlers to map the BARs

2018-03-19 Thread Paul Durrant
> -Original Message- > From: Roger Pau Monne [mailto:roger@citrix.com] > Sent: 16 March 2018 13:30 > To: xen-devel@lists.xenproject.org > Cc: Boris Ostrovsky ; Konrad Rzeszutek Wilk > ; Roger Pau Monne ; Ian >

[Xen-devel] [PATCH v10 07/11] vpci/bars: add handlers to map the BARs

2018-03-16 Thread Roger Pau Monne
Introduce a set of handlers that trap accesses to the PCI BARs and the command register, in order to snoop 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. A