From nobody Wed Jul 3 23:43:38 2024 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=1629314963; cv=none; d=zohomail.com; s=zohoarc; b=l0+usDo37pcmiFy9NkQKzdOWxpGrJfZbjCoWXxpiD4gmQ8AA7lMet72KtIHKDfJJKfHIitKZ/3uaLmNg0bhLh4eKt+dltDRK2BAQN9BHFySCLjrUqlsPtX2tN1bcVP1TTj9VHP7Z3TKSNtuiRfxrxwSSyYEalODOclQ7qSbebuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629314963; h=Content-Type: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=9LRYcsa0xVQPirZK44p+3i/UGY3pZV0A4hST50affbs=; b=k+2m3GQ+PirxWGmPIRjT9Z+gVm23c8yuFtHFW17n3OfpImgKmLeTESmNYpkaHw7R4g6PEunj2VR59WO7OmRMdoyRZoWl3s7qLmNduZqi2LGz6aqxXOxoesaOGbA/iWZvgo+Eds5Lv6CnVerKr4wgOGUtjfnjxJMTb7DQcimoRIY= 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 1629314962998987.91513125061; Wed, 18 Aug 2021 12:29:22 -0700 (PDT) Received: from localhost ([::1]:37694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGRFZ-00046G-Vg for importer@patchew.org; Wed, 18 Aug 2021 15:29:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGR6D-0000Nw-QN for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:19:41 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:42807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGR6C-0008UH-7j for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:19:41 -0400 Received: by mail-pg1-x532.google.com with SMTP id o2so3308413pgr.9 for ; Wed, 18 Aug 2021 12:19:39 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id a6sm524108pjs.40.2021.08.18.12.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 12:19:38 -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=9LRYcsa0xVQPirZK44p+3i/UGY3pZV0A4hST50affbs=; b=Isz9UrhgsSy6RuJNdAWaLk8Fx5UoDEuJ+qYsk5j0KBS8rqhQ6kb/HrnVP7upv7P0k1 7soUykoIqP+GL0j92kvuBZwWImdehUtwOqrv2+G1sl3RNsCKoPNtNugb2Vpf1RQuwsyz hCJwjFMUKRJnOSW5wBKOlrtbZ7TTzKQG0hlfSofdqV/Eo0PAeqWj9BveacaE+GX8NUPm A1uGGIlcBvF3MaKiI7KW3NKtQZgOFBv1S1ZiqzytfPER0NZbIBPmvz9rgl+3JKi8s6cN l8Koz++5ruO4QIT+1lrp83ZLJSLrUksF/nwhV9LHkcFqb/w602hyQLfuo7zrkuj6+Gek SvXQ== 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=9LRYcsa0xVQPirZK44p+3i/UGY3pZV0A4hST50affbs=; b=kbN4wtBn1LP/t/EW0h7RHJ1qim24KoOLWXxFwI6DFc/3/qfBAl6GPUcNA9Mf+Zp+uG r+3NfGc99OJuZmwCjKwu4kW3ETyNgVmXGNKlPkp2dQ/KT2PgqnG1oz/C0u114y+glIs+ tGP3EhnxSn6D6bDi/qlhlJUOQVIZVtoZJNwpMHrvsII6+8hQAYqJs25m7nWeXXz+bJlX C/22Haae/XABAh/uB33/k082vQGlXxcPd7IMwxLaGz8m+VwdRJdZ5L9dhFcG7aO0F8X4 lcG2953JOGrmjA+64uz/gXhBN3M6a43Iw5oXxv2HnRjNNwjIil0md6VNzCdHkKVf4PjI GYzQ== X-Gm-Message-State: AOAM533whaJs0rRs2NBc0CHhIDdkWCbVVPfrwWG01TIUXmWdvNlv2VMJ ACibJn+FBlGn5bZcnY1hJ1rCrA10J9vZGg== X-Google-Smtp-Source: ABdhPJz6Xf/3Bdv7vpoe/P4yeZbnuRPBDsFQwWEj5xfiCm55ajfh3zr6Q+asL8DTumoq6Jn6rSbF8w== X-Received: by 2002:a62:7ed0:0:b0:3e1:99bb:d824 with SMTP id z199-20020a627ed0000000b003e199bbd824mr10824013pfc.34.1629314378907; Wed, 18 Aug 2021 12:19:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 13/66] target/s390x: Implement do_unaligned_access for user-only Date: Wed, 18 Aug 2021 09:18:27 -1000 Message-Id: <20210818191920.390759-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818191920.390759-1-richard.henderson@linaro.org> References: <20210818191920.390759-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629314964817100001 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/cpu.c | 2 +- target/s390x/tcg/excp_helper.c | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7b7b05f1d3..9d8cfb37cd 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -267,12 +267,12 @@ static void s390_cpu_reset_full(DeviceState *dev) static const struct TCGCPUOps s390_tcg_ops =3D { .initialize =3D s390x_translate_init, .tlb_fill =3D s390_cpu_tlb_fill, + .do_unaligned_access =3D s390x_cpu_do_unaligned_access, =20 #if !defined(CONFIG_USER_ONLY) .cpu_exec_interrupt =3D s390_cpu_exec_interrupt, .do_interrupt =3D s390_cpu_do_interrupt, .debug_excp_handler =3D s390x_cpu_debug_excp_handler, - .do_unaligned_access =3D s390x_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ }; #endif /* CONFIG_TCG */ diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index a61917d04f..9cbe160f66 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -82,6 +82,21 @@ void HELPER(data_exception)(CPUS390XState *env, uint32_t= dxc) tcg_s390_data_exception(env, dxc, GETPC()); } =20 +/* + * Unaligned accesses are only diagnosed with MO_ALIGN. At the moment, + * this is only for the atomic operations, for which we want to raise a + * specification exception. + */ +void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + S390CPU *cpu =3D S390_CPU(cs); + CPUS390XState *env =3D &cpu->env; + + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); +} + #if defined(CONFIG_USER_ONLY) =20 void s390_cpu_do_interrupt(CPUState *cs) @@ -602,19 +617,6 @@ void s390x_cpu_debug_excp_handler(CPUState *cs) } } =20 -/* Unaligned accesses are only diagnosed with MO_ALIGN. At the moment, - this is only for the atomic operations, for which we want to raise a - specification exception. */ -void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) -{ - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; - - tcg_s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); -} - static void QEMU_NORETURN monitor_event(CPUS390XState *env, uint64_t monitor_code, uint8_t monitor_class, uintptr_t r= a) --=20 2.25.1