From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2K4x-0007Lq-0o for qemu-devel@nongnu.org; Tue, 09 Jun 2015 10:00:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2K4r-0001QF-77 for qemu-devel@nongnu.org; Tue, 09 Jun 2015 10:00:34 -0400 Received: from foss.arm.com ([217.140.101.70]:41755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2K4r-0001Or-2J for qemu-devel@nongnu.org; Tue, 09 Jun 2015 10:00:29 -0400 Message-ID: <5576F177.3090903@arm.com> Date: Tue, 09 Jun 2015 15:00:23 +0100 From: Marc Zyngier MIME-Version: 1.0 References: <5576C559.2000902@arm.com> <5576DBB5.3010100@arm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] should KVM or userspace be the one which decides what MIPIDR/affinity values to assign to vcpus? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Shlomo Pongratz , Shlomo Pongratz , Pavel Fedin , QEMU Developers , Shannon Zhao , Ashok Kumar , Igor Mammedov , "kvmarm@lists.cs.columbia.edu" On 09/06/15 14:16, Peter Maydell wrote: > On 9 June 2015 at 13:27, Marc Zyngier wrote: >> On 09/06/15 12:24, Peter Maydell wrote: >>> So either: >>> * QEMU needs to tell the kernel the MPIDR for each vCPU >>> * QEMU needs to ask the kernel the MPIDR for each vCPU >>> >>> Which is better? The latter is simpler and will work with >>> existing kernels. The former would let us (for instance) >>> use KVM when we're modelling (real world) boards which have >>> particular cluster configurations (which might not match the >>> kernel's current simplistic "always 16 CPUs at Aff0" setup). >> >> Given that it is userspace that provides the description of the >> platform, it feels natural to let userspace set MPIDR accordingly. >> >> This will require some interesting rework in the kernel, but this >> doesn't feel too bad. > > On the other hand QEMU needs to keep working with current kernels, > so we need the "ask the kernel" code at least for the moment. > Probably needs a capability for "kernel allows userspace to > set MPIDR" so we can adapt. Yeah, what I had in mind was something along the lines of: - kernel computes its "default MPDIR" - kernel exposes a new capability "KVM_ARM_ALLOW_MPIDR_OVERRIDE" (or something along those lines) - userspace does the right thing. M. -- Jazz is not dead. It just smells funny...