qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 1/4] spapr: Implement VPA dispatch counter an


From: Nicholas Piggin
Subject: Re: [Qemu-devel] [PATCH v5 1/4] spapr: Implement VPA dispatch counter and prod bit on tcg
Date: Thu, 18 Jul 2019 12:17:02 +1000
User-agent: astroid/0.14.0 (https://github.com/astroidmail/astroid)

Cédric Le Goater's on July 17, 2019 10:50 pm:
> On 17/07/2019 07:39, Nicholas Piggin wrote:
>> Implement cpu_exec_enter/exit on ppc which calls into new methods of
>> the same name in PPCVirtualHypervisorClass. These are used by spapr
>> to implement these splpar elements, used in subsequent changes.
>> 
>> Signed-off-by: Nicholas Piggin <address@hidden>
> 
> This is nice. I am thinking of using these handlers to push/pull 
> the XIVE OS CAM line and escalate to QEMU when a vCPU being notified 
> is not dispatched.

Great if it is useful.

>> +static void spapr_cpu_exec_enter(PPCVirtualHypervisor *vhyp, PowerPCCPU 
>> *cpu)
>> +{
>> +    SpaprCpuState *spapr_cpu = spapr_cpu_state(cpu);
>> +
>> +    /* These are only called by TCG, KVM maintains dispatch state */
>> +
>> +    spapr_cpu->prod = false;
> 
> I would have kept this prod bool for the next patch as we don't use it here.

Okay I'll do that.

>> +    if (spapr_cpu->vpa_addr) {
>> +        CPUState *cs = CPU(cpu);
>> +        unsigned int dispatch;
>> +
>> +        dispatch = ldl_be_phys(cs->as,
>> +                               spapr_cpu->vpa_addr + VPA_DISPATCH_COUNTER);
>> +        dispatch++;
>> +        if ((dispatch & 1) != 0) /* guest set the "wrong" value */
>> +            dispatch++;
> 
> 
> You might want to add :
> 
>   qemu_log_mask(LOG_GUEST_ERROR, ...);  
> 
> when the yield value is wrong.

Hm didn't know about that, good point I can add it.

Thanks,
Nick



reply via email to

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