[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-18 Thread Blue Swirl
On Tue, Jan 12, 2010 at 7:29 PM, Blue Swirl wrote: > On Mon, Jan 11, 2010 at 10:33 PM, Igor Kovalenko > wrote: >> On Tue, Jan 12, 2010 at 12:29 AM, Blue Swirl wrote: >>> On Sun, Jan 10, 2010 at 6:41 PM, Blue Swirl wrote: On Sun, Jan 3, 2010 at 7:18 PM, Blue Swirl wrote: > On Sun, Jan

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-12 Thread Blue Swirl
On Mon, Jan 11, 2010 at 10:33 PM, Igor Kovalenko wrote: > On Tue, Jan 12, 2010 at 12:29 AM, Blue Swirl wrote: >> On Sun, Jan 10, 2010 at 6:41 PM, Blue Swirl wrote: >>> On Sun, Jan 3, 2010 at 7:18 PM, Blue Swirl wrote: On Sun, Jan 3, 2010 at 6:06 PM, Michael S. Tsirkin wrote: > On Sun,

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-11 Thread Igor Kovalenko
On Tue, Jan 12, 2010 at 12:29 AM, Blue Swirl wrote: > On Sun, Jan 10, 2010 at 6:41 PM, Blue Swirl wrote: >> On Sun, Jan 3, 2010 at 7:18 PM, Blue Swirl wrote: >>> On Sun, Jan 3, 2010 at 6:06 PM, Michael S. Tsirkin wrote: On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: >

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-11 Thread Blue Swirl
On Sun, Jan 10, 2010 at 6:41 PM, Blue Swirl wrote: > On Sun, Jan 3, 2010 at 7:18 PM, Blue Swirl wrote: >> On Sun, Jan 3, 2010 at 6:06 PM, Michael S. Tsirkin wrote: >>> On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: >>>

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-10 Thread Blue Swirl
On Sun, Jan 3, 2010 at 7:18 PM, Blue Swirl wrote: > On Sun, Jan 3, 2010 at 6:06 PM, Michael S. Tsirkin wrote: >> On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: >>> >>> On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: >>> >>> > On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2010 at 07:10:58AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2010-01-04 at 13:07 +0200, Michael S. Tsirkin wrote: > > BTW, I think we really should think about the right way to address the > > swap/noswap issue without using a preprocessor. Maybe make pci host > > bridge explic

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
On Tue, 2010-01-05 at 00:25 +0200, Michael S. Tsirkin wrote: > On Tue, Jan 05, 2010 at 08:53:52AM +1100, Benjamin Herrenschmidt wrote: > > > > > Yes, but I think how you program your host to pci bridge is platform > > > specific, > > > the standard (mostly) applies to what happens below the bridg

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
> Yes, but I think how you program your host to pci bridge is platform specific, > the standard (mostly) applies to what happens below the bridge. There's > no real standard for how PCI host bridge is connected to processor > AFAIK, it's by luck we can share code there at all. Well, yes and no .

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
On Tue, 2010-01-05 at 00:08 +0100, Alexander Graf wrote: > > IIRC qemu's mmio functions just pass the register value the guest had > at that moment to the mmio function. That means that qemu HW emulation needs, for each device, to add a layer of byteswap depending on whether the CPU is LE or BE w

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
On Mon, 2010-01-04 at 23:12 +0200, Michael S. Tsirkin wrote: > Well, the main issue if I understand correcttly is that basically the > same hardware bridge can be connected to host in different ways. Yes, we > can say "if it's connected differently it's a different device" but this > is slightly ug

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Alexander Graf
On 04.01.2010, at 23:59, Michael S. Tsirkin wrote: > On Tue, Jan 05, 2010 at 09:51:48AM +1100, Benjamin Herrenschmidt wrote: >> On Tue, 2010-01-05 at 00:25 +0200, Michael S. Tsirkin wrote: >>> On Tue, Jan 05, 2010 at 08:53:52AM +1100, Benjamin Herrenschmidt wrote: > Yes, but I think how

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2010 at 08:25:30AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2010-01-04 at 23:12 +0200, Michael S. Tsirkin wrote: > > Well, the main issue if I understand correcttly is that basically the > > same hardware bridge can be connected to host in different ways. Yes, we > > can say "

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
> So, it appears that this is not the case for many platforms: bridge > itself does a byteswap to make devices behind it work according to spec, > but this does not apply to programming bridge itself. > > This seems common on BE platforms, this is why qemu has > ifdef TARGET_WORDS_BIGENDIAN there

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2010 at 08:53:52AM +1100, Benjamin Herrenschmidt wrote: > > > Yes, but I think how you program your host to pci bridge is platform > > specific, > > the standard (mostly) applies to what happens below the bridge. There's > > no real standard for how PCI host bridge is connected t

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Benjamin Herrenschmidt
On Mon, 2010-01-04 at 13:07 +0200, Michael S. Tsirkin wrote: > BTW, I think we really should think about the right way to address the > swap/noswap issue without using a preprocessor. Maybe make pci host > bridge explicitly specify whether to swap bytes? How about adding a > field in PCIHostState

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2010 at 09:51:48AM +1100, Benjamin Herrenschmidt wrote: > On Tue, 2010-01-05 at 00:25 +0200, Michael S. Tsirkin wrote: > > On Tue, Jan 05, 2010 at 08:53:52AM +1100, Benjamin Herrenschmidt wrote: > > > > > > > Yes, but I think how you program your host to pci bridge is platform > >

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-05 Thread Michael S. Tsirkin
On Tue, Jan 05, 2010 at 12:08:19AM +0100, Alexander Graf wrote: > > On 04.01.2010, at 23:59, Michael S. Tsirkin wrote: > > > On Tue, Jan 05, 2010 at 09:51:48AM +1100, Benjamin Herrenschmidt wrote: > >> On Tue, 2010-01-05 at 00:25 +0200, Michael S. Tsirkin wrote: > >>> On Tue, Jan 05, 2010 at 08:5

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-04 Thread Alexander Graf
On 04.01.2010, at 12:07, Michael S. Tsirkin wrote: > On Mon, Jan 04, 2010 at 07:45:16PM +0900, Isaku Yamahata wrote: >> +static PCIDevice *pci_host_dev_find_fn_noswap(PCIHostState *s, uint32_t >> addr) >> +{ >> +return pci_host_find_dev_active(s->bus, pci_host_pci_addr(s, addr)); >> +} >> +

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2010 at 07:45:16PM +0900, Isaku Yamahata wrote: > +static PCIDevice *pci_host_dev_find_fn_noswap(PCIHostState *s, uint32_t addr) > +{ > +return pci_host_find_dev_active(s->bus, pci_host_pci_addr(s, addr)); > +} > + > +static PCIDevice *pci_host_dev_find_fn(PCIHostState *s, uint3

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-04 Thread Isaku Yamahata
On Mon, Jan 04, 2010 at 11:55:10AM +0100, Alexander Graf wrote: > > On 04.01.2010, at 11:45, Isaku Yamahata wrote: > > > On Mon, Jan 04, 2010 at 04:26:46AM +0100, Alexander Graf wrote: > >> > >> On 03.01.2010, at 21:50, Benjamin Herrenschmidt wrote: > >> > >>> On Sun, 2010-01-03 at 21:27 +0100,

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-04 Thread Alexander Graf
On 04.01.2010, at 11:45, Isaku Yamahata wrote: > On Mon, Jan 04, 2010 at 04:26:46AM +0100, Alexander Graf wrote: >> >> On 03.01.2010, at 21:50, Benjamin Herrenschmidt wrote: >> >>> On Sun, 2010-01-03 at 21:27 +0100, Alexander Graf wrote: >>> I think if unin_pci is the only user, it'd be b

Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-04 Thread Isaku Yamahata
On Mon, Jan 04, 2010 at 04:26:46AM +0100, Alexander Graf wrote: > > On 03.01.2010, at 21:50, Benjamin Herrenschmidt wrote: > > > On Sun, 2010-01-03 at 21:27 +0100, Alexander Graf wrote: > > > >> I think if unin_pci is the only user, it'd be better to do it hacky > >> inside unin_pci.c. But if th

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Alexander Graf
On 03.01.2010, at 21:50, Benjamin Herrenschmidt wrote: > On Sun, 2010-01-03 at 21:27 +0100, Alexander Graf wrote: > >> I think if unin_pci is the only user, it'd be better to do it hacky >> inside unin_pci.c. But if there's a chance there's another user, it'd >> be better to make it generic. >>

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Benjamin Herrenschmidt
On Sun, 2010-01-03 at 21:27 +0100, Alexander Graf wrote: > I think if unin_pci is the only user, it'd be better to do it hacky > inside unin_pci.c. But if there's a chance there's another user, it'd > be better to make it generic. > > Since this is the first time I ever stumbled across type 0 and

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Alexander Graf
On 03.01.2010, at 19:06, Michael S. Tsirkin wrote: > On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: >> >> On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: >> >>> On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander Graf wrote: On 03.01.2010, at 18:29, Michael S. Tsi

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Blue Swirl
On Sun, Jan 3, 2010 at 6:06 PM, Michael S. Tsirkin wrote: > On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: >> >> On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: >> >> > On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander Graf wrote: >> >> >> >> On 03.01.2010, at 18:29, Michael

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Michael S. Tsirkin
On Sun, Jan 03, 2010 at 06:50:15PM +0100, Alexander Graf wrote: > > On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: > > > On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander Graf wrote: > >> > >> On 03.01.2010, at 18:29, Michael S. Tsirkin wrote: > >> > >>> On Sun, Jan 03, 2010 at 05:09:32PM

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Alexander Graf
On 03.01.2010, at 18:44, Michael S. Tsirkin wrote: > On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander Graf wrote: >> >> On 03.01.2010, at 18:29, Michael S. Tsirkin wrote: >> >>> On Sun, Jan 03, 2010 at 05:09:32PM +0100, Alexander Graf wrote: On 03.01.2010, at 16:45, Michael S. Tsi

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Michael S. Tsirkin
On Sun, Jan 03, 2010 at 06:40:52PM +0100, Alexander Graf wrote: > > On 03.01.2010, at 18:29, Michael S. Tsirkin wrote: > > > On Sun, Jan 03, 2010 at 05:09:32PM +0100, Alexander Graf wrote: > >> > >> On 03.01.2010, at 16:45, Michael S. Tsirkin wrote: > >> > >>> On Sun, Jan 03, 2010 at 02:50:45AM

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Alexander Graf
On 03.01.2010, at 18:29, Michael S. Tsirkin wrote: > On Sun, Jan 03, 2010 at 05:09:32PM +0100, Alexander Graf wrote: >> >> On 03.01.2010, at 16:45, Michael S. Tsirkin wrote: >> >>> On Sun, Jan 03, 2010 at 02:50:45AM +0100, Alexander Graf wrote: Different host buses may have different layou

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Michael S. Tsirkin
On Sun, Jan 03, 2010 at 05:09:32PM +0100, Alexander Graf wrote: > > On 03.01.2010, at 16:45, Michael S. Tsirkin wrote: > > > On Sun, Jan 03, 2010 at 02:50:45AM +0100, Alexander Graf wrote: > >> Different host buses may have different layouts for config space accessors. > >> > >> The Mac U3 for e

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Alexander Graf
On 03.01.2010, at 16:45, Michael S. Tsirkin wrote: > On Sun, Jan 03, 2010 at 02:50:45AM +0100, Alexander Graf wrote: >> Different host buses may have different layouts for config space accessors. >> >> The Mac U3 for example uses the following define to access Type 0 (directly >> attached) devic

[Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable

2010-01-03 Thread Michael S. Tsirkin
On Sun, Jan 03, 2010 at 02:50:45AM +0100, Alexander Graf wrote: > Different host buses may have different layouts for config space accessors. > > The Mac U3 for example uses the following define to access Type 0 (directly > attached) devices: > > #define MACRISC_CFA0(devfn, off)\ >