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 <npig...@gmail.com> > > 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