From patchwork Thu Jun 13 10:44:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 803866 Delivered-To: patch@linaro.org Received: by 2002:a5d:58c5:0:b0:35b:5a80:51b4 with SMTP id o5csp239898wrf; Thu, 13 Jun 2024 03:45:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWqViqwdr7pWyGPSi8BFh14+RK/7rf3KohSgUqiC7pCdlcZzepaxz6Nj0j5bG5m1LJv+aAshcHsUIaQdQAPcHcj X-Google-Smtp-Source: AGHT+IE1k02rd8eBrbsnXWMoFDUyyzuFqfFGSNdrm+WLMUddPslyWfEc5OoUSLXIb5/FidU3KQ1M X-Received: by 2002:a05:622a:11c2:b0:441:4184:17f3 with SMTP id d75a77b69052e-4415aca73abmr51269981cf.61.1718275507433; Thu, 13 Jun 2024 03:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718275507; cv=none; d=google.com; s=arc-20160816; b=EAwV846g3ZmbLmseI/pWBqvj+2YVI9ZmtEgh3BsQ3gv5x8rXRR0CIxVY5fBBhqinIR nL50bOY/WlAKTy8/L8dy59Vsd3GhqUHwIwLW4dTlAH3OWRVxHNcpP04CJZIAUhiQgNU0 H5dU15Fv4zobrJT7nwZkeNKCq7qe5NWm58i0i4HEs84xxm9qywQArvhrqTrz27wQFcvD Yjj3akM8FOgjKiZ597VXvG3KQHzbzxn+ItUgJ1vcg3shAuX6JjlOJ3DVk4dJ5Y0bqCdc LC8k8NJHzKkRxiWvMHz4J1JbdO0LzPpbTyeLXW9QgJVWX9yWUF9NFSLEJTs6hKbEcykx 2lcA== 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=sumL6TrGjbghTO5XOerJp+bSLYxh41etGSCXTjn7OMI=; fh=xBDq+vw2O4NzhKQlMCAv2ESMCrOs2fHGJ5yzjmHHQ6k=; b=u1LqnwV31GpIlcHqBwNbEwQRL3UBa5p5gTYnuLNxdIhoe52B4siOpHjFtWoc/icoEp vtY8Yn9OXmDmL1NAO29w9ccqVJnqgQKcSbnlU6nSAbi8NXqNML60OkednVgTSRFMXlPN BuJr+cZYJ1owagJtNugkMuP6XDWxHYSGej0IWEjaY8f95yAHIrJEC9+dcCCs0D7wLLod J79e5O+9jz1VuUt096e8ixMDuTDhWsgQPV1uBTGf/o+ZWsXMckL982wAnQEzZDLEJC4F dpkUpxZemFocj7QK951t9KBZHbRz+QINuiEdWmO5G1mwzYWbmzkdrrBHo0eidNs9b9rq v+OA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JWOSgHO5; 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 d75a77b69052e-441f3102b42si11165961cf.731.2024.06.13.03.45.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2024 03:45:07 -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=JWOSgHO5; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHhwb-0005tX-Tu; Thu, 13 Jun 2024 06:44:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHhwZ-0005rA-A8 for qemu-devel@nongnu.org; Thu, 13 Jun 2024 06:44:35 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHhwX-0003mI-Gf for qemu-devel@nongnu.org; Thu, 13 Jun 2024 06:44:35 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a6ef8e62935so116915966b.3 for ; Thu, 13 Jun 2024 03:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718275471; x=1718880271; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sumL6TrGjbghTO5XOerJp+bSLYxh41etGSCXTjn7OMI=; b=JWOSgHO51At2ze4OeOqEGR+70/MhdBleQsIjCxfOD0pMiYIdXN3NLIY2My7YuZNJgr hr88ECtXODaLlOv8wzhoyyY5lP3H8L9iAPGcy/nMOXFKRE+yyOeHANjCKgXIlISgEyRz xu2WJDgLFuFeEi00cTS1KM9IoQcsgXJaQ9fvCXkILbtqTiDASePftwtruJpAwPI56onB XvshJxbuaaHpcXNJrBR5MwHyH4MGjiK66ceB4jNy2MkbtWGsZKNNr86sns7JIBlUh2Gg ZjVXUi3VYKgd8oEaCMnNIOI26+zrm+DJYHoDTu08cFZChNSt+wcsRexJVT+DMwXsCxaa lCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718275471; x=1718880271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sumL6TrGjbghTO5XOerJp+bSLYxh41etGSCXTjn7OMI=; b=O+gxVyhDas6oncdUBMNivIERhsTucGMzRymbyycPMGCjEZs9fww3NUIXvlDPM6kSOc aAUdJh3OEuBMumq1l+waztY+If/LYeANGV18F4oDoruVzeBUjdfSEQbbM7Y8qUTL2Q20 3Vbmg8RQn+Eyd5CKcyoLFSDB9YqOeVuZVclPW+F3bTgmOQZwGkq5EPK8mb4x0CNJWrbs BCDS/ssn3q9X38Vw9bv/zlRZxHco/4IGd9pWhZxlX1iOTjBDZgRc67gk+/GhWGZyMmQr X2b5bx2bZZIeuDfqsZ06vi35dNYU3CvrL5TOxk6s29E2QW0kcSXCsc+QkRYZdNv7GCj2 7/Yw== X-Gm-Message-State: AOJu0YzbZjY3pK5qusxR5bUR3OGkR4zuGfOn/dwmd/FcXKMjrrcMC6uY LeSQPhWjc//Ge54JWP6mwTRgdCRqL4aGTsNw8CQVS+2X28vo57OhH0vn81ZqKRrHs3yoz/1Mme1 Y X-Received: by 2002:a17:906:480a:b0:a6f:5f:8b7 with SMTP id a640c23a62f3a-a6f47f589cdmr354174066b.21.1718275471420; Thu, 13 Jun 2024 03:44:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.148.226]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f41721sm58272566b.154.2024.06.13.03.44.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 13 Jun 2024 03:44:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Farman , Peter Maydell , Halil Pasic , Richard Henderson , David Hildenbrand , qemu-s390x@nongnu.org, Ilya Leoshkevich , Christian Borntraeger , Mark Cave-Ayland , Thomas Huth , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/2] target/s390x: Use s390_skeys_get|set() helper Date: Thu, 13 Jun 2024 12:44:15 +0200 Message-ID: <20240613104415.9643-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240613104415.9643-1-philmd@linaro.org> References: <20240613104415.9643-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-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=unavailable 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-bounces+patch=linaro.org@nongnu.org Commit c9274b6bf0 ("target/s390x: start moving TCG-only code to tcg/") moved mem_helper.c, but the trace-events file is still in the parent directory, so is the generated trace.h. Call the s390_skeys_get|set() helper, removing the need for the trace event shared with the tcg/ sub-directory Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/mmu_helper.c | 11 ++--------- target/s390x/tcg/mem_helper.c | 16 ++++------------ target/s390x/trace-events | 4 ---- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index f3a2f25a5c..6c59d0d216 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -25,7 +25,6 @@ #include "sysemu/tcg.h" #include "exec/exec-all.h" #include "exec/page-protection.h" -#include "trace.h" #include "hw/hw.h" #include "hw/s390x/storage-keys.h" #include "hw/boards.h" @@ -303,7 +302,6 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags) static S390SKeysClass *skeyclass; static S390SKeysState *ss; uint8_t key, old_key; - int rc; /* * We expect to be called with an absolute address that has already been @@ -341,9 +339,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags) * * TODO: we have races between getting and setting the key. */ - rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); - if (rc) { - trace_get_skeys_nonzero(rc); + if (s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key)) { return; } old_key = key; @@ -371,10 +367,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags) key |= SK_R; if (key != old_key) { - rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); - if (rc) { - trace_set_skeys_nonzero(rc); - } + s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key); } } diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 6a308c5553..6cdbc34178 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -30,7 +30,6 @@ #include "hw/core/tcg-cpu-ops.h" #include "qemu/int128.h" #include "qemu/atomic128.h" -#include "trace.h" #if !defined(CONFIG_USER_ONLY) #include "hw/s390x/storage-keys.h" @@ -2093,9 +2092,8 @@ uint64_t HELPER(iske)(CPUS390XState *env, uint64_t r2) } } - rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); + rc = s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key); if (rc) { - trace_get_skeys_nonzero(rc); return 0; } return key; @@ -2108,7 +2106,6 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2) static S390SKeysClass *skeyclass; uint64_t addr = wrap_address(env, r2); uint8_t key; - int rc; addr = mmu_real2abs(env, addr); if (!mmu_absolute_addr_valid(addr, false)) { @@ -2124,10 +2121,7 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2) } key = r1 & 0xfe; - rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); - if (rc) { - trace_set_skeys_nonzero(rc); - } + s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key); /* * As we can only flush by virtual address and not all the entries * that point to a physical address we have to flush the whole TLB. @@ -2157,18 +2151,16 @@ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2) } } - rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); + rc = s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key); if (rc) { - trace_get_skeys_nonzero(rc); return 0; } re = key & (SK_R | SK_C); key &= ~SK_R; - rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); + rc = s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key); if (rc) { - trace_set_skeys_nonzero(rc); return 0; } /* diff --git a/target/s390x/trace-events b/target/s390x/trace-events index 729cb012b4..d371ef71b9 100644 --- a/target/s390x/trace-events +++ b/target/s390x/trace-events @@ -1,9 +1,5 @@ # See docs/devel/tracing.rst for syntax documentation. -# mmu_helper.c -get_skeys_nonzero(int rc) "SKEY: Call to get_skeys unexpectedly returned %d" -set_skeys_nonzero(int rc) "SKEY: Call to set_skeys unexpectedly returned %d" - # ioinst.c ioinst(const char *insn) "IOINST: %s" ioinst_sch_id(const char *insn, int cssid, int ssid, int schid) "IOINST: %s (%x.%x.%04x)"