From nobody Tue Feb 10 13:37:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1635790813; cv=none; d=zohomail.com; s=zohoarc; b=kBBVD0/wc0gPHsyMuS8LMollkSg73KD6dmzKzcdaz3AzcMh+EciI/w1IO60j7hWHSWens4APZ5m0xkYf0YadH8/Ss9z+QLhFjl2PFoP8uZcyipWQ7oZMR1mbf4P+WOR1whRHLegP/LxT6sayDbUo5SjLPnV+Xc+YlwNTHlbL4zA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635790813; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mTKdaHiEpe60z+ThGKt8c3K8jQRQXSW+5obPKHUiPMs=; b=Wl3mBEpzq+H75XAvI3OUI0V5o3phOvlUYRNye+H1k78sKTyMsi9t7yoihzm1aG91kNFNzb4LUND8OUrHQ5FLxLmEtVJKFbf42jWRb1SKuM568uD9axErb2mmQ0S7jBQOGqkWQM9t1vSQGBjAUOBmCkLoZGKcRJJRp59EtniIe8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1635790813415869.8061133323839; Mon, 1 Nov 2021 11:20:13 -0700 (PDT) Received: from localhost ([::1]:60320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhbug-0000Mu-AM for importer@patchew.org; Mon, 01 Nov 2021 14:20:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhb9B-0007tr-TY for qemu-devel@nongnu.org; Mon, 01 Nov 2021 13:31:01 -0400 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:34328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhb99-0001CN-K6 for qemu-devel@nongnu.org; Mon, 01 Nov 2021 13:31:01 -0400 Received: by mail-qt1-x829.google.com with SMTP id v17so16553948qtp.1 for ; Mon, 01 Nov 2021 10:30:59 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id 13sm1222289qkc.40.2021.11.01.10.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 10:30:58 -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=mTKdaHiEpe60z+ThGKt8c3K8jQRQXSW+5obPKHUiPMs=; b=RwYtp+HJ0qo3kSBV6JhaZvb76eRw5Yq8Hkhu/Zpo0GcvsPan/2mj2+fDdL9EbDKbiW HgAset2upzR3bL52CHTmSyPs4iG/FBU+FbkqiKk5MnRVpw3lt7WfyVMtMq6v1Q//8Itt TnZoPfj/7spT0J1zRevlM0fm352gnjSLZgPW6oQSlj3vcLzngheGT2qlN7kp1sHNzB+k W8WH5Z3wotvPF8XLm+jZUax89aOYgwH/o5GLcS5bhrGSnhnFirfaCrHQeZ0Tuaf6tAaR /gdHHl4U9mkX9qozpDIXGjgqw5vyYHhq0fvULiOiFbF1XkI061gBZRAzQfTiGttqY7tt O98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mTKdaHiEpe60z+ThGKt8c3K8jQRQXSW+5obPKHUiPMs=; b=kHS6kgXihJqVGzb0VT6ikaLkmPvuPmVpXTc4IWD7wToXrKePN/UVTpunKSGBdVKjdb F6dVqFaTsOxFQsGHuzcaYk8JL01JFxeH046vxM763DQi0vSCV5J0XPZPDyon6ic+3T0w AwO/n/rNGRs9IeFgfi4oopj/m/5W8/yaXUzBLcTNqWl9QYoEdmZ17TfoXI+kHB6CPIjM +y25yccunpP8e5NeKHHjFHwKzQp4f8/hKamTHMd9FRaBA3OfPBsisU/+vs3Na+Dt6Hgx aWCGSBE3SWGI5nmRDvrchHS27BBImGxQ+RduxZVz2XG4GJaABEFj6kspn5n702MAjubI 9rQg== X-Gm-Message-State: AOAM531k6TzJGMHspQyDX0+VxeLt3G2RqgaTXLzk+hQQQNAZQ07Douks Z7BcUVZtL5LTZ5cna0BNXF9uq3eUMf4LBw== X-Google-Smtp-Source: ABdhPJwjrfHgPH+jmAUW3Wqmep4WCmLU0unWjH4nJbRIEuBmas9w2OPEz8B/e0f+dLeLWE3jOu2Cjg== X-Received: by 2002:a05:622a:52:: with SMTP id y18mr18468744qtw.177.1635787858678; Mon, 01 Nov 2021 10:30:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 47/60] target/microblaze: Do not set MO_ALIGN for user-only Date: Mon, 1 Nov 2021 13:27:16 -0400 Message-Id: <20211101172729.23149-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211101172729.23149-1-richard.henderson@linaro.org> References: <20211101172729.23149-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::829; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x829.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1635790814267100001 Content-Type: text/plain; charset="utf-8" The kernel will fix up unaligned accesses, so emulate that by allowing unaligned accesses to succeed. Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 437bbed6d6..2561b904b9 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -722,6 +722,7 @@ static TCGv compute_ldst_addr_ea(DisasContext *dc, int = ra, int rb) } #endif =20 +#ifndef CONFIG_USER_ONLY static void record_unaligned_ess(DisasContext *dc, int rd, MemOp size, bool store) { @@ -734,6 +735,7 @@ static void record_unaligned_ess(DisasContext *dc, int = rd, =20 tcg_set_insn_start_param(dc->insn_start, 1, iflags); } +#endif =20 static bool do_load(DisasContext *dc, int rd, TCGv addr, MemOp mop, int mem_index, bool rev) @@ -755,12 +757,19 @@ static bool do_load(DisasContext *dc, int rd, TCGv ad= dr, MemOp mop, } } =20 + /* + * For system mode, enforce alignment if the cpu configuration + * requires it. For user-mode, the Linux kernel will have fixed up + * any unaligned access, so emulate that by *not* setting MO_ALIGN. + */ +#ifndef CONFIG_USER_ONLY if (size > MO_8 && (dc->tb_flags & MSR_EE) && dc->cfg->unaligned_exceptions) { record_unaligned_ess(dc, rd, size, false); mop |=3D MO_ALIGN; } +#endif =20 tcg_gen_qemu_ld_i32(reg_for_write(dc, rd), addr, mem_index, mop); =20 @@ -901,12 +910,19 @@ static bool do_store(DisasContext *dc, int rd, TCGv a= ddr, MemOp mop, } } =20 + /* + * For system mode, enforce alignment if the cpu configuration + * requires it. For user-mode, the Linux kernel will have fixed up + * any unaligned access, so emulate that by *not* setting MO_ALIGN. + */ +#ifndef CONFIG_USER_ONLY if (size > MO_8 && (dc->tb_flags & MSR_EE) && dc->cfg->unaligned_exceptions) { record_unaligned_ess(dc, rd, size, true); mop |=3D MO_ALIGN; } +#endif =20 tcg_gen_qemu_st_i32(reg_for_read(dc, rd), addr, mem_index, mop); =20 --=20 2.25.1