From nobody Sat Nov 15 23:37:21 2025 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=1745457971; cv=none; d=zohomail.com; s=zohoarc; b=AKFMTzNA1x8tbhJdWMQOYihcTWWg+DNg14j2i1gcnn1EtVjCa2nilvXjharPwcS3h2oluq7Ay69LodPRq4QAvf0FaGQ7cCQjlbOwziXLHr20ZwrNvfFVXB2suM1pY1UUDEEyLwcp2wifIePLu0lYZSeLrSyVljVmKZdGzCnRpxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457971; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JTY2OFpS1RWTqGYBX13cfwjNoyREKh7hiz39ECnEaC4=; b=lAcTh9M4xayXLKKtb5FsaYH2/eTNfeokXVa4dZOIkRTzerRP5mk8YgeOKEKiug00fLH0FVREH7bsNWmqYP6Z0qnHwFRzT9QPhPKe5r2Zal1IQqrbLggMJk0sTv3yuCJ8GZS4h3q+WYcp6r0Ua3kVlGikDH96PxdVrzuBD/fM0ic= 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 1745457971738631.5562032226711; Wed, 23 Apr 2025 18:26:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGe-0004px-Dy; Wed, 23 Apr 2025 21:20:44 -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 1u7lFP-0002aK-6H for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFJ-00078J-OK for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:26 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-736aaeed234so353994b3a.0 for ; Wed, 23 Apr 2025 18:19:21 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457560; x=1746062360; 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=JTY2OFpS1RWTqGYBX13cfwjNoyREKh7hiz39ECnEaC4=; b=J83aGy34xfEEhWyj4WodrsJ2/DtUjvCxdDknjOFgLlwXowHv1AVHKoX/K7+T+U+x+c h965d81TtW+NUMcGojtmmy3sNr28acGlhmym9PIqS0avg0YfHcTc4kQHg0yEuqRT1nil n6LunxsUoAFs25LMulaTFHtnwyrbI9oWMGARCZrFtTHFvalFY3I5Lg/SOmIBjlkc79qD BjSuLWbNatJY6Ksqw3kKXTDk1/OsxkmgFYe1Ck5RLnP3UigJ3DZbtTb2/TS1P/bFCr0g ZxNicZ2HsegEJ3f05mdBhYUEEVff/KaRWls77gnfSgu/FekXt3lNp3lAiAdK41+X1iQa JVqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457560; x=1746062360; 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=JTY2OFpS1RWTqGYBX13cfwjNoyREKh7hiz39ECnEaC4=; b=q2j3JvyWL4oVcmLb3ZnTFX97tD0PPw4yYmKZAnrs55FCuU4iWLNwM7Aihstd9rlrn5 vbxCT9bY9WEg9txqR7v+bXUX/ZYl07xh9vlzk2GTurIoMeDXQffoDI1zEloSSOegtLDJ QAAfaP5GmhANmKQiM1t9r8hnzYe96Qnc7kaGiXT69QRizhFH0VJ+OY3oTL6NoCCgdQ8W KfV3HmzGHN+FsAInk6gWgymGitrPKm3gWfWNRlEvRyduSoYLDOnLLVzd3482u5QksttN fnyY2qdRT7D9XD3kNoixTkbyzG3hpbsjZEu/zdGkL/SpKJe4beexBPMFkJRi5y7rDdMP LksA== X-Gm-Message-State: AOJu0Yy4ialZ8pyxgKHiHL1kyOo6erNIFvNgMyzu4IfsmC8MeImmmW+b CRnTvDLDWAxuagHEPNSr0TjYS74HkqKyeTe7OvUkrbfLePAMqRm+SKOopGabYZCjiaBytV47ibb c X-Gm-Gg: ASbGncv1vTGtGYT9K30j8LxfQxS5mHJZ1gVZt7YhBwXBxN1hqRUWbNoXcjTqdPOKtM0 4gtrR1mYjz6Ma7j+aT81sgA8YugcWSJzquSmIpuHD2H7LasqZFiQgC2u8MGYvZ6zAe247D38IeL HE/L+SBo35hp6SoH3pCP5FCBXsta3zlFrLtbO9fPzT5pGeeGyEWBSDQ/EVAz75qyJez5aqXG0x5 bJl/MHjFH5wLPGnTb9MUd+k+3GvjSLkLEWxxYgWsNMfu9/nyRUURb/xot5BWz6hx1xhkh4ZXZ/9 bu9J95bgkMcvqz6r3HjVzzI+VlpIAI6L0St/Us0HBegyaG2BW+i3CXWCthaAc5OIKzqb3AyLHMU = X-Google-Smtp-Source: AGHT+IGVIn2VBTQ1j810ewXZpmfE3Z6BlD+pvqgsDn1jxME6klGd6xtjQfwUWeuR2vxMKzOqWtpsSA== X-Received: by 2002:a05:6a00:3928:b0:736:34ca:dee2 with SMTP id d2e1a72fcca58-73e245dafa2mr1203122b3a.4.1745457560358; Wed, 23 Apr 2025 18:19:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 01/15] accel/tcg: Add CPUState argument to page_unprotect Date: Wed, 23 Apr 2025 18:19:04 -0700 Message-ID: <20250424011918.599958-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457973160019000 In the next patch, page_unprotect will need to pass the CPUState to tb_invalidate_phys_page_unwind. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/user/page-protection.h | 2 +- accel/tcg/user-exec.c | 8 +++++--- linux-user/elfload.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/user/page-protection.h b/include/user/page-protection.h index d5c8748d49..1de72e31e6 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -16,7 +16,7 @@ #include "exec/target_long.h" #include "exec/translation-block.h" =20 -int page_unprotect(tb_page_addr_t address, uintptr_t pc); +int page_unprotect(CPUState *cpu, tb_page_addr_t address, uintptr_t pc); =20 int page_get_flags(target_ulong address); =20 diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 5eef8e7f18..90b345a0cf 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -128,7 +128,7 @@ MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_w= rite) bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, uintptr_t host_pc, abi_ptr guest_addr) { - switch (page_unprotect(guest_addr, host_pc)) { + switch (page_unprotect(cpu, guest_addr, host_pc)) { case 0: /* * Fault not caused by a page marked unwritable to protect @@ -584,7 +584,7 @@ bool page_check_range(target_ulong start, target_ulong = len, int flags) break; } /* Asking about writable, but has been protected: undo. */ - if (!page_unprotect(start, 0)) { + if (!page_unprotect(NULL, start, 0)) { ret =3D false; break; } @@ -704,11 +704,13 @@ void tb_lock_page0(tb_page_addr_t address) * immediately exited. (We can only return 2 if the 'pc' argument is * non-zero.) */ -int page_unprotect(tb_page_addr_t address, uintptr_t pc) +int page_unprotect(CPUState *cpu, tb_page_addr_t address, uintptr_t pc) { PageFlagsNode *p; bool current_tb_invalidated; =20 + assert((cpu =3D=3D NULL) =3D=3D (pc =3D=3D 0)); + /* * Technically this isn't safe inside a signal handler. However we * know this only ever happens in a synchronous SEGV handler, so in diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 99811af5e7..7519b6bcda 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4245,7 +4245,7 @@ static int wmr_page_unprotect_regions(void *opaque, t= arget_ulong start, size_t step =3D MAX(TARGET_PAGE_SIZE, qemu_real_host_page_size()); =20 while (1) { - page_unprotect(start, 0); + page_unprotect(NULL, start, 0); if (end - start <=3D step) { break; } --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458086; cv=none; d=zohomail.com; s=zohoarc; b=ZvN3bgDoxnG7Bu44x9SDjEUUHQ9WRnHECpC+ZbPq57hsQyPhr+u5Tlcdoprvs+vPDxwJE4gDH5KY8krilkrRRjlsappLshq3IOeTTIvnSaHAWKtbipK0SESt5EW3PnjPJA4F4CkKhA6uI9HaP8kzFmj6wSiBcrAIZr7aDwC48Fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458086; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7BSyrZdC7v2JUnVuoXHNlf5lgfOuXFUfOH2AgahCd9o=; b=YjRl9Sje+FUIaDz0vlBO/VJG2mY81vLn6O7p5TnJ4V5RMIZU7LqWTQrDxTpAXDHqHTeN8mp/c6+2vHD3+ZGulrO225/i8Mnc4sOV6lFpvGG2DiWBYUPgYf+9xXPWdUgGDcLvPAfuEdCIl/kjZ5FHOEtjz1DWJzvJ99dKQAP2uso= 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 1745458086223117.52721629919608; Wed, 23 Apr 2025 18:28:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGN-0003uX-I9; Wed, 23 Apr 2025 21:20:28 -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 1u7lFP-0002a7-5s for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFK-00078V-LF for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:26 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-736a72220edso432203b3a.3 for ; Wed, 23 Apr 2025 18:19:22 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457561; x=1746062361; 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=7BSyrZdC7v2JUnVuoXHNlf5lgfOuXFUfOH2AgahCd9o=; b=y0FK71/dodldrMacsgVxZUYO6NKDQ8WXukDxmzPVUzGmYVJNxjdCljcDAO4RTJL5Ln RHEyZ67U7cXXw9VrNWMfzLQxyI9LCgIzWn1qdRFIQyeIzTSYJW6pydx5IF/gq2E8RLcf VUAdkaU32K9jflvY0/P8iJMm+HSY6h1C4o3yHmxlTyYqY08qo6X5GCqjQ2ZKVHxV1t1y pz4XSfPyGXF25fArIW/+N2h9ntKB1j6O59Va5BnY/akT+Ln9Xjwhpqim12vJDR/1nAqs P1p3E993Qe59rPv2Q+1YwA8VGTexyXFDKToO3VJfF/h9FklEx1fGOIBmEvjBRn5E+yA2 NMeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457561; x=1746062361; 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=7BSyrZdC7v2JUnVuoXHNlf5lgfOuXFUfOH2AgahCd9o=; b=DXjIfMWnuNPOSrNqTe4BTg62d2QO88ewZWpafk8naZhcMtiJbgVCJMMSgzslSBJJiE VMppaNz0nSFu1CWwqgVRacO69ZvLcSajSrfHdcvfBOPtz5Pd4RExc0i+HSm3PPXg+VQI 5/1N4jKe23QEB2KU0lWU0/sb6jL6LSTLIU/TQMSfymtFVcHaOzczZ6f3pOoadslUTZp6 EWRvXELj2L8i0jPh30AOFJBcB6uF/qdhQUu26UX/8XwTFx6fh/XiJzvxD7Wke58HTPzP u87vFAct+KTSMpHlUZCqot1AI+pdZ7pNnWXaFsULgQjg9l9wsdFUds1DGGy/IRAu6zwl fDGw== X-Gm-Message-State: AOJu0YwYdsV5P4JoIt8yjmGEwE4gJfdr3ASAqt6SbYFoF/zoacGB67Sy el+Htpjz5JrWQKIvKYqGGxqYyQF6xK8WVNZlb9YOaMAqrBIc6w+MDwdpS74Rh1yb0JjXTY+qYq/ + X-Gm-Gg: ASbGnctAExJxYjgC8aisz4Y9vLs0xuchrMBAQWdg4EQaaeRUxcnj1himBFeZCKNXdBs shrzBT3wIsZ0xVBDOtwNx+dIlQvWVHxRaB8Gom7SmZ2eAa5A6inqD9vTU3nIiN1BC4BbJUx7GOP CE3rXfVXFgMRKuRBjYLQ+qS5nhUtLoyQxy9glK7beiwEK6E5H+uvk3QCUooMCnqXO2scKj3l8w3 WIG+jYzDHe2sfRMJDA++/9YWhfaURC4O0asQeEZi26WHIks1f1VSRzCjzBASHcLZ1rV9+RF+F8q wsRZU+Tvd6cEilW+fg8AwitMlRila6GkIt4q+6nl9+zwuSAH0juQ2Z8BPy/c0y8qWxOO9X0MaRd 5U8c/WBru2Q== X-Google-Smtp-Source: AGHT+IGYM2DwESJiINJzNJzPPoHI7bpOL6ks1LIELyRacW7v4H+T8a6/PjQ6dFd5EjyhqNYM3sxtXw== X-Received: by 2002:a05:6a00:1d0a:b0:736:457b:9858 with SMTP id d2e1a72fcca58-73e245e6478mr1034101b3a.10.1745457560957; Wed, 23 Apr 2025 18:19:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 02/15] accel/tcg: Add CPUState argument to tb_invalidate_phys_page_unwind Date: Wed, 23 Apr 2025 18:19:05 -0700 Message-ID: <20250424011918.599958-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458087644019100 Replace existing usage of current_cpu. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-internal.h | 3 ++- accel/tcg/tb-maint.c | 8 ++++---- accel/tcg/user-exec.c | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h index 08538e2896..1078de6c99 100644 --- a/accel/tcg/tb-internal.h +++ b/accel/tcg/tb-internal.h @@ -50,6 +50,7 @@ void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ =20 -bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); +bool tb_invalidate_phys_page_unwind(CPUState *cpu, tb_page_addr_t addr, + uintptr_t pc); =20 #endif diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index d479f53ae0..714dcaedc9 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1045,7 +1045,8 @@ static void tb_invalidate_phys_page(tb_page_addr_t ad= dr) * TB (because it was modified by this store and the guest CPU has * precise-SMC semantics). */ -bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc) +bool tb_invalidate_phys_page_unwind(CPUState *cpu, tb_page_addr_t addr, + uintptr_t pc) { TranslationBlock *current_tb; bool current_tb_modified; @@ -1083,15 +1084,14 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t = addr, uintptr_t pc) * the CPU state. */ current_tb_modified =3D true; - cpu_restore_state_from_tb(current_cpu, current_tb, pc); + cpu_restore_state_from_tb(cpu, current_tb, pc); } tb_phys_invalidate__locked(tb); } =20 if (current_tb_modified) { /* Force execution of one insn next time. */ - CPUState *cpu =3D current_cpu; - cpu->cflags_next_tb =3D 1 | CF_NOIRQ | curr_cflags(current_cpu); + cpu->cflags_next_tb =3D 1 | CF_NOIRQ | curr_cflags(cpu); return true; } return false; diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 90b345a0cf..39b76d9654 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -749,7 +749,8 @@ int page_unprotect(CPUState *cpu, tb_page_addr_t addres= s, uintptr_t pc) len =3D TARGET_PAGE_SIZE; prot =3D p->flags | PAGE_WRITE; pageflags_set_clear(start, start + len - 1, PAGE_WRITE, 0); - current_tb_invalidated =3D tb_invalidate_phys_page_unwind(star= t, pc); + current_tb_invalidated =3D + tb_invalidate_phys_page_unwind(cpu, start, pc); } else { start =3D address & -host_page_size; len =3D host_page_size; @@ -772,7 +773,7 @@ int page_unprotect(CPUState *cpu, tb_page_addr_t addres= s, uintptr_t pc) * the corresponding translated code. */ current_tb_invalidated |=3D - tb_invalidate_phys_page_unwind(addr, pc); + tb_invalidate_phys_page_unwind(cpu, addr, pc); } } if (prot & PAGE_EXEC) { --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457697; cv=none; d=zohomail.com; s=zohoarc; b=j7lDQbQMg5Jy3NJ/d/ceOH919Scmg3aRhEm56BeJsv2UOOMebjrLXAN57sc+GGKIvKS2NWPpUJjGF5he25+ezj6vcpd6sYMd5TntG0GxvIjBrGTFS/wYS+l8tA1s+GsaOmJieAscltWwl/c7ZPnRpEFoiFpZsRc+SdsITMIX5+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457697; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=E2Pb/xj5a0DFM5mce1sHnV2dTI3TtHpGhVsfW6YeWgU=; b=Ro6z3HI0xOgofVi2CT09a/Hw7xtHCmugWBkfjG0iS5wBOH4FKo1G6CUjgr6/yN5mbAq2u9nQBnVQkTMj3w0/Ykx1IUPCYfcwQZwazaLLg/2ZSM6ehu40OsTnrCbKJN3fOOS8aEjiIFPv2nEGiub+emHQd/6qXupkzcjTorReacE= 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 1745457697235757.7680500720963; Wed, 23 Apr 2025 18:21:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lG9-0003a4-Px; Wed, 23 Apr 2025 21:20:15 -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 1u7lFP-0002aU-5t for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFL-00078a-9o for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:26 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-736b98acaadso382555b3a.1 for ; Wed, 23 Apr 2025 18:19:22 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457561; x=1746062361; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=E2Pb/xj5a0DFM5mce1sHnV2dTI3TtHpGhVsfW6YeWgU=; b=rH7OeVHUUQSNfZuF6MRjYnSje45rdgpuMNLjAOK6FlasFLdXYjVHjl9WU6AKFh4jBN TsgnUsel+t4cwzvKMHaChzGDtVS65gHytX4fXIG3KpC73bS6MvZjhJRXxFBNuDAz046f qyf8FLlPi3tYfV1PzATCb/ZnckU+eWNJRQTG8cRysgJbcc+eSyXpgIxaU+zwIt3WgdQR yYQiE22Z/w1kgvnzzS3DQSfwlsWls8tv6x2ligAR3V8QUClcwZf4Y2oojtyM6n4vAZPV uZhGuP4tAuwbGfTSx7rYvnYrM7dnOAURQnZ4nNx2aEyNbcUKvIuNo92xcM58eSOB3f4Z ghiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457561; x=1746062361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E2Pb/xj5a0DFM5mce1sHnV2dTI3TtHpGhVsfW6YeWgU=; b=JwI0A1AiBQj6PSm90qOCwJAMJ5GaFcEm5gOORGT6fnB2c9UyqN+0iDQBx0yRYpprD4 Uzkj53G6q+5uDug+yztCFyyOcB7n8l8D4gSks8RUveXs1QqLVPT5cTyeAOf/QnhZpAQA y02lOQdOc5m9iz3dj4eTzAz0DVIw4Rk631DWdowdkSnBUdHWnCCaXrkXC0ByCiK5PIcX 177qAIkRped6uteuMKHnLK4/SGYZEUwvBEE2G9ZODiZCnRIPEegyPErUFQzyEUAgIzu4 zuOkyRZWbm1Ac21RjxwlbxudYy9iSe7Nmp++AiD/vFoN7Z4fVWQtNLhcYRefbXLdQt6Y QQYw== X-Gm-Message-State: AOJu0YyzY2DXvAT94benW/Mkny6ZWAu86RFpQNMgKqByZo82RtHoIDOQ 2JTdpt5zZrDmhZg1VVKT5D+g6za0w4E5cYXCLwTvbeOSKfJjzYUO3dkfYpk7d13/jW6atjJpzxl X X-Gm-Gg: ASbGncvzl8+DXzyscVzLtZVXNH4d1rOPRUDchmmSePnUEcQSQZGYT+5P2sYE2T3Iwsf yGG/B3QfP75ZZ8I5OOj20Mo5w1uYGOHIcu9b0/SBNdhyQ8Xy6F4E2CqICfrSQFJ5X6m8oG1/g3C KmPQWvhR0kcICHVx1Q3UUpfLIv48b0yFUSDNIuHG1Fiqi7GKyddkc313WSbzPbGsah5gmaCXPYa KYG4OwL+aehQuaNNPW9FX3UpBFVZUV1pLjWSbbgP64yF0SvmYw6T/gld6CrYmAk/XQIJyUfvuaC ThQG37HmATV7UsCDxIGInwp3bTjO2VpnvLo6FrHLO80UKTzpOX1/bqXn28m9fzaUR2F+D1DDvSI = X-Google-Smtp-Source: AGHT+IEyM2VXKXx6X4PEEWSRA4fQkoBF9m52x2cgLi1s1SF2K53NeJOpkD8Iwku1iyTeSiMudDCdxQ== X-Received: by 2002:a05:6a00:a8a:b0:736:d6da:8f9e with SMTP id d2e1a72fcca58-73e23cb1724mr1201065b3a.0.1745457561566; Wed, 23 Apr 2025 18:19:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/15] accel/tcg: Add CPUState arg to tb_invalidate_phys_page_range__locked Date: Wed, 23 Apr 2025 18:19:06 -0700 Message-ID: <20250424011918.599958-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457698238019000 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-maint.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 714dcaedc9..e8a465c9ac 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1100,9 +1100,12 @@ bool tb_invalidate_phys_page_unwind(CPUState *cpu, t= b_page_addr_t addr, /* * @p must be non-NULL. * Call with all @pages locked. + * If cpu may be NULL outside of a cpu context. In which case, + * precise_smc need not be detected. */ static void -tb_invalidate_phys_page_range__locked(struct page_collection *pages, +tb_invalidate_phys_page_range__locked(CPUState *cpu, + struct page_collection *pages, PageDesc *p, tb_page_addr_t start, tb_page_addr_t last, uintptr_t retaddr) @@ -1194,7 +1197,7 @@ void tb_invalidate_phys_range(tb_page_addr_t start, t= b_page_addr_t last) page_start =3D index << TARGET_PAGE_BITS; page_last =3D page_start | ~TARGET_PAGE_MASK; page_last =3D MIN(page_last, last); - tb_invalidate_phys_page_range__locked(pages, pd, + tb_invalidate_phys_page_range__locked(NULL, pages, pd, page_start, page_last, 0); } page_collection_unlock(pages); @@ -1215,7 +1218,7 @@ static void tb_invalidate_phys_page_fast__locked(stru= ct page_collection *pages, } =20 assert_page_locked(p); - tb_invalidate_phys_page_range__locked(pages, p, start, start + len - 1= , ra); + tb_invalidate_phys_page_range__locked(NULL, pages, p, start, start + l= en - 1, ra); } =20 /* --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457969; cv=none; d=zohomail.com; s=zohoarc; b=Kc6J10tKIscDIHIZdXurr4PFC6WF9DI+m5g5Kx4fQvLz1wBpIoUDcyzFaIysEXhzlPuYZNGGXt4lJhCKM9OkIPsi5FJ17t7/w1MIbDfDMStNlSez/4nFkB2jLIsfmZ0dQbZUA38RfDF1qj29Zi/9W8CTjNQAxIOxVSl3G5m09aM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457969; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=+AhSAw0yISu1j2mAPNZj8JIUUEWW3orS97qT0s5kocY=; b=HXB7x5O2/pYHe3Zp7Pl3hXu/Sflh6UHAcT4lToOzzbKWCs98x0CVVdCj4j4WALk6qqzX4gk8tz9xhYHZMtfQyA3sEvvay+FzxSfN580oWybUaJPPTp75NU5pMIK90IF7dcxNgwXeuWdJWQIoM/C38teblpk5Mrr1+Wqb3yrmpbk= 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 1745457968973734.8610861740798; Wed, 23 Apr 2025 18:26:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lFu-0003TF-GB; Wed, 23 Apr 2025 21:19:59 -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 1u7lFQ-0002es-Dz for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:29 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFL-00078y-TR for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:27 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7399838db7fso525973b3a.0 for ; Wed, 23 Apr 2025 18:19:23 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457562; x=1746062362; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+AhSAw0yISu1j2mAPNZj8JIUUEWW3orS97qT0s5kocY=; b=EWdxRNf9KM20uTq8gXydcsWsLIWdkVy+fBz9K6op+Q/Sjx4SzziJcZXXxE/udVS11d MyugfSPzpT4a7ggMXif03jzgAc/fo959Siq0nmVY1/DP2LQ6S5nqSN1LlEiW7zDK2vLf os+7YgVjfMPEOEQOU4fJso1WQ74l7YhhzASOO1L2kX8vP4tuDk/YJUSgGR6BqRKdl3lj bHNYRS51ntxiYqZnZcs3KPpX1zXrVIb6ytIYvUdNO6GxdD542oer5Ug9MpbDSTSkH6qy LOqMBLvmInytgZ97nSse+L5GtGw7pQnZuZrTM715VGhQJg/RsWyig3/n+B6T1MtOBq9+ zaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457562; x=1746062362; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+AhSAw0yISu1j2mAPNZj8JIUUEWW3orS97qT0s5kocY=; b=BSSnzvryJPUXNtnoGWh7UP/CHzGluoemEUJWBXeb+4f6FOh20dcMAZTdKasw3AnXTf K3L+hO0P5AoaJ3rkVLAFTjjmRadlCjovMfwRus2RwcFDCc7hXgY+6bENHBn0AuL0i9mR V+V3rZMVuoWNMyxDKHEXg2x5yvOxK3pz2ELvqJvjo9bmN4ceima2pANNR6wW9yXMTU9X kdMI0l0EABQtMtq4exxYqR1mpWbi8pe/xocc4ikNzceyju3X3WkbnLha2oYyVXwVIW7b M21FODA9RX8XajklYepNL9rOsZ/x/s9kXw3tPRvLP1puFt+x3sXXewnuPDfqiaCtmtka Mg5A== X-Gm-Message-State: AOJu0YxN54O6tFxLMzIqgQaw9wC/fbHw2ydcf84nAJOnc1LA4yItIFpf r1TgVzQYkcshtgjMknGI9/lpE+j3nhxn+to23xkbrnXdyvHgj1jLuQXN/+qyw3h4SpkMUVvzh9L u X-Gm-Gg: ASbGnctW/6NrBOQANq+EfCuFG57Y/p3wxOgYK+rIfSU5CchYFJrGHdwFpmqcjKAk+ga ALzJxy/TM0zB/UD+OlawrYjZAjn1DiQt5nrmejiLKKZnudqMIwxSPABmTqr7Ag4s/nFY9e8buig mCzolC/TZuMt2aFzWb1nVzPaJGucomtVMNHDQXn8NvCGNE+PfdSl4RMTXjCu3E+9IRxThUtCFXW 4jA4tQcuxTFKOmSdjPOujN+Klpyvml7JFagm97iBmbMzFNeOqNguuTqxpt0JyaLC8BK6AJ9Km9F tPkRNiQqugPuOa9KarNyTSiqM40SGnkpeuXHB258x3UKKS1+/JRwlIIFilYpGQbhElo0po4Ysoa KVaR+Xv57dA== X-Google-Smtp-Source: AGHT+IG0+XOYeLml61p6d8wfvVV3mUhUPGrV89/ZpYefGfRfmkRJgQ7573RcKo/Z/lZaKpVFcwnwBQ== X-Received: by 2002:a05:6a00:e1b:b0:736:b3cb:5db with SMTP id d2e1a72fcca58-73e268ee7b6mr704357b3a.11.1745457562190; Wed, 23 Apr 2025 18:19:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/15] accel/tcg: Merge tb_invalidate_phys_range{__locked} Date: Wed, 23 Apr 2025 18:19:07 -0700 Message-ID: <20250424011918.599958-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457971522019100 Content-Type: text/plain; charset="utf-8" Merge tb_invalidate_phys_page_fast__locked into its only caller, tb_invalidate_phys_range_fast. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-maint.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index e8a465c9ac..67a2570b4c 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1203,38 +1203,24 @@ void tb_invalidate_phys_range(tb_page_addr_t start,= tb_page_addr_t last) page_collection_unlock(pages); } =20 -/* - * Call with all @pages in the range [@start, @start + len[ locked. - */ -static void tb_invalidate_phys_page_fast__locked(struct page_collection *p= ages, - tb_page_addr_t start, - unsigned len, uintptr_t r= a) -{ - PageDesc *p; - - p =3D page_find(start >> TARGET_PAGE_BITS); - if (!p) { - return; - } - - assert_page_locked(p); - tb_invalidate_phys_page_range__locked(NULL, pages, p, start, start + l= en - 1, ra); -} - /* * len must be <=3D 8 and start must be a multiple of len. * Called via softmmu_template.h when code areas are written to with * iothread mutex not held. */ -void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, - unsigned size, - uintptr_t retaddr) +void tb_invalidate_phys_range_fast(ram_addr_t start, + unsigned len, uintptr_t ra) { - struct page_collection *pages; + PageDesc *p =3D page_find(start >> TARGET_PAGE_BITS); =20 - pages =3D page_collection_lock(ram_addr, ram_addr + size - 1); - tb_invalidate_phys_page_fast__locked(pages, ram_addr, size, retaddr); - page_collection_unlock(pages); + if (p) { + ram_addr_t last =3D start + len - 1; + struct page_collection *pages =3D page_collection_lock(start, last= ); + + tb_invalidate_phys_page_range__locked(NULL, pages, p, + start, last, ra); + page_collection_unlock(pages); + } } =20 #endif /* CONFIG_USER_ONLY */ --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458353; cv=none; d=zohomail.com; s=zohoarc; b=cRf2Nn07K2K6Og20pZoeu4VbUjVPngmdXcjqoKZy5p9j+ldEaa4czTF+t0esyYhLgRaA54IkJnrlI8OKXGLxQRh7cvrMB6arVmpvf6Nj7kiGDwaXrwip7MawdMg9y3HCIpqtaiz6Vj8PqW8/JQjeedQZxOQvicaDAGdfvkXGX90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458353; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=yfxlS/j/l5o/48KW68uDDwVYspo4hJz8obcvv8QliPk=; b=QE1mRi1Tx/DVCEakBCjd4ecjxYmhH3wxuqD50YmpfkjVS86cEQpfhmRxtNGq1LOb5q+wlWix1hmCjHYC1Aul+UOZFyFkY0mogZGqOYdvNNQvW/XNhNOrFa5l+3sGCbooF+ctK049xyrr0BcJQTpggHsVReZPiWJetLzQMYK/bck= 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 1745458353301406.2897494484099; Wed, 23 Apr 2025 18:32:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lH7-0006Og-28; Wed, 23 Apr 2025 21:21:13 -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 1u7lFQ-0002hX-T7 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:29 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFM-000792-BR for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-739b3fe7ce8so411847b3a.0 for ; Wed, 23 Apr 2025 18:19:23 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457563; x=1746062363; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yfxlS/j/l5o/48KW68uDDwVYspo4hJz8obcvv8QliPk=; b=hFVCN5jCbk51C1c2nTDsIgKCAT3rNt4RJNQisBF2XLb98wQLo9U+m7MywjY2MwGZBm RHpka7dtaMxk+BxPI8RhTDBNXsFLRC+NiJNXnSdU3/GbYRUcqBFjtitGi4A42dQVh4cL tnp2EFuPLHSdeTcWREQqOP0zZDWiHNsQb1NOUqSl9asjQwOFym8Gy+iKl946e/5hH3cK XZYqH3meX7SmHnDAHmqxXHDbgWhECVCKQE9CQCZumVome3sIMHR8ClWYzeziHCiLrFZ1 tSBwShTZZTTgb8u3g9dAFsHfSrLaRvPbn2t/fsYfnO8717h/ezCisHa73x3JxNhVNa9b 0tBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457563; x=1746062363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yfxlS/j/l5o/48KW68uDDwVYspo4hJz8obcvv8QliPk=; b=T09pIjhJbubkY2Vncu5WIFxRC3wgdkxSEIHdXOQzn0BNONWV11h6ATn/yT5iFEl2Tf Gxt5ZjJflyBS2d0lGnqr4pSsjdO3mKTZZblbA2dqdOXePZi7vGhIjPBbsyERLVY3berZ FtLzfNPlKFC/4YWz8koq1N4RaKAP+j6gEHPWyE0EBfDVT+tgK3IXFEEOAhM/aymq+Pgk x/S6hNr53DwZ3OK58yz9jhh6hPhY/X4Uch7xaMt2hZrqQADRubHAYnFwzUwa9PLwsoar CyUIjLmV4FRk14reejw25dQnDkfqEwtNwCE9StmagBmf2o6K8RTAAEDtPAbllHfp7zhJ YOvA== X-Gm-Message-State: AOJu0YyuTRFipf2V5yTIlxxQNYom17kJuafiL0ztT7bm+42prna/e7Ox 21nEOlZSEIKyLh0vrh29pB1G2cpVYzW16H9HFLYtJhmvbqlaTR+WstDJXCYD4pcn8nJY1cqe34c j X-Gm-Gg: ASbGncv5e2amybHlRSToNxE2/iRP5KunvrOtZUxpyrnIId5fiP8mL8ZdQX8vB4ZcRiG kKNqjgp/76d4dGB/HQqtCI3EgV8X4kPl4l3tNomzIpOE690woR7pvQen4IgxNyftwlW9Hz8iyxL wi2/KpZtwkg4t9l2ZG0Rw0/hxzyxnXhGKknaZH49ZXYadofHx9KbF+j15MEZMSLLMaMXtMTZRo5 8dcuIsF/tOkdwjQZhi0rKkXJFZQdms2O/9X8DCAXetLEIgdy3yvsvxwOLKT8N0PA92319srQlqg /c3yZnP/zzQKg+7m/Lnrz2XY39eHFHFU2wSiJJo8gmjP+9v8oD57jx1/KbsiWgVV97cXe6UbzVs = X-Google-Smtp-Source: AGHT+IHyeRtodk9EHC9rV/l66b0TnDhcE7t9nIbjiP9bplzWVqgkkeCwdvn9r9uVmUGHsJTEDqFdPg== X-Received: by 2002:a05:6a00:aa0b:b0:736:47a5:e268 with SMTP id d2e1a72fcca58-73e245cc687mr1163600b3a.1.1745457562801; Wed, 23 Apr 2025 18:19:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/15] accel/tcg: Add CPUState arg to tb_invalidate_phys_range Date: Wed, 23 Apr 2025 18:19:08 -0700 Message-ID: <20250424011918.599958-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458356260019100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/exec/exec-all.h | 3 ++- accel/tcg/tb-maint.c | 10 ++++++---- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 4 ++-- system/physmem.c | 2 +- target/arm/helper.c | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 944b579d91..bee3416e7e 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -122,7 +122,8 @@ int probe_access_full_mmu(CPUArchState *env, vaddr addr= , int size, =20 /* TranslationBlock invalidate API */ void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); -void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last); +void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, + tb_page_addr_t last); void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); =20 #if !defined(CONFIG_USER_ONLY) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 67a2570b4c..df31322cc4 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1012,7 +1012,8 @@ TranslationBlock *tb_link_page(TranslationBlock *tb) * Called with mmap_lock held for user-mode emulation. * NOTE: this function must not be called while a TB is running. */ -void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last) +void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, + tb_page_addr_t last) { TranslationBlock *tb; PageForEachNext n; @@ -1035,7 +1036,7 @@ static void tb_invalidate_phys_page(tb_page_addr_t ad= dr) =20 start =3D addr & TARGET_PAGE_MASK; last =3D addr | ~TARGET_PAGE_MASK; - tb_invalidate_phys_range(start, last); + tb_invalidate_phys_range(NULL, start, last); } =20 /* @@ -1178,7 +1179,8 @@ tb_invalidate_phys_page_range__locked(CPUState *cpu, * access: the virtual CPU will exit the current TB if code is modified in= side * this TB. */ -void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last) +void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, + tb_page_addr_t last) { struct page_collection *pages; tb_page_addr_t index, index_last; @@ -1197,7 +1199,7 @@ void tb_invalidate_phys_range(tb_page_addr_t start, t= b_page_addr_t last) page_start =3D index << TARGET_PAGE_BITS; page_last =3D page_start | ~TARGET_PAGE_MASK; page_last =3D MIN(page_last, last); - tb_invalidate_phys_page_range__locked(NULL, pages, pd, + tb_invalidate_phys_page_range__locked(cpu, pages, pd, page_start, page_last, 0); } page_collection_unlock(pages); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c007b9a190..9bf8728064 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -599,7 +599,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retad= dr) cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); addr =3D get_page_addr_code(env, pc); if (addr !=3D -1) { - tb_invalidate_phys_range(addr, addr); + tb_invalidate_phys_range(cpu, addr, addr); } } } diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 39b76d9654..2b12c077e9 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -529,7 +529,7 @@ void page_set_flags(target_ulong start, target_ulong la= st, int flags) ~(reset ? 0 : PAGE_STICKY)); } if (inval_tb) { - tb_invalidate_phys_range(start, last); + tb_invalidate_phys_range(NULL, start, last); } } =20 @@ -1020,7 +1020,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, * be under mmap_lock() in order to prevent the creation of * another TranslationBlock in between. */ - tb_invalidate_phys_range(addr, addr + l - 1); + tb_invalidate_phys_range(NULL, addr, addr + l - 1); written =3D pwrite(fd, buf, l, (off_t)(uintptr_t)g2h_untagged(addr)); if (written !=3D l) { diff --git a/system/physmem.c b/system/physmem.c index 16cf557d1a..637f2d8532 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2830,7 +2830,7 @@ static void invalidate_and_set_dirty(MemoryRegion *mr= , hwaddr addr, } if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) { assert(tcg_enabled()); - tb_invalidate_phys_range(addr, addr + length - 1); + tb_invalidate_phys_range(NULL, addr, addr + length - 1); dirty_log_mask &=3D ~(1 << DIRTY_MEMORY_CODE); } cpu_physical_memory_set_dirty_range(addr, length, dirty_log_mask); diff --git a/target/arm/helper.c b/target/arm/helper.c index 7fb6e88630..c6fd290012 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4987,7 +4987,7 @@ static void ic_ivau_write(CPUARMState *env, const ARM= CPRegInfo *ri, =20 mmap_lock(); =20 - tb_invalidate_phys_range(start_address, end_address); + tb_invalidate_phys_range(env_cpu(env), start_address, end_address); =20 mmap_unlock(); } --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457852; cv=none; d=zohomail.com; s=zohoarc; b=QxPMw6q7zVxTM8kBFXayFJdGm7Hr8yEctAur0XLjUyWWqwRWfp2T2vJNMCNoWQc5JBUdLv2CBCGqtSkuWxXSLODzbQN/4FMqxL1fLbKhBqOI97Qyq46GEfMJI7RsT+XIaPxo0y9B1gdttct7wbjsWCEqoaqDqEibicutT2RgAdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457852; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=tkF0mLdUKamGU6WMR2w37sZaplycdM+4ocMcKEopH7U=; b=XHXWOFWgldTpcAXNO7k2ZCFAGWG+uESNfHT7ydiNzXqGl6pVwt2Mrig45dy9SuEB4PNphjCGmWiyfapMAthJQqfkC6xsoQHl5obo6rWhY2u6q9hxzNotYxMsVVD1EUjAwtMljasJILuEvMZXg9rAUHntTUwDXE7z03eXPDuEPmQ= 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 1745457852963492.8111543100051; Wed, 23 Apr 2025 18:24:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGz-0005cl-Er; Wed, 23 Apr 2025 21:21:05 -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 1u7lFQ-0002hY-Sy for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:29 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFN-000799-Dm for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7398d65476eso372904b3a.1 for ; Wed, 23 Apr 2025 18:19:24 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457563; x=1746062363; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=tkF0mLdUKamGU6WMR2w37sZaplycdM+4ocMcKEopH7U=; b=zySMuK7kL+9uY1NwsSZ3SVXC2aDPpquSLIhPfxne7pRjvqOY82iCskKw5hXf6WjfrW sJM0y0CAAyHeKJPkrvAFXKxRJjnPH0hiD+ypscUaX334OCZMe9DBhnI2dCLZpku5jYR2 Du5S80cz+azHJ7VqDcVGtxLd2o6GMXr09z/TItxpG1F8faYehvgEIByKZSVWhXPoz000 SBQNYaldBG09XHrm6D5qjV27y+rw0oV3vjxUcSyQBm2SkHtD9xyaVQwnht0LGTtCkCfP M9nYiZ0D33LxZNiXkZbqeCgsDnjTJUKTUnoo0novJQwWUYrAZwwVW9ZJrTQX+ntIaib1 xhkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457563; x=1746062363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tkF0mLdUKamGU6WMR2w37sZaplycdM+4ocMcKEopH7U=; b=B4iKLZuOHq6PQOuBJbqLyUDBFjTO4Dycy/2U66OG/z1+b/0FP+iQ80P58kSJUZCF7t xK5czP8cobY8eLg252ZvroUMQjc/NWHfv/zhdHGGSb4YSb5N9gRQ2fQWq/aTfwvC4a0g ZI0YlN3Z4yqQHTqT/0C6rGAiAp0U1mJScLqAK+SyPeAQ1czvHTIEasI8qBmPkoagUU0h YyrSyFcBCqA3n1Aa4uDBqaVZI5YQJtEiLFKyZfL3LDgKH1L11mkhApB9UbDs/3KYFJw9 0EoqRls1IUPUXliC7VDMjNYlqfPIXTQAIDTo35NKSuYidm2ODQzWzXNMbwLDrxZDKOB9 d1UQ== X-Gm-Message-State: AOJu0YyJh+abhPVVTx8NCr4cJN/m6aGxIzATuUgmiA3BwlDVXfgpyhpa yHl2emVR+cZjadX60fAd8boN9xNSOuutMfdIC46z5u/n+lQpfNJ8T8Q7xyFT4ABjhcgZvt1zjh8 p X-Gm-Gg: ASbGncuS7cI/b72pZN2l3mzXHaqXjSsyFvPnAKgawDECjZLms+3xWnZg7MjVWTvdyH0 VIj32WWPVnH+0nl+qSeXlwJnzojun+PrYNJ71Es+vt6kktkiE1/LyKMSB1nbj62q3dC/qw0enTX z0jObsobVKsXwl8EIiDp3D1DKEcdqlROT66j21ka2hhLuUaBWrCdzUuNLKC/t+r7g5i4IB/oQsX VjSwWQ4GYWjfqHa2GQJEO4vHaXlQaQd7wZA25+nzw6qMf7ZsVXIeXH134XfvJAxl0rAgS654jLr zMqlWFlK3PhejL5QHPUp60yXk2wDSDBj6RVR9TfxT3p01RvkC3V8RfunMJuSLlSQW+rU/cnQ+Hg = X-Google-Smtp-Source: AGHT+IHwSXdxPt1j3PypzRQD84SRNPlQ1hqKRO+QXQPlCb87JYg18gKUsb/KS6zV2Pe8EisxO02uOw== X-Received: by 2002:a05:6a00:3911:b0:73d:fdd9:a55 with SMTP id d2e1a72fcca58-73e2680bcdamr774368b3a.8.1745457563419; Wed, 23 Apr 2025 18:19:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/15] accel/tcg: Add CPUState arg to tb_invalidate_phys_range_fast Date: Wed, 23 Apr 2025 18:19:09 -0700 Message-ID: <20250424011918.599958-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457854713019000 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-internal.h | 5 ++--- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h index 1078de6c99..40439f03c3 100644 --- a/accel/tcg/tb-internal.h +++ b/accel/tcg/tb-internal.h @@ -45,9 +45,8 @@ void tb_unlock_pages(TranslationBlock *); #endif =20 #ifdef CONFIG_SOFTMMU -void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, - unsigned size, - uintptr_t retaddr); +void tb_invalidate_phys_range_fast(CPUState *cpu, ram_addr_t ram_addr, + unsigned size, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ =20 bool tb_invalidate_phys_page_unwind(CPUState *cpu, tb_page_addr_t addr, diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index d9fb68d719..ed6de1e96e 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1340,7 +1340,7 @@ static void notdirty_write(CPUState *cpu, vaddr mem_v= addr, unsigned size, trace_memory_notdirty_write_access(mem_vaddr, ram_addr, size); =20 if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) { - tb_invalidate_phys_range_fast(ram_addr, size, retaddr); + tb_invalidate_phys_range_fast(cpu, ram_addr, size, retaddr); } =20 /* diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index df31322cc4..345a7a473a 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1210,7 +1210,7 @@ void tb_invalidate_phys_range(CPUState *cpu, tb_page_= addr_t start, * Called via softmmu_template.h when code areas are written to with * iothread mutex not held. */ -void tb_invalidate_phys_range_fast(ram_addr_t start, +void tb_invalidate_phys_range_fast(CPUState *cpu, ram_addr_t start, unsigned len, uintptr_t ra) { PageDesc *p =3D page_find(start >> TARGET_PAGE_BITS); @@ -1219,7 +1219,7 @@ void tb_invalidate_phys_range_fast(ram_addr_t start, ram_addr_t last =3D start + len - 1; struct page_collection *pages =3D page_collection_lock(start, last= ); =20 - tb_invalidate_phys_page_range__locked(NULL, pages, p, + tb_invalidate_phys_page_range__locked(cpu, pages, p, start, last, ra); page_collection_unlock(pages); } --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457683; cv=none; d=zohomail.com; s=zohoarc; b=Jqyik5O5CW3Vaef6t1uWyT3VtgJod0Kz1qnjgZuCz86qnJyId/jzQmvFZ41maJwzZd3hF8ZyCwIElhKu4ioVVJPfdMH30ejauOkCoiGRxrMenwaSvjlHT9mtyqiwCyxGvvIQI4QAn7vaGNZjq3XveIeH2KBFz17akxiKsLH/38k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457683; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=eZtOoGV0Bg9Le+zLQ/C2D+0pnwsAfg8z9TKrAU/gNUw=; b=n/RlE3xY/t/2MREnCMDzUI0XsM7il3aNLR8qzj872LgXdVatjKrZJaf19cckuEsJilxyMkGGvfdMDGLr3YNdLNACld9/aYzCOAWLjYX3/m7/kZpafw31iZ1lBhV09/DDW5Ja+s9IG1v+saFh0BVp3FOKaYOklnjm+GD1xVzYW68= 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 1745457683274950.7560917843512; Wed, 23 Apr 2025 18:21:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lFm-0003Cs-Ve; Wed, 23 Apr 2025 21:19:51 -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 1u7lFR-0002i2-BU for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:30 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFN-00079L-Nb for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-736ab1c43c4so379265b3a.1 for ; Wed, 23 Apr 2025 18:19:25 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457564; x=1746062364; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eZtOoGV0Bg9Le+zLQ/C2D+0pnwsAfg8z9TKrAU/gNUw=; b=Oa2IOWcDTGy5ZmvwZj71+q18dbQF+VkKDLfAy6huNYI7DKjQzCfAC44fyiUSxCVNII hujQiZyDDTOQU+y8+zPIKL+ndd8VFmW9vMUF4I8hKh9scm5twFwbJib3wvRIWK8QTdXl O6woEXCRa0S2awqMvWIa1ZxX3crs3SkMWrBi5BBEBturnRw/GuBzRhl8lDM9Sqm9RIeY HeOZIhgvzW5iuozBh64fjvvI8y9z0zTnAnyDIEKxuUPt0/Wk3n8Kt4s2ES1Le36CB5Ek qWIlv0DU17vejsy2MJ7c6MUI9Gmm7Wg2+yzu99h3HPjM5F73ekkYqI/8mAYhRqlxzaJC 8D8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457564; x=1746062364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZtOoGV0Bg9Le+zLQ/C2D+0pnwsAfg8z9TKrAU/gNUw=; b=Iu6EiulOS6rVNncO5L/Hko2mcnpNlSUpqKin+S/AHLowA8HmTbc/AGReC0pxlMTzOd GJZmC36VUyug8Os7nUlY+1h9q/jRJ2po5VBoGEwG7a4iYT74Hi/WQ4tfexWgiYSw4Jcj qMoQO31m2iaRyxzIStHLxY5RwSK5KReAdFAh+Mp5Skpf48OoaHRXsE6tgNJtsLUmGUVA 8AhYuF5UBL/KEMA4M5U0x4TfUHkhJawE7KBvoR6GiR24s5vUjjfMwNKloRIzXrANOiQY 1bLCN7A4eSye+QCrTg8A3/Ev1cjHRfSc3DY8bhYG1jDcXI/fubOs4SW22v2LEHaOqCK2 gdfA== X-Gm-Message-State: AOJu0YwNRQzkYCCgmsiN0yQTlBch44TsuVBmbK2P5Jf3GwzhuWIEippn LFE1ysHIIxu4JPInZPU2mpxVP9Zy0kGUXt8gZ/Aw+k9hIHjsakGDVsRs7Z7/X0M0U2XeiF2jgt2 F X-Gm-Gg: ASbGncskl5f/D1lTNjD/KWaOkfSEStzGrbXIWwKfTy/H+fsIY7p7ZanqhWS9Cy1TLBa ZkJYNRJcbXbPMmxecJja0eJFR/z2v3db+aAFdEklMZ2EAo4Afq0RArmHIW68zZ8SW5U/yi4gc9p jM5pVE2rpYMUWiIpmxAlKrCUA4O9g11gSCFbLGcxxgGk8+c74nMgx6AIsyCKGiDnocdvBy/rNSa AslcEiZlIayRyHb1zjUPMFIQIINlQaT/d3WEOyfHB/aGBcuKhiSpKvWHvc0WLqf+3Y8lIaiCNvZ CJksMLLDClol+Wnt2xs74+EEPXAEFUJBZKFbk5YlKlkSPHqvjwTS9PU8LYCi+SbI+M6MLXwzXcZ zmNJwppRsnQ== X-Google-Smtp-Source: AGHT+IFqhq+fqTmhvPHuuhokaa9IT8RywlLv27t8VQ5rZtPZOS5kYePX/6E366qrk9vVhIdTDH696A== X-Received: by 2002:a05:6a20:9d8e:b0:1f5:58b9:6d9b with SMTP id adf61e73a8af0-20444f003bbmr936975637.12.1745457564046; Wed, 23 Apr 2025 18:19:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/15] accel/tcg: Convert TARGET_HAS_PRECISE_SMC to TCGCPUOps.precise_smc Date: Wed, 23 Apr 2025 18:19:10 -0700 Message-ID: <20250424011918.599958-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457684399019000 Content-Type: text/plain; charset="utf-8" Instead of having a compile-time TARGET_HAS_PRECISE_SMC definition, have each target set the 'precise_smc' field in the TCGCPUOps structure. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/accel/tcg/cpu-ops.h | 7 +++++++ include/exec/poison.h | 1 - target/i386/cpu.h | 4 ---- target/s390x/cpu.h | 2 -- accel/tcg/tb-maint.c | 32 +++++++++++++------------------- accel/tcg/user-exec.c | 10 +++++----- target/i386/tcg/tcg-cpu.c | 1 + target/s390x/cpu.c | 1 + 8 files changed, 27 insertions(+), 31 deletions(-) diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h index 0e4352513d..60b5e97205 100644 --- a/include/accel/tcg/cpu-ops.h +++ b/include/accel/tcg/cpu-ops.h @@ -28,6 +28,13 @@ struct TCGCPUOps { */ bool mttcg_supported; =20 + /** + * @precise_smc: Stores which modify code within the current TB force + * the TB to exit; the next executed instruction will see + * the result of the store. + */ + bool precise_smc; + /** * @guest_default_memory_order: default barrier that is required * for the guest memory ordering. diff --git a/include/exec/poison.h b/include/exec/poison.h index bc422719d8..a779adbb7a 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -37,7 +37,6 @@ #pragma GCC poison TARGET_NAME #pragma GCC poison TARGET_BIG_ENDIAN #pragma GCC poison TCG_GUEST_DEFAULT_MO -#pragma GCC poison TARGET_HAS_PRECISE_SMC =20 #pragma GCC poison TARGET_LONG_BITS #pragma GCC poison TARGET_FMT_lx diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 9866595cd0..877df7de1f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -35,10 +35,6 @@ =20 #define XEN_NR_VIRQS 24 =20 -/* support for self modifying code even if the modified instruction is - close to the modifying instruction */ -#define TARGET_HAS_PRECISE_SMC - #ifdef TARGET_X86_64 #define I386_ELF_MACHINE EM_X86_64 #define ELF_MACHINE_UNAME "x86_64" diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 90f64ee20c..ee59039879 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -35,8 +35,6 @@ =20 #define ELF_MACHINE_UNAME "S390X" =20 -#define TARGET_HAS_PRECISE_SMC - #define MMU_USER_IDX 0 =20 #define S390_MAX_CPUS 248 diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 345a7a473a..581d06ebf3 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -28,6 +28,7 @@ #include "exec/mmap-lock.h" #include "exec/tb-flush.h" #include "exec/target_page.h" +#include "accel/tcg/cpu-ops.h" #include "tb-internal.h" #include "system/tcg.h" #include "tcg/tcg.h" @@ -1042,9 +1043,7 @@ static void tb_invalidate_phys_page(tb_page_addr_t ad= dr) /* * Called with mmap_lock held. If pc is not 0 then it indicates the * host PC of the faulting store instruction that caused this invalidate. - * Returns true if the caller needs to abort execution of the current - * TB (because it was modified by this store and the guest CPU has - * precise-SMC semantics). + * Returns true if the caller needs to abort execution of the current TB. */ bool tb_invalidate_phys_page_unwind(CPUState *cpu, tb_page_addr_t addr, uintptr_t pc) @@ -1059,10 +1058,7 @@ bool tb_invalidate_phys_page_unwind(CPUState *cpu, t= b_page_addr_t addr, * Without precise smc semantics, or when outside of a TB, * we can skip to invalidate. */ -#ifndef TARGET_HAS_PRECISE_SMC - pc =3D 0; -#endif - if (!pc) { + if (!pc || !cpu || !cpu->cc->tcg_ops->precise_smc) { tb_invalidate_phys_page(addr); return false; } @@ -1113,14 +1109,16 @@ tb_invalidate_phys_page_range__locked(CPUState *cpu, { TranslationBlock *tb; PageForEachNext n; -#ifdef TARGET_HAS_PRECISE_SMC bool current_tb_modified =3D false; - TranslationBlock *current_tb =3D retaddr ? tcg_tb_lookup(retaddr) : NU= LL; -#endif /* TARGET_HAS_PRECISE_SMC */ + TranslationBlock *current_tb =3D NULL; =20 /* Range may not cross a page. */ tcg_debug_assert(((start ^ last) & TARGET_PAGE_MASK) =3D=3D 0); =20 + if (retaddr && cpu && cpu->cc->tcg_ops->precise_smc) { + current_tb =3D tcg_tb_lookup(retaddr); + } + /* * We remove all the TBs in the range [start, last]. * XXX: see if in some cases it could be faster to invalidate all the = code @@ -1138,8 +1136,7 @@ tb_invalidate_phys_page_range__locked(CPUState *cpu, tb_last =3D tb_start + (tb_last & ~TARGET_PAGE_MASK); } if (!(tb_last < start || tb_start > last)) { -#ifdef TARGET_HAS_PRECISE_SMC - if (current_tb =3D=3D tb && + if (unlikely(current_tb =3D=3D tb) && (tb_cflags(current_tb) & CF_COUNT_MASK) !=3D 1) { /* * If we are modifying the current TB, we must stop @@ -1149,9 +1146,8 @@ tb_invalidate_phys_page_range__locked(CPUState *cpu, * restore the CPU state. */ current_tb_modified =3D true; - cpu_restore_state_from_tb(current_cpu, current_tb, retaddr= ); + cpu_restore_state_from_tb(cpu, current_tb, retaddr); } -#endif /* TARGET_HAS_PRECISE_SMC */ tb_phys_invalidate__locked(tb); } } @@ -1161,15 +1157,13 @@ tb_invalidate_phys_page_range__locked(CPUState *cpu, tlb_unprotect_code(start); } =20 -#ifdef TARGET_HAS_PRECISE_SMC - if (current_tb_modified) { + if (unlikely(current_tb_modified)) { page_collection_unlock(pages); /* Force execution of one insn next time. */ - current_cpu->cflags_next_tb =3D 1 | CF_NOIRQ | curr_cflags(current= _cpu); + cpu->cflags_next_tb =3D 1 | CF_NOIRQ | curr_cflags(cpu); mmap_unlock(); - cpu_loop_exit_noexc(current_cpu); + cpu_loop_exit_noexc(cpu); } -#endif } =20 /* diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 2b12c077e9..112292b729 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -733,12 +733,12 @@ int page_unprotect(CPUState *cpu, tb_page_addr_t addr= ess, uintptr_t pc) * this thread raced with another one which got here first and * set the page to PAGE_WRITE and did the TB invalidate for us. */ -#ifdef TARGET_HAS_PRECISE_SMC - TranslationBlock *current_tb =3D tcg_tb_lookup(pc); - if (current_tb) { - current_tb_invalidated =3D tb_cflags(current_tb) & CF_INVALID; + if (pc && cpu->cc->tcg_ops->precise_smc) { + TranslationBlock *current_tb =3D tcg_tb_lookup(pc); + if (current_tb) { + current_tb_invalidated =3D tb_cflags(current_tb) & CF_INVA= LID; + } } -#endif } else { int host_page_size =3D qemu_real_host_page_size(); target_ulong start, len, i; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 621502c984..d441c0752e 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -126,6 +126,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) =20 const TCGCPUOps x86_tcg_ops =3D { .mttcg_supported =3D true, + .precise_smc =3D true, /* * The x86 has a strong memory model with some store-after-load re-ord= ering */ diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 41cccc1e69..e3623ad32a 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -346,6 +346,7 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, =20 static const TCGCPUOps s390_tcg_ops =3D { .mttcg_supported =3D true, + .precise_smc =3D true, /* * The z/Architecture has a strong memory model with some * store-after-load re-ordering. --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458355; cv=none; d=zohomail.com; s=zohoarc; b=iyEToCzXh76qqQux60O4u8mDouPOhBei/qQaCh5g9/iGhdTJQJUSc0lQKxTZpHu9ZgJPEKpIVSTAHpP/v2fvViSfJWGeB+FBckTPzHVk8GqA1o2S1VpXWJJplbTDya2yyisXUnfLzXBarHSF9ElhnenNnI1IxyxLQ2o+HSse7ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458355; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=JhhILi6kCl6QHk3rZPaZJbYqQ/dafTh8uv7kqMAXi2E=; b=RNQSO6Sb8PXTxXIuO67i/9qBk+sjd0kplCmQCPGFvJVM4t+fmxrJdPopcwC8a55lQ9e1zmU49XhFlLTxlYJRsZ4a5ofyjc3wkvi5FIZByW8qkijkeWJDDb3fRtRwXZJYrzOyR/b8SF46D/NLUi5UIWeG5PzjJez4qOpoZ4b6H6Q= 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 1745458355654736.9277183054612; Wed, 23 Apr 2025 18:32:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGO-0003vC-OG; Wed, 23 Apr 2025 21:20:29 -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 1u7lFR-0002i4-Cv for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:30 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFO-00079c-7W for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:28 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-73bf5aa95e7so382384b3a.1 for ; Wed, 23 Apr 2025 18:19:25 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457565; x=1746062365; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JhhILi6kCl6QHk3rZPaZJbYqQ/dafTh8uv7kqMAXi2E=; b=eIXQcSiSNwn2JhGfNF+ROGiFl7miMq6PSoMcPX1RrTMWs/K/LwJD3O2P5asHo5HIex eYZ8MNao0klwda83QxXjEn4bB0VdRQlCF25mi+FkOXylnVWdBCWHAu+uNWjwBmIkcdg4 M6l7p2TLTitV1xiWo+pj7IOmHUOZrHDdVcnkHBtY3OXk9ygCoc9Jxd1vTopt5M/Zlftq gzrmQ1EpYXlxPsHq6x5algak92/gyd2NEKxfcajoThwWfUvRulepJvzSCDmejh7+4CNV NprJVGX9yWbmjk5BBaspwnmzb2bJnVIGP4VKrdbZ3t7vo0wwW+HHT2mp5GhVNZWlmUEt t85Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457565; x=1746062365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JhhILi6kCl6QHk3rZPaZJbYqQ/dafTh8uv7kqMAXi2E=; b=XK76tW9v34PCidFRhQJlS4YpZ0IGPMwUzOxLizkyzXtRGMS4nER72Mf+s26uaDFkTC AKv23ZPA7k1pQrpDVF8m/Dgnx6gGmlAXSu1kYg4l07pfKh3kxz5bOaYikApldoQGnfux M/Ep+FMr9lalskXaABoUp/b7+C8kyTd6JwnA5kRbhYumqtZSHRKxuIjU+7RZ5YXAdQG5 /wlH8Acnfel1IEOmcjLVECRZe498GG2jEr9+x53ZuAl5Rit9RkyAWIXWnRvsf4NfmEYA v9dIIPbjcXzvBc7R+AdiYaSSXa28ppR6NUuSpTZP/QCjbplk1scl9pKdjfKDmCFmPMj8 7q1g== X-Gm-Message-State: AOJu0YwBjOG4/bHp6GknzpJEmzRLCbRq0kTPmqgsL8nsTEE08p7wWLQd 4zaYnQ/AzaYRKi6wI6rO/z7DWZ1MhADXfWPgE76n8kH1P6XHUaWSGwPkhPUl4fbVGPyGX6rC0Gx t X-Gm-Gg: ASbGncswz4MpnPL2/2J84i6CyPm3ir23TKciegtdeC0YkVQJIdH/Uw2rXGRsBTQL7lw YfEtl4S6gudF813xqlsX/Id2TUGFqN9CbQJtMp2oAAtjgmdqACJ/Zv5vWkSfC9pPSdiJNZsumkX o9t2Mf7bPZJoSqLlQByMGSmOnnu3WAnI4y8nv1TnPYI0YxQpiblDcbn5oVRQmr/NKm5ch7VOGUa 9S7el1b6OVm22iEHy5zGDS7U3WDwNJf44ki8vLXdoYz+4knn1U0pISsWtaEEqy3Qch5T+zT6Fj1 jPQHG+ZHhuCuJ+9e7mseh+oSGY0Cv3GVGJu9ekufPqrmILVc/0FgOHgX73h/s55M1KEvuQ0kv8Y = X-Google-Smtp-Source: AGHT+IEbm3rotnea/g+7em2IQXJmJth92d/NknR4nMT4uPw0WmXL9wwC6p5clcgQ9gqp7AsrPUU89A== X-Received: by 2002:a05:6a00:1410:b0:739:4723:c4d7 with SMTP id d2e1a72fcca58-73e24cfa1d7mr1135199b3a.22.1745457564653; Wed, 23 Apr 2025 18:19:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/15] accel/tcg: Simplify CPU_TLB_DYN_MAX_BITS Date: Wed, 23 Apr 2025 18:19:11 -0700 Message-ID: <20250424011918.599958-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458358254019100 Content-Type: text/plain; charset="utf-8" Stop taking TARGET_VIRT_ADDR_SPACE_BITS into account. Since we currently bound CPU_TLB_DYN_MAX_BITS to 22, the new bound with a 4k page size is 20, which isn't so different. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/tlb-bounds.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/accel/tcg/tlb-bounds.h b/accel/tcg/tlb-bounds.h index efd34d4793..f83d9ac9ee 100644 --- a/accel/tcg/tlb-bounds.h +++ b/accel/tcg/tlb-bounds.h @@ -7,26 +7,7 @@ #define ACCEL_TCG_TLB_BOUNDS_H =20 #define CPU_TLB_DYN_MIN_BITS 6 +#define CPU_TLB_DYN_MAX_BITS (32 - TARGET_PAGE_BITS) #define CPU_TLB_DYN_DEFAULT_BITS 8 =20 -# if HOST_LONG_BITS =3D=3D 32 -/* Make sure we do not require a double-word shift for the TLB load */ -# define CPU_TLB_DYN_MAX_BITS (32 - TARGET_PAGE_BITS) -# else /* HOST_LONG_BITS =3D=3D 64 */ -/* - * Assuming TARGET_PAGE_BITS=3D=3D12, with 2**22 entries we can cover 2**(= 22+12) =3D=3D - * 2**34 =3D=3D 16G of address space. This is roughly what one would expec= t a - * TLB to cover in a modern (as of 2018) x86_64 CPU. For instance, Intel - * Skylake's Level-2 STLB has 16 1G entries. - * Also, make sure we do not size the TLB past the guest's address space. - */ -# ifdef TARGET_PAGE_BITS_VARY -# define CPU_TLB_DYN_MAX_BITS \ - MIN(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) -# else -# define CPU_TLB_DYN_MAX_BITS \ - MIN_CONST(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) -# endif -# endif - #endif /* ACCEL_TCG_TLB_BOUNDS_H */ --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457916; cv=none; d=zohomail.com; s=zohoarc; b=UJpUKwrI2xkz2BazO15SxBI5nqMLcdLoKY9SBvAfo2x06Bs8yI2q/+YqPovtlfMcqb91mHzYrfH4MbQlIOxG3epo/nwu4SThCPifiJg5Lw9rQmVRP/LUMcwx3nDjKtsRBpf328P+q7u/eqsOmmA9/H0tXWGTfaOP1Fc67lDtvaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457916; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=lN8U4pCvani3EVxhH+Cp85aPQAK2No9bOUG5l7LfXn8=; b=MHiwzIxxgwTTXRaqtyEx9VG5k99hWD7kFVwILc4/WEs4D6XdEZ/pK49kmj9vbmheU4UKwfsOoxzC3dhaXWVMiUzPAiEflu2B8EkAwAR4pjKeQCjOVdxLwDPMLt0aVmunzP7QusR8vXI2G3Jg0QBAbKLgkwtPulSNWZEv15LyBjg= 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 1745457916649381.5933234769019; Wed, 23 Apr 2025 18:25:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lH6-0006NU-PQ; Wed, 23 Apr 2025 21:21:13 -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 1u7lFS-0002kA-At for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:32 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFP-00079i-V8 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:29 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-736a72220edso432243b3a.3 for ; Wed, 23 Apr 2025 18:19:26 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457565; x=1746062365; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lN8U4pCvani3EVxhH+Cp85aPQAK2No9bOUG5l7LfXn8=; b=bHeTss/SfJBByix4nrUnbHqSMbOb1RTIk7Ecfw1H1zoY3sAJgjMVmYF3/Nj/XAZ5NO vP2gxpVdCt1h1Mbc5+OVk+5iMTy4bUR/uGhT6OqCadz4KOABswgHf3MVZK/QrIRm35La evwkEtMkPdwa7GezG8rLQEwmKUilyIkuWpXKQ6GRnQijSbCXqPCc4oQorb9IL5h8CReX SHgbYaN8m/rH2I3K3AmgJ4sB9DLsXoA/Lzd8CIG4t6IISxuPxgcx67yNa18B12Ibw9zi RyzZK3gFnurzZeAbdBQrigKhSjL7wUglzH9pcqP7PR1bxdart2GskveMyqotjVdNfpYl WRgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457565; x=1746062365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lN8U4pCvani3EVxhH+Cp85aPQAK2No9bOUG5l7LfXn8=; b=GVTdOF0f4iiLpEC2hiOhPK3zH2CJkq7gxcYJ3kAyp34A6JLAV/72LY0x2PTBh2/ex1 qTFAZxuZt9Pm01pnay79wRWmm63X6NMquxjqa4rLAjRHgbAUK9Gz82pD33AX69fUWCDZ 0fqfGzde/sce40f6jwAUW43kiQF0HiLyCqaPROgl5+kaygRyL4lrwqzM3bYGTRDwJEdy OFwANJpS1/xsC3jhZobJxXHSca2MGWpLZZ++8NOz2IvCpOwNN+mxcT/TVM+HgyoR5fu1 72ErNhy36Fs/9wAfq2wVdeu9+4ofYqhU89BIMttugLVjK1NitflEs1DwAlHINzW+ocsb ph9w== X-Gm-Message-State: AOJu0YywIx5btksfm+jpIlpWjI5cX4WQmCTY+0S6MUzuBAO1Sn+nsAwq ZP6sCUwSFRTSnL6aOaoIuCoOkxvV58NtbRswe3Sy/7PcJVuo9bl+4Oxvc9vy64rjRZeUBYhUTWE s X-Gm-Gg: ASbGncv39ktSRv15Ce8UqMv3CZ7Uwp8SxcbHGY/Cumz0k3tFdQ3shvSOeYmE2OufqVn gOA/jiG2XmVpXMMFkn3XCLKTGEaMCyWV/TxzDYRiXA4n/+bXQdc4+uabktmBpRrt1A5ziHnPpZu 3oiE999YTH6rPa4sgHHsj/Fy7ACTp83PVknibxWeRCNbj86p00h57pjHOKw9PquAUfjkCm4oB+j Ys7ELMK7Cd77+klFP/j+g7EX99H9+fTFYQewKgdtj/kmOHZW90MbJwqZaob7rHIag/1NXP1OhuO rUOWccwjURNwzHR6RyWoDLCvOp0Vfpi8cHtmnSPHvyAw1y0vAr+sRSqRAGrjaaGOWw5V1COJ/Uk = X-Google-Smtp-Source: AGHT+IFWZjr2rSRh3faFqc8z/jLEjTjptxTwUWnR16rA+g+PIxWdy97x6nRpAejvfXAQlnGDDmXLCg== X-Received: by 2002:a05:6a21:181a:b0:1f5:9cb2:28a2 with SMTP id adf61e73a8af0-20444ebe192mr921198637.19.1745457565253; Wed, 23 Apr 2025 18:19:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/15] accel/tcg: Simplify L1_MAP_ADDR_SPACE_BITS Date: Wed, 23 Apr 2025 18:19:12 -0700 Message-ID: <20250424011918.599958-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457917115019000 Content-Type: text/plain; charset="utf-8" Stop taking TARGET_PHYS_ADDR_SPACE_BITS into account. Simply allow the entire ram_addr_t space. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-maint.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 581d06ebf3..f43f5342a6 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -160,11 +160,7 @@ static PageForEachNext foreach_tb_next(PageForEachNext= tb, /* * In system mode we want L1_MAP to be based on ram offsets. */ -#if HOST_LONG_BITS < TARGET_PHYS_ADDR_SPACE_BITS -# define L1_MAP_ADDR_SPACE_BITS HOST_LONG_BITS -#else -# define L1_MAP_ADDR_SPACE_BITS TARGET_PHYS_ADDR_SPACE_BITS -#endif +#define L1_MAP_ADDR_SPACE_BITS HOST_LONG_BITS =20 /* Size of the L2 (and L3, etc) page tables. */ #define V_L2_BITS 10 --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458202; cv=none; d=zohomail.com; s=zohoarc; b=VCO+s+fYqPc3vzuC8YaNTH/kepkgynMsFZb4KKKORZGBrpaMx+lb2qsMWX09A5p+84MuYpQBIMMRZgtipEf5e77flePTNOi+6Mi9V12lensJS7YyZkvyM73pCPx8ZICI1bjdecUOVGSCqxfo0GcHz/Ip0YziKfhSC9FBPi/3dCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458202; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jtt7Oh++1fV+Vh2SgiqUZ2mBLC6qZ0dag5VMp1U8aEA=; b=QGT11QqjrEa4jblc5/jxlj/4jHN3niFjtItyQbtB86yUfeDmGtkP4+K46JrBAEzbr4wnNe/bIfZAC7pLIPPAb50A9I2tA0nHY47l5HFKqjEclx5rZLJBm+yI9/eQ7dMS9xzrWyaj6cwejzTiBk19JSazHf0OV+ZAn0Dn7yHk2MM= 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 1745458202238169.00046529259134; Wed, 23 Apr 2025 18:30:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGt-00056r-7G; Wed, 23 Apr 2025 21:21:01 -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 1u7lFT-0002lV-36 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:33 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFQ-00079v-0G for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:30 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-736c3e7b390so385201b3a.2 for ; Wed, 23 Apr 2025 18:19:26 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457566; x=1746062366; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jtt7Oh++1fV+Vh2SgiqUZ2mBLC6qZ0dag5VMp1U8aEA=; b=fXv9L5kU5qBcxXFanRDYBVw91WhpnqfwSWMYExouvTP3q712KZv5nEgOhcM6O0eDw/ wDUWdV2lqjdmMAQ26hOW89qLiDJV+uk9hT8gnWzzCvDeX0SMyKMw7suDAqDKdDcqIWSH dUSEe88LazlQ3JOB4Sudqr3FsKigrYgjOv6OjlyJwapMwTFVCmYMC56j4deSznOgb9HU EL5/2ddLn8vyWUrR4KwOYw8nIHJ2hWqE1RsLG1Zfb8fqRl8VFcVZcFPEHweOQdb94M5K Yn8mKTDaicDYDOGMyD42BW0lQ9UpGfugF3ZadoaGBp1DZfRGJq7BTKZOSTZMmBJxlLki 7ybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457566; x=1746062366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jtt7Oh++1fV+Vh2SgiqUZ2mBLC6qZ0dag5VMp1U8aEA=; b=cz3SVYFtYw72AvVoVVu9C7IhybNkz2f8dv51VKrZax0Ne/9by6GPzCJJlIxHfhaqhW /sj+XTgYxFUTgfU8DXC7MBHsfSTiK0mTikq4u0kl/NQ3Kz6hBpG1UR0IXt/NLHGmJCOr CPi7F0g4kGHeZaHbpMAUCYbiay7Hcqwdq/9xZqi4i7LJZFd2Y+ySkWTXmgYT52mnOBqQ a6oZfL678wanQ3TEzgJC2TAcM0bOxxhLurUvs6OIU5dH/L79pbLy0jxGR+RKwlzmXoZS 5bmBWgHRE5nDia3MPPDNH8o/SPUO+L9NlsjNB2zpqEP7TVICgd/SalgY4cfypbxz2Mch kBjQ== X-Gm-Message-State: AOJu0YwWwAbN55fRtzXxlIklFSmA5utNq2B9cE1jpcZlCg4mGLHI7qBq x+Y9gZ+vyIW/3KIxVsNPamUHti8FaCltLOZTLxIBgw2j+4drtD2PHlFB5Ihhg8EDaRtOH4xzhxI d X-Gm-Gg: ASbGnctOagNgHECspu1ZVk29wsS2z8JpKDmrLcodZ0q4WQEy/xr9JrBQH/fRbHjd5PZ 26PwpkVeFQE/oqmTDc0W4eXbH9hVraNykEgsEQUhRU/jDn3lcjLdW7qpvimVbpolIldDh+pjWWT lY1T1CMxv0Vrm9Eelf/U2YyuDCWERaYMfrGtJNxU4LrAdYMLOBmgw2fjZo/YT9rZkgpHPYAN+GG uw7aIcdQKDs4T00BznBJ1jVv6ZH87IC7t4ZEsXi0oleS7czh+9zAPYXrQqmea7WuxbASGxe1gVd VPdLkz5MrifiLJ7iaROtnhGyHhcLG89xRevKtndG4T37PmvtUxKpxhc7gPPL61XLmE31a/L+gpA = X-Google-Smtp-Source: AGHT+IFmYAB/pkkO231HW+jR7UBi7MWJXDoJhPRTSm5V2fS7MTPLAhRlZSmMHo4VFpqwMzE/De9Lug== X-Received: by 2002:a05:6a00:3a22:b0:736:32d2:aa93 with SMTP id d2e1a72fcca58-73e24cfa09amr1267586b3a.20.1745457565871; Wed, 23 Apr 2025 18:19:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/15] accel/tcg: Merge internal-target.h into internal-common.h Date: Wed, 23 Apr 2025 18:19:13 -0700 Message-ID: <20250424011918.599958-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458203982019000 Content-Type: text/plain; charset="utf-8" There's nothing left in internal-target.h that is target specific. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-common.h | 29 +++++++++++++++++++++++ accel/tcg/internal-target.h | 46 ------------------------------------- accel/tcg/cpu-exec.c | 1 - accel/tcg/cputlb.c | 1 - accel/tcg/tb-maint.c | 1 - accel/tcg/translate-all.c | 1 - accel/tcg/user-exec.c | 1 - 7 files changed, 29 insertions(+), 51 deletions(-) delete mode 100644 accel/tcg/internal-target.h diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 2f00560d10..573e8438c3 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -11,6 +11,7 @@ =20 #include "exec/cpu-common.h" #include "exec/translation-block.h" +#include "exec/mmap-lock.h" =20 extern int64_t max_delay; extern int64_t max_advance; @@ -108,4 +109,32 @@ static inline tb_page_addr_t get_page_addr_code(CPUArc= hState *env, return get_page_addr_code_hostp(env, addr, NULL); } =20 +/* + * Access to the various translations structures need to be serialised + * via locks for consistency. In user-mode emulation access to the + * memory related structures are protected with mmap_lock. + * In !user-mode we use per-page locks. + */ +#ifdef CONFIG_USER_ONLY +#define assert_memory_lock() tcg_debug_assert(have_mmap_lock()) +#else +#define assert_memory_lock() +#endif + +#if defined(CONFIG_SOFTMMU) && defined(CONFIG_DEBUG_TCG) +void assert_no_pages_locked(void); +#else +static inline void assert_no_pages_locked(void) { } +#endif + +#ifdef CONFIG_USER_ONLY +static inline void page_table_config_init(void) { } +#else +void page_table_config_init(void); +#endif + +#ifndef CONFIG_USER_ONLY +G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); +#endif /* CONFIG_USER_ONLY */ + #endif diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h deleted file mode 100644 index 9a9cef3140..0000000000 --- a/accel/tcg/internal-target.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Internal execution defines for qemu (target specific) - * - * Copyright (c) 2003 Fabrice Bellard - * - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#ifndef ACCEL_TCG_INTERNAL_TARGET_H -#define ACCEL_TCG_INTERNAL_TARGET_H - -#include "cpu-param.h" -#include "exec/exec-all.h" -#include "exec/translation-block.h" -#include "tb-internal.h" -#include "exec/mmap-lock.h" - -/* - * Access to the various translations structures need to be serialised - * via locks for consistency. In user-mode emulation access to the - * memory related structures are protected with mmap_lock. - * In !user-mode we use per-page locks. - */ -#ifdef CONFIG_USER_ONLY -#define assert_memory_lock() tcg_debug_assert(have_mmap_lock()) -#else -#define assert_memory_lock() -#endif - -#if defined(CONFIG_SOFTMMU) && defined(CONFIG_DEBUG_TCG) -void assert_no_pages_locked(void); -#else -static inline void assert_no_pages_locked(void) { } -#endif - -#ifdef CONFIG_USER_ONLY -static inline void page_table_config_init(void) { } -#else -void page_table_config_init(void); -#endif - -#ifndef CONFIG_USER_ONLY -G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); -#endif /* CONFIG_USER_ONLY */ - -#endif /* ACCEL_TCG_INTERNAL_H */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index b00f046b29..4f1955d3d8 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -46,7 +46,6 @@ #include "tb-context.h" #include "tb-internal.h" #include "internal-common.h" -#include "internal-target.h" =20 /* -icount align implementation. */ =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index ed6de1e96e..ca69128232 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -43,7 +43,6 @@ #include "tb-internal.h" #include "tlb-bounds.h" #include "internal-common.h" -#include "internal-target.h" #ifdef CONFIG_PLUGIN #include "qemu/plugin-memory.h" #endif diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index f43f5342a6..cf12a28eab 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -36,7 +36,6 @@ #include "tb-context.h" #include "tb-internal.h" #include "internal-common.h" -#include "internal-target.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h" #endif diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 9bf8728064..38819a507b 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -66,7 +66,6 @@ #include "tb-context.h" #include "tb-internal.h" #include "internal-common.h" -#include "internal-target.h" #include "tcg/perf.h" #include "tcg/insn-start-words.h" #include "cpu.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 112292b729..17e3be337f 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -39,7 +39,6 @@ #include "tcg/tcg-ldst.h" #include "backend-ldst.h" #include "internal-common.h" -#include "internal-target.h" #include "tb-internal.h" =20 __thread uintptr_t helper_retaddr; --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457853; cv=none; d=zohomail.com; s=zohoarc; b=Z8Z3ZnFoP0x2AKM7N3myiy0DAx/0puVCW4jl2bXNyWxy/ad3Q7JKqCEJFgu97ZuEGW++5t2MqraeusT3+o1QP85dKxtWv7VCmi4BOL9LzAkNNv3klGpkzYpmBhvDyn8s2S41URsSeT0sW9aqO4VMiir+93qS2Kq7zQhJjvhlcUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457853; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=oOPlOdbDbguknjepjxusIV42ybLDvwlv6HjsVhp9s/A=; b=fzEgQLjUFVuo9ZNzJ++vAPZBolqo2m69EDJZ+jilEOLNuYbW1m82S/PuyyAiMqGjjePW24j6JkglGMhsDvb7Fonr6YOM/0M+V+ze2EiNgVBzPwcIc34Mm2oh3pVINdRv2w3R0V1BFS7c/8HeWJNW1n3A1WOYFKH0VOy+WX0UFUU= 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 1745457853755923.2230766473107; Wed, 23 Apr 2025 18:24:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGv-0005EJ-3i; Wed, 23 Apr 2025 21:21:03 -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 1u7lFT-0002lU-2w for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:33 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFQ-0007AK-IF for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:30 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-73bf1cef6ceso403721b3a.0 for ; Wed, 23 Apr 2025 18:19:27 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457566; x=1746062366; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oOPlOdbDbguknjepjxusIV42ybLDvwlv6HjsVhp9s/A=; b=XrAW8oSeJEtOiKrsWSui6N4omM/rDcpmAlKvRudF5u2rThZZXbAO8T/9/liFcPgg4X qtyawjlwY+iR3KKtFnqnlHRguI0/aOkB33YnGz0jQejXPuVmUxEFK+x23EMYWJDlN41F iagPf+xVlZKuRfxkclQTDO+6JfpLnNKOsxKx1nAXPZEnb11QC9RIThx4vhteMlcoDEWQ z/Tlx/wr9NcbKWhHAb7mlOkaHiv43Vj8lvUEmTklPoebZWmT8Ef3kXtQ71DjDIzpwbKP nWPCh1yUIqTZas+skPwsRKbG0ymiGN5H9OUzsUHSdlxRUFFmQJN06C/TXDco4Ahdn/u/ stRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457566; x=1746062366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oOPlOdbDbguknjepjxusIV42ybLDvwlv6HjsVhp9s/A=; b=LxCPktGILhI6mqO5GEefvLioQfhCmfUnVwU0ORPhoYiGBAa9bXrTBUKv7JbtVB1Rji m6JWksY0hldQM0J31rq/i/HxBgzQpX34e6bpDG+jAU0lndLjbzzW5TP+iIBgcsipbl3r 0/sORBIX17f1C/iYlQbCCeKcec+4mV8c/5A+h67KMdaSuY2Y17TYVzTQVPkYTKiQaNJn 57wNHlKaepJ9DBpZt/i8/lWG3a/WPoAA6L7FWoFVCla0BRe7DCEJxw5CfK/KDm+T6tEK 4TBioKJzbXWlWbbElW8S9V+Us4BuLmR8zf9v4bWFcBjgnNO+TAgHv+beSZI3XrX12Qwe 0BYg== X-Gm-Message-State: AOJu0YwbOqf3LZcVP1dMyQ1l1rScOIIdxSVFFxqfGao7WUUBYln88IUj CsVQAAHbTxoymhooy0+REFYthoQjoYAHh7IU+Y0GPPBKgVo2SUdYbIXkAlORJQBUdmLqYXWGu6l i X-Gm-Gg: ASbGncvNj7wJRlm9MGoZyvorepk0ONkOvGQCku+ndL+YMK2VgAnqFN+2scvsYHtwpQf F0JvOXjN+PcyGJra88HSPVtzJaJAtlGpyz9/q15LysTdF2kZwhha6QGpsp1uS7/zCntbSuSCRnp pw7jc5vFmvltp+gHuQtqSMijGcS2jHshLxeO5n6d0j2RV+4+MfEEN23mdkOMfxywJlg74hvEk+o iqOmzQ+3Un55NAzNKq/G7XshrVi8llhAsbtoNYKnw6P8vmIdT3QDDdauLgk0PbUWhUzcdWUzoC8 ziljff62hugAADlNPEIZJDPK7zd3SzUo7IwoTGeXqymT9dPH9I+Ty2SH2q5eDmsBi1T72ioBHhU = X-Google-Smtp-Source: AGHT+IG7a7M15twHMxDKWKI8TNj5+RYtX/BtkRYdFAI1j5y1wVAfu3pkKpQD+PZeRhg6zUcP4nTuHg== X-Received: by 2002:a05:6a21:78a3:b0:1f5:839e:ece8 with SMTP id adf61e73a8af0-20444e6fad7mr908316637.2.1745457566491; Wed, 23 Apr 2025 18:19:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/15] accel/tcg: Reduce scope of tb_phys_invalidate, tb_set_jmp_target Date: Wed, 23 Apr 2025 18:19:14 -0700 Message-ID: <20250424011918.599958-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457854662019000 Content-Type: text/plain; charset="utf-8" Move the declarations of these functions out of exec/exec-all.h to accel/tcg/internal-common.h. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/internal-common.h | 3 +++ include/exec/exec-all.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 573e8438c3..98c702422f 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -137,4 +137,7 @@ void page_table_config_init(void); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); #endif /* CONFIG_USER_ONLY */ =20 +void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); +void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); + #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index bee3416e7e..24383b6aba 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -121,10 +121,8 @@ int probe_access_full_mmu(CPUArchState *env, vaddr add= r, int size, #endif /* CONFIG_TCG */ =20 /* TranslationBlock invalidate API */ -void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, tb_page_addr_t last); -void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); =20 #if !defined(CONFIG_USER_ONLY) =20 --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458275; cv=none; d=zohomail.com; s=zohoarc; b=lafEGk/S6FD3o3TxaLgBzY5SDR3ELk7dZ17cd3aYkgP85n3b04hqp/0UHIbp3A/yOY/K07u8ixe0tu97FDQI38M0qSCNwdTnXrfs5Lfyes9s3oAdYGf95w3a1FFCLB2Db7S3M6ni37ra6wXJgneqf8b3sQappMCbUHstZBymjyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458275; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=AJHxgd8xUq6D1KvcEBjRZYTNQLKHnzsXGPORpScz2Ns=; b=ak5SMI9e0wtk5cXeafzYVVDr4JIarzgERYd26zwqrUDyDL8KHa7J0Pq9uaG3S9W4l+lemvPqRF/6HxWBBJl96ZYwUZN5E7i/8SUs8JjyXu0j4JCHpaHbGaBXn3Qugma4VE1UOZgggzZOtrXeBx6yCCGiaWOCM4Frsi6oGwZ1btk= 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 1745458275509102.29559781267665; Wed, 23 Apr 2025 18:31:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lH2-0005vm-IL; Wed, 23 Apr 2025 21:21:08 -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 1u7lFT-0002lW-5o for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:33 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFR-0007AQ-19 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:30 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7399838db7fso526023b3a.0 for ; Wed, 23 Apr 2025 18:19:28 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457567; x=1746062367; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AJHxgd8xUq6D1KvcEBjRZYTNQLKHnzsXGPORpScz2Ns=; b=ZqmH19/LZyeCd4I6n9mryrc5rvycjFMJqmmbN0Ioe9T6gi6qKBy0iJnVCJYGCMs1Qp +Q78caisfS+TK3zeg0SRoDJCaOgykrbAGIjDamf3qUrux+/At4LVcbmc1rvtrT9vT9ez 4pxJBb/XZOWSvNPjRKHdv6CgqRkcttcbgQJjfdiP6rtD/UnsNnhEXQsqTzQx7sfVSYGK 5yZwscj4MbeMnWo3anutHkxndikDogQn8bN2ciUxnoIfHOd/dYod25vqmoAaqi6Re3sY L2oiydDs+GOkM9uuiVfcBdxRTUVx3xHvfAf7PT+omnoWCFZXclaGCbowN8MZFZEkojwm +zHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457567; x=1746062367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AJHxgd8xUq6D1KvcEBjRZYTNQLKHnzsXGPORpScz2Ns=; b=SKXU82FyS18607kB1YavD+S2zkowB/B9TiJc6B89112EFTln2vg55Ps3e6f86CVEkG 5NT8e2gtCxKqc0EYc7l17xDZotDtS8GAN2PWmCxnSEPxmEKV9FDPm16yKriDU7sYyHEs Uz1kB8gD+D+dknOF+5j2usON3borcHeSeOLPiZzTabfhICeVKvx82foU2o3wjsSVpFLI Gx4OutRg5xmOvFNZd5VI3Pd6Y6QLQCMbGHUx16LtQzncNjhtwPfcyA2dEPMoo6gB0EBa AmGhh2dcg2fk3xFj4QWvBP+HeQJcDeXgm1Lm+9KOZ0txWQ+x+RODw/f+X9prMhnpTsfN ABrQ== X-Gm-Message-State: AOJu0YwRLozouL+pEUcHVJx2ZlPNxDnHxqGAOvAVovkRw+Vv0uFzbsn/ pUe8Dy6p/U64Y2l/ov6bQZiySQJVC9sLjt5D+s6SSYcg5CXNdBFAHk0hU3GCwk3qo2I7b6po68W U X-Gm-Gg: ASbGncudiO9WqiUmuyQMlEbJC9QJqWWRhlNUQady4UiIPOevhxlxAQp7Mfs9+fAzELp TrlL4/gq5EgmWMkbHZK5DSUW8qEOdqkBYpQdMqY4aV80KHFmsi89uBibcczpXPOvrPMFi5VHiLP wBY3sEtkSgT165EQNpZ6ZX2RWxSI3jy909ig7mHrfGKRras7vt4uSmOf3iifmm5qRjmRA/Jh+Lt /VwHBZjoLlTKpySeECJZXwNrCT34odp10JidvP0jj/uc0dSxfFrRH2LGE3NApqaE0RTNglW8nrF mimsA7lgKR/xIpcF9+Lgkfk49Rj9mm/+If2loYTLQHPBgrl6+Uow/uuBxUjgKc82ZL+18caDcP2 WqkE1d/37BQ== X-Google-Smtp-Source: AGHT+IER3+eZHOaBdOBMVaG6qFbNCTB07MsFku2h/slloBF8PLIzVip7O+FNiHqf2b3e1UD9bK5XGQ== X-Received: by 2002:a05:6a00:1306:b0:73e:2367:c914 with SMTP id d2e1a72fcca58-73e2680bccfmr587033b3a.7.1745457567079; Wed, 23 Apr 2025 18:19:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/15] accel/tcg: Use vaddr for walk_memory_regions callback Date: Wed, 23 Apr 2025 18:19:15 -0700 Message-ID: <20250424011918.599958-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458278140019100 Content-Type: text/plain; charset="utf-8" Use vaddr instead of target_ulong. At the same time, use int instead of unsigned long for flags, to match page_set_flags(). Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/user/page-protection.h | 4 +--- accel/tcg/user-exec.c | 10 +++++----- linux-user/elfload.c | 19 +++++++++---------- linux-user/syscall.c | 8 ++++---- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/include/user/page-protection.h b/include/user/page-protection.h index 1de72e31e6..55aa05ce24 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -88,9 +88,7 @@ target_ulong page_find_range_empty(target_ulong min, targ= et_ulong max, __attribute__((returns_nonnull)) void *page_get_target_data(target_ulong address); =20 -typedef int (*walk_memory_regions_fn)(void *, target_ulong, - target_ulong, unsigned long); - +typedef int (*walk_memory_regions_fn)(void *, vaddr, vaddr, int); int walk_memory_regions(void *, walk_memory_regions_fn); =20 void page_dump(FILE *f); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 17e3be337f..25d86567e7 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -199,13 +199,13 @@ int walk_memory_regions(void *priv, walk_memory_regio= ns_fn fn) return rc; } =20 -static int dump_region(void *priv, target_ulong start, - target_ulong end, unsigned long prot) +static int dump_region(void *opaque, vaddr start, vaddr end, int prot) { - FILE *f =3D (FILE *)priv; + FILE *f =3D opaque; =20 - fprintf(f, TARGET_FMT_lx"-"TARGET_FMT_lx" "TARGET_FMT_lx" %c%c%c\n", - start, end, end - start, + fprintf(f, TARGET_ABI_FMT_ptr "-" TARGET_ABI_FMT_ptr + " " TARGET_ABI_FMT_ptr " %c%c%c\n", + (abi_ptr)start, (abi_ptr)end, (abi_ptr)(end - start), ((prot & PAGE_READ) ? 'r' : '-'), ((prot & PAGE_WRITE) ? 'w' : '-'), ((prot & PAGE_EXEC) ? 'x' : '-')); diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 7519b6bcda..e281745e48 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4044,8 +4044,7 @@ static inline void bswap_note(struct elf_note *en) { } /* * Calculate file (dump) size of given memory region. */ -static size_t vma_dump_size(target_ulong start, target_ulong end, - unsigned long flags) +static size_t vma_dump_size(vaddr start, vaddr end, int flags) { /* The area must be readable. */ if (!(flags & PAGE_READ)) { @@ -4238,8 +4237,8 @@ static int dump_write(int fd, const void *ptr, size_t= size) return (0); } =20 -static int wmr_page_unprotect_regions(void *opaque, target_ulong start, - target_ulong end, unsigned long flag= s) +static int wmr_page_unprotect_regions(void *opaque, vaddr start, + vaddr end, int flags) { if ((flags & (PAGE_WRITE | PAGE_WRITE_ORG)) =3D=3D PAGE_WRITE_ORG) { size_t step =3D MAX(TARGET_PAGE_SIZE, qemu_real_host_page_size()); @@ -4260,8 +4259,8 @@ typedef struct { size_t size; } CountAndSizeRegions; =20 -static int wmr_count_and_size_regions(void *opaque, target_ulong start, - target_ulong end, unsigned long flag= s) +static int wmr_count_and_size_regions(void *opaque, vaddr start, + vaddr end, int flags) { CountAndSizeRegions *css =3D opaque; =20 @@ -4275,8 +4274,8 @@ typedef struct { off_t offset; } FillRegionPhdr; =20 -static int wmr_fill_region_phdr(void *opaque, target_ulong start, - target_ulong end, unsigned long flags) +static int wmr_fill_region_phdr(void *opaque, vaddr start, + vaddr end, int flags) { FillRegionPhdr *d =3D opaque; struct elf_phdr *phdr =3D d->phdr; @@ -4298,8 +4297,8 @@ static int wmr_fill_region_phdr(void *opaque, target_= ulong start, return 0; } =20 -static int wmr_write_region(void *opaque, target_ulong start, - target_ulong end, unsigned long flags) +static int wmr_write_region(void *opaque, vaddr start, + vaddr end, int flags) { int fd =3D *(int *)opaque; size_t size =3D vma_dump_size(start, end, flags); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5826ac3adb..23b901b713 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8135,8 +8135,8 @@ static void open_self_maps_4(const struct open_self_m= aps_data *d, * Callback for walk_memory_regions, when read_self_maps() fails. * Proceed without the benefit of host /proc/self/maps cross-check. */ -static int open_self_maps_3(void *opaque, target_ulong guest_start, - target_ulong guest_end, unsigned long flags) +static int open_self_maps_3(void *opaque, vaddr guest_start, + vaddr guest_end, int flags) { static const MapInfo mi =3D { .is_priv =3D true }; =20 @@ -8147,8 +8147,8 @@ static int open_self_maps_3(void *opaque, target_ulon= g guest_start, /* * Callback for walk_memory_regions, when read_self_maps() succeeds. */ -static int open_self_maps_2(void *opaque, target_ulong guest_start, - target_ulong guest_end, unsigned long flags) +static int open_self_maps_2(void *opaque, vaddr guest_start, + vaddr guest_end, int flags) { const struct open_self_maps_data *d =3D opaque; uintptr_t host_start =3D (uintptr_t)g2h_untagged(guest_start); --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457701; cv=none; d=zohomail.com; s=zohoarc; b=hlREjUkPZ9SoD0OwLA5yfhVyL+EPCMk32G89VO4orQnFs+J/EdVzo7yNyvCZ1kZssXM3z5g/s+Ds3/wS1PL0LutrqVu4uUS6fxI4nQBUaCKyoRP+ykCNGuprRRcBrfG0soysv5qxqDZl5pQdgrUjNVmtQO1XzyT6+MzdjFb9XyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457701; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=i6eTTqBVbqJi5x+I+UsZ0X40LcCyAdkFjFwlBMbt3Is=; b=AvwwWYZZHtWJ5v333H9PaWb2tAIC32yenp4y9lffcJHqeOgIgaTVsKyEY2zQxrgeRAfZpJ3lR6BGXBV9atMjmf4fLpBC306ksYzEjmtILWPYczdZ2Ewf3xkkHCNhS3QYfEXGldB1u5MkY0u4KlEZECBvy0Mzf1GY+W1M+wNhYF0= 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 1745457701326745.0404181772451; Wed, 23 Apr 2025 18:21:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lGd-0004oB-IH; Wed, 23 Apr 2025 21:20:43 -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 1u7lFU-0002pK-LW for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:35 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFR-0007Ae-U1 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:32 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7369ce5d323so318241b3a.1 for ; Wed, 23 Apr 2025 18:19:28 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457568; x=1746062368; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=i6eTTqBVbqJi5x+I+UsZ0X40LcCyAdkFjFwlBMbt3Is=; b=WYTzcwtKFcsb6wrB5x1Ydih0QzZl9bFpWXYHC6bxZDQxGLF+es6aWl0lDjlqSa6YVs w2Dwq9w/lK4QKxNazrKv98vP9gyg3MlT2QIrZEd8YMZl9NNbHUgNuUyTyQJ56X0MwhPW 3+bvWWz1cMiMJ/xLjz9RC1nrx0FyghKAz/TcRnHYKWoXm2cQlqR6l1rwAn5Ip9GezWDb kw8UnzHqhpKkTTykw34kj4GiSYvQQEQDaJgSij6wY8Hm94NtMb+QlUZUiGbR5Bf/cGAe EjidkkTe2l8jlcS7yC0SMwi/aAQuhxAUqiAONT+/k3iyo3WTBYwG/45mRm5zvEj63JpF LIUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457568; x=1746062368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i6eTTqBVbqJi5x+I+UsZ0X40LcCyAdkFjFwlBMbt3Is=; b=draUHzlEg/zzCbFeNM3nuM0E8DZeS8Y2/XuVr2S8i7GYJVRxbawSTCRhEWk/Znhhs2 9hj4ICQj5rCs3QQhka5WNbvDtZ9eguN4HE1Wha6IekVyFgDDnpMGpyxvtBdcpckHNqUs dMRRnOk3AQlfR90bm8J0RxEI/JDOJiZKX2Bxy922DHMBnMZ7VsWk/bk3NIfpN3CL/2wJ 1qamCqAI4duOeyvVPC+W59wrGLj5dczYdRCL3HFjpp8THBM9kZTg1G4gKhZ9w7bLjcEs ItyUiHO41Gos1qlfygmGyuhyMAvjjTcQYokSQxExuZYYGxVFxRu4dfESK+WxYtkkkjAk n49w== X-Gm-Message-State: AOJu0YwK0MFJXsatjJRKVQzfpYgp3ihwOefd8CJvZRjh6PJUokQ+o/xP vNAZSUcS2E0tKN3xk7mXJiceoF5IHDdcIXafAgFuGVTbF78Y4it/kK03aKJIPPHl03ntO8EQ8QH o X-Gm-Gg: ASbGncvZkLRrbQRucs91s+CSvh5yQ5SNS7g3JVfI+2U6rYBXYyvgL4O+KDWJ5KfJq50 PWto1NZmUt+64ycG5kUzdyZr6ARe6VfHlPeM/SNkJEg6rCmXBkAkcQiTozpGL2I8oIXtjMiEX23 I8pOgp0uZCDetrChf5bCJRGBJxSz1Yo5QG4Wcfb0UWmfeaoQghx0B/gIPg5K2gcXOjQNXYSaY/f sp4BFnx3yb3wHKeOI3AdsqMXHbyTefPHJMRQRysk1tHPZTW+MjuAgEw5jOtAV9yY4L0gQzWSn2+ 0mQw69E5KDJETvEhU0JJpQ/68jD836AvXeB42tcN8Ps+pPrj+7V9gVmmQHSRw1NGmR2obya3Iv4 = X-Google-Smtp-Source: AGHT+IGC/w6Zx8gIC+jkZwRyIvXoMf3P2erqziz4m/xL1A9FOjdF4sYO915RFukXml0lZ3cHMgMY6A== X-Received: by 2002:a05:6a00:b8d:b0:736:3979:369e with SMTP id d2e1a72fcca58-73e2461d7f1mr961414b3a.9.1745457567748; Wed, 23 Apr 2025 18:19:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/15] accel/tcg: Use vaddr in user/page-protection.h Date: Wed, 23 Apr 2025 18:19:16 -0700 Message-ID: <20250424011918.599958-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457702282019000 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/user/page-protection.h | 18 ++++++------ accel/tcg/user-exec.c | 51 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/include/user/page-protection.h b/include/user/page-protection.h index 55aa05ce24..86143212fd 100644 --- a/include/user/page-protection.h +++ b/include/user/page-protection.h @@ -12,13 +12,12 @@ #error Cannot include this header from system emulation #endif =20 -#include "cpu-param.h" -#include "exec/target_long.h" +#include "exec/vaddr.h" #include "exec/translation-block.h" =20 int page_unprotect(CPUState *cpu, tb_page_addr_t address, uintptr_t pc); =20 -int page_get_flags(target_ulong address); +int page_get_flags(vaddr address); =20 /** * page_set_flags: @@ -31,9 +30,9 @@ int page_get_flags(target_ulong address); * The flag PAGE_WRITE_ORG is positioned automatically depending * on PAGE_WRITE. The mmap_lock should already be held. */ -void page_set_flags(target_ulong start, target_ulong last, int flags); +void page_set_flags(vaddr start, vaddr last, int flags); =20 -void page_reset_target_data(target_ulong start, target_ulong last); +void page_reset_target_data(vaddr start, vaddr last); =20 /** * page_check_range @@ -45,7 +44,7 @@ void page_reset_target_data(target_ulong start, target_ul= ong last); * Return false if any page is unmapped. Thus testing flags =3D=3D 0 is * equivalent to testing for flags =3D=3D PAGE_VALID. */ -bool page_check_range(target_ulong start, target_ulong last, int flags); +bool page_check_range(vaddr start, vaddr last, int flags); =20 /** * page_check_range_empty: @@ -57,7 +56,7 @@ bool page_check_range(target_ulong start, target_ulong la= st, int flags); * The memory lock must be held so that the caller will can ensure * the result stays true until a new mapping can be installed. */ -bool page_check_range_empty(target_ulong start, target_ulong last); +bool page_check_range_empty(vaddr start, vaddr last); =20 /** * page_find_range_empty @@ -71,8 +70,7 @@ bool page_check_range_empty(target_ulong start, target_ul= ong last); * The memory lock must be held, as the caller will want to ensure * the returned range stays empty until a new mapping can be installed. */ -target_ulong page_find_range_empty(target_ulong min, target_ulong max, - target_ulong len, target_ulong align); +vaddr page_find_range_empty(vaddr min, vaddr max, vaddr len, vaddr align); =20 /** * page_get_target_data(address) @@ -86,7 +84,7 @@ target_ulong page_find_range_empty(target_ulong min, targ= et_ulong max, * e.g. with the munmap system call. */ __attribute__((returns_nonnull)) -void *page_get_target_data(target_ulong address); +void *page_get_target_data(vaddr address); =20 typedef int (*walk_memory_regions_fn)(void *, vaddr, vaddr, int); int walk_memory_regions(void *, walk_memory_regions_fn); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 25d86567e7..43d005e24e 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -161,7 +161,7 @@ typedef struct PageFlagsNode { =20 static IntervalTreeRoot pageflags_root; =20 -static PageFlagsNode *pageflags_find(target_ulong start, target_ulong last) +static PageFlagsNode *pageflags_find(vaddr start, vaddr last) { IntervalTreeNode *n; =20 @@ -169,8 +169,7 @@ static PageFlagsNode *pageflags_find(target_ulong start= , target_ulong last) return n ? container_of(n, PageFlagsNode, itree) : NULL; } =20 -static PageFlagsNode *pageflags_next(PageFlagsNode *p, target_ulong start, - target_ulong last) +static PageFlagsNode *pageflags_next(PageFlagsNode *p, vaddr start, vaddr = last) { IntervalTreeNode *n; =20 @@ -215,14 +214,14 @@ static int dump_region(void *opaque, vaddr start, vad= dr end, int prot) /* dump memory mappings */ void page_dump(FILE *f) { - const int length =3D sizeof(target_ulong) * 2; + const int length =3D sizeof(abi_ptr) * 2; =20 fprintf(f, "%-*s %-*s %-*s %s\n", length, "start", length, "end", length, "size", "prot"); walk_memory_regions(f, dump_region); } =20 -int page_get_flags(target_ulong address) +int page_get_flags(vaddr address) { PageFlagsNode *p =3D pageflags_find(address, address); =20 @@ -245,7 +244,7 @@ int page_get_flags(target_ulong address) } =20 /* A subroutine of page_set_flags: insert a new node for [start,last]. */ -static void pageflags_create(target_ulong start, target_ulong last, int fl= ags) +static void pageflags_create(vaddr start, vaddr last, int flags) { PageFlagsNode *p =3D g_new(PageFlagsNode, 1); =20 @@ -256,13 +255,13 @@ static void pageflags_create(target_ulong start, targ= et_ulong last, int flags) } =20 /* A subroutine of page_set_flags: remove everything in [start,last]. */ -static bool pageflags_unset(target_ulong start, target_ulong last) +static bool pageflags_unset(vaddr start, vaddr last) { bool inval_tb =3D false; =20 while (true) { PageFlagsNode *p =3D pageflags_find(start, last); - target_ulong p_last; + vaddr p_last; =20 if (!p) { break; @@ -301,8 +300,7 @@ static bool pageflags_unset(target_ulong start, target_= ulong last) * A subroutine of page_set_flags: nothing overlaps [start,last], * but check adjacent mappings and maybe merge into a single range. */ -static void pageflags_create_merge(target_ulong start, target_ulong last, - int flags) +static void pageflags_create_merge(vaddr start, vaddr last, int flags) { PageFlagsNode *next =3D NULL, *prev =3D NULL; =20 @@ -353,11 +351,11 @@ static void pageflags_create_merge(target_ulong start= , target_ulong last, #define PAGE_STICKY (PAGE_ANON | PAGE_PASSTHROUGH | PAGE_TARGET_STICKY) =20 /* A subroutine of page_set_flags: add flags to [start,last]. */ -static bool pageflags_set_clear(target_ulong start, target_ulong last, +static bool pageflags_set_clear(vaddr start, vaddr last, int set_flags, int clear_flags) { PageFlagsNode *p; - target_ulong p_start, p_last; + vaddr p_start, p_last; int p_flags, merge_flags; bool inval_tb =3D false; =20 @@ -492,7 +490,7 @@ static bool pageflags_set_clear(target_ulong start, tar= get_ulong last, return inval_tb; } =20 -void page_set_flags(target_ulong start, target_ulong last, int flags) +void page_set_flags(vaddr start, vaddr last, int flags) { bool reset =3D false; bool inval_tb =3D false; @@ -532,9 +530,9 @@ void page_set_flags(target_ulong start, target_ulong la= st, int flags) } } =20 -bool page_check_range(target_ulong start, target_ulong len, int flags) +bool page_check_range(vaddr start, vaddr len, int flags) { - target_ulong last; + vaddr last; int locked; /* tri-state: =3D0: unlocked, +1: global, -1: local */ bool ret; =20 @@ -610,17 +608,16 @@ bool page_check_range(target_ulong start, target_ulon= g len, int flags) return ret; } =20 -bool page_check_range_empty(target_ulong start, target_ulong last) +bool page_check_range_empty(vaddr start, vaddr last) { assert(last >=3D start); assert_memory_lock(); return pageflags_find(start, last) =3D=3D NULL; } =20 -target_ulong page_find_range_empty(target_ulong min, target_ulong max, - target_ulong len, target_ulong align) +vaddr page_find_range_empty(vaddr min, vaddr max, vaddr len, vaddr align) { - target_ulong len_m1, align_m1; + vaddr len_m1, align_m1; =20 assert(min <=3D max); assert(max <=3D GUEST_ADDR_MAX); @@ -661,7 +658,7 @@ target_ulong page_find_range_empty(target_ulong min, ta= rget_ulong max, void tb_lock_page0(tb_page_addr_t address) { PageFlagsNode *p; - target_ulong start, last; + vaddr start, last; int host_page_size =3D qemu_real_host_page_size(); int prot; =20 @@ -740,7 +737,7 @@ int page_unprotect(CPUState *cpu, tb_page_addr_t addres= s, uintptr_t pc) } } else { int host_page_size =3D qemu_real_host_page_size(); - target_ulong start, len, i; + vaddr start, len, i; int prot; =20 if (host_page_size <=3D TARGET_PAGE_SIZE) { @@ -756,7 +753,7 @@ int page_unprotect(CPUState *cpu, tb_page_addr_t addres= s, uintptr_t pc) prot =3D 0; =20 for (i =3D 0; i < len; i +=3D TARGET_PAGE_SIZE) { - target_ulong addr =3D start + i; + vaddr addr =3D start + i; =20 p =3D pageflags_find(addr, addr); if (p) { @@ -883,7 +880,7 @@ typedef struct TargetPageDataNode { =20 static IntervalTreeRoot targetdata_root; =20 -void page_reset_target_data(target_ulong start, target_ulong last) +void page_reset_target_data(vaddr start, vaddr last) { IntervalTreeNode *n, *next; =20 @@ -897,7 +894,7 @@ void page_reset_target_data(target_ulong start, target_= ulong last) n !=3D NULL; n =3D next, next =3D next ? interval_tree_iter_next(n, start, last) : NULL) { - target_ulong n_start, n_last, p_ofs, p_len; + vaddr n_start, n_last, p_ofs, p_len; TargetPageDataNode *t =3D container_of(n, TargetPageDataNode, itre= e); =20 if (n->start >=3D start && n->last <=3D last) { @@ -921,11 +918,11 @@ void page_reset_target_data(target_ulong start, targe= t_ulong last) } } =20 -void *page_get_target_data(target_ulong address) +void *page_get_target_data(vaddr address) { IntervalTreeNode *n; TargetPageDataNode *t; - target_ulong page, region, p_ofs; + vaddr page, region, p_ofs; =20 page =3D address & TARGET_PAGE_MASK; region =3D address & TBD_MASK; @@ -956,7 +953,7 @@ void *page_get_target_data(target_ulong address) return t->data + p_ofs * TARGET_PAGE_DATA_SIZE; } #else -void page_reset_target_data(target_ulong start, target_ulong last) { } +void page_reset_target_data(vaddr start, vaddr last) { } #endif /* TARGET_PAGE_DATA_SIZE */ =20 /* The system-mode versions of these helpers are in cputlb.c. */ --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745458249; cv=none; d=zohomail.com; s=zohoarc; b=RD05R1iekROLxG6GvF+jzPn1QuFAKtMVUkIlqd/rWHK3HjKvafJSbsDUWXQZiUo+kwbHx+YqQd0fEbaPRPvsNHaE4bS8ne/5dnBlMBneTL2f9UVLH3yqZ7RtZoKePXw3MS3NXLNR0oripVPHaJrKNBzw1cC3tHJgbTW622ZxtY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745458249; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VlU+5utG7ndLnI3liyhSosykEbCdiIswzRyFOphsCF8=; b=bVtXtW7YwVXUBDazbascu3s08yMVUeN5DLanYhkV5iEUBgSb3FxpcFXPgefkUUw19tNcRzevpRxkgw6KnT6HPbjr84j4UVsgRJ3zrhTUa/QK4DoJn6GIBdjkPG2jY/GkEvgHETFug4uqeRyVX6DvjEb+yNs/1qItPxHOPe9iGlA= 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 1745458249825921.6744036225788; Wed, 23 Apr 2025 18:30:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lH2-0005xN-RQ; Wed, 23 Apr 2025 21:21:09 -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 1u7lFU-0002mL-0c for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:35 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFR-0007Aw-V3 for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:31 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-736bfa487c3so314065b3a.1 for ; Wed, 23 Apr 2025 18:19:29 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457568; x=1746062368; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VlU+5utG7ndLnI3liyhSosykEbCdiIswzRyFOphsCF8=; b=B9FrrQ/N7VHA6vgzAOJS9440S0deznHAksILF0WClzpSja3OMOLs0pu/pg2FOdPxlt ZY4NkEn5PAJV7RXA5WGgH8E9yUIx7VNIMjuoILstdnd9R1C9o35Mt7/ZKT4nG32Exx6/ R4l/NcKEf5YmXVRYXopaZ+NW+P4B29VsFa1mW0zYG6JSmaYrRJXFImWiiwBhHM56Yjmc LjTliUMraQa/WotKAbDlM3HgAfgUBQyROnuOo2yKMENh1h0rBESMeolDng3z3DG1/OcT R954777z8kMV0s7PBcgiJyClYMN2U1rzx82MTm+V91izhbVb9tr9REmSZd5W4FhKrJ1h Q9kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457568; x=1746062368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VlU+5utG7ndLnI3liyhSosykEbCdiIswzRyFOphsCF8=; b=vaZxn+vZ6ZI52CA1HLFGjvVKP+xfXJb48o7njy0tmWf+q/OBRxQOSEd3lI5DX/yjoK 8/LYw1Yy3IHUwryQCNp5joabO2yTtt3qXoYfF1cNZpQ6DTrXQ7GifjVNzGzVCsefNxsr fZg23DyRJOYdb9Y8b7Q6j5WJ2zFoZbx/Ocu64RRC3bHncj6fCancOpg1svm6jSE9H6jh M6zInNLAbgSS39S0H6zq47sZpj3sfAKAXNCjX4id/5iPOEChrUYGgyGx65FAUTswoh62 224yppU9vEJE2d68CajADlYUkUpPA1xuz3pHHgrKq5JCsdnosts64DvE8LKDQhRdnrK3 GtXg== X-Gm-Message-State: AOJu0YxMeRrc3K2D7Bp8v6qpnT5++EhmdZmPQKkC0FGPpZPRv5m7RfSX VcyCF1vvugKaqXtcBd3RNysOvycsRRel67C9PvAA18+l/5Y+Nf+Pz9tXXwEJufPDX/g0/XeI4Oh P X-Gm-Gg: ASbGncur2KoWAfILMHg8oN+glVxUz/9qGjV/HP7LfyINYqC8pUj/hJrWkSDauSQkyZn JTEwq2AkYgBtaAceATQ3chI1VfLW24n3d/3vKzrGSdO8ikyHVylEuhrjPHaWHwyENjzWjF9K4Wf uGG+hFFpsnpAgF27Op7/ocG4N5qeGLpgZK47ehkt2ONwUtiF5ReVUKGXJ0XPjCahDDAEd/77E1B HcJ/p8BdVuKAWvXLdXty66JJQI45zfXEPtu2lJWs8SliESzFgnLUNpOjkIvi3qix/43OJ54S8F7 KLvWDMwX4ioT0BzBnBYKipAM74OVyq5QXXXcHGV4d1kMulMDhLCakRk269jXkvV0L5GvxKgq3vo = X-Google-Smtp-Source: AGHT+IG/AiqF6TryjbnMvGK7c4DYyhTpzBnWdrxVTY1kGNrveMNEir5EvPVzevlwdam73SiFhejLnw== X-Received: by 2002:a05:6a21:108f:b0:1f5:591b:4f7a with SMTP id adf61e73a8af0-20444f9e9cemr942334637.38.1745457568423; Wed, 23 Apr 2025 18:19:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/15] include/exec: Move tb_invalidate_phys_range to translation-block.h Date: Wed, 23 Apr 2025 18:19:17 -0700 Message-ID: <20250424011918.599958-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745458250037019000 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/exec/exec-all.h | 4 ---- include/exec/translation-block.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 24383b6aba..90986152df 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -120,10 +120,6 @@ int probe_access_full_mmu(CPUArchState *env, vaddr add= r, int size, #endif /* !CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ =20 -/* TranslationBlock invalidate API */ -void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, - tb_page_addr_t last); - #if !defined(CONFIG_USER_ONLY) =20 /** diff --git a/include/exec/translation-block.h b/include/exec/translation-bl= ock.h index 8b8e730561..cdce399eba 100644 --- a/include/exec/translation-block.h +++ b/include/exec/translation-block.h @@ -207,4 +207,8 @@ static inline void tb_set_page_addr1(TranslationBlock *= tb, #endif } =20 +/* TranslationBlock invalidate API */ +void tb_invalidate_phys_range(CPUState *cpu, tb_page_addr_t start, + tb_page_addr_t last); + #endif /* EXEC_TRANSLATION_BLOCK_H */ --=20 2.43.0 From nobody Sat Nov 15 23:37:21 2025 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=1745457964; cv=none; d=zohomail.com; s=zohoarc; b=K9Y7WeCxPbH0hYhi9qCQgn3wWGb6FcNwh/3grfHYCEMdy4XF2rvDMNL1QM9zEba7InKCBaCzNkE3fIXvNHcgaR34QL1+BxP+PupEqH/uEqv8OI7O/8E34Fwj69O13abBxnWJ4DIY013AC+WrzOZOWbRPfpDOiYjHsxS7eKdPIwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745457964; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=LvS1n+qlS73FdHFx8FlT1NvgH8GPjz2T857j7hIsMgE=; b=HVwz6xLmsZpEvb9q0N3nSEHf5XnQBy8OCh0/9LjyU9HANnUWPIr1XZkQNNOKv7BJbcJpp0DGWGeMZZLX//Q7JAwbHjeTai06IOpIM5X/d9ZOkqkcZwWbmqPdE/VWJfkGFod5rmetC4GtPr9SXq1tk7RfLKZczHU/Qm1U633QITo= 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 1745457964759332.59210497580193; Wed, 23 Apr 2025 18:26:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7lFq-0003LB-0o; Wed, 23 Apr 2025 21:19:54 -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 1u7lFU-0002pM-Lf for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:35 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7lFS-0007BB-Qv for qemu-devel@nongnu.org; Wed, 23 Apr 2025 21:19:32 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-736e52948ebso472487b3a.1 for ; Wed, 23 Apr 2025 18:19:29 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25912ef0sm244079b3a.10.2025.04.23.18.19.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 18:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745457569; x=1746062369; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LvS1n+qlS73FdHFx8FlT1NvgH8GPjz2T857j7hIsMgE=; b=Le0CXtO7ZSS99h/jSYnyJARfse+VkCRNhtDQin/ayT6zpmvyB029Rvy2wmn8Yt2p/d 4n11KPV++Pe3NTfuBCdO/sZ+kuaAXpM6sN0/Y42KeTXciF5IyXwECokSORdwt3jSOqQv +Pk5UlQ55/1yBBM88mDdSiCdWawHcAHwfhv6sv3EMLrFSnvotfXx/3Ex8o7RzNkGcpPm Q0rfEeAwnKmqSETknf4dBiMoQv9v1pelDbuyoYEX83dZF/FT9BJYWJX/6TDGyut5Fqlz Ojt2B7ulDg1+0mVVNcZ6zDWPkIP8dVUaSCZaHiDT1HVK70ERFtTFUQa7zOgyQI9XE/y3 GHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745457569; x=1746062369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LvS1n+qlS73FdHFx8FlT1NvgH8GPjz2T857j7hIsMgE=; b=LkdKANbi4o+rQdZCPEFkL6GmoH8hrBT5qnIMghfYMUc9O1C/LVlOTTlHVsPy7zktIo oFwFpaGn0yFSYstjQ7WDQ0kJIlQ7yxh7cnUj0HCQFqcS88qg5c/QuLDNAxU8aFwSj3r2 vnjzfr7LVc3e8uoxC8qYOd9x3XgIQQElDntOqDebZWNX0Px/ixTA4yZnK5zTNMXoJzU9 LbFaotpyXvufvYN+D1HRm1M9i+9O2rBf47ItYk7BapqpOV9USZkgtmlDQkOylW+tcwCl q4k3b7QsGE5YSIbKYQNxqseuPYvNG0KAaoQSDlyqfbviuLLTff3/mzXM3Egz8sflnmA+ nhYA== X-Gm-Message-State: AOJu0YwWCj2EV2wzo1r10oC7m8/tm7D2T+z+4ph7d7dMKNakiLXHCloE C5e7nuFXFmumGLMNOG6UeEIvT/JR6Qf7Ha7u60y/HAsU17c4wjWoxnrZUq6iUDIxJX7hvGtWgGr Y X-Gm-Gg: ASbGncvHDIsSe9AWRys1b6jjZpDC5PxhNTfrunOsLQe0khrIvODLsazTim+HuA8DSaO 3Lk3mTY7nkUp2+nLHqYYTO+fho2VQzSsRe4RIyKpBG38LHQtHt+0LLmjrhk9FNEncxgc7KDgkUw PYS/frj9KykxGcM8yXuWCok5TopACFOQmS2TOCE9AnvGA2hNERJ0WMpKp9yHiCociKTadMtq+G6 kVZ1kxZyDl2sTTQx8iTKgBtmslpIvITZd7vDv7eE1DiUFWQFdk/SQmA+ESBAyqgzyUVRIYwxBv0 6Wz70613CyApDzQi3LchDR9ukKbmRVqOxvLDWBu2MdhuGe6nJWSo4FFytJ2v4/fxGAEBT/q35/M = X-Google-Smtp-Source: AGHT+IE4W/f9ZtqEvJvGk3pKsHmem/x+QfesC/hXE1eIiy4QB2eKNK1AatJUOG+ajhW+IFVecNpCDg== X-Received: by 2002:a05:6a21:516:b0:1fd:e9c8:b8c3 with SMTP id adf61e73a8af0-20444f8b15fmr878044637.26.1745457569049; Wed, 23 Apr 2025 18:19:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/15] accel/tcg: Compile tb-maint.c twice Date: Wed, 23 Apr 2025 18:19:18 -0700 Message-ID: <20250424011918.599958-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424011918.599958-1-richard.henderson@linaro.org> References: <20250424011918.599958-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1745457978837019000 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/tb-hash.h | 3 +-- accel/tcg/tb-maint.c | 2 -- accel/tcg/meson.build | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 3bc5042d9d..f7b159f04c 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -20,8 +20,7 @@ #ifndef EXEC_TB_HASH_H #define EXEC_TB_HASH_H =20 -#include "exec/cpu-defs.h" -#include "exec/exec-all.h" +#include "exec/vaddr.h" #include "exec/target_page.h" #include "exec/translation-block.h" #include "qemu/xxhash.h" diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index cf12a28eab..512dae93bd 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -20,10 +20,8 @@ #include "qemu/osdep.h" #include "qemu/interval-tree.h" #include "qemu/qtree.h" -#include "cpu.h" #include "exec/cputlb.h" #include "exec/log.h" -#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/mmap-lock.h" #include "exec/tb-flush.h" diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 047afa49a2..3f7b127130 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -8,6 +8,7 @@ tcg_ss.add(files( 'cpu-exec-common.c', 'tcg-runtime.c', 'tcg-runtime-gvec.c', + 'tb-maint.c', 'translator.c', )) if get_option('plugins') @@ -21,7 +22,6 @@ tcg_specific_ss =3D ss.source_set() tcg_specific_ss.add(files( 'tcg-all.c', 'cpu-exec.c', - 'tb-maint.c', 'translate-all.c', )) tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c'= )) --=20 2.43.0