From patchwork Fri Dec 29 06:31:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 10136069 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 60600600C5 for ; Fri, 29 Dec 2017 06:42:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F6802CC98 for ; Fri, 29 Dec 2017 06:42:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41EC52CCED; Fri, 29 Dec 2017 06:42:08 +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_SIGNED, 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 C96122CC98 for ; Fri, 29 Dec 2017 06:42:07 +0000 (UTC) Received: from localhost ([::1]:56988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoMo-0002yR-Iz for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Dec 2017 01:42:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoDC-0002zW-BB for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUoD9-0004es-6L for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:10 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:43471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUoD9-0004eS-0d for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:07 -0500 Received: by mail-pf0-x243.google.com with SMTP id e3so21816769pfi.10 for ; Thu, 28 Dec 2017 22:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aFHIkozRWX5if2e5WGCHQPivH4xIjlspquNWW3iUH68=; b=jW5M2iBUcfoDf+9e/vUPM6HCUDxtX7hh/Fx4/GeMG+ddsUxPZhSaGJegUIbaFE4zR/ SV5+WoykJvQI+HkcEanOdjFRdaDt60qGfKIHlWPmYcCTL+LyOegYsWe1qLhATxYvQBnm 2dcwtkza0TKGtGWyy+3naZBrDXqvxmyPeE9/c= 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; bh=aFHIkozRWX5if2e5WGCHQPivH4xIjlspquNWW3iUH68=; b=m/yl6lZ2+GMBBPGiexARjsXD0rK3n3qjolHQEZhiX/J5w4FODmg3huAL5w4sh5U1oB 8ZlAABT1cL690fhCRzBH19V9ND94Ba2t9z0TkZYQZwZCy5zK2ZXlfTuM5OSotWnNfL/R l7zdditHbVmL7TPm1Ni308GUGp42Yo/HFY1+1G/tbO9VjIWi3nEm6S/WGmdYUE8mCy1x 9JW8zGXiBjRPfeRThJh7femKfhEp4iXLYRTyaSjJICCd3GOWZnWnZhBrm2b/C1zuZFnu 50CkF93gullU37X0FUWrMVSapehP9iA968XKsochMEajQcoBEX6GpbPAaYbptm72Hp7y 4E1w== X-Gm-Message-State: AKGB3mLHuNDOQpVFCCq72weVeBDVkxwWWrZftXIcXzRmI4owhR7sVHAs EOQLC1MpvH8pNAwEs1jNNH2sS9y00TI= X-Google-Smtp-Source: ACJfBovsxE/mcCOxEXpP2ztb9V818IgxsHIJdhslVSfFxjKm/fhoMD+DD+Vw0bYAVpTcp6JfVnsWOA== X-Received: by 10.101.70.65 with SMTP id k1mr10055950pgr.320.1514529125832; Thu, 28 Dec 2017 22:32:05 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id c28sm76539063pfe.69.2017.12.28.22.32.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 22:32:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Dec 2017 22:31:20 -0800 Message-Id: <20171229063145.29167-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171229063145.29167-1-richard.henderson@linaro.org> References: <20171229063145.29167-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH 13/38] target/hppa: Implement unaligned access trap 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: deller@gmx.de Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index ca619578dd..6b2d22118d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -48,6 +48,21 @@ static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) info->print_insn = print_insn_hppa; } +static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + HPPACPU *cpu = HPPA_CPU(cs); + CPUHPPAState *env = &cpu->env; + + cs->exception_index = EXCP_UNALIGN; + /* ??? Needs tweaking for hppa64. */ + env->cr[CR_IOR] = addr; + env->cr[CR_ISR] = addr >> 32; + + cpu_loop_exit_restore(cs, retaddr); +} + static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs = CPU(dev); @@ -139,7 +154,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) #else cc->get_phys_page_debug = hppa_cpu_get_phys_page_debug; #endif - + cc->do_unaligned_access = hppa_cpu_do_unaligned_access; cc->disas_set_info = hppa_cpu_disas_set_info; cc->tcg_initialize = hppa_translate_init;