From patchwork Tue Jan 16 22:22:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 861923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLlD85mh3z9s7v for ; Wed, 17 Jan 2018 09:25:44 +1100 (AEDT) Received: from localhost ([::1]:41397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebZfq-00075P-F1 for incoming@patchwork.ozlabs.org; Tue, 16 Jan 2018 17:25:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebZd3-0004wR-Dv for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebZd1-0003Xw-AV for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:48 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:64616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebZd0-0003XT-VT for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:47 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M7Wjr-1enS2B2vnb-00xKGs; Tue, 16 Jan 2018 23:22:16 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 23:22:08 +0100 Message-Id: <20180116222212.1266-1-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Provags-ID: V03:K0:5SRDyu6FsPY2HhqgQdkKskN83jFDCoZ4MwhZ9hxi94nA7KBG2uZ 8AS/v+4tr9H+i+BoT4LdF4jfxGDyiV9DGvm+rXhRNWNqGB7A9KQhF4io9MluoE+nqeU4yAn q4FSq2/IBjIxdLCZPBm7KYjZa2MfsW5H0Tkk2TcpZXAq5WydgWhUPD4uZCaKvDPdEBviOCF DnodgJiv1sNzzKHa8i+CQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:tvCv1X1WFS4=:gh8FVorHhYUF1P2LrmC+7y h9CzxrBwnkfUaEhgivH+0riuWUPbfZp4xRp4HYiUH+mTzIPxpmS8KUh8fBDX8+SwOMf0ffEMw 2zSkV9INuWDDWqpeEEXJuT1XmTxrBiCGcYLpMoL/HRfvXqebzwXjnMP09yWAzNAiYq2wGKbyr TS7jkNXeJaPDAWbxOuuKYbqGwH1GXUuQQCvDSGTVVvBeG4/H4A1YBQKBTUa2dmIkEd9blufNe Fmu7f2Kz8qRFuyLxNN/4hd+UtiBNqXmDXIcqwxbwMXDH35ywaw+9nUTI006iftyOH8EO/NZLn U6/DQpiHhAugQBDLQTwSAqJoh/1jmZcxft+WzSY5qh5o/nkKnkqYQfkWd4eBgkF3OiCrDAY1A Py8Zwg2bq8YXr4bRIn2xCb9aCz65lHQwrwi9qvCvZBuFmPVF03r0wqzM4+9sZL5gFKtkfRBmM zGXDy/5kxI+2Fz479CLnH3nnDX9hsOFdp7NjHmtxFUoxGBCE11Q9cENWRtdvYYHYZGECmDQX1 2Ia6KF4qwMvp6iC+dReOwgbnlie5YY34CucwX6oUYDylX0TUq53JCqoG0RDeMjU6zEByQVIdV XTdCbD4fwYqozIlvgv4QVY9pHKxG+wygvKlVP0TX74ot1A4uYUkSkmRMF7hPlTRbVC9+h/krr CdpZTcRb6HVg6Nd8pNd0qO/HVAUMTkcHgVfol1tXesJaniSiI94qd5ovglMQilF8KA2+d5KNv At76tqn55S8Lnx4JkxaiHFA8+55HRMPZ/ice+yi7O2XP3ZTuNh3Bqfl+cg8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PATCH v3 0/4] linux-user: select CPU type according ELF header values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , YunQiang Su , Riku Voipio , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier , Aaron Sierra Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This idea has been suggested to me before by Philippe Mathieu-Daudé, and recently YunQiang Su has proposed a patch to manage the MIPS r6 case. Based on this, this series tries to clean-up the original patch, and introduces the use for m68k architecture and port the patch from YunQiang Su. v3: fix code indent problem reported by patchew remove useless "!= 0" check for EF_M68K_M68000 add EF_M68K_* flags in elf.h set 680x0 default CPU to m68040 change "#if ... #endif" structure for ppc v2: move cpu_model selection to linux-user/*/target_elf.h provide eflags to cpu_get_model() instead of fd (and modify other patches accordingly) Laurent Vivier (2): linux-user: Move CPU type name selection to a function linux-user,m68k: select CPU according to ELF header values YunQiang Su (2): linux-user: introduce functions to detect CPU type linux-user: MIPS set cpu to r6 CPU if binary is R6 include/elf.h | 32 +++++++++++++++++++++ linux-user/aarch64/target_elf.h | 14 +++++++++ linux-user/alpha/target_elf.h | 14 +++++++++ linux-user/arm/target_elf.h | 14 +++++++++ linux-user/cris/target_elf.h | 14 +++++++++ linux-user/elfload.c | 35 ++++++++++++++++++++++ linux-user/hppa/target_elf.h | 14 +++++++++ linux-user/i386/target_elf.h | 14 +++++++++ linux-user/m68k/target_elf.h | 20 +++++++++++++ linux-user/main.c | 59 +++++++------------------------------- linux-user/microblaze/target_elf.h | 14 +++++++++ linux-user/mips/target_elf.h | 17 +++++++++++ linux-user/mips64/target_elf.h | 17 +++++++++++ linux-user/nios2/target_elf.h | 14 +++++++++ linux-user/openrisc/target_elf.h | 14 +++++++++ linux-user/ppc/target_elf.h | 18 ++++++++++++ linux-user/qemu.h | 1 + linux-user/s390x/target_elf.h | 14 +++++++++ linux-user/sh4/target_elf.h | 14 +++++++++ linux-user/sparc/target_elf.h | 14 +++++++++ linux-user/sparc64/target_elf.h | 14 +++++++++ linux-user/tilegx/target_elf.h | 14 +++++++++ linux-user/unicore32/target_elf.h | 14 +++++++++ linux-user/x86_64/target_elf.h | 14 +++++++++ 24 files changed, 375 insertions(+), 48 deletions(-) create mode 100644 linux-user/aarch64/target_elf.h create mode 100644 linux-user/alpha/target_elf.h create mode 100644 linux-user/arm/target_elf.h create mode 100644 linux-user/cris/target_elf.h create mode 100644 linux-user/hppa/target_elf.h create mode 100644 linux-user/i386/target_elf.h create mode 100644 linux-user/m68k/target_elf.h create mode 100644 linux-user/microblaze/target_elf.h create mode 100644 linux-user/mips/target_elf.h create mode 100644 linux-user/mips64/target_elf.h create mode 100644 linux-user/nios2/target_elf.h create mode 100644 linux-user/openrisc/target_elf.h create mode 100644 linux-user/ppc/target_elf.h create mode 100644 linux-user/s390x/target_elf.h create mode 100644 linux-user/sh4/target_elf.h create mode 100644 linux-user/sparc/target_elf.h create mode 100644 linux-user/sparc64/target_elf.h create mode 100644 linux-user/tilegx/target_elf.h create mode 100644 linux-user/unicore32/target_elf.h create mode 100644 linux-user/x86_64/target_elf.h