From patchwork Fri Mar 30 17:16:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D3232B6FA3 for ; Sat, 31 Mar 2012 04:20:34 +1100 (EST) Received: from localhost ([::1]:36771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDfV2-0003tm-MO for incoming@patchwork.ozlabs.org; Fri, 30 Mar 2012 13:20:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDfUX-0002ZF-QF for qemu-devel@nongnu.org; Fri, 30 Mar 2012 13:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDfUS-000681-U4 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 13:20:01 -0400 Received: from mail-qc0-f173.google.com ([209.85.216.173]:42356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDfUS-00062f-LP for qemu-devel@nongnu.org; Fri, 30 Mar 2012 13:19:56 -0400 Received: by qcsc20 with SMTP id c20so505358qcs.4 for ; Fri, 30 Mar 2012 10:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=lcjcz0T2W0Of89Vgy7fs2HO5i5B24DnUcTsfK5CcsC0=; b=pHkI5sIBfbIfw63kNScc82Z/Urg24g167x2tAPGtu6WEiAFc6egbpr6g+n4P2Ilpug sGynI/lI9Z7ZMifFGDzTDQy1v/j2Vp4hO1UctWDVVWOwUXQYwSCW3GX9Tn4mAxC55l/2 jEw3P3mPfAvcHTDrd9X63mSWAtpOmTaHjPx6V+FSLRV4A2G/JEUhj4ChIZ2RyteuzDTO ozQKVhb1S5sYFQfO5HMp+LK7zUBsjpi/tHGNoJZBbkLza7lmWSKnRe4TU/RIy0499xYX mtdkdmJ+Lg9Eq5GTyN566povW1hlddB95E0gq9a3Hf8OHX28zyKG0UxRImPT2lbOzGd8 +FWw== Received: by 10.224.205.1 with SMTP id fo1mr6405171qab.99.1333127995128; Fri, 30 Mar 2012 10:19:55 -0700 (PDT) Received: from pebble.com ([200.7.43.190]) by mx.google.com with ESMTPS id cv8sm19272326qab.12.2012.03.30.10.19.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Mar 2012 10:19:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 30 Mar 2012 13:16:37 -0400 Message-Id: <1333127797-8133-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1333127797-8133-1-git-send-email-rth@twiddle.net> References: <1333127797-8133-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.173 Cc: Riku Voipio , aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 2/2] mips-linux-user: Always support rdhwr. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The kernel will emulate this instruction if it's not supported natively. This insn is used for TLS, among other things, and so is required by modern glibc. Signed-off-by: Richard Henderson Cc: Riku Voipio --- target-mips/translate.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index 300d95e..ed28ca8 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -8111,7 +8111,11 @@ gen_rdhwr (CPUMIPSState *env, DisasContext *ctx, int rt, int rd) { TCGv t0; +#if !defined(CONFIG_USER_ONLY) + /* The Linux kernel will emulate rdhwr if it's not supported natively. + Therefore only check the ISA in system mode. */ check_insn(env, ctx, ISA_MIPS32R2); +#endif t0 = tcg_temp_new(); switch (rd) {