Re: [Qemu-devel] ARM CPU affinities

2015-09-29 Thread Peter Maydell
On 29 September 2015 at 07:15, Andrew Jones wrote: > My current thinking is that we'll set MPIDR with KVM_SET_ONE_REG, which > will also set the cached value in struct kvm_vcpu. Reset will then use > that value. Yes, supporting SET_ONE_REG is definitely the way to go for the userspace API for thi

Re: [Qemu-devel] ARM CPU affinities

2015-09-29 Thread Andrew Jones
On Mon, Sep 28, 2015 at 06:36:29PM +0300, Pavel Fedin wrote: > Hello! > > > I think we'll need to cache mpidr in the vcpu data in order to properly > > reset it. > > We already have it in our data. I took a quick look at that, but kernel > needs patching. IIRC reset Right. I was referring to

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Pavel Fedin
Hello! > Not worrying about KVM yet, but I think pushing this up to virt > shouldn’t interfere with that work anyway. Actually, IMHO this code is quite universal. My initial idea was to introduce a global variable instead of ARM_CPUS_PER_CLUSTER definition. By setting this variable before cre

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Peter Crosthwaite
On Mon, Sep 28, 2015 at 2:13 AM, Peter Maydell wrote: > On 27 September 2015 at 22:28, Peter Crosthwaite > wrote: >> Hi Peter, >> >> I am looking at this: >> >> static void arm_cpu_initfn(Object *obj) >> { >> ... >> Aff1 = cs->cpu_index / ARM_CPUS_PER_CLUSTER; >> Aff0 = cs->cpu_index

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Pavel Fedin
Hello! > I think we'll need to cache mpidr in the vcpu data in order to properly > reset it. We already have it in our data. I took a quick look at that, but kernel needs patching. IIRC reset for secondary vCPUs happens inside kernel's PSCI code, before primary tells it to start up. You canno

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Andrew Jones
On Mon, Sep 28, 2015 at 06:16:26PM +0300, Pavel Fedin wrote: > Hello! > > > I've been thinking about picking this work up. Let me confirm first that > > Pavel hasn't already, because, iirc, he was the last to look into it. > > Pavel? > > I am here. Yes, i did not do anything else with this. The

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Pavel Fedin
Hello! > I've been thinking about picking this work up. Let me confirm first that > Pavel hasn't already, because, iirc, he was the last to look into it. > Pavel? I am here. Yes, i did not do anything else with this. The problem is in the kernel; every time vCPU is reset, it resets its MPIDR v

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Andrew Jones
On Mon, Sep 28, 2015 at 10:13:15AM +0100, Peter Maydell wrote: > On 27 September 2015 at 22:28, Peter Crosthwaite > wrote: > > Hi Peter, > > > > I am looking at this: > > > > static void arm_cpu_initfn(Object *obj) > > { > > ... > > Aff1 = cs->cpu_index / ARM_CPUS_PER_CLUSTER; > > Aff0

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Pavel Fedin
Hello! > NB that as the comment says KVM currently imposes its own numbering > anyway -- if you care about that you need to get the kernel to > support having userspace tell it about affinity numbering. Yes. You cannot set MPIDR values for the KVM, because upon reset they are reverted to somet

Re: [Qemu-devel] ARM CPU affinities

2015-09-28 Thread Peter Maydell
On 27 September 2015 at 22:28, Peter Crosthwaite wrote: > Hi Peter, > > I am looking at this: > > static void arm_cpu_initfn(Object *obj) > { > ... > Aff1 = cs->cpu_index / ARM_CPUS_PER_CLUSTER; > Aff0 = cs->cpu_index % ARM_CPUS_PER_CLUSTER; > cpu->mp_affinity = (Aff1 << ARM_AFF1_S