From patchwork Tue Aug 23 21:38:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599476 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp2724633mae; Tue, 23 Aug 2022 14:39:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bq8CizsxJhysplSYmDSng8fzArzHqP+9T8nhikpAPHSP9XmcQo9YLFCUXOf8Q34vv6v6D X-Received: by 2002:a05:622a:649:b0:343:7b74:5cd1 with SMTP id a9-20020a05622a064900b003437b745cd1mr21708911qtb.407.1661290741275; Tue, 23 Aug 2022 14:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661290741; cv=none; d=google.com; s=arc-20160816; b=osSfbbdfamZQJIrHtxI9Mu2RkTqk3q1e9TsTbvcNHH4eG3EZ/4mBFxbaKyMLP/MDAj UQDfFCchJ/4ZlD4JIO/s3pj9PGTePSS8r9ngHiP6LtpWwWGsP044tIN4G4aNupnmisO/ nR7aH5Y4saM6pudjVcDLBKiAgInpCkIqfFEyY1CE3vrs52ZLawdlYen18fTqWBDkMXYc c0dtwIVmtNFmvnesScsMWulneV8zzDdvZrIN1+da6vtqp6zjkUFXO40ZelxKaF4dUpiX +OBZIYe8PIm+jV0XBLAGTWNxQiXg+K/COsMDngBhYizEhj4TUIRo29MXbXsJZmp6gz/8 VfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=1wC40Txe5zJ5ok4xl905SAO8DYChZ8Ztlm4id2EmYkU=; b=bKkmHU1MawfCnoSdTTvFp6H/xzl/x/btZJ3Rxw1pfbr2CLM3Fz20aWJgwzaCrwGrgW s+PvD0DEuuZ0UYTvYSD6ohSQt7mPTQ11YZzRe/1EPRX5ndNE8b426tgw41LAT/AHV712 iHfsVPXX3GX6GWoy2IirLpsDpC8LZsMIE4RrQNzSna6IxB23JROf7hc6BO0rQTpfENv4 YmQHQzd7WRY1cJSBhAfLP0SxcNxZn0ucPHirL4C6p9p3tMikZdORDOXjWVGSjSJz3d4d 9YghKJH2+4eWFTudUoVEAuV5ifLleQNkpwz/ekxpsUd4DsPp7WaDDuiPvIMaQDyLeOti RXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jikUyGdI; 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 e9-20020ac84b49000000b003437ba56c2esi6306925qts.475.2022.08.23.14.39.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Aug 2022 14:39: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=jikUyGdI; 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]:43590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQbbw-0000r7-Sd for patch@linaro.org; Tue, 23 Aug 2022 17:39:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQbbA-0000ie-Vc for qemu-devel@nongnu.org; Tue, 23 Aug 2022 17:38:12 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:45712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQbb9-00060t-5U for qemu-devel@nongnu.org; Tue, 23 Aug 2022 17:38:12 -0400 Received: by mail-pl1-x630.google.com with SMTP id u22so13953838plq.12 for ; Tue, 23 Aug 2022 14:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=1wC40Txe5zJ5ok4xl905SAO8DYChZ8Ztlm4id2EmYkU=; b=jikUyGdICV1jmwScfFClC1NRzjd5JLpR4Bflu9jcLq+KAglZXaSxwM3alX085mK2XO jEmmi9lNgF4PsUwsgD4q7phYptXMU2LHiT1rYIJzi45QXZGYn42gdeH7Yv01jPjOvJza 14mcJLNxXzDyuPimyyT2I/X0Vcq0aIrQGcwvXsY/j2OcZNSUm6aKXrcqmzPpr0WoDckh rGjUME0o7n3sFtFVBuds/cDEEcD1HsZTUDEJ7fTNHiw97IZZ6vy/ohNr7gUAGVzG7Uhd Uq5+KGvmiakozrumD/GEofbO8GYDe3/mWVOu54NamzqbGhEHVMl/31LtT/ae0zrYMZ6I iIoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=1wC40Txe5zJ5ok4xl905SAO8DYChZ8Ztlm4id2EmYkU=; b=XaB8jofsisz0ltJO7U0M8sQyNjvnJJjl9NqX9azZ0uZ7VOVJ3pwbQuy7eZ0GPjabR3 u6NcGRuKPszmttQ0zv4Z44yWar05KYNNOD6iESH+cJukdGW5uTj/IobHamNLbgYapPFI ZS/39fTsKpX0xmVNiZOXjAkp3HI3jsjn6v+1QOOOshqjtpuNREKqciOCN5L0hmIvrPJ8 XCDmAw7PWIGUe8+9p6iAlzEdVdLjx48MTMv+YG8ILST8r5XooRTKv1ldEuzTH0+iUsJY leuymVmfRYRc+IdRxy8Md3sjDBIuVYjeg7NHZeNfZkskeod6hn4sXR8lYJT4l5j8prIb HNuA== X-Gm-Message-State: ACgBeo13WMb5CEUgcfojIgyyxiKQn8u+Ar6vrX0r9qc63HG4v8zGLudi f2Qyc++M79glyYzCg/nESF4KZu74+gTCWQ== X-Received: by 2002:a17:902:e94c:b0:171:3df0:c886 with SMTP id b12-20020a170902e94c00b001713df0c886mr26393020pll.39.1661290689810; Tue, 23 Aug 2022 14:38:09 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:46f9:77b4:ec0a:c2d9]) by smtp.gmail.com with ESMTPSA id s19-20020a635253000000b0040d75537824sm5366403pgl.86.2022.08.23.14.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 14:38:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: david@redhat.com, qemu-s390x@nongnu.org Subject: [PATCH 1/2] Revert "target/s390x: Use probe_access_flags in s390_probe_access" Date: Tue, 23 Aug 2022 14:38:04 -0700 Message-Id: <20220823213805.1970804-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220823213805.1970804-1-richard.henderson@linaro.org> References: <20220823213805.1970804-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This reverts commit db9aab5783a2fb62250e12f0c4cfed5e1778c189. This patch breaks the contract of s390_probe_access, in that it no longer returns an exception code, nor set __excp_addr. Reported-by: David Hildenbrand Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/mem_helper.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index fc52aa128b..4c0f8baa39 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -142,12 +142,20 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, uintptr_t ra) { -#if defined(CONFIG_USER_ONLY) - return probe_access_flags(env, addr, access_type, mmu_idx, - nonfault, phost, ra); -#else int flags; +#if defined(CONFIG_USER_ONLY) + flags = page_get_flags(addr); + if (!(flags & (access_type == MMU_DATA_LOAD ? PAGE_READ : PAGE_WRITE_ORG))) { + env->__excp_addr = addr; + flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING; + if (nonfault) { + return flags; + } + tcg_s390_program_interrupt(env, flags, ra); + } + *phost = g2h(env_cpu(env), addr); +#else /* * For !CONFIG_USER_ONLY, we cannot rely on TLB_INVALID_MASK or haddr==NULL * to detect if there was an exception during tlb_fill(). @@ -166,8 +174,8 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size, (access_type == MMU_DATA_STORE ? BP_MEM_WRITE : BP_MEM_READ), ra); } - return 0; #endif + return 0; } static int access_prepare_nf(S390Access *access, CPUS390XState *env,