Peter Maydell wrote:
> On 19 September 2012 14:32, Jamie Lokier wrote:
> > However, someone may run QEMU on a kernel before 2.6.32, which isn't
> > that old. (E.g. my phone is running 2.6.28).
>
> NB that ARM kernels that old have other amusing bugs, such
> as not saving the floating point regis
On 19 September 2012 14:32, Jamie Lokier wrote:
> However, someone may run QEMU on a kernel before 2.6.32, which isn't
> that old. (E.g. my phone is running 2.6.28).
NB that ARM kernels that old have other amusing bugs, such
as not saving the floating point registers when invoking
signal handler
liu ping fan wrote:
> >> +static inline void atomic_set(Atomic *v, int i)
> >> +{
> >> +v->counter = i;
> >> +}
Hi,
When running on ARM Linux kernels prior to 2.6.32, userspace
atomic_set() needs to use "clrex" or "strex" too.
See Linux commit 200b812d, "Clear the exclusive monitor when retu
Avi Kivity wrote:
> On 09/13/2012 09:54 AM, liu ping fan wrote:
>
> >>> +typedef struct Atomic {
> >>> +int counter;
> >>> +} Atomic;
> >>
> >> Best to mark counter 'volatile'.
> >>
> >>> +
> >>> +static inline void atomic_set(Atomic *v, int i)
> >>> +{
> >>> +v->counter = i;
> >>> +}
> >>
On Thu, Sep 13, 2012 at 4:19 PM, Paolo Bonzini wrote:
> Il 13/09/2012 10:14, Avi Kivity ha scritto:
> >>> +static inline void atomic_set(Atomic *v, int i)
> >>> +{
> >>> +v->counter = i;
> >>> +}
> >>> +
> >>> +static inline int atomic_read(Atomic *v)
> >>> +{
>
Il 13/09/2012 10:23, Avi Kivity ha scritto:
>> > But I don't really see the point in wrapping atomically-accessed
>> > variables in a struct.
> Preventing accidental naked access (to be reported in patch review as
> "wardrobe malfunction").
Yeah, I understand that, but it's rare enough that I do
On 09/13/2012 11:19 AM, Paolo Bonzini wrote:
> Il 13/09/2012 10:14, Avi Kivity ha scritto:
> >>> +static inline void atomic_set(Atomic *v, int i)
> >>> +{
> >>> +v->counter = i;
> >>> +}
> >>> +
> >>> +static inline int atomic_read(Atomic *v)
> >>> +{
> >>> +
Il 13/09/2012 10:14, Avi Kivity ha scritto:
>>> +static inline void atomic_set(Atomic *v, int i)
>>> +{
>>> +v->counter = i;
>>> +}
>>> +
>>> +static inline int atomic_read(Atomic *v)
>>> +{
>>> +return v->counter;
>>> +}
>>>
>>> >>
>>> >> S
On 09/13/2012 09:54 AM, liu ping fan wrote:
>>> +typedef struct Atomic {
>>> +int counter;
>>> +} Atomic;
>>
>> Best to mark counter 'volatile'.
>>
>>> +
>>> +static inline void atomic_set(Atomic *v, int i)
>>> +{
>>> +v->counter = i;
>>> +}
>>> +
>>> +static inline int atomic_read(Atomic
On Tue, Sep 11, 2012 at 4:04 PM, Avi Kivity wrote:
> On 09/11/2012 10:51 AM, Liu Ping Fan wrote:
>> From: Liu Ping Fan
>>
>> If out of global lock, we will be challenged by SMP in low level,
>> so need atomic ops.
>>
>> This file is a wrapper of GCC atomic builtin.
>>
>> Signed-off-by: Liu Ping F
On Tue, Sep 11, 2012 at 4:15 PM, Peter Maydell wrote:
> On 11 September 2012 08:51, Liu Ping Fan wrote:
>> +
>> +/**
>> + * * atomic_inc - increment atomic variable
>> + * * @v: pointer of type Atomic
>> + **
>> + * * Atomically increments @v by 1.
>> + * */
>
> Your editor has do
On 11 September 2012 08:51, Liu Ping Fan wrote:
> +
> +/**
> + * * atomic_inc - increment atomic variable
> + * * @v: pointer of type Atomic
> + **
> + * * Atomically increments @v by 1.
> + * */
Your editor has done something weird with these comments.
-- PMM
On 09/11/2012 10:51 AM, Liu Ping Fan wrote:
> From: Liu Ping Fan
>
> If out of global lock, we will be challenged by SMP in low level,
> so need atomic ops.
>
> This file is a wrapper of GCC atomic builtin.
>
> Signed-off-by: Liu Ping Fan
> ---
> include/qemu/atomic.h | 63
> ++
From: Liu Ping Fan
If out of global lock, we will be challenged by SMP in low level,
so need atomic ops.
This file is a wrapper of GCC atomic builtin.
Signed-off-by: Liu Ping Fan
---
include/qemu/atomic.h | 63 +
1 files changed, 63 insertions
14 matches
Mail list logo