From patchwork Thu Jul 29 00:46:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 488623 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1703654jas; Wed, 28 Jul 2021 17:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1bcssBO37P1Ua0Cb+8R5skgS+D96mMOlmhoKK3mlHKDI4VxvTIzkXBq6kC721Qsc158Jr X-Received: by 2002:a37:87c5:: with SMTP id j188mr2485335qkd.317.1627520104161; Wed, 28 Jul 2021 17:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627520104; cv=none; d=google.com; s=arc-20160816; b=0twSja3N/sOF2JFnKUoPmigjwib5nJ3OQTfiOOAPKWnt7aEjtRp4rMnvsixxuA/ptQ /cznt8lxljBir7k/dX9UxsZ2h7bsdkBW2jCpXb4OkIiMxW2JczJNKt5GcS0IkCuScepv ToGf9BwSCQHhaMZ5fhYuGyOsAMnTFrcbeZ39G9HRimZ9gvwNyO2XEyVwNNholCwKTArQ I6+tZP0CCAoYnft2kKkWf4d0yCU9ekVdt0Lks9VKgq2F0jNeRF11noxEwX24fmwfO/V+ TZs/grONQIUhwndaFgzF0LcDPV2rhG+gd5Nii1eopyMXU+L6mOuDMHvkpXRWnCADHLcy jBkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dn6B0Ee8lUtbxJq9t/+3kZTnEWW7d7P7paI/3Q/udV0=; b=ecy9vzKX2+PEsAp28yCVnjblloZjeAGPfq9BH1dsbfS5vUtg/uWwVFtoiwVzdW5vM+ 0whUvWJkkD2QSFCi8NnEbY4P8DDyHQGKZKi6CxCjgcQZd0e/AWfgvOICABE3ZyLeRcxj Mce/j8dZNAkUDGqvcLY0XCnHN4Fr9cieT78R8s+DUou/lXJouZSqEjZuMhvheq/DPp1o Vawtq81tjVpDNJMrCJJTR/s8BYQTF20p6q5iTvUeN6FxbvFbDHY+p4lAOJAU6/kxVA2/ GfbPa4d+5ZU3Ud8IUmB0hZZ9+V5Nv/G/IWGCdNyA9xpdlIMV5rX/0l+hqhRYI25qhUfY nceQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DmjfpAlw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 139si866474qkk.333.2021.07.28.17.55.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 17:55:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DmjfpAlw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8uKE-0007j0-N8 for patch@linaro.org; Wed, 28 Jul 2021 20:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8uCP-0003ub-Tj for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:46:57 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:39863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8uCO-0002OI-BV for qemu-devel@nongnu.org; Wed, 28 Jul 2021 20:46:57 -0400 Received: by mail-pl1-x62d.google.com with SMTP id e5so4858329pld.6 for ; Wed, 28 Jul 2021 17:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=dn6B0Ee8lUtbxJq9t/+3kZTnEWW7d7P7paI/3Q/udV0=; b=DmjfpAlwhTHfZkB0b2PbeYLv9A1qxwmfH0J3Q5aFjtrSTQGgbaCbIMUZxqIH+XIaqn E3Hvb1HXCKkKroJfQ2SFXtOCttGDSKvsljNepkygkOozO6eELECbelIGCj4BS8wkFHy/ I1oBHhJxrMBBIWXt0xeOfvrzj9HVHjGHGUSOMDQLS87AGuNka0KJl+JO+Ok0ZYhSqMtA t+XCcZGECSgFJ9wO0NB2FmXWunHZ72J/PD3wINt9GxExzya0fLgfab9hYg7+wVU5RFWG DZVGYNJS71VOv6mApzVYBGBzoQWTMHsKMBpPRD4PgtCUdGqukB0hxXQ1iqeE+jd3ZZ/w S5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dn6B0Ee8lUtbxJq9t/+3kZTnEWW7d7P7paI/3Q/udV0=; b=ougUhHjVP2Ha+iuTCmE1GPQ8anYAF0Hr6Et7GNWVI6g8gWh28v2TO5G7Dm5PLQK3ss UoTHZpVoA5kDIdDt4fNZzghJvjSNIrr74pV4J1qVKGA3Vk2b276p4GNz5/8y8lO0WRgS 5augsh+vPoQEekQT4wtBg6AI1MNeQEvQAe9m/JO7iOxfZZf//4xbqHZhfRBodVGpJv7K xxqoO3XRVFIVQP5G/1h+4V7nUJhMDMy81mqWkuQpJ/wmV2/7dpF+IasTRomTqf9Ymd+W 9q1sxD32pG+AzgmLQnXysaUkU4Tpq5IlvWqSgF8mgeRxqIfbWX0MRA7LDAbFX0X7Q/OV dtgA== X-Gm-Message-State: AOAM530GRz83vIPD0a4AKB1nyodgEreDSYbhkrtZjiCrQ3CL0hwm9i/d fsk1auxBkGcf/PLgiivUMTpYlBkEIvmZgg== X-Received: by 2002:a05:6a00:ac8:b029:320:a6bb:880d with SMTP id c8-20020a056a000ac8b0290320a6bb880dmr2269899pfl.41.1627519615116; Wed, 28 Jul 2021 17:46:55 -0700 (PDT) Received: from cloudburst.home (2603-800c-3202-ffa7-dcaa-9e71-a2b2-2604.res6.spectrum.com. [2603:800c:3202:ffa7:dcaa:9e71:a2b2:2604]) by smtp.gmail.com with ESMTPSA id t205sm1305005pfc.32.2021.07.28.17.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 17:46:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 04/43] target/hppa: Implement do_unaligned_access for user-only Date: Wed, 28 Jul 2021 14:46:08 -1000 Message-Id: <20210729004647.282017-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210729004647.282017-1-richard.henderson@linaro.org> References: <20210729004647.282017-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- linux-user/hppa/cpu_loop.c | 2 +- target/hppa/cpu.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 82d8183821..5ce30fec8b 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -161,7 +161,7 @@ void cpu_loop(CPUHPPAState *env) case EXCP_UNALIGN: info.si_signo = TARGET_SIGBUS; info.si_errno = 0; - info.si_code = 0; + info.si_code = TARGET_BUS_ADRALN; info._sifields._sigfault._addr = env->cr[CR_IOR]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 2eace4ee12..55c0d81046 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -71,7 +71,6 @@ static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) info->print_insn = print_insn_hppa; } -#ifndef CONFIG_USER_ONLY static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) @@ -80,15 +79,18 @@ static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, CPUHPPAState *env = &cpu->env; cs->exception_index = EXCP_UNALIGN; +#ifdef CONFIG_USER_ONLY + env->cr[CR_IOR] = addr; +#else if (env->psw & PSW_Q) { /* ??? Needs tweaking for hppa64. */ env->cr[CR_IOR] = addr; env->cr[CR_ISR] = addr >> 32; } +#endif cpu_loop_exit_restore(cs, retaddr); } -#endif /* CONFIG_USER_ONLY */ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) { @@ -146,10 +148,10 @@ static const struct TCGCPUOps hppa_tcg_ops = { .synchronize_from_tb = hppa_cpu_synchronize_from_tb, .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .tlb_fill = hppa_cpu_tlb_fill, + .do_unaligned_access = hppa_cpu_do_unaligned_access, #ifndef CONFIG_USER_ONLY .do_interrupt = hppa_cpu_do_interrupt, - .do_unaligned_access = hppa_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ };