From: Tim Deegan Subject: Re: [PATCH] Don't track all memory when enabling log dirty to track vram Date: Tue, 11 Feb 2014 10:02:02 +0100 Message-ID: <20140211090202.GC92054@deinos.phlegethon.org> References: <1392012840-22555-1-git-send-email-yang.z.zhang@intel.com> <20140210080314.GA758@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Zhang, Yang Z" Cc: "andrew.cooper3@citrix.com" , "Zhang, Xiantao" , "JBeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 08:15 +0000 on 10 Feb (1392016516), Zhang, Yang Z wrote: > Tim Deegan wrote on 2014-02-10: > > At 14:14 +0800 on 10 Feb (1392038040), Yang Zhang wrote: > >> From: Yang Zhang > >> > >> When enabling log dirty mode, it sets all guest's memory to readonly. > >> And in HAP enabled domain, it modifies all EPT entries to clear > >> write bit to make sure it is readonly. This will cause problem if > >> VT-d shares page table with EPT: the device may issue a DMA write > >> request, then VT-d engine tells it the target memory is readonly and > >> result in VT-d > > fault. > > > > So that's a problem even if only the VGA framebuffer is being tracked > > -- DMA from a passthrough device will either cause a spurious error or > > fail to update the dirt bitmap. > > Do you mean the VGA frambuffer will be used as DMA buffer in guest? If yes, I think it's guest's responsibility to ensure it never happens. > I don't think that works. We can't expect arbitrary OSes to (a) know they're running on Xen and (b) know that that means they can't DMA to or from their framebuffers. > Without VT-d and EPT share page, we still cannot track the memory > updating from DMA. Yeah, but at least we don't risk crashing the _host_ by throwing DMA failures around. > I think the point is that we cannot track the > memory updating via DMA. So the user should use the log dirty mode > carefully. Also, I am not sure whether the memory updating from dom0 > and QEMU is tracked currently. Yes, dom0 and qemu updates are tracked in the log-dirty bitmaps. Tim.