From patchwork Fri Aug 26 20:03:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 111834 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 26732B6F92 for ; Sat, 27 Aug 2011 06:03:53 +1000 (EST) Received: from localhost ([::1]:54087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx2d3-0008DR-UB for incoming@patchwork.ozlabs.org; Fri, 26 Aug 2011 16:03:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx2cx-0008Cw-UC for qemu-devel@nongnu.org; Fri, 26 Aug 2011 16:03:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qx2cx-0006bB-0r for qemu-devel@nongnu.org; Fri, 26 Aug 2011 16:03:43 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:61043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx2cw-0006b7-Uj for qemu-devel@nongnu.org; Fri, 26 Aug 2011 16:03:42 -0400 Received: by vws17 with SMTP id 17so3601448vws.4 for ; Fri, 26 Aug 2011 13:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=x0jS/rL7sKYIzm8g7dS0sqZYA5AUCzcKbeOPVLwVDJk=; b=manmF5y/RdsnhSDv5XI7o8Asp47FWKzB5Vp4eC4JpPP1CWiTlxR5kp9LNRhLnUoQe6 imEEauVgc8H3qGivYzWZ3zE2RNdbjJI6kTgLoGHFTMOW6xBgRnLD7hGRyfNVn49KHPRy fGMFG4OMjOzhEbRvw4q13dnoDPChREi/nL2K0= Received: by 10.52.187.104 with SMTP id fr8mr1597197vdc.499.1314389022229; Fri, 26 Aug 2011 13:03:42 -0700 (PDT) Received: from pebble.twiddle.home (cpe-66-91-180-197.hawaii.res.rr.com [66.91.180.197]) by mx.google.com with ESMTPS id q10sm546547vdv.30.2011.08.26.13.03.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Aug 2011 13:03:41 -0700 (PDT) Message-ID: <4E57FC17.1080405@twiddle.net> Date: Fri, 26 Aug 2011 10:03:35 -1000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Thunderbird/3.1.12 MIME-Version: 1.0 To: Peter Maydell References: <1314308722-14495-1-git-send-email-rth@twiddle.net> <1314308722-14495-7-git-send-email-rth@twiddle.net> <4E576264.2050200@redhat.com> <4E57C9AC.4040703@twiddle.net> In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.45 Cc: Paolo Bonzini , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH 6/6] target-alpha: Add high-resolution access to wall clock and an alarm. 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 On 08/26/2011 06:36 AM, Peter Maydell wrote: > Look at the way target-i386 and target-mips use gen_io_start() > and gen_io_end() around x86 io insns and MIPS mtc0. I think > that what you need is (a) to bracket with gen_io_start/end > and (b) to end the translation block, but that's really just > guesswork from the existing code... I'll be applying this on top of 6/6. Look sane? r~ diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 37f2f20..8f0dc3e 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1609,7 +1609,17 @@ static void gen_mfpr(int ra, int regno) if (regno == 250) { /* WALL_TIME */ - gen_helper_get_time(cpu_ir[ra]); + if (use_iocount) { + /* Mark as an IO operation because we read the time. */ + gen_io_start(); + gen_helper_get_time(cpu_ir[ra]); + gen_io_end(); + /* Other targets break the TB to be able to take timer + interrupts immediately. This doesn't apply to Alpha + because we never take interrupts in PALmode. */ + } else { + gen_helper_get_time(cpu_ir[ra]); + } return; } @@ -1661,7 +1671,14 @@ static ExitStatus gen_mtpr(DisasContext *ctx, int rb, int regno) case 251: /* ALARM */ - gen_helper_set_alarm(tmp); + if (use_icount) { + /* Mark as an IO operation because we reference the time. */ + gen_io_start(); + gen_helper_set_alarm(tmp); + gen_io_end(); + } else { + gen_helper_set_alarm(tmp); + } break; default: