Received: from eggs.gnu.org ([2001:4830:134:3::10]:40071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVHZW-0006wU-5A for qemu-devel@nongnu.org; Thu, 04 Aug 2016 08:16:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVHZQ-00050t-Ab for qemu-devel@nongnu.org; Thu, 04 Aug 2016 08:16:20 -0400 Date: Thu, 4 Aug 2016 08:16:10 -0400 (EDT) From: Paolo Bonzini Message-ID: <1648819381.13532219.1470312970610.JavaMail.zimbra@redhat.com> In-Reply-To: References: <1470133216-6758-1-git-send-email-vijay.kilari@gmail.com> <1470133216-6758-2-git-send-email-vijay.kilari@gmail.com> <107219873.13018814.1470134892902.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v1 1/2] utils: Add helper to read arm MIDR_EL1 register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vijay Kilari Cc: qemu-arm , peter maydell , QEMU Developers , Prasun Kapoor , Vijaya Kumar K > > Third, it's probably a bad idea to call this function from generic code, so > > make it static and add the detection function from patch 2/2 already here. > > By making it static, it's also possible to define it only if CONFIG_LINUX > > is defined; the ThunderX detection will then return false if !CONFIG_LINUX. > > > > You mean to say, move contents of this patch to util/cutils.c and make it > static and define under __aarch64__ and CONFIG_LINUX?. I don't think util/cutils.c is the right file. It should be a new file, something like util/aarch64-cpuid.c. If CONFIG_LINUX is not defined, the ThunderX detection function should return zero. If __aarch64__ is not defined, the function should not be defined at all. Paolo