From patchwork Tue Aug 3 04:13:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 490840 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp306336jap; Mon, 2 Aug 2021 21:17:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Aw7eCmQM5L4FZEknZeUJ3wi6vuGoI019Kn3DfeudVDVgPEV2tloJt8Qpoi7bAFoxHIhT X-Received: by 2002:a5e:8f0d:: with SMTP id c13mr242277iok.57.1627964241894; Mon, 02 Aug 2021 21:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627964241; cv=none; d=google.com; s=arc-20160816; b=iTqKg5/XvO83Jli0qbgR/+VF9dO14K85va8tJcw356JWOL/nxMAkU/g/HY1iSelty6 jQF8dk8ENDJkzg5bm3eP0j050usCYy13V94Pp4Yg9RFTfYXcz8hOGEyfeX2sAHv9Ms3q +vkbV+s95ZsIubcOFZWJu+uE05RmdNUu5pP73hqZzfae9kgyE5yfDKTymCNWGZDwu5Zp JopytsQmnElaGdus8pLq/Buz4ahSZQiJ112GrmFcuZqb8XJHCNJTApHTi4ag0b4pau2R Z0/oESMcXFIgMoeyZzOSaGArLPTIDcwHQMgBS0hL0RjjKG/XVA8/tTfY6KV5Tywqo/L/ YTJA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=o7f9pq5L0TzmsrOXr/ZiuGxR/VCctySCfk7zYCcLFRk=; b=wuXnJtBzqFiBbJHY5vf0FxgJAmTakvgquiinKwHE1ADsrarsgwgW/oZ1S0lbXWDTAO YwlxRb1Sjb4ZVieSH9+PP+1pv63GO583KS9vN+U3xk4wKTkKkYf0KlhFGwjq/Qcjib+Q zgeBr6EBtNvHOckh9zzRCtS02VmCXZKG4zdE7Ib0jJ7gz+J4fstzjaJmQRVkLisZx/XP G91HuBqcw/++eZSY/8/dEKeqnn+54kanylYHy2LgRfs7M5LtdZydwQAsKffYCbphHIuX jDgxN3JDzyfSjPr0dpJ/TtMq4WAUROo0nCFOMVBv6BWHiiVUl8+CQarvTLBqzv8JPzWO WdMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Vvg/rgB0"; 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 f1si5609961jai.62.2021.08.02.21.17.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 21:17:21 -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="Vvg/rgB0"; 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]:52526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAlrl-0008PH-BW for patch@linaro.org; Tue, 03 Aug 2021 00:17:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAlpM-0002PB-7r for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:14:52 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:36584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAlpK-0001zT-P8 for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:14:52 -0400 Received: by mail-pl1-x635.google.com with SMTP id i10so22160154pla.3 for ; Mon, 02 Aug 2021 21:14:50 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=o7f9pq5L0TzmsrOXr/ZiuGxR/VCctySCfk7zYCcLFRk=; b=Vvg/rgB0M44Xdj5tt+IVyNMjEwED5v4aUZeen7IBwRsFiwJskxHa5MpjhOp8PxCCJa P7euxvhGeILxUNh+TjXP2iikmEE5wK9pZ9q/dyook5YhHXvlLvGRM0nYDj46w4TtZizD Bgdl3c/Mm8xocFNjd8BPtqxYn7ivC87+ee3LnpogO/JbyU2bEFJiCwBtaMH3ZtN+ugI9 8GA5eFJ+YNY/ex2DQMkHU7F4Beazobvs+h3/ER9qDbpEGswUNloxCH+0zjLPgrapYBOx SHuIGvLNlmsUk+Fb1sUcXHurhGg1CgBE4hz5RZCL4Jlx7lREChfzTA5e/+RWEyvg+NDN NaQQ== 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:mime-version:content-transfer-encoding; bh=o7f9pq5L0TzmsrOXr/ZiuGxR/VCctySCfk7zYCcLFRk=; b=d9X9sBWjAhBYvQcjbNn/tT7qNOc6PQhGskOZeSuj/nkazSBs5Hgq+jFfz4U/i0uE7t ijHj4njPaq3/RZhRHQ6sYXvKMBuPHH6scDRQpUdwz1N0YXj/qIf4pzn5WJ5o/KwjPFwE LquFKPtJDeJMqwPqoxaCBjYgCZc35hzwWae20RDRROSa3Bb7eoJEUetzpO9gWOaVaNq4 b9C59WEYk05iMRx1RlW8otrErEeTWvK5PBb20iomm9T0W7vEd5cb9nwkvzRrn1DoVKuZ 3ha6D9DPsfVYPriMdKuyTa1V3nXxhxRZoMLoAky3ACMW94ok8g/ZYXt0T/Pto7gX7k3L 4P/A== X-Gm-Message-State: AOAM532/kW02iD0G9zyJVW84i4kKrYhnPTKRp5y3Q1pGcxF5OwY7CmpL t+V8Yup+54jOAt4IYj6kAMjvmgGNjZVXOw== X-Received: by 2002:a17:902:c443:b029:12c:92c1:9b4d with SMTP id m3-20020a170902c443b029012c92c19b4dmr16367159plm.85.1627964089542; Mon, 02 Aug 2021 21:14:49 -0700 (PDT) Received: from localhost.localdomain (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id c23sm13718532pfn.140.2021.08.02.21.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 21:14:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 03/55] target/alpha: Implement do_unaligned_access for user-only Date: Mon, 2 Aug 2021 18:13:51 -1000 Message-Id: <20210803041443.55452-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210803041443.55452-1-richard.henderson@linaro.org> References: <20210803041443.55452-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/alpha/cpu.c | 2 +- target/alpha/mem_helper.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 4871ad0c0a..cb7e5261bd 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -220,11 +220,11 @@ static const struct TCGCPUOps alpha_tcg_ops = { .initialize = alpha_translate_init, .cpu_exec_interrupt = alpha_cpu_exec_interrupt, .tlb_fill = alpha_cpu_tlb_fill, + .do_unaligned_access = alpha_cpu_do_unaligned_access, #ifndef CONFIG_USER_ONLY .do_interrupt = alpha_cpu_do_interrupt, .do_transaction_failed = alpha_cpu_do_transaction_failed, - .do_unaligned_access = alpha_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/alpha/mem_helper.c b/target/alpha/mem_helper.c index 75e72bc337..e3cf98b270 100644 --- a/target/alpha/mem_helper.c +++ b/target/alpha/mem_helper.c @@ -23,30 +23,28 @@ #include "exec/exec-all.h" #include "exec/cpu_ldst.h" -/* Softmmu support */ -#ifndef CONFIG_USER_ONLY void alpha_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) { AlphaCPU *cpu = ALPHA_CPU(cs); CPUAlphaState *env = &cpu->env; - uint64_t pc; uint32_t insn; cpu_restore_state(cs, retaddr, true); - pc = env->pc; - insn = cpu_ldl_code(env, pc); + insn = cpu_ldl_code(env, env->pc); env->trap_arg0 = addr; env->trap_arg1 = insn >> 26; /* opcode */ env->trap_arg2 = (insn >> 21) & 31; /* dest regno */ + cs->exception_index = EXCP_UNALIGN; env->error_code = 0; cpu_loop_exit(cs); } +#ifndef CONFIG_USER_ONLY void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type,