qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPI


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC
Date: Thu, 13 Sep 2018 18:29:29 -0400

On Thu, Sep 13, 2018 at 05:20:34PM -0500, Brijesh Singh wrote:
> 
> 
> On 09/13/2018 01:18 PM, Michael S. Tsirkin wrote:
> ...>>
> > > 0x01 00a0 00 00 0000 48
> > > 
> > > Byte 0: 0x48 (special device)
> > > Byte 1 & 2: must be zero
> > > Byte 3: 0 (dte setting)
> > > Byte 4: 0 (handle)
> > > Byte 5 & 6: IOAPIC devfn (14:0.0)
> > 
> > Do you mean *bus* devfn? devfn is 0.0.
> > 
> 
> Sorry my bad, I was meaning to write devid and not devfn.
> 
> See, 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/iommu/amd_iommu_init.c#n2343
> 
> /* SB IOAPIC is always on this device in AMD systems */
> #define IOAPIC_SB_DEVID               ((0x00 << 8) | PCI_DEVFN(0x14, 0))

And devid is bus device function.

So in fact it is 0:20.0

So use

        PCI_BUILD_BDF(0, PCI_DEVFN(0x14, 0))

below

> 
> > > Byte 7: 0x1 (IOAPIC) - See Table 97 in spec
> > 
> > 
> > Above should go into code comment, along with
> > first (oldest) version of spec that has this table.
> > Additionally the number is IMHO more readable as:
> >     (0x1ull << 56) | (PCI_BUILD_BDF(14, 0) << 40) | 0x48
> > 
> > (assuming I got what it should be).
> > 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]