qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v5 1/6] exec.c: Add new exclusive bitmap to ram_li


From: alvise rigo
Subject: Re: [Qemu-devel] [RFC v5 1/6] exec.c: Add new exclusive bitmap to ram_list
Date: Mon, 28 Sep 2015 09:28:55 +0200


On Sat, Sep 26, 2015 at 7:15 PM, Richard Henderson <address@hidden> wrote:
On 09/24/2015 01:32 AM, Alvise Rigo wrote:
> +    if (cpu == smp_cpus) {
> +        if (smp_cpus >= EXCL_BITMAP_CELL_SZ) {
> +            return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)];
> +        } else {
> +            return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)] &
> +                                            ((1 << smp_cpus) - 1);
> +        }
> +    } else {
> +        return bitmap[EXCL_BITMAP_GET_BYTE_OFFSET(addr)] & (1 << EXCL_IDX(cpu));
> +    }

How can more than one cpu have the same address exclusively?

The bitmap is used to track which cpus have the EXCL flag set for that particular page.
A bit set to 0 assures that all the corresponding cpus are following the slow-path in that page.
 

Isn't this scheme giving a whole page to a cpu, not a cacheline?

The actual exclusive range in set in CPUArchState, this is the information that we evaluate to see whether there was a conflict or not.

Regards,
alvise
 
That's going to cause ll/sc conflicts where real hardware wouldn't.



r~


reply via email to

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