All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen ARM smmu questions
@ 2019-03-12  8:58 jinchen
  2019-03-12 11:42 ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: jinchen @ 2019-03-12  8:58 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]

Hello xen-devel, 
I'm reading the code of xen arm smmu in drivers/passthrough/arm, and I have some questions that confused me.
I think if the board use SMMU, xen will take charge of it before dom0 boot, and will not pass the node of SMMU to dom0 in device tree,
so my question is how dom0 use SMMU? or can dom0 use SMMU? What dom0 use if it wants to use IOMMU?
What about domU? The SMMU could be passed to domU?
Thank you!

[-- Attachment #1.2: Type: text/html, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Xen ARM smmu questions
  2019-03-12  8:58 Xen ARM smmu questions jinchen
@ 2019-03-12 11:42 ` Julien Grall
  2019-03-12 13:47   ` Jinch
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2019-03-12 11:42 UTC (permalink / raw)
  To: jinchen, xen-devel, Stefano Stabellini



On 3/12/19 8:58 AM, jinchen wrote:
> Hello xen-devel,

Hello,

> I'm reading the code of xen arm smmu in drivers/passthrough/arm, and I 
> have some questions that confused me.
> I think if the board use SMMU, xen will take charge of it before dom0 
> boot, and will not pass the node of SMMU to dom0 in device tree,
> so my question is how dom0 use SMMU? or can dom0 use SMMU? What dom0 use 
> if it wants to use IOMMU?
> What about domU? The SMMU could be passed to domU?

Some SMMU are able to provide Stage 1 (Guest VA to Guest PA) and Stage 2 
(Guest PA to Host PA) support. In the current configuration, Xen will 
use the Stage 2 part to isolate device passthrough. Stage 1 is not 
supported.

If you wanted a guest to use the SMMU, you would either need to provide 
Stage 1 support (requires HW support) or a PV IOMMU.

Alternatively, you might be able to give the SMMU to Dom0. I haven't 
explored it so far. Do you have a use case for using the IOMMU in guest?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Xen ARM smmu questions
  2019-03-12 11:42 ` Julien Grall
@ 2019-03-12 13:47   ` Jinch
  2019-03-12 19:20     ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Jinch @ 2019-03-12 13:47 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, Stefano Stabellini

Thank you for your reply,
I’m just researching the implementation of the SMMU driver in Xen and dom0 kernel.
If my board has SMMU of arm,mmu-500, do you mean that the Xen use the stage 2 of it and the dom0 kernel use stage1?
And if I want to passthrough some device that use SMMU to domu, how the SMMU working in Xen and the domu kernel?

> 在 2019年3月12日,下午7:42,Julien Grall <julien.grall@arm.com> 写道:
> 
> 
> On 3/12/19 8:58 AM, jinchen wrote:
>> Hello xen-devel,
> 
> Hello,
> 
>> I'm reading the code of xen arm smmu in drivers/passthrough/arm, and I have some questions that confused me.
>> I think if the board use SMMU, xen will take charge of it before dom0 boot, and will not pass the node of SMMU to dom0 in device tree,
>> so my question is how dom0 use SMMU? or can dom0 use SMMU? What dom0 use if it wants to use IOMMU?
>> What about domU? The SMMU could be passed to domU?
> 
> Some SMMU are able to provide Stage 1 (Guest VA to Guest PA) and Stage 2 (Guest PA to Host PA) support. In the current configuration, Xen will use the Stage 2 part to isolate device passthrough. Stage 1 is not supported.
> 
> If you wanted a guest to use the SMMU, you would either need to provide Stage 1 support (requires HW support) or a PV IOMMU.
> 
> Alternatively, you might be able to give the SMMU to Dom0. I haven't explored it so far. Do you have a use case for using the IOMMU in guest?
> 
> Cheers,
> 
> -- 
> Julien Grall
> 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Xen ARM smmu questions
  2019-03-12 13:47   ` Jinch
@ 2019-03-12 19:20     ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2019-03-12 19:20 UTC (permalink / raw)
  To: Jinch; +Cc: xen-devel, Julien Grall, Stefano Stabellini

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2292 bytes --]

Hi Jinch,

Replies inline below.


On Tue, 12 Mar 2019, Jinch wrote:
> Thank you for your reply,
> I’m just researching the implementation of the SMMU driver in Xen and dom0 kernel.
> If my board has SMMU of arm,mmu-500, do you mean that the Xen use the stage 2 of it and the dom0 kernel use stage1?

Yes, that is the idea, however, it is not straightforward to implement
from what I have been told. For your information, today, only stage2 in
Xen works -- stage1 cannot be used by dom0 (or anybody else) and would
be left unused.


> And if I want to passthrough some device that use SMMU to domu, how the SMMU working in Xen and the domu kernel?

As I mentioned, today Xen makes use of the SMMU, and nobody else in the
system can access it, not dom0, not any domUs. I would love to have a
way to export the SMMU to dom0 and/or a domU. To do that, the easiest
way would be to introduce support for a paravirtualized IOMMU as Julien
mentioned: Xen would expose a "fake" SMMU to guests, and based on its
settings, it would program the real SMMU (it could even use stage1 to do
it). The "fake" SMMU is not implemented yet.


> > 在 2019年3月12日,下午7:42,Julien Grall <julien.grall@arm.com> 写道:
> > 
> > 
> > On 3/12/19 8:58 AM, jinchen wrote:
> >> Hello xen-devel,
> > 
> > Hello,
> > 
> >> I'm reading the code of xen arm smmu in drivers/passthrough/arm, and I have some questions that confused me.
> >> I think if the board use SMMU, xen will take charge of it before dom0 boot, and will not pass the node of SMMU to dom0 in device tree,
> >> so my question is how dom0 use SMMU? or can dom0 use SMMU? What dom0 use if it wants to use IOMMU?
> >> What about domU? The SMMU could be passed to domU?
> > 
> > Some SMMU are able to provide Stage 1 (Guest VA to Guest PA) and Stage 2 (Guest PA to Host PA) support. In the current configuration, Xen will use the Stage 2 part to isolate device passthrough. Stage 1 is not supported.
> > 
> > If you wanted a guest to use the SMMU, you would either need to provide Stage 1 support (requires HW support) or a PV IOMMU.
> > 
> > Alternatively, you might be able to give the SMMU to Dom0. I haven't explored it so far. Do you have a use case for using the IOMMU in guest?
> > 
> > Cheers,
> > 
> > -- 
> > Julien Grall
> > 
> 
> 
> 

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-12 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  8:58 Xen ARM smmu questions jinchen
2019-03-12 11:42 ` Julien Grall
2019-03-12 13:47   ` Jinch
2019-03-12 19:20     ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.