From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen: arm: invalidate caches after map_domain_page done Date: Fri, 01 Aug 2014 15:01:07 +0100 Message-ID: <53DB9DA3.2080109@linaro.org> References: <1406877914-31583-1-git-send-email-andrii.tseglytskyi@globallogic.com> <53DB5C88.8030602@linaro.org> <53DB6BE1.2040005@linaro.org> <53DB72EA.6080704@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: 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: Andrii Tseglytskyi Cc: Tim Deegan , Stefano Stabellini , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 01/08/14 12:37, Andrii Tseglytskyi wrote: >> The page you are trying to map belongs to a guest, right? When the guest >> writes data in this page. Does it map with cacheable attribute or not? I >> suspect no. > > Hard to say. This page is allocated using usual kernel API such as > kmalloc(). Then its pfn is stored in MMU 1-st level translation > pagetable. If it's allocated from kmalloc then the page is allocated with cacheable attribute. > Before storing - kernel driver flush corresponding cache ranges. Clean and invalidate the cache, right? > After > this - remoteproc_iommu framework translates pfns to mfns. > So - I would expect that after map_domain_page() function call all > data will be valid. Actually with your explanation me too. :) I'm run out of idea. Maybe Ian or Stefano have any clue. >> >> I think your current problem is the cache contains stall data. In this case >> you have to only invalidate the cache. >> > > May work. But it looks like new helper should be introduced in this > case. I see that only clean_and_invalidate_xen_dcache_va_range API is > present, no standalone API for invalidating only. You can add a new helper. I suspect it will be necessary sooner or later in other places. Regards, -- Julien Grall