[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/3] target-ppc: tlbie should have global eff
From: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/3] target-ppc: tlbie should have global effect |
Date: |
Mon, 12 Sep 2016 10:13:58 +0530 |
User-agent: |
Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) |
Benjamin Herrenschmidt <address@hidden> writes:
> On Fri, 2016-09-09 at 18:44 +0530, Nikunj A Dadhania wrote:
>> +static inline void tlb_clear_flag(CPUState *cs)
>> +{
>> + PowerPCCPU *cpu = POWERPC_CPU(cs);
>> + CPUPPCState *env = &cpu->env;
>> +
>> + env->tlb_need_flush = 0;
>> +}
>
> What is the point of making this a separate function ?
When I wrote, i thought this would be used from various places. But dont
think its a requirement. Will inline it.
> Also I'm not 100% certain about the correctness of clearing
> TLB_NEED_GLOBAL_FLUSH on the "other" guy.
>
> We could have the situation where:
>
> cpu 1: cpu 2:
> sets both ..
> isync (clears local flush) ..
> <insert new translation>
> .. set both
> .. ..
> .. ..
> ptesync (clears global flush) .. (both gets cleared)
>
> Now here, you can see that cpu2 never does a global flush and so the
> new translation inserted by cpu 1 is not cleared while architecturally
> it should be.
Right, will only clear the local flag.
> That being said, I doubt the above scenario can happen in practice,
> but I think it's safer if you only clear the local bit on the "other"
> CPUs.
Regards,
Nikunj