[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device

From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties
Date: Tue, 10 Jul 2012 14:03:16 +0100

On 10 July 2012 07:54, Peter Crosthwaite
<address@hidden> wrote:
> Constantly bouncing back is safer however. If you hang on to an
> in-place pointer into the FDT (as returned by get_prop) and someone
> comes along and set_props() then your pointer is corrupted. Ive been
> snagged before by doing exactly this and eventually came to the
> brute-force approach of just requerying the DTB every touch rather
> than try to work with pointers to arrays. duping the property could
> work, but its a bit of a mess trying to free the returned copies.

Incidentally, if you have two separate bits of code both accessing
the DTB in parallel then this sounds like a really weird corner case
use. I would expect that the standard thing would be "at startup
we read the DTB, modify it slightly and after that ignore it",
all of which should be straightforward single threaded code with
no particular control flow/threading/coroutine issues.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]