[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5CEE57910200007800233571@prv1-mh.provo.novell.com>
Date: Wed, 29 May 2019 03:57:37 -0600
From: "Jan Beulich" <JBeulich@...e.com>
To: "Juergen Gross" <jgross@...e.com>
Cc: "Stefano Stabellini" <sstabellini@...nel.org>,
<iommu@...ts.linux-foundation.org>,
"xen-devel" <xen-devel@...ts.xenproject.org>,
"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH v2 3/3] xen/swiotlb: remember having
called xen_create_contiguous_region()
>>> On 29.05.19 at 11:04, <jgross@...e.com> wrote:
> @@ -345,8 +346,11 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
> size = 1UL << (order + XEN_PAGE_SHIFT);
>
> if (!WARN_ON((dev_addr + size - 1 > dma_mask) ||
> - range_straddles_page_boundary(phys, size)))
> + range_straddles_page_boundary(phys, size)) &&
> + PageXenRemapped(virt_to_page(vaddr))) {
> xen_destroy_contiguous_region(phys, order);
> + ClearPageXenRemapped(virt_to_page(vaddr));
> + }
To be symmetric with setting the flag only after having made the region
contiguous, and to avoid (perhaps just theoretical) races, wouldn't it be
better to clear the flag before calling xen_destroy_contiguous_region()?
Even better would be a TestAndClear...() operation.
Jan
Powered by blists - more mailing lists