From patchwork Tue Aug 3 04:14:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 490853 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp310051jap; Mon, 2 Aug 2021 21:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2Pxx4btPqiMp5l7LyYN+F0K+Nob7X20wPpw4IqDjsmcfmYeBzAYJEjNOESZnbdilpjBW0 X-Received: by 2002:a25:d2c6:: with SMTP id j189mr27944941ybg.187.1627964641393; Mon, 02 Aug 2021 21:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627964641; cv=none; d=google.com; s=arc-20160816; b=apLAbklvopcT/53DZkj28Wi0dU2Noom4Fk2TgnNf/ExXXUsyteuL08FNXdC38GIt/X TPM4Aq0/u0bKbqiA/rVykObKj8nuP4EXwcH+tQK4Lo59VonNKssQmiahhmGeI3PuRSkD Vz7hN+iavbNjKiihLASZYwV4tnv1orTJmO7tb63ti10urP0gVfVUUxBbFrRlYhLCshOw oACr0W2QhzSDGB5f1E07H3+ruxtPEfGncgTqsd7jWDiLp5brlVJo4HkHM6yfjB0Xzhxg 8zThu7kO63tO6TphFupey2IPLCHxZc3dWqLshcSsCDX/bqSWd2/i3jQUXGZoAiqtkEHG Cs/Q== 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=JUJY8z2475zIBNarMLMPEdlHtKrQEQrNMuj/yYXL3iE=; b=j2oEHcIFq0+/26QdIh7b+6mGekpXmOKYJaIh34WnfAYWQOb2iapV4TikStZslS+CYw 2vSmitbg6+cGR0AWaVdZDMdiiTPnX4WeUOtqTHH412jQ0d/CBFh4H6EOD7OGHCXs4lhS tHmpgyaWD1o/gaiC88wCeB/nm5UYyx6UUiFMSFwdyy8TQHBQ7c7RpFiMfcW8E24raouN 4nR0juKO3FFCx1oyi6hhTdAjmKNz0XO6mq8vSpuhCZV7KXgCdaYWxpcRlL69+l/hRvB+ djhMXvWrMhKRiPuyNxBOkXJEj4RGI8QhoxpsU/c3PcIFJhsjCqkU3HIGbuyThTjN4Qxk CQ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ctXV514t; 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 k10si6893975ybt.5.2021.08.02.21.24.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 21:24:01 -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=ctXV514t; 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]:51000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAlyC-00016F-NX for patch@linaro.org; Tue, 03 Aug 2021 00:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAlpY-00031I-5t for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:04 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:41684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAlpU-00028g-Vq for qemu-devel@nongnu.org; Tue, 03 Aug 2021 00:15:03 -0400 Received: by mail-pj1-x102c.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so3039576pjd.0 for ; Mon, 02 Aug 2021 21:15:00 -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=JUJY8z2475zIBNarMLMPEdlHtKrQEQrNMuj/yYXL3iE=; b=ctXV514tAPd4jFdMd5DYKfmvZGCoo34cFW2FCs+gXVkbKze0CJeSw8q+8Rs5y+EK1n NKREFn8CHzBC26oGudXhiQej3Dv1VzfKwHzUr3ehKsYCewGlt0uH9qGRNVWPSfQdF1qv RTLqSFSUA4Q583wzDd3W458pqbObPUSSLiFTGnXRA57wgDL4zTkODt9qX7WWYn0Plq/9 ssrbkdR1FQsaK2qcUW/y7kblC/UqZAWVa5Y2JuvQuPPjocAWfJsdRRUoxYbeUBKZjaLy fsGW0le73aWxJ0BjzuusVSNHGuzOGKexexfe09n2LC12R6VneFHbtKJaoNZSoqvVwp3o FB0A== 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=JUJY8z2475zIBNarMLMPEdlHtKrQEQrNMuj/yYXL3iE=; b=O//XeO+L8nvP0XOMLwr4oWxCSDf7SBGViyY4e/w2ESLy8UsdWHBxlsG2xCRDkhkHtV DwJ89KGMuPgO9zS8EcIXq5DCjEHBtaSxXveOMSiAhhqBBmPe2JvR8KkpgoScZIotg6iH jzEmmo8spwt3aEHWo19PuwYfkRNo/1UhVZLqvn/jADQPPAP1od/I1sb8GeQJzYaSCOe4 oFDZjdiQSHSOmmngmHpVSw63TxFv6uQtUCrDEt+5HJFHgPPFQ0//DXUui7SucPNHknL+ xbIZwTwtoH7iOIpVDxRHwSDScp1NSMTG/BCMr2OouEVRppBsm2wzPI0W8n5PCpzVXjR4 dPtg== X-Gm-Message-State: AOAM531YLulU2qUpe9a4MF1riRYlKZhjp2OcGXGKSRrFJnSCE4I2DgfX SUyxv8NPXIr01mJumcHvrwDbXdO5i9OpgQ== X-Received: by 2002:a17:90a:2ec3:: with SMTP id h3mr20716910pjs.125.1627964099803; Mon, 02 Aug 2021 21:14:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 21:14:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 12/55] target/s390x: Implement do_unaligned_access for user-only Date: Mon, 2 Aug 2021 18:14:00 -1000 Message-Id: <20210803041443.55452-13-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::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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: David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé 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 = { .initialize = s390x_translate_init, .tlb_fill = s390_cpu_tlb_fill, + .do_unaligned_access = s390x_cpu_do_unaligned_access, #if !defined(CONFIG_USER_ONLY) .cpu_exec_interrupt = s390_cpu_exec_interrupt, .do_interrupt = s390_cpu_do_interrupt, .debug_excp_handler = s390x_cpu_debug_excp_handler, - .do_unaligned_access = 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()); } +/* + * 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 = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); +} + #if defined(CONFIG_USER_ONLY) void s390_cpu_do_interrupt(CPUState *cs) @@ -602,19 +617,6 @@ void s390x_cpu_debug_excp_handler(CPUState *cs) } } -/* 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 = S390_CPU(cs); - CPUS390XState *env = &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 ra)