From patchwork Sun Apr 23 22:40:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 9695311 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 AA703601AE for ; Sun, 23 Apr 2017 22:44:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B39D226223 for ; Sun, 23 Apr 2017 22:44:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A76E726530; Sun, 23 Apr 2017 22:44:56 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 3116C26223 for ; Sun, 23 Apr 2017 22:44:56 +0000 (UTC) Received: from localhost ([::1]:40837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QFT-0002TO-8h for patchwork-qemu-devel@patchwork.kernel.org; Sun, 23 Apr 2017 18:44:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QC0-0000QX-0t for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2QBz-0000Oe-Ax for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:20 -0400 Received: from mail-io0-x242.google.com ([2607:f8b0:4001:c06::242]:36481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2QBz-0000OT-5s for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:19 -0400 Received: by mail-io0-x242.google.com with SMTP id x86so43370900ioe.3 for ; Sun, 23 Apr 2017 15:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=T/5SyyeuyLbC6XdPnHSu/yu73YSFhxwg0LcKe5HXvxA=; b=h2NVCIX1BBOr6e0lPGQkxqtvzwzi2QX2mCRs7eCtkExfSHvVDlURzFAwK5vDqOVEjK nQgG6mfVlwhr9IQJQIkEl66mj91KXZ8h57sm8b0WnhMBFbN1UbVI8vM86Y8EkFwKFbV9 j98Tcx7Da9TaB0SiBfOnSRi+rJ4TE7fUELFuVvw0gXibl30YFEOvuqWJswD9UIBgyQqn HFCJ4vzU0r+T/bkwzI3kJoXYIzWs6RKUUS8bmnnl2HXyF4t76hw2t33zVTCGBVd1hiTZ VnM+7FVaQaI9BWti47sUI5m0L7sXTx6Tx7sq+PIToHM0lb98tGHM4940O+2Q/8IRow2u nNSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=T/5SyyeuyLbC6XdPnHSu/yu73YSFhxwg0LcKe5HXvxA=; b=JjZpcHwYJZd6UUGXMqU5yCtQC7z7p6OW1YavQFHBuJRIH1T/FZI/mh6+gLRkg3vApx RFhB5rfxkvRc/yC8yBQOdX/XG3gYmwNJGhqUIfEMbDny2Ns3aKuXMpwnw8TGNx8dVgkL umQCa2Fo2Mlg+zUJ82VtkorNKV4DrqVs/Res0OoUDOrV+xqM/U1KqPjgdxEOntVFIz5o bCX9p+q0nNmGITDzYV8fAl1KaZSqIbf/PNDNcI0cDLcfC1wF8aje5Dp+zqa3C8bsPLAN 1kIAm0mdDM72xuFZQZX8w3BHj1ROrUioFw4BexRnyToXlV3xWyNsY0OSZ/u4IbiKLANx To2w== X-Gm-Message-State: AN3rC/794Vz9e6RLGdv1j+MRCo4RbwXYenZmDnZM8lyd7x6IxnMLbdJa eRYfU3W/auR+CQ== X-Received: by 10.98.31.90 with SMTP id f87mr9200149pff.264.1492987278500; Sun, 23 Apr 2017 15:41:18 -0700 (PDT) Received: from localhost (z64.124-44-184.ppp.wakwak.ne.jp. [124.44.184.64]) by smtp.gmail.com with ESMTPSA id u23sm26944039pfd.63.2017.04.23.15.41.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2017 15:41:17 -0700 (PDT) From: Stafford Horne To: QEMU Development Date: Mon, 24 Apr 2017 07:40:50 +0900 Message-Id: <3fee028d1ea02cd16470dc5c65d54974ef85b673.1492986468.git.shorne@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::242 Subject: [Qemu-devel] [PATCH v2 2/9] target/openrisc: Implement EPH bit 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: Stafford Horne , Openrisc , "Tim \\'mithro\\' Ansell" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Tim 'mithro' Ansell Exception Prefix High (EPH) control bit of the Supervision Register (SR). The significant bits (31-12) of the vector offset address for each exception depend on the setting of the Supervision Register (SR)'s EPH bit and the Exception Vector Base Address Register (EVBAR). If SR[EPH] is set, the vector offset is logically ORed with the offset 0xF0000000. This means if EPH is; * 0 - Exceptions vectors start at EVBAR * 1 - Exception vectors start at EVBAR | 0xF0000000 Signed-off-by: Tim 'mithro' Ansell Signed-off-by: Stafford Horne --- target/openrisc/interrupt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index 78f0ba9..2c91fab 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -69,6 +69,9 @@ void openrisc_cpu_do_interrupt(CPUState *cs) if (env->cpucfgr & CPUCFGR_EVBARP) { vect_pc |= env->evbar; } + if (env->sr & SR_EPH) { + vect_pc |= 0xf0000000; + } env->pc = vect_pc; } else { cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index);