From patchwork Mon Feb 19 17:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 10228437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B30E760392 for ; Mon, 19 Feb 2018 17:16:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3BD528A77 for ; Mon, 19 Feb 2018 17:16:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9722E28AC4; Mon, 19 Feb 2018 17:16:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 39B5328A77 for ; Mon, 19 Feb 2018 17:16:03 +0000 (UTC) Received: from localhost ([::1]:51466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enp2o-0000kR-9m for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Feb 2018 12:16:02 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. */ /* 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