All of lore.kernel.org
 help / color / mirror / Atom feed
* question on share ept page table with vtd
@ 2014-02-01  0:29 Zhang, Yang Z
  2014-02-01  0:56 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Yang Z @ 2014-02-01  0:29 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Tim Deegan (tim@xen.org), Zhang, Xiantao,
	'Jan Beulich (JBeulich@suse.com)'

Hi all

I have a question with the page table share between EPT and VTD which is enabled by default. Currently, we will enable log_dirty mode to track vram. And when first enable the log dirty mode, it will set all guest ram to readonly in EPT entry. The question is that if a page is current used as DMA write buffer, isn't it a problem?

best regards
yang

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

* Re: question on share ept page table with vtd
  2014-02-01  0:29 question on share ept page table with vtd Zhang, Yang Z
@ 2014-02-01  0:56 ` Andrew Cooper
  2014-02-01  1:13   ` Zhang, Yang Z
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2014-02-01  0:56 UTC (permalink / raw)
  To: Zhang, Yang Z, xen-devel@lists.xenproject.org
  Cc: Tim Deegan (tim@xen.org),
	'Jan Beulich (JBeulich@suse.com)', Zhang, Xiantao

On 01/02/2014 00:29, Zhang, Yang Z wrote:
> Hi all
>
> I have a question with the page table share between EPT and VTD which is enabled by default. Currently, we will enable log_dirty mode to track vram. And when first enable the log dirty mode, it will set all guest ram to readonly in EPT entry. The question is that if a page is current used as DMA write buffer, isn't it a problem?
>
> best regards
> yang

Looking at the code, it would indeed appear to be a problem.

Is has presumably gone unnoticed until now as all writes into the vram
would have been from software, and hit the log_dirty logic, rather than
DMA writes hitting the IOMMU.

~Andrew

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

* Re: question on share ept page table with vtd
  2014-02-01  0:56 ` Andrew Cooper
@ 2014-02-01  1:13   ` Zhang, Yang Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Yang Z @ 2014-02-01  1:13 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel@lists.xenproject.org
  Cc: Tim Deegan (tim@xen.org),
	'Jan Beulich (JBeulich@suse.com)', Zhang, Xiantao

Andrew Cooper wrote on 2014-02-01:
> On 01/02/2014 00:29, Zhang, Yang Z wrote:
>> Hi all
>> 
>> I have a question with the page table share between EPT and VTD
>> which is
> enabled by default. Currently, we will enable log_dirty mode to track
> vram. And when first enable the log dirty mode, it will set all guest
> ram to readonly in EPT entry. The question is that if a page is
> current used as DMA write buffer, isn't it a problem?
>> 
>> best regards
>> yang
> 
> Looking at the code, it would indeed appear to be a problem.
> 
> Is has presumably gone unnoticed until now as all writes into the vram
> would have been from software, and hit the log_dirty logic, rather
> than DMA writes hitting the IOMMU.
> 

Yes, and I do saw the issue that caused by this that SRIOV fails issue with Xen 4.4+qemu-xen-dir. 
http://www.gossamer-threads.com/lists/xen/devel/315663

There are two places that will call paging_log_dirty_enable() to enable log dirty mode: one is in vram tracking and on is in domain saving. Since VT-d is not recommended to use with saving/restore, so for latter case, it is OK. But for the vram tracking, I don't think we need to set all guest ram to readonly when first enable log dirty mode. Only set the memory range that used by vram is enough.
Furthermore, I think sharing EPT page table with VT-d is not a good idea since hypervisor can mark the ram as readonly in any time and in any usage mode in furture. If sharing page table is used, this will becomes impossible. 

> ~Andrew


Best regards,
Yang

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

end of thread, other threads:[~2014-02-01  1:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-01  0:29 question on share ept page table with vtd Zhang, Yang Z
2014-02-01  0:56 ` Andrew Cooper
2014-02-01  1:13   ` Zhang, Yang Z

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.