From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eejB3-0003Ep-7s for qemu-devel@nongnu.org; Thu, 25 Jan 2018 10:11:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eejAz-0005N4-AQ for qemu-devel@nongnu.org; Thu, 25 Jan 2018 10:10:57 -0500 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:34601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eejAz-0005Mf-4a for qemu-devel@nongnu.org; Thu, 25 Jan 2018 10:10:53 -0500 Received: by mail-oi0-x241.google.com with SMTP id k15so5439173oib.1 for ; Thu, 25 Jan 2018 07:10:53 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1512670493-18114-1-git-send-email-peter.maydell@linaro.org> <20171209010811.GJ3037@localhost.localdomain> <20180122183301.GA31237@localhost.localdomain> From: Peter Maydell Date: Thu, 25 Jan 2018 15:10:31 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH 0/6] arm: support -cpu max (and gic-version=max) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-arm , QEMU Developers , "Richard W . M . Jones" , "patches@linaro.org" On 25 January 2018 at 14:41, Peter Maydell wrote: > On 22 January 2018 at 18:33, Eduardo Habkost wrote: >> About QOM type names: >> >> On x86, all CPU models are resolved to "-", and >> i386 and x86_64 have different suffixes. So the QOM type name is >> "max-x86_64-cpu" on qemu-system-x86_64, and "max-i386-cpu" on >> qemu-system-i386. > > OK. Looking at the target/arm code we do a similar suffix > trick, but we seem to have cut-n-pasted the handling in > aarch64_cpu_register(), so it uses the TYPE_ARM_CPU as the > suffix, rather the TYPE_AARCH64_CPU. ...and that's not as simple a fix as I thought, because the code in helper.c for implementing arch_query_cpu_definitions() and arm_cpu_list() assumes it can create the QOM type name by appending TYPE_ARM_CPU. The ARM_CPU_TYPE_NAME() macro which we use pretty extensively also assumes the suffix is the same regardless of what CPU type it's being applied to. Looking at x86 it seems that TYPE_X86_CPU expands to a different string for qemu-system-x86_64 and qemu-system-i386. I could do that, but it seems very confusing: I would expect a QOM type name like TYPE_FOO to always mean the same QOM type. Given that the type names don't appear to the user, I think we can go ahead with implementing "-cpu max" for Arm without having to first disentangle this? "max" isn't in any worse a position than the existing "host" and "any" types. thanks -- PMM