From nobody Tue Oct 28 01:50:35 2025 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 1516141465239813.833583758573; Tue, 16 Jan 2018 14:24:25 -0800 (PST) Received: from localhost ([::1]:41323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebZea-000617-GJ for importer@patchew.org; Tue, 16 Jan 2018 17:24:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebZd2-0004wQ-2r for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebZcy-0003We-Ue for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:48 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:58761) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebZcy-0003W4-JZ for qemu-devel@nongnu.org; Tue, 16 Jan 2018 17:22:44 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M85Ej-1ep6C539FZ-00vfZo; Tue, 16 Jan 2018 23:22:21 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 23:22:12 +0100 Message-Id: <20180116222212.1266-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180116222212.1266-1-laurent@vivier.eu> References: <20180116222212.1266-1-laurent@vivier.eu> X-Provags-ID: V03:K0:pylrkmBEtpxmodkjxvNAwVYNOzSbBRw2Guw+WD9u35gzSPgFBEH rEQiox5Nc7V7IiXw1TzDIhzdHuQyVkTmzUF2plHE7AElY9wY+CdGJx1SdU6+U+e7fOU9Nd4 KRZN399TT61Aw3fb7K2xvLY1szPvdZ8IYH/g4S/niyJCm2Y8zwH0+CIEGMskH8CPhIoUr44 42ockskioYDua+gfON7VQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZSd/WDf0jHA=:o7rAQvMqtzg5p2TVGeuK5F T3PrPOMtCV9D2SEi7zlIo61yG9VEXO//QqKLHZGKVHnKxULFqmcEqWu+PMSu1TQZz8/r4hE90 xgNMHtUxvSj/PQKdiogFu+KMF1HBT8gJs+qXLwtfN3+vP0ZaEOcSPgdXdx/v7ZCDJkd1vHIXo QubwIvC7QYRvRxTHjOeClp2qBPc4lPAwFKytTBg2s3TyU9I2XzJPTmqtaCj+W2ma+Xpmh0D3R OotM/OefCLHwy6r8E8IBP9Tbn9WXzWYeBPAAbxM0c9X2KdFM3kuH62XiJgqmXyRiCneEkLHuE a2HSvjVcEgkTMUaz0HteWUYY+EvaHxmJ/B4XF4x0ylxcncToHH/8Bnf8RBNbQBJmCO5Z2oqbY /0I+nBrxK2ZljnzTS/b2kWTrqZMVG7Gy0iuEJBbPrCH71oJUVsPohONQAK2fR8qMk8YazLSPT mBFPEZ210oYgbO3iSHdnBafXJQcHGeantAo9WolO3h7gCoVC+wvcY14bk1IRGSOfY8QFPDYv2 HwRMHoSbWlMORynfZUkoeRjCoPG2AlDN9hkAjK71Yu7HjQQpW5F5dkg7WfRcRAolNBVvrbLBX VYScogE3Erl3VhH9EnrcB0EHZh75nXoRal7hLb1PC3Y4eJHaCeqSsaZ0dtOFifn+4YuLxQfsz 8XXIH1ehY2q755rn6ARKvWGyH60hdvcZs+eu7dGc8qi09gOIx4zq+7oxoGo2m1ALKX0w/g5/Y gBdzfoHv8wD3CZJdqQUwIvQ9keLx0EKuVpYTOg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PATCH v3 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: Peter Maydell , YunQiang Su , Riku Voipio , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Aaron Sierra 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. [lv: original patch modified to move code into cpu_get_model()] Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- Notes: YunQiang Su, please add your Signed-off-by that was missing in your original patch. =20 v3: fix code indent problem reported by patchew remove useless "!=3D 0" v2: call cpu_get_model() with the result of get_elf_eflags() include/elf.h | 4 ++++ linux-user/mips/target_elf.h | 3 +++ linux-user/mips64/target_elf.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/include/elf.h b/include/elf.h index ca9a419043..746b6d393b 100644 --- a/include/elf.h +++ b/include/elf.h @@ -40,6 +40,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..14b53d7469 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_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..ae14b38bfa 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_64R6) { + return "I6400"; + } return "5KEf"; } #endif --=20 2.14.3