From patchwork Sun Jan 28 23:14:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 126106 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp1982349ljd; Sun, 28 Jan 2018 15:32:59 -0800 (PST) X-Google-Smtp-Source: AH8x226Ne2nx1PIR/dzhF8b90avoE4jAB9kr6gf1so1lhs7coHcsTCtE02e8DvSH731/FRjYPbsz X-Received: by 10.129.112.15 with SMTP id l15mr15886651ywc.494.1517182379037; Sun, 28 Jan 2018 15:32:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517182379; cv=none; d=google.com; s=arc-20160816; b=OWNM+tQ9GHBqSReOzae6LTorqfSP2r2BNQYtFv8q3uYN5zLJnPmWASQasa6Lgx8ubm cfCHJUJTMpl0KwhmQvUxNgI3m2xUGExARGHCecjUOAERq0wcz8dwNB6GtZGRqgsEdMU6 KpbvuUiLC4BzkWhh5OXGC0vmgFiwadEApkFQ3P+8sgZB7iY2YS/NZVxJvlvBTlEtfOR/ Fr8aRb3oNgZeQoC+p3bU1AsfjxXsgKHwUQErvlhNObeOTL8hNviDMwgGXLSkCthMefiF 2nTm3j8q5TF9HI9015Ui4AZVGqbVXHnzdJspvYqoR4+6M96ZUcMPGJwKNShwvNKCGQpl 7/tA== 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=b1Z6d8vzZ3adC+SRkMYeme9R75wZN74KLoBboiIKdOc=; b=EG/v2GhqeHIrGcQSsAfT02YVD7UN8xSBjYlyQbseR+wSsaUWis16gREtGV/PKL+DZs JtEGnLdBtEdlkaS8MvZlLhbSL4/+g9ZAueXoU2SgaYhQJNiUvfCLdlLYlMiJ5mOb3dH0 TlXvmu0ctBE8nRH6bMR/FHuuIy2lYi7ljqDsAHVVL5fkr5PTps3Jnf+Uin4eO7QYAR+4 rav+S3UaHKB5PoAzrnxogAseVw8BaVO/s2tCPFwzs/yte0VSnL564L/g0vO20WApOGc4 HpS61DumlidQJWqRkeOwzVPhZSDRLl81m/zHQ7TrtaE0Mt3/7ITUiN0ltAygubRp28YJ xDQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jfDLOa0R; 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 h185si4370087ybb.327.2018.01.28.15.32.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 28 Jan 2018 15:32:59 -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=jfDLOa0R; 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]:45007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwRW-00063M-EW for patch@linaro.org; Sun, 28 Jan 2018 18:32:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwB0-0002hF-9q for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efwAz-0008Mc-IO for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:54 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:45219) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efwAz-0008M4-DI for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:53 -0500 Received: by mail-pg0-x241.google.com with SMTP id m136so2995106pga.12 for ; Sun, 28 Jan 2018 15:15:53 -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=b1Z6d8vzZ3adC+SRkMYeme9R75wZN74KLoBboiIKdOc=; b=jfDLOa0RaLnq6th2+xZhYPGVkIpar/uuUK3gKHCtP6/js0v5jHWfEsbabTcQE3inu2 jz7/yliWNZwZ33C0HzkEzInEZrGDglzzTMAfYlqB4XIY2n1M9Tq4jSLKPCZLdGyrvu/X ragl3Ul5r/DwOulS5ol8fOAlgn/RucyHNLiuA= 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=b1Z6d8vzZ3adC+SRkMYeme9R75wZN74KLoBboiIKdOc=; b=SrMBpXA48BnGtnETA/EEa2xV8j10z8vhVGDbBVRYc6IXwaRKVR57mZlIedyF9gtGwu urlxzKQk1uGsOOCEqwtlmYxKz0cXaOsn6ANLbQ4eTmrsLImhwGIsR7TEkU3DNP/Vt5ad cRruZFnP5lrAMeRGWVRqLF9GKzMBvZTBDSNLgm91UvcdbQhkDGtLJ62vhyWsvyA71+YS BvQINRiH/Oip746Mnh1xeYSuWioj8WarCWiThvq5UqKRYUc+RAaJlIkU964kqMUBE2Z5 QCobdT07pjzGtymRjEs2yL0pbrapP7hFQHhll2G8w9z0BWlSVA55WZndIsueO0bADAzw bkHA== X-Gm-Message-State: AKwxytexmaE8Wy3nbU56YYwmP7q/IFVfXT8eL2crhO4YyDazZfS0lbty OHKrqTawY9CFNdlhCES1N001xZ51qwg= X-Received: by 2002:a17:902:8545:: with SMTP id d5-v6mr87980plo.306.1517181352220; Sun, 28 Jan 2018 15:15:52 -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 r27sm26949344pfj.75.2018.01.28.15.15.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2018 15:15:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 28 Jan 2018 15:14:58 -0800 Message-Id: <20180128231528.22719-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180128231528.22719-1-richard.henderson@linaro.org> References: <20180128231528.22719-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:c05::241 Subject: [Qemu-devel] [PULL v4 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 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) -- 2.14.3 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index ca619578dd..4d0b760baa 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -48,6 +48,23 @@ 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; + if (env->psw & PSW_Q) { + /* ??? 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 +156,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;