From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef6Ap-0001BB-Cm for qemu-devel@nongnu.org; Fri, 26 Jan 2018 10:44:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef6Ak-0000j0-OM for qemu-devel@nongnu.org; Fri, 26 Jan 2018 10:44:15 -0500 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <1512670493-18114-1-git-send-email-peter.maydell@linaro.org> <1512670493-18114-5-git-send-email-peter.maydell@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Fri, 26 Jan 2018 12:44:00 -0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 4/6] target/arm: Add "-cpu max" support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-arm , QEMU Developers , "Richard W . M . Jones" , Eduardo Habkost , "patches@linaro.org" On 01/26/2018 11:33 AM, Peter Maydell wrote: > On 26 January 2018 at 14:29, Philippe Mathieu-Daudé wrote: >> Hi Peter, >> >> On 12/07/2017 03:14 PM, Peter Maydell wrote: >>> Add support for "-cpu max" for ARM guests. This CPU type behaves >>> like "-cpu host" when KVM is enabled, and like a system CPU with >>> the maximum possible feature set otherwise. (Note that this means >>> it won't be migratable across versions, as we will likely add >>> features to it in future.) >>> >>> Signed-off-by: Peter Maydell >>> --- > >>> +#ifndef TARGET_AARCH64 >>> +/* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); >>> + * otherwise, a CPU with as many features enabled as our emulation supports. >>> + * The version of '-cpu max' for qemu-system-aarch64 is defined in cpu64.c; >>> + * this only needs to handle 32 bits. >>> + */ >>> +static void arm_max_initfn(Object *obj) >>> +{ >>> + ARMCPU *cpu = ARM_CPU(obj); >>> + >>> + if (kvm_enabled()) { >>> + kvm_arm_set_cpu_features_from_host(cpu); >>> + } else { >>> + cortex_a15_initfn(obj);> + /* In future we might add feature bits here even if the >>> + * real-world A15 doesn't implement them. >>> + */ >> >> Why not use arm_any_initfn() here? > > That function (and the 'any' cpu) are deliberately only > included in the linux-user binaries, not the system-emulation binaries. why not use the V8 features? > (Also arm_any_initfn() only initializes userspace-visible stuff, it > doesn't provide ID register values etc for kernel-visible things.) I'd still use an unique arm_max_initfn() such // initializes userspace-visible stuff #ifndef CONFIG_USER_ONLY // initializes kernel-visible things #endif > >> Actually what seems cleaner is to move "any" features here, and kill the >> "any" cpu, using "max" for this purpose. > > We can't kill 'any', that would break back-compatibility > of command lines. and use an alias for 'any' -> 'max' or just { .name = "any", .initfn = arm_max_initfn }, /* backward compat */ Anyway: Reviewed-by: Philippe Mathieu-Daudé > > thanks > -- PMM >