From nobody Fri Oct 24 11:45:25 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 1519060595260251.90547103847518; Mon, 19 Feb 2018 09:16:35 -0800 (PST) Received: from localhost ([::1]:51466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enp3K-0000kR-9L for importer@patchew.org; Mon, 19 Feb 2018 12:16:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoxu-0004vL-5P for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoxt-0005Vb-27 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:58 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:60235) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enoxs-0005Uu-PC for qemu-devel@nongnu.org; Mon, 19 Feb 2018 12:10:56 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LmC02-1eEDIN0EcM-00a01O; Mon, 19 Feb 2018 18:10:45 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 19 Feb 2018 18:10:37 +0100 Message-Id: <20180219171037.24539-9-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219171037.24539-1-laurent@vivier.eu> References: <20180219171037.24539-1-laurent@vivier.eu> X-Provags-ID: V03:K0:HkzSxmB7kL+L70jyM4N9+3xpXVgst1nZ8LAu+ydTcdZR3r/l4GL 9Jl1OcUuy0/FziQz+deW69fIHUuJjWz4JtrtaxI2ufg9ybK2qC0tCE8LBqg7GrDA0EL3VX6 fdLdw18CvApefxY6ywc804sY29/bO1zuQW5mWkdve+FHSPDzKykUnwJ8is23zwBwrxS6xab +8g1SBHM/7LWdOMAM9zFQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:0glOHDqHwTI=:cVxa63iBC+/MM0R2xHu0vn UvcO6Imh6uTV8EvZ7TCNJ1rno9IkLHFXQE0s9eqDdr6la8CLoG4s5nZ2Zc5RDUGnZz5HCeelN x0auQnO8MYCBntiDsPKw6fqBmzB+/2YIOMOFAoWZ4VwLm+X9qaR60+GPFnVBBlGpqjTCt4/On ALMAGY1RScKgWDq3dJ5awMZN5nOx93L9s5TljTOJxqkZcujurZOYsVN8i/PP7E6BpCFMvl0Cu h+GsTh0ejrQmlyL/el5bFxPOq/tYQzgBro1azEhp1Kbl/cIXfU8FySgrDsXHUjXFz9StKJEhr n4b/UaZAu1rlEe4atXuGe2+QpDqClOtcHv4nPYkDSC8x+nCaZ4VWnybPNwW10dFJalMGpYEwu 3nQZmSNJW9yKO5tEm1yeXUQ1ulAdbwVdHp49+nE0YtRTmYAhxUhKDog7yRyvLUaW5F7DWIoBT KyZxLkFJtMGTrGbM4E+0pKkv9r1Zc35AkBGh3OcIbwT5aTQgSg7owsqO+9krANU8KGXlY3bZ9 O360GQ8BcIg6h+BdAYZP4Q4mm44o/ZjECGNH+AVxysJDvsSXtZ+/ZdMGXL0aifIiExU1SLZck 5dg9RGanDxkWefYP3BSCDU8rIDI6As1sBc2y/9LCjpvP3j5hXp/c3117pWn3YNN0FP1E3A003 znRKdJvOiJ7N7fsxxoAWjiM92WGnAfUsxwY0KlFHvdb4hKRfG9n8+6lOEQhz3CsRx043pyZfN puf885SdB/Yhha5hBY/X2rBlNOcKfwnTX3R0iw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 8/8] 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: <20180124211301.10095-5-laurent@vivier.eu> --- 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