From patchwork Mon Oct 9 11:02:33 2023 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: 730992 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1143144wrw; Mon, 9 Oct 2023 04:03:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMtYCLiaoTjlOtUkoXV9FvBdrj7jEF4u77CxJcNbZcZfcbjHtIlQo8r5G/qlkBSG/d3eLB X-Received: by 2002:a05:6122:494b:b0:49d:c1f5:d491 with SMTP id ew11-20020a056122494b00b0049dc1f5d491mr8785689vkb.15.1696849402580; Mon, 09 Oct 2023 04:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696849402; cv=none; d=google.com; s=arc-20160816; b=gmlt9JXpiycSwNZst+xaeEjBbx3Z/y3YG1kI0UlMSq4kqXlWsge+7ealSVuy3xImVT Rosxi0ubg37oMqycfhcRCDaJ/XUgUQE6twkoEgNd2E4U1hucBVgJMsrs5VoPketLWTcq nsWIZtA4/14iEcLhyZXthV0TYRlhjpCxgtj8h6ZstLpcUqL9aRWts15SdNp9rSweC1jr V44g09aVfOEuOlRUaDSYAGi3As5Oq0dJstrMWobhT7nvI94BgyyfJACdpAa9bAW88vHJ 2UG61Ly4wUr0U793/pgU9EWS1pfc6sqncoyfoSGR2Otwn1V9+KMKnnj5J0l2KQt+EmlZ +EuA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=zlXP41ypA0ujX/YV0zfxHyaduivoE0OxI8maqcWq1N0=; fh=JT+suEVcDyElyoNkyLRJK+Ua1enxIL+q6FnXD6fdVGI=; b=Zna0xqXbZQR6UqDi5IMo/o8QrRcPMF3/MOVR9a6FCzZRLnr22chaFFqsPc4ZlPi24W c+HvyBxEImiz2gB1O44EkrO3iki1mU2El7V8tIlvlM5Gye1REbLxFLvl476mfJ6hocqc 9NBHA2rCLIOFHNfyFUL5e0IGp1ehl7KMFUuCeHRaoDcdLSGEQnJ3LnfcRWkfkJxv1UCD npP871NVgEVfc7waiotI7dKo7xPVS87/s3aN1MK2Q1wMPga7EdIfBHGiAbfd+Mj/GWvI O5m9LswQ5pWy/wnItQMc014S7Vga2rcsDcu+FEj8yuMiyGFt+EDuuWv0ykL8/Iyf0cYK eBQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wz1Np+Lc; 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 j19-20020ac85c53000000b004181f3cf9a0si5960599qtj.327.2023.10.09.04.03.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 04:03:22 -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=Wz1Np+Lc; 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 1qpo2S-0006EV-0e; Mon, 09 Oct 2023 07:03:06 -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 1qpo2C-0006Bs-HT for qemu-devel@nongnu.org; Mon, 09 Oct 2023 07:02:50 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpo2A-0003J0-0r for qemu-devel@nongnu.org; Mon, 09 Oct 2023 07:02:48 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-533d31a8523so7856340a12.1 for ; Mon, 09 Oct 2023 04:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696849363; x=1697454163; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zlXP41ypA0ujX/YV0zfxHyaduivoE0OxI8maqcWq1N0=; b=Wz1Np+LcHbHayjpNos82V4XoRMZ6RDYcFzvxW7YloQ02u1GbmndY41TmZPYDA9QDDg fT7GWVJDNlcrytIni+YUu3lO5vybhw4T9e1VG4m3MPx6egduqMY0WVXaKpND1Q7mOoyy PE5Mlc+Qqe6N+u4Bc27wT01KBOAdrmhK6zxW+gfMBojcWobWqB6R4SG+x6pT5bnjb6lC 1cAzW8iT4pthosZ65Gwo+3ZSUKCBalzTX97EreFu7C449c1nwbozcyz9D9npNrMh5c0x dGNEVjEvZFKJnuxV5ld6YmEopR1o67lFi2yMTRE7Po/sR32eKfkGQRo6sVdeu1jwtEgP poTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696849363; x=1697454163; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zlXP41ypA0ujX/YV0zfxHyaduivoE0OxI8maqcWq1N0=; b=bEjNDtUj6l9Ppzyd0PYB0NNioNRC+8Gqx692zN4Dpd/uzASBWonL1MWBf4/TFyJlPF 7WwG57osEEpjnG05zUDpwq+RgsImbwqnU+pIyHpbs0SsZ8/8OMu4dHUYYIflwBTMdmip 1RfP2xM2OinoxuNtLJ7+5pu/VplJFX9ZclCvAw5Pbg420yuRIJUdjYsKv31UcamBVx3S xFhAazfB4tuHbeCS1BeX4Y4eO8R4vjPEM12IjJGpzbRDKeIT8FletQp+Nm7Ydauoe51o UN936N3zTsWHQyK4iJs1jCcaFVMSBgt7EJOjKoy9GIUxEtxIs2Z7UjcW3d21WRzZt3NT ibFw== X-Gm-Message-State: AOJu0Yx0ndvoBHlLEJpctoe9BAaCp5m+uieDeRt/t7MnrAzAGG/VX/0O HSYXnSdMOeLZpbK4W9EIWTFBfU1zV5rI5KYUry0= X-Received: by 2002:a17:907:7631:b0:9a2:256a:65cd with SMTP id jy17-20020a170907763100b009a2256a65cdmr11273866ejc.4.1696849363071; Mon, 09 Oct 2023 04:02:43 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id w19-20020a170906481300b009b9720a85e5sm6604806ejq.38.2023.10.09.04.02.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 04:02:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Weiwei Li , qemu-s390x@nongnu.org, Ilya Leoshkevich , Bin Meng , Alistair Francis , Cameron Esfahani , qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-riscv@nongnu.org, Max Filippov , Daniel Henrique Barboza , Palmer Dabbelt , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Liu Zhiwei , Richard Henderson , Thomas Huth , Roman Bolshakov , Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 0/6] target: Use env_archcpu() instead of ARCH_CPU(env_cpu(env)) Date: Mon, 9 Oct 2023 13:02:33 +0200 Message-ID: <20231009110239.66778-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-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=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 When we have a CPUArchState* pointer we can directly get the corresponding ArchCPU* pointer with env_archcpu(). No need to use QOM cast which is slower due when building with --enable-qom-cast-debug. This series replace ARCH_CPU(env_cpu(env)) by env_archcpu(env) when possible. Philippe Mathieu-Daudé (6): target/ppc: Use env_archcpu() in helper_book3s_msgsndp() target/riscv: Use env_archcpu() in [check_]nanbox() target/s390x: Use env_archcpu() in handle_diag_308() target/xtensa: Use env_archcpu() in update_c[compare|count]() target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr]() target/i386: Use env_archcpu() in simulate_[rdmsr/wrmsr]() target/i386/hvf/x86_emu.h | 4 ++-- target/riscv/internals.h | 8 ++++---- target/i386/hvf/hvf.c | 4 ++-- target/i386/hvf/x86_emu.c | 25 ++++++++++++------------- target/ppc/excp_helper.c | 2 +- target/s390x/diag.c | 2 +- target/xtensa/op_helper.c | 4 ++-- 7 files changed, 24 insertions(+), 25 deletions(-) Reviewed-by: Richard Henderson