From nobody Tue Feb 10 05:41:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519581755459663.6288722276786; Sun, 25 Feb 2018 10:02:35 -0800 (PST) Received: from localhost ([::1]:55406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eq0d7-0003eH-FO for importer@patchew.org; Sun, 25 Feb 2018 13:02:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eq0aS-0002Dx-BL for qemu-devel@nongnu.org; Sun, 25 Feb 2018 12:59:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eq0aR-0002oJ-8r for qemu-devel@nongnu.org; Sun, 25 Feb 2018 12:59:48 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:41673) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eq0aQ-0002nH-Vj for qemu-devel@nongnu.org; Sun, 25 Feb 2018 12:59:47 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MPGl6-1elajt2JzE-004Tt5; Sun, 25 Feb 2018 18:59:33 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Sun, 25 Feb 2018 18:59:28 +0100 Message-Id: <20180225175928.13101-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180225175928.13101-1-laurent@vivier.eu> References: <20180225175928.13101-1-laurent@vivier.eu> X-Provags-ID: V03:K0:kJiunCKCoBSlbBTHqfC0T4sEhoEafRkpk5oKijTVE2g7p+5xYPt 8NJLfv0bjdoIytfL15o3IdO1mS0Bx81UfaiNjrySqUuucp3YEM831Fczta4UkelIX+l0oB9 EO5ggRR3OWGgJrX2RyqlI9oAnrCNBDg3K306zP4tijBNxDFoLMYToRo2lDoUfWcrEKGRs/T Ynbb61jLhtor/+38BqjnA== X-UI-Out-Filterresults: notjunk:1;V01:K0:c8LBr1WzIZ8=:r3rHy6eUik4spOBgfBy9Jj IJahNviuy6stLwIVsdCpfDZa5huj4RB+0ft3vAiiXY+flZP1b4fPHpH7boxPBC4XA6W4sGohb 9WQWWZp+3vqTl2ql2V+nHV42IVez4xDoVuOlGCbiDNnIWik7xNeM56OCq9WxuEu/FAGbi9Fq4 4/1BCyO23ezv6mztKLtnSqKW+AEhKF6OjQ9PYPFqJqRMQQn3XbKb3GI8ot27KpnYYaozzKPDA xFZ+KCcs5rBsr7OUJ1G4MwCM/+iWzNl+J5Y0XlEgnYfcspbwbvG5YKYr60E1BZ54siEJ/EkfO jTFBkACA+KLSx3oRczmhGNTw5NFpE8q0hOINbyYuAMHYOKHd/9+YOhSBuvJe2KjWGx+BO75LQ W8kw/uNaveMIof/k5kHNKBpgGY/0Jv5T0XYKmKS+z0I9Tx2V4riNvpZCeFDyZWfRJuRSH3EaO qCpNb8FS/4HM11FVE7HalKuEx686tg2MK0KorlYYmd3vly9r1PYXI0sVzBBxbPh2s8bfx6GsQ KWlflSBaFK9rIX8JmYow0N4kRpfrRZmyWtrZunwvg7BGwQQvm3xw0G6h+dlJVA61aCmMH86xL 74PrLFdgc7eTRHuNsRhlPMx2EyOZUKnt/6IlgLrQO4TMPAx6CC/2jPuNpe1ieUL2/kSv/drN9 kBw8LRKzUfQ1IbftCCQxaOmriurIb+Jb5d9A2O223X5UMDIIUOE62D0nLskIvueDuBzk+y36P 4KMwCkHS3t9nyOH2VhEHNF8pD904VCbHK1KKDg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PULL 4/4] linux-user: MIPS set cpu to r6 CPU if binary is R6 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: YunQiang Su , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: YunQiang Su So here we need to detect the version of binaries and set cpu_model for it. Signed-off-by: YunQiang Su [lv: original patch modified to move code into cpu_get_model()] Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <20180220173307.25125-5-laurent@vivier.eu> --- include/elf.h | 7 +++++++ linux-user/mips/target_elf.h | 3 +++ linux-user/mips64/target_elf.h | 3 +++ 3 files changed, 13 insertions(+) diff --git a/include/elf.h b/include/elf.h index ca9a419043..943ee21171 100644 --- a/include/elf.h +++ b/include/elf.h @@ -33,6 +33,9 @@ typedef int64_t Elf64_Sxword; =20 /* Flags in the e_flags field of the header */ /* MIPS architecture level. */ +#define EF_MIPS_ARCH 0xf0000000 + +/* Legal values for MIPS architecture level. */ #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ @@ -40,6 +43,10 @@ typedef int64_t Elf64_Sxword; #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ +#define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32r2 code. */ +#define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64r2 code. */ +#define EF_MIPS_ARCH_32R6 0x90000000 /* MIPS32r6 code. */ +#define EF_MIPS_ARCH_64R6 0xa0000000 /* MIPS64r6 code. */ =20 /* The ABI of a file. */ #define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index bed0b43259..fa5d30bf99 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -9,6 +9,9 @@ #define MIPS_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { + if ((eflags & EF_MIPS_ARCH) =3D=3D EF_MIPS_ARCH_32R6) { + return "mips32r6-generic"; + } return "24Kf"; } #endif diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index 5b6f4692e0..ec55d8542a 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -9,6 +9,9 @@ #define MIPS64_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { + if ((eflags & EF_MIPS_ARCH) =3D=3D EF_MIPS_ARCH_64R6) { + return "I6400"; + } return "5KEf"; } #endif --=20 2.14.3