From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for-4.5 v11 4/9] xen/arm: Data abort exception (R/W) mem_events. Date: Mon, 29 Sep 2014 13:35:32 +0100 Message-ID: <54295214.6030902@linaro.org> References: <1411990609-22374-1-git-send-email-tklengyel@sec.in.tum.de> <1411990609-22374-5-git-send-email-tklengyel@sec.in.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411990609-22374-5-git-send-email-tklengyel@sec.in.tum.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tamas K Lengyel , xen-devel@lists.xen.org Cc: tim@xen.org, dgdegra@tycho.nsa.gov, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Tamas, On 09/29/2014 12:36 PM, Tamas K Lengyel wrote: > @@ -776,6 +863,8 @@ static int apply_p2m_changes(struct domain *d, > unsigned int cur_root_table = ~0; > unsigned int cur_offset[4] = { ~0, }; > unsigned int count = 0; > + unsigned long sgfn = paddr_to_pfn(start_gpaddr), > + egfn = paddr_to_pfn(end_gpaddr); NIT: const unsigned long [..] > +/* Set access type for a region of pfns. > + * If start_pfn == -1ul, sets the default access type */ > +long p2m_set_mem_access(struct domain *d, unsigned long pfn, uint32_t nr, > + uint32_t start, uint32_t mask, xenmem_access_t access) > +{ [..] > + > + rc = apply_p2m_changes(d, MEMACCESS, > + pfn_to_paddr(pfn+start), pfn_to_paddr(pfn+nr), > + 0, MATTR_MEM, mask, 0, a); > + > + flush_tlb_domain(d); > + iommu_iotlb_flush(d, pfn+start, nr-start); With your solution, when rc == 0 (i.e the call memaccess has been fully applied), you will have one more TLB flush: one in apply_p2m_changes, the other one here... As this code already exists in apply_p2m_changes but in the wrong place, why didn't you move it later? Regards, -- Julien Grall