From patchwork Mon Jan 22 03:41:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125298 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp944704ljf; Sun, 21 Jan 2018 19:49:42 -0800 (PST) X-Google-Smtp-Source: AH8x224ST9VECrZ/JtimLYZoCeMk/OmksMEDiLFjfIR2zizAS4BLWcvNJ7k+kypgHvr8KrsjssAp X-Received: by 10.129.165.11 with SMTP id c11mr6094174ywh.311.1516592981969; Sun, 21 Jan 2018 19:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516592981; cv=none; d=google.com; s=arc-20160816; b=C6+krGWvvQ9kY1KryV4FqGhYRTTeTwTD/7+EpudaR9fUijm7ypmKbqdvWxWVRIKsZw I/+Yz0eUq4Oa9UnM7FEDzAxibpWnmD+qHnkUA3/frMmv0m7ZTG3/2w5fOv8iInkpNfzA aXn+kanRdzetQb/vlyLw/EfPz4VQN7KXRxk4/QghrXLwd8HoIhNRgWXBkwp2ArZT+T5b 7aGdlBfCCkNUUtZPD2cYz1bGQtWp3bSXRym08dvU2aKSxbgwnVfoLD4zF7BVCQfImBPZ lX/pdRj6AxOOEJTEophoRKVulm4TpN4A1bUxHpxH/5p4B1bRD5ckKcQ7hLnUQWIkCacs R4EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=aFHIkozRWX5if2e5WGCHQPivH4xIjlspquNWW3iUH68=; b=kEhfRU+i3Up47/jO6xnXOfVrJ7Jw2SCxSml9KV1lDCbKls6gMZ6e+4/+GsP98hrh2K yLoHmSZFw0Kvzj950K3ayY4ewS/YlVm1ow1ZxvzeUPNwjqMULdqW5U6neMJIOXOQ8qsb TyRxhUrQXj2OhCB6s4/Xp9dxs7LnDmyitzimxcVVmTSt7a+2tj9ZK199j/Y/q7Lzj93n 2YNMK4AEAFwba21KxHv4WWqSgEWoSKAbHIEjAfeAncKmH3MsO5KxJleLuGdMEpxGjqL9 uYcws7WQ/PEsqD7d4IlEijw+Jo6MXdTUw34GM5NbsLAwRqH88YXB27Rz3nKCqEx3xeU5 Q4iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YjurKWN5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d62si1394034ybf.734.2018.01.21.19.49.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 21 Jan 2018 19:49:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YjurKWN5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edT77-00012g-9w for patch@linaro.org; Sun, 21 Jan 2018 22:49:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edT0L-0005QC-Cb for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edT0K-0006MT-DA for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:41 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:38203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edT0K-0006Ko-7B for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:40 -0500 Received: by mail-pf0-x242.google.com with SMTP id k19so6080223pfj.5 for ; Sun, 21 Jan 2018 19:42:40 -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=YjurKWN5yYG5W4UOBUxv/1zxCjmHQSpJNTBk0vLBk38SJ8Tk5c0TICp6dUSgU0m51m makBSXFukBcIh29/Dj3bjeia9h7ov1nrKVh2omKf5uWcNpfDre1MJVz7Ow60mifwuTwb 9+PMa7+KfonI81CW9VMj5a7Ed348cqlMezt1I= 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=Y+HbNYgyCTchBUyofzVrJeEXcCJluNqrsyybJfkP+ze3UdH2xzac0zNNLe4BMnzeOu KK+dah1waikmh4NSHtxK+rLRybj7l6suPbZo19Zd+Xp211xtbkBnV+n7dZ6GTcyoabEg yDgxqwbBB2Qvqcf3JHahfkr7TVY7/0HC5H3cJooQF4GJYQvv7V+lArxse6AekoOHKYB+ hYPt2QStGECF+IxggD8/kkKcXx8esLKZMqXGvnlt4awo1Njmol/5aNBtj/HQzSQoD/Mk 6nA0eW8XniGW1YrFJEFKIW5a5UByFHYAhE8YqcFTcBTcR1yJcUdxoXZLHmyJBEyzbqgF WPSA== X-Gm-Message-State: AKwxyted05llr1XLGnrxjNKRt+M4j3NBBvs5ZIb3G1Zq/jeH5bIC0XKQ cA/OEuQEGo3aMOB6enMgBG5PlqTZRLM= X-Received: by 10.98.133.93 with SMTP id u90mr7178665pfd.134.1516592558934; Sun, 21 Jan 2018 19:42:38 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id z125sm182023pfz.27.2018.01.21.19.42.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Jan 2018 19:42:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 21 Jan 2018 19:41:47 -0800 Message-Id: <20180122034217.19593-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180122034217.19593-1-richard.henderson@linaro.org> References: <20180122034217.19593-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::242 Subject: [Qemu-devel] [PULL 13/43] 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/hppa/cpu.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- 2.14.3 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;