lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ed681b9-c8d4-ea27-6b8b-e399ed034bda@arm.com>
Date:   Fri, 18 Jan 2019 11:43:32 +0000
From:   Julien Grall <julien.grall@....com>
To:     Oleksandr Andrushchenko <Oleksandr_Andrushchenko@...m.com>,
        Christoph Hellwig <hch@...radead.org>
Cc:     "jgross@...e.com" <jgross@...e.com>,
        Oleksandr Andrushchenko <andr2000@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "noralf@...nnes.org" <noralf@...nnes.org>,
        Gerd Hoffmann <kraxel@...hat.com>,
        "daniel.vetter@...el.com" <daniel.vetter@...el.com>,
        "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
        "boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
        Stefano Stabellini <sstabellini@...nel.org>
Subject: Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display
 buffer coherent

(+ Stefano)

Hi,

Sorry for jumping late in the conversation.

On 18/01/2019 09:40, Oleksandr Andrushchenko wrote:
> On 1/17/19 11:18 AM, Christoph Hellwig wrote:
>> On Wed, Jan 16, 2019 at 06:43:29AM +0000, Oleksandr Andrushchenko wrote:
>>>> This whole issue keeps getting more and more confusing.
>>> Well, I don't really do DMA here, but instead the buffers in
>>> question are shared with other Xen domain, so effectively it
>>> could be thought of some sort of DMA here, where the "device" is
>>> that remote domain. If the buffers are not flushed then the
>>> remote part sees some inconsistency which in my case results
>>> in artifacts on screen while displaying the buffers.
>>> When buffers are allocated via DMA API then there are no artifacts;
>>> if buffers are allocated with shmem + DMA mapping then there are no
>>> artifacts as well.
>>> The only offending use-case is when I use shmem backed buffers,
>>> but do not flush them
>> The right answer would be to implement cache maintainance hooks for
>> this case in the Xen arch code.  These would basically look the same
>> as the low-level cache maintainance used by the DMA ops, but without
>> going through the DMA mapping layer, in fact they should probably
>> reuse the same low-level assembly routines.
>>
>> I don't think this is the first usage of such Xen buffer sharing, so
>> what do the other users do?
> I'll have to get even deeper into it. Initially I
> looked at the code, but didn't find anything useful.
> Or maybe I have just overlooked obvious things there
 From Xen on Arm ABI:

"All memory which is shared with other entities in the system
(including the hypervisor and other guests) must reside in memory
which is mapped as Normal Inner Write-Back Outer Write-Back Inner-Shareable.
This applies to:
   - hypercall arguments passed via a pointer to guest memory.
   - memory shared via the grant table mechanism (including PV I/O
     rings etc).
   - memory shared with the hypervisor (struct shared_info, struct
     vcpu_info, the grant table, etc).
"

So you should not need any cache maintenance here. Can you provide more details 
on the memory attribute you use for memory shared in both the backend and frontend?

Cheers,

> 
> Thank you,
> Oleksandr
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@...ts.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel
> 

-- 
Julien Grall

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ