From patchwork Sat Dec 17 22:21:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 132025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4196C1007DA for ; Sun, 18 Dec 2011 09:22:37 +1100 (EST) Received: from localhost ([::1]:57822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rc2eI-0005Aq-90 for incoming@patchwork.ozlabs.org; Sat, 17 Dec 2011 17:22:34 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rc2dh-0003fK-O8 for qemu-devel@nongnu.org; Sat, 17 Dec 2011 17:21:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rc2dg-0000pg-OH for qemu-devel@nongnu.org; Sat, 17 Dec 2011 17:21:57 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:52826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rc2dg-0000p4-Eo for qemu-devel@nongnu.org; Sat, 17 Dec 2011 17:21:56 -0500 Received: by mail-iy0-f173.google.com with SMTP id j37so7270149iag.4 for ; Sat, 17 Dec 2011 14:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=q3wTBEJeo5lYvrbO0YNIC4ohFGDrFAOEWdEWvLaE1dE=; b=WtBejf/gnFxi4RiBZt1dcQnauYJl7giMRSOYx2R9T4m7XlNZtWuHdRwUvseiYbNcJW 8E7CSd4JjE7QTNjiDU7aZlRqBDc4zKH991E6PEcFnc6xX1mnAqAqTLS0MI7acZ6fgmSy lvnm8qx5Ps4EDdmk/ntnIdplRh69RWZ0DO+aU= Received: by 10.50.186.200 with SMTP id fm8mr17419604igc.93.1324160516130; Sat, 17 Dec 2011 14:21:56 -0800 (PST) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id mb4sm22620613igc.1.2011.12.17.14.21.55 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Dec 2011 14:21:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 17 Dec 2011 14:21:45 -0800 Message-Id: <1324160506-25183-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.4 In-Reply-To: <1324160506-25183-1-git-send-email-rth@twiddle.net> References: <1324160506-25183-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.173 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 2/3] 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 --- 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 b20a817..e2ee763 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -8118,7 +8118,11 @@ gen_rdhwr (CPUState *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) {