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

Re: [Xen-devel] [PATCH V2 4/25] Xen/doc: Add Xen virtual IOMMU doc



On Wed, Aug 23, 2017 at 03:36:19PM +0800, Lan Tianyu wrote:
> On 2017年08月22日 23:55, Roger Pau Monné wrote:
> > On Wed, Aug 09, 2017 at 04:34:05PM -0400, Lan Tianyu wrote:
> >> This patch is to add Xen virtual IOMMU doc to introduce motivation,
> >> framework, vIOMMU hypercall and xl configuration.
> >>
> >> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
> >> ---
> >>  docs/misc/viommu.txt | 139 
> >> +++++++++++++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 139 insertions(+)
> >>  create mode 100644 docs/misc/viommu.txt
> >>
> >> diff --git a/docs/misc/viommu.txt b/docs/misc/viommu.txt
> >> new file mode 100644
> >> index 0000000..39455bb
> >> --- /dev/null
> >> +++ b/docs/misc/viommu.txt
> >> +
> >> +To support >255 vcpus, X2APIC mode in guest is necessary because legacy
> >> +APIC(XAPIC) just supports 8-bit APIC ID and it only can support 255
> >> +vcpus at most. X2APIC mode supports 32-bit APIC ID and it requires
> >> +interrupt mapping function of vIOMMU.
> > 
> > Correct me if I'm wrong, but I don't think x2APIC requires vIOMMU. The
> > IOMMU is required so that you can route interrupts to all the possible
> > CPUs. One could image a setup where only CPUs with APIC IDs < 255 are
> > used as targets of external interrupts, and that doesn't require a
> > IOMMU.
> 
> This is OS behavior. IIRC, Windows strictly requires IOMMU when enable
> x2apic mode and Linux kernel only has such requirement when cpu number
> is > 255.

But this document doesn't speak about OSes, it speaks about the IOMMU
implementation. What I think is wrong is the following sentence:

"x2APIC mode supports 32-bit APIC ID and it requires interrupt mapping
function of vIOMMU."

IMHO it should be:

"x2APIC mode supports 32-bit APIC ID and it requires the interrupt
remapping functionality of a vIOMMU if the guest wishes to route
interrupts to all available vCPUs."

> > 
> > Also, why do you need the x2apic parameter? Is there any value in
> > providing a vIOMMU if it doesn't support x2APIC mode?
> 
> User can configure whether vIOMMU can support x2APIC mode and tool stack
> will use this configuration to prepare ACPI DMAR table. There is an
> X2APIC_OPT_OUT bit in DMAR table to tell OS not enable X2APIC mode for
> IOMMU.

Let me rephrase my question, what's the value in implementing the
xAPIC support for vIOMMU?

The vIOMMU work is done so that Xen can create guests with > 128 vCPUs
(> 255 APIC IDs), at which point you _must_ use x2APIC mode. Is there
any value is providing a vIOMMU implementation that doesn't support
x2APIC?

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.