From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8FA9C4338F for ; Thu, 29 Jul 2021 17:57:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FFD960F42 for ; Thu, 29 Jul 2021 17:57:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5FFD960F42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9AHa-0000XE-4W for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 13:57:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9AGB-0006Gd-EL for qemu-devel@nongnu.org; Thu, 29 Jul 2021 13:55:55 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:41768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9AG9-0007o7-Ms for qemu-devel@nongnu.org; Thu, 29 Jul 2021 13:55:55 -0400 Received: by mail-pj1-x102e.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so10772307pjd.0 for ; Thu, 29 Jul 2021 10:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NMw0cGhcepxkvayTb9X7mKcaWf0pZIKbI2WveHaKGLE=; b=Pm6Y1mcu5V2rnShPjoeodRVpRMtgkwInC55fqw+YJcdXp+9GY8RXd7LMihX9TwcLk+ cxKGfFCU2JEctmoYgEWhHLc+NWdZwj3aevEOJp/iHhHadj7ksstWtvmfnwVvBvRaaZjL YVIGCG7iIPihLyLiPlOlL/3v3XZTnenA571Szgq2B/i+t0Fa9zcfr+hify3VynKMUgsB 90TvZYY9/jCxH5lnoL+ZTzc0hcviS/nb8qYMkfoXYUJe9l8lYcjCpRZ3XjxuXEV/KvkA 29uOTnU0UVljKA8EzoMk0XzBJNM1YI/WTuXZZj2c0yqAmS9OHlAxYcPFPlBRjwnnHX4E eFzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NMw0cGhcepxkvayTb9X7mKcaWf0pZIKbI2WveHaKGLE=; b=IBmJ7QDtvJWpJU53fPk3x2pprR3MK94t+sqVq6dTW6184eldVaEv72jAffVqbpNyzf Gl2GdTo12OABGyabjMHNAI9MGjywOiTLFqqvlaNFj5DINQyUmvSb1QmnBBRjMbzaOetV A5Lzvm4vXMqLtdgq1dyfoFzw1FYsBfJ0zl+Ybn2t0+s+asEksT/JgxKrTotb18quGWfT yf6oh3McWTZiFAN99o5z62585/GLTG17OAAq0FDUrsdSYLR0E2mSKYhKjhgcA2a8BGIU XdstFX0V1lCcd52Q6tcK9uWxmBZWBMZWVb5pUrO/v0pssFBUUH8Bf6DUE/yIujLH61y/ cvqg== X-Gm-Message-State: AOAM533t1eJu/V/P+SVQ0UssU2HzbYS6jhJ5j9QijD6C7sEI/6FI35x4 R0FFjnjeBaZyABd71OPcJrWYAm83KdDXyA== X-Google-Smtp-Source: ABdhPJxxoXI7nemGVAWqqO2u/pjy655VDOz1Ur8KvhZc7TDt2y8UrH7dgh0mx6DKaFH0d/6VdR0mig== X-Received: by 2002:a17:902:c391:b029:12c:f2:f5f with SMTP id g17-20020a170902c391b029012c00f20f5fmr5678146plg.48.1627581352098; Thu, 29 Jul 2021 10:55:52 -0700 (PDT) Received: from ?IPv6:2603:800c:3202:ffa7:c4c7:6719:c57e:8ffe? (2603-800c-3202-ffa7-c4c7-6719-c57e-8ffe.res6.spectrum.com. [2603:800c:3202:ffa7:c4c7:6719:c57e:8ffe]) by smtp.gmail.com with ESMTPSA id b20sm4323892pfo.210.2021.07.29.10.55.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jul 2021 10:55:51 -0700 (PDT) Subject: Re: [PATCH for-6.2 04/43] target/hppa: Implement do_unaligned_access for user-only To: Peter Maydell References: <20210729004647.282017-1-richard.henderson@linaro.org> <20210729004647.282017-5-richard.henderson@linaro.org> From: Richard Henderson Message-ID: Date: Thu, 29 Jul 2021 07:55:48 -1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 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, NICE_REPLY_A=-0.125, 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: , Cc: QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/29/21 3:15 AM, Peter Maydell wrote: > On Thu, 29 Jul 2021 at 01:57, Richard Henderson > wrote: >> >> Signed-off-by: Richard Henderson >> --- >> linux-user/hppa/cpu_loop.c | 2 +- >> target/hppa/cpu.c | 8 +++++--- >> 2 files changed, 6 insertions(+), 4 deletions(-) >> >> 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; > > Do we not need the top 32 bits of the address, which the softmmu > version is recording in CR_ISR ? No. That's the "space" number, which for Linux user is always 0. In system mode we use 64-bit addresses to make sure we can represent that; in user-only, we use 32-bit addresses. r~ >> +#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 */ > > -- PMM >