Re: [Qemu-devel] [PATCH 4/5] spapr: consolidate the VCPU id numbering logic in a single place

2018-02-14 Thread David Gibson
On Wed, Feb 14, 2018 at 08:40:53PM +0100, Greg Kurz wrote: > Several places in the code need to calculate a VCPU id: > > (cpu_index / smp_threads) * spapr->vsmt + cpu_index % smp_threads > (core_id / smp_threads) * spapr->vsmt (1 user) > index * spapr->vsmt (2 users) > > or guess

[Qemu-devel] [PATCH 4/5] spapr: consolidate the VCPU id numbering logic in a single place

2018-02-14 Thread Greg Kurz
Several places in the code need to calculate a VCPU id: (cpu_index / smp_threads) * spapr->vsmt + cpu_index % smp_threads (core_id / smp_threads) * spapr->vsmt (1 user) index * spapr->vsmt (2 users) or guess that the VCPU id of a given VCPU is the first thread of a virtual core: