From patchwork Wed Jan 24 21:13:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 865480 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 3zRdG54xG5z9s7s for ; Thu, 25 Jan 2018 08:14:20 +1100 (AEDT) Received: from localhost ([::1]:46674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeSN7-0007ku-6L for incoming@patchwork.ozlabs.org; Wed, 24 Jan 2018 16:14:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeSMO-0007kC-3L for qemu-devel@nongnu.org; Wed, 24 Jan 2018 16:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeSML-0006Un-HH for qemu-devel@nongnu.org; Wed, 24 Jan 2018 16:13:32 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:65502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeSML-0006U6-7z for qemu-devel@nongnu.org; Wed, 24 Jan 2018 16:13:29 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LdVQI-1f5EJj39Iw-00in4x; Wed, 24 Jan 2018 22:13:10 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 24 Jan 2018 22:13:01 +0100 Message-Id: <20180124211301.10095-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180124211301.10095-1-laurent@vivier.eu> References: <20180124211301.10095-1-laurent@vivier.eu> X-Provags-ID: V03:K0:IVygD7HgiiOnWn1Ki8jvEljPT2C1jDWhgIcxr1fyGIXOiHM4EE4 2qjF1PJkI222RftgA4o3x7s8aGv2lNjdlAwZ8i18Oyn1Az4jRbzLgGlL6uDdbFAwEvHE0ge AeGGtKrXdxhdnerdZSXbeGrC7Qxi9SazIKsLZhog66ItCJabpJ6zH1H0L1CTj0NmcVaG53T AtjFGsNq3CcT+Shc2/jJQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ht2nFvOwOrM=:0HfIjYzoXKO9dNUQbkjGAV Vzl65MP5r1kkYBkV3qMsmgebNyGrthBh2TTR8TFGw66IXZJBBrJeM3FPZgJO6om6e1/LgAjyd MMMdjN5W6srakT1kikR9hCe5HpEJu/Fwx8oOaqZ/gUURr6lIMZMrsKoWuFfpM4IHoBKA+GzuV SLIDXF4XWc2ttrBPzUYgIQtBxhSvdQldJT4uphoGlwRWtXuefU7XwJBIoJi8rZQz+GFQro0I4 UZJjM8qHxBCQbA1t9YI8IeZyr2xCpAjaWdRfdRdHkHDQJbONLccuAB+p94i7if3CPUtlFEccZ fPhjDrXzdpJInJ6oc0ddsVGKDbPMtE393dyH0YNuXlg5rqO3rn2/94l2Jl0ef2wYs/Rrd5APW M212P5CBzQ+82UhrKR9oE3w7RJENT3PbsLg4/wMaJm4cJ9prjEL91pSQ5FwHQ915dtqB63yX0 Dav1IuP6pqZLtQ0Hb2CO0+L/sNOIQgNm4fDYWl9KrLAkHNXpfPbe5OxD1peW1UuPevmAjTfxi x9XLOYYgbZMpczy0QXr2uAFQtWcQgb2yLHH6k7UePVIlRpnqNQYgZg7ZDKAAQFQLF7JpZEaYe 3dZJZvGa7ZefsTqBa06al0Q0/QVGk0JW9O1SiedWeScPkuwQ1UVxW7YVoAutsuUIVv43QljVj 3I6R4w4Rd1a9kHsF8bCCjDKJK8mdsgmOZO6+jkkon8KUMOKFlWxpWLwjJmNKtggfYdg5qs9Gh mOpeygWfIgwPFguQoXsbw+91uMkQs6nk/Y6TCQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PATCH v4 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_Mathieu-Daud=C3=A9?= , Laurent Vivier , Igor Mammedov , Aaron Sierra Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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