Hi,
On 17/12/14 17:52, Andrew Cooper wrote:
> On 17/12/14 17:10, Jan Beulich wrote:
> Julien Grall 12/17/14 1:55 PM >>>
>>> On 17/12/14 10:05, Jan Beulich wrote:
>> On 16.12.14 at 21:08, wrote:
> +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
Any reason not to simply use
Hi Andrew Cooper,
On 17/12/2014 17:52, Andrew Cooper wrote:
On 17/12/14 17:10, Jan Beulich wrote:
Julien Grall 12/17/14 1:55 PM >>>
On 17/12/14 10:05, Jan Beulich wrote:
On 16.12.14 at 21:08, wrote:
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
Any reason not to simply use {read,w
Hi Andrew,
On 17/12/2014 17:52, Andrew Cooper wrote:
On 17/12/14 17:10, Jan Beulich wrote:
Julien Grall 12/17/14 1:55 PM >>>
On 17/12/14 10:05, Jan Beulich wrote:
On 16.12.14 at 21:08, wrote:
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
Any reason not to simply use {read,write}_a
On 17/12/14 17:10, Jan Beulich wrote:
Julien Grall 12/17/14 1:55 PM >>>
>> On 17/12/14 10:05, Jan Beulich wrote:
> On 16.12.14 at 21:08, wrote:
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
>>> Any reason not to simply use {read,write}_atomic() instead, which we
>>> already
>>> Julien Grall 12/17/14 1:55 PM >>>
>On 17/12/14 10:05, Jan Beulich wrote:
On 16.12.14 at 21:08, wrote:
>>> +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
>>
>> Any reason not to simply use {read,write}_atomic() instead, which we
>> already have?
>
>To avoid modifying Linux drivers
Hi Jan,
On 17/12/14 10:05, Jan Beulich wrote:
On 16.12.14 at 21:08, wrote:
>> --- a/xen/include/xen/compiler.h
>> +++ b/xen/include/xen/compiler.h
>> @@ -90,4 +90,18 @@
>> __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
>> (typeof(ptr)) (__ptr + (off)); })
>>
>> +/*
>> + * Prevent
>>> On 16.12.14 at 21:08, wrote:
> --- a/xen/include/xen/compiler.h
> +++ b/xen/include/xen/compiler.h
> @@ -90,4 +90,18 @@
> __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
> (typeof(ptr)) (__ptr + (off)); })
>
> +/*
> + * Prevent the compiler from merging or refetching accesses. The c
This macro can be used in drivers imported from Linux.
Signed-off-by: Julien Grall
CC: Ian Jackson
CC: Jan Beulich
CC: Keir Fraser
---
xen/include/xen/compiler.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 4