From nobody Tue Nov 26 15:17:25 2024 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=1706569351; cv=none; d=zohomail.com; s=zohoarc; b=hkzsN2EzCYPsl/52Fuib7lLZaZAUaiUOEKDxeVctJeq3almnNyDHT0bjvSqnUtXkOsDxHAm1DnWe2MM2Z4YrqhIQsuLQW6pffzmkSXvfHjBdfyozAxZCoNaGTlNFZabp82dqJVnSG6n0lf5F2h5D9rH9WJ/EGjCnameobQQ2QBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569351; 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=qYS/soxWe3h+ML5uFbbfcdAcoE+eOI+G62ajUSGtp3A=; b=ODW+3sOU8ZdpzZRTj2bOOo4qXprpa9SzJ6zEZdndNxCTmVDALyM1L5xVOyYYoGkx+lgsQRANcHzlFc+YzmUWZ47atmuWzf+UwyhN8vYP93umwACNEP22FsgQaZOlx9R72E1FB2il/p+HDVNTGk5c56maiVPquzwbVJLsGw1uAqU= 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 1706569351291153.9594530826347; Mon, 29 Jan 2024 15:02:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadJ-0005v7-B9; Mon, 29 Jan 2024 18:01:42 -0500 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 1rUadC-0005uY-U8 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:38 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUad8-0008Md-TW for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:33 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-290ec261a61so1815127a91.0 for ; Mon, 29 Jan 2024 15:01:30 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569289; x=1707174089; 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=qYS/soxWe3h+ML5uFbbfcdAcoE+eOI+G62ajUSGtp3A=; b=fRCfdjhZNLeHGxftzyGomW7hJ8q7o5RZyH9eyOaAbs+yTn+mXsSntVdZ7Nr0BZGGfi fduN9gh79kDtD/fV7qntQ1KExr7MlyijAuJlAhNgSalZqqzqy1uW/cpeTExXdVuJsDoE 6v9GqszrkQAmd9Xj9aOahM9082FSHsJeg/rcZaJYiryRx44DP+wzWIvblIgNYlDUXZUK 8KnoWtQtfU3jIwfHBPsOdHyLH/dx2V43kyO4g803k/jEGeONin3LpXrCKy/FXsGeyLLY sICrRGYI6ZcAYBH9i6HsPANet2tzCzhKSUF5Q+sWsKzGw7WLGYB+WHD+q3KjsLcAfM19 +eWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569289; x=1707174089; 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=qYS/soxWe3h+ML5uFbbfcdAcoE+eOI+G62ajUSGtp3A=; b=cQNPZ4c0VckUmPgvqwnOGo94+7anAEPuSYrN7oZx61tPO4j4WfDT1NMWVkZsRtsC46 1gtLP7Z/EU8c6br6GmSbq5ACl9fYSFZxAUehIz/0whhZPYAOZTYSgSqTRRNcF9m77Pzk gnd1siL5tP3KR3amS+OAayN/gWM1iIYDZoM0NfjXodZ3QS3QWCozAmtMhiD4ZXz8zUF9 SFozaNs6V7fQgDzNLXlJ0xoODB42u7fLPnTKK3lkU5mgGzjWXS0n5mNG5Xy7j2WpTWXz NMXH8lapS9eJB+L4v/GhNJkIDe2eo5j0vSs96u3goAjZNTvtCzcHSkS+FzKc43rcmOQs naHg== X-Gm-Message-State: AOJu0Ywie9ME66Ojjv1v99Xuqhfr29++FWDdCa3YTOidVhAQcfT8VaXj h0vQfqNOpcKBTuR+bdlzRIy4WVuIbvbBzldyIZRN3n+peilSUlUk4r6csr6AR2NKlotu3B5anCK IC+c= X-Google-Smtp-Source: AGHT+IGE6xkRhpJSI4MC1CfLpR+fDXbchjjPRPG4ziPrbNjOmEtdul3EBPYmgx/QRmZ4SlVejC9F3Q== X-Received: by 2002:a17:902:d50a:b0:1d7:5f1b:49f3 with SMTP id b10-20020a170902d50a00b001d75f1b49f3mr4750928plg.120.1706569289265; Mon, 29 Jan 2024 15:01:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 01/31] cpu-exec: simplify jump cache management Date: Tue, 30 Jan 2024 09:00:51 +1000 Message-Id: <20240129230121.8091-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569351828100001 From: Paolo Bonzini Unless I'm missing something egregious, the jmp cache is only every populated with a valid entry by the same thread that reads the cache. Therefore, the contents of any valid entry are always consistent and there is no need for any acquire/release magic. Indeed ->tb has to be accessed with atomics, because concurrent invalidations would otherwise cause data races. But ->pc is only ever accessed by one thread, and accesses to ->tb and ->pc within tb_lookup can never race with another tb_lookup. While the TranslationBlock (especially the flags) could be modified by a concurrent invalidation, store-release and load-acquire operations on the cache entry would not add any additional ordering beyond what you get from performing the accesses within a single thread. Because of this, there is really nothing to win in splitting the CF_PCREL and !CF_PCREL paths. It is easier to just always use the ->pc field in the jump cache. I noticed this while working on splitting commit 8ed558ec0cb ("accel/tcg: Introduce TARGET_TB_PCREL", 2022-10-04) into multiple pieces, for the sake of finding a more fine-grained bisection result for https://gitlab.com/qemu-project/qemu/-/issues/2092. It does not (and does not intend to) fix that issue; therefore it may make sense to not commit it until the root cause of issue #2092 is found. Signed-off-by: Paolo Bonzini Tested-by: Alex Benn=C3=A9e Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20240122153409.351959-1-pbonzini@redhat.com> Signed-off-by: Richard Henderson --- accel/tcg/tb-jmp-cache.h | 8 +++-- accel/tcg/cpu-exec.c | 66 ++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 46 deletions(-) diff --git a/accel/tcg/tb-jmp-cache.h b/accel/tcg/tb-jmp-cache.h index bb424c8a05..4ab8553afc 100644 --- a/accel/tcg/tb-jmp-cache.h +++ b/accel/tcg/tb-jmp-cache.h @@ -13,9 +13,11 @@ #define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS) =20 /* - * Accessed in parallel; all accesses to 'tb' must be atomic. - * For CF_PCREL, accesses to 'pc' must be protected by a - * load_acquire/store_release to 'tb'. + * Invalidated in parallel; all accesses to 'tb' must be atomic. + * A valid entry is read/written by a single CPU, therefore there is + * no need for qatomic_rcu_read() and pc is always consistent with a + * non-NULL value of 'tb'. Strictly speaking pc is only needed for + * CF_PCREL, but it's used always for simplicity. */ struct CPUJumpCache { struct rcu_head rcu; diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 67eda9865e..40c268bfa1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -253,43 +253,29 @@ static inline TranslationBlock *tb_lookup(CPUState *c= pu, vaddr pc, hash =3D tb_jmp_cache_hash_func(pc); jc =3D cpu->tb_jmp_cache; =20 - if (cflags & CF_PCREL) { - /* Use acquire to ensure current load of pc from jc. */ - tb =3D qatomic_load_acquire(&jc->array[hash].tb); - - if (likely(tb && - jc->array[hash].pc =3D=3D pc && - tb->cs_base =3D=3D cs_base && - tb->flags =3D=3D flags && - tb_cflags(tb) =3D=3D cflags)) { - return tb; - } - tb =3D tb_htable_lookup(cpu, pc, cs_base, flags, cflags); - if (tb =3D=3D NULL) { - return NULL; - } - jc->array[hash].pc =3D pc; - /* Ensure pc is written first. */ - qatomic_store_release(&jc->array[hash].tb, tb); - } else { - /* Use rcu_read to ensure current load of pc from *tb. */ - tb =3D qatomic_rcu_read(&jc->array[hash].tb); - - if (likely(tb && - tb->pc =3D=3D pc && - tb->cs_base =3D=3D cs_base && - tb->flags =3D=3D flags && - tb_cflags(tb) =3D=3D cflags)) { - return tb; - } - tb =3D tb_htable_lookup(cpu, pc, cs_base, flags, cflags); - if (tb =3D=3D NULL) { - return NULL; - } - /* Use the pc value already stored in tb->pc. */ - qatomic_set(&jc->array[hash].tb, tb); + tb =3D qatomic_read(&jc->array[hash].tb); + if (likely(tb && + jc->array[hash].pc =3D=3D pc && + tb->cs_base =3D=3D cs_base && + tb->flags =3D=3D flags && + tb_cflags(tb) =3D=3D cflags)) { + goto hit; } =20 + tb =3D tb_htable_lookup(cpu, pc, cs_base, flags, cflags); + if (tb =3D=3D NULL) { + return NULL; + } + + jc->array[hash].pc =3D pc; + qatomic_set(&jc->array[hash].tb, tb); + +hit: + /* + * As long as tb is not NULL, the contents are consistent. Therefore, + * the virtual PC has to match for non-CF_PCREL translations. + */ + assert((tb_cflags(tb) & CF_PCREL) || tb->pc =3D=3D pc); return tb; } =20 @@ -1012,14 +998,8 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) */ h =3D tb_jmp_cache_hash_func(pc); jc =3D cpu->tb_jmp_cache; - if (cflags & CF_PCREL) { - jc->array[h].pc =3D pc; - /* Ensure pc is written first. */ - qatomic_store_release(&jc->array[h].tb, tb); - } else { - /* Use the pc value already stored in tb->pc. */ - qatomic_set(&jc->array[h].tb, tb); - } + jc->array[h].pc =3D pc; + qatomic_set(&jc->array[h].tb, tb); } =20 #ifndef CONFIG_USER_ONLY --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569321; cv=none; d=zohomail.com; s=zohoarc; b=LanQZWLJD+/vTh3047wbadGRb+JR1DAWm/gXHgt7GrmsLFd7WpbNKbDUoC6UsUt78/yz1lSFchsJzoWax1Do2HeKGxtXmSatuRKCsgeGzjsqS6SzpV8KLJR8Jy/zPuXofhaTlFyYKdL/QmlaqfL+Z5UYzfAkIqxGFC/9/YlGucQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569321; h=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=M8UjEMO1j2vm3/2aeEMHpkVHZcyY+4Tl4SZGy9Fx+X8=; b=B5G8/K1bD08AVpwGuiiJ7gM8Kiggknb1IyoUXpi0cAOIhuGelZWrpbQvR+WTx+Ym0bKB+N3rIv/UvYXBiS52FN3XRGR6ISsQhOQBk/qYZdfOiJnPDJ91ylFxe4UjRc4VF/Pn2BYMTgzX3k1OjelXRHQtHXxxxbc6h2R568fGZSI= 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 1706569321144837.706607500837; Mon, 29 Jan 2024 15:02:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadK-0005vY-Ts; Mon, 29 Jan 2024 18:01:42 -0500 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 1rUadE-0005ue-H5 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:38 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadC-0008N1-MZ for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:36 -0500 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5d8b276979aso1294555a12.2 for ; Mon, 29 Jan 2024 15:01:32 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569291; x=1707174091; 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=M8UjEMO1j2vm3/2aeEMHpkVHZcyY+4Tl4SZGy9Fx+X8=; b=A5lTa/SJuGD45c6dyta1F29CneQKXnpI65VRqxIV+cV1lFna0Pttcttkdhhi//XFPd LITsH7nK/9BvFoxCDWe5amtNDMHkL03rjOCdmEGLmxOEnqcFkRz1LiqtOg3c7WIGkziN ha8zD1llWJoZTtlbW4kSDB0Ia+FdnJ8f68SDMI3SdMYtVuNwe2WihnTCDvMkZv4guhTr +8e1meSYyIoh+sDgMSrBef8SkpUGRLmJt4TKTt6OPhHgO3pKkA20L9sVWVLoipQWpjnp UXWdgJbw+AEwoT5t1jtw5niEmoxn9OQgkmhvG/3lPsoJ8cGMP+pYsMO5hRCell73snn7 ilUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569291; x=1707174091; 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=M8UjEMO1j2vm3/2aeEMHpkVHZcyY+4Tl4SZGy9Fx+X8=; b=TdXDZVEd3+g37Kpox+XNRcq/8UBkc3WUoH9C2ok6G8mzoXTZ376mzMtQqyUffcAXc2 eoNJu9PK2ot2K7GBrtcMwV3kp9LlPt2lMRRD/QmaVrmyZpBwmKxMc5dqAO5wtyK7yATX ijiFpOtQ62WXCnjjqQR73L71ILNKSjmBU7hammviNK8yl5K3Vz4ms7oWMiDItZS0Lpo6 EFe9leNTinUZEQKLkDv4XPy/PqZPPqUPff8ckOqFW8GaiY4UaxSmZxRo2UEdW7Rl3FVz Y8wfjiK3/3T8WuMsJD/IL0QR9qDDu/JUzw3Lqc9bJBZYR6SfqONiWnAlLRaWZVfKQabx YXVg== X-Gm-Message-State: AOJu0YzLPyaWGYSS/h94hA97zx6rpb2g4oMfX0OYhOW8oFxVMjAqyf9D LCr1RARiZRPipuAcQCxo5kPZ1EP2cxtI6XBEkU3gT2sxWpfBORI17c3gx7dORXBAMKnT2n7yCY3 8auc= X-Google-Smtp-Source: AGHT+IHPhJt8i7vtlXplm8sf40EHpIqlYEZV0xie0de3YXpi5eEPjwrD8a75z1R9KBTGbk9Kr10afg== X-Received: by 2002:a05:6a20:252e:b0:19c:8fa7:66da with SMTP id j46-20020a056a20252e00b0019c8fa766damr2771537pzd.1.1706569291303; Mon, 29 Jan 2024 15:01:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 02/31] include/exec: Move vaddr defines to separate file Date: Tue, 30 Jan 2024 09:00:52 +1000 Message-Id: <20240129230121.8091-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569321846100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Needed to work around circular includes. vaddr is currently defined in cpu-common.h and needed by hw/core/cpu.h, but cpu-common.h also need cpu.h to know the size of the CPUState. [Maybe we can instead move parts of cpu-common.h w. hw/core/cpu.h to sort out the circular inclusion.] Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-7-anjo@rev.ng> Reviewed-by: Richard Henderson [rth: Add include of vaddr.h into cpu-common.h] Signed-off-by: Richard Henderson --- include/exec/cpu-common.h | 13 +------------ include/exec/vaddr.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 include/exec/vaddr.h diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index fef3138d29..3109c6b67d 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -3,6 +3,7 @@ =20 /* CPU interfaces that are target independent. */ =20 +#include "exec/vaddr.h" #ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" #endif @@ -14,18 +15,6 @@ #define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another= */ #define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */ =20 -/** - * vaddr: - * Type wide enough to contain any #target_ulong virtual address. - */ -typedef uint64_t vaddr; -#define VADDR_PRId PRId64 -#define VADDR_PRIu PRIu64 -#define VADDR_PRIo PRIo64 -#define VADDR_PRIx PRIx64 -#define VADDR_PRIX PRIX64 -#define VADDR_MAX UINT64_MAX - void cpu_exec_init_all(void); void cpu_exec_step_atomic(CPUState *cpu); =20 diff --git a/include/exec/vaddr.h b/include/exec/vaddr.h new file mode 100644 index 0000000000..b9844afc77 --- /dev/null +++ b/include/exec/vaddr.h @@ -0,0 +1,18 @@ +/* Define vaddr. */ + +#ifndef VADDR_H +#define VADDR_H + +/** + * vaddr: + * Type wide enough to contain any #target_ulong virtual address. + */ +typedef uint64_t vaddr; +#define VADDR_PRId PRId64 +#define VADDR_PRIu PRIu64 +#define VADDR_PRIo PRIo64 +#define VADDR_PRIx PRIx64 +#define VADDR_PRIX PRIX64 +#define VADDR_MAX UINT64_MAX + +#endif --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569639; cv=none; d=zohomail.com; s=zohoarc; b=OpNHDHmhy0si1PVMRDWG2ihOIRlB/z+uu/9FQPBsSFrCIDDjeNCAmBXYXWcZqC7mR6n0Yg2V84DAPzBNdLpAMs1S5kT9waHsEn9HxiqvrGRArXl/3lIB6n/AvLzcXAan6tW7tKwCfJUjtdxdM4F1fLQUFMcxVEKzhTbC0UiTnzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569639; h=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=ADBUc3fCETku7gSMiSslG1Ep+CbDq8k+uqgwv8Xr0vk=; b=dQ0+WqYbKok3yYT71gpApD1YWd6EmYMX7CKO9APHJTH8U5GMQnn1/q6o1zSGxqKCIOU05ccRip6G832PZkvVc4jA9tWm3h95JMmj/52OWWKR/4NdclR2UapGhzptHPlqoUg6Lydrl5NqlGjw3f95OLRo+VnNZ3y2XC55MRYFDLg= 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 1706569639706749.7274488044204; Mon, 29 Jan 2024 15:07:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadM-0005wG-Lg; Mon, 29 Jan 2024 18:01:44 -0500 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 1rUadF-0005uf-Fs for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:38 -0500 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 1rUadC-0008NU-Np for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:37 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ddb1115e82so2245937b3a.0 for ; Mon, 29 Jan 2024 15:01:34 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569293; x=1707174093; 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=ADBUc3fCETku7gSMiSslG1Ep+CbDq8k+uqgwv8Xr0vk=; b=RMgObZ+duwuBfwDffDR4r9TalTdjrZ0NbSqyMPUvSv9gqX+3ewKskilUw968Y+5AZg iJBz2uLa7ya/xMH1qXXDxaBIyTGEVqmFJETu0KgXCh2fKZMlzORrs+pROuObQ3XlaLj6 9dDgfPmNjFZbbobYTJ+aa1elqQk/+xbHa253qUJwmcKTYGuvMwUgRayHncpA2+cbWPdB 1VhbNzjo29mbhrHrVFQeJP7Nz+yYMF88TXvpFxjBERg0AXasUhmjLVqyXnPZWsZmNdXj HbpcaGhaOYgif4sL6+SsuuiSUE7+ZyARLGmq6J5YItZP5UOcIfYXRkv5ALSeDwhCpdf5 InJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569293; x=1707174093; 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=ADBUc3fCETku7gSMiSslG1Ep+CbDq8k+uqgwv8Xr0vk=; b=ed9ONIywGT9jlM2RgYpbcRVPqxs7YGqY08UQk+W5giDaXtsNTFpPU4SqPQA1ZIjQz5 qZT/eeelft6Vz+sMhlF0vzL2GORf950MEZSaVQXOl+bmcapRJ+OBdviaCOJM2auUh7nl VCzS3Z0FjtaT5cOo75mRCbFTWwsid5n+qeJXcfVIF8xmFrbUguucp6cKpbMY6B2Ep1b+ M9Hg4n3QlOdhc/K1iutD3Qg8IqcJc9TNAGiQH251zfGjVESSGAcrk42i20QhjqCNa7kN pjoPerv9ekHe0ZJzVw14jt2IbBVeaCxdWDEVpxcZD4WyzVCU6FMOXoRUcMz21C2nEWoK LIWw== X-Gm-Message-State: AOJu0YyzWeH3HJ2D+7rQ1MziiMcMkI2+t90NxNVu71Q100mwbDDcyXBk rKJmDj2lsC0hUvMKJqL9IlaAOiiUNIjysTU0yln0POpbvn2/Mbd+D4ta6HG9siClvhfADF18Vop XVLs= X-Google-Smtp-Source: AGHT+IFptAI+2J+nBhbOdEYFzh067vlo7/8VVtRTRMDgkL3n7e9lb9P/13CRj/F7NerldqMJKkbE/g== X-Received: by 2002:a05:6a00:c8e:b0:6dd:c35c:e7c5 with SMTP id a14-20020a056a000c8e00b006ddc35ce7c5mr7121237pfv.18.1706569293306; Mon, 29 Jan 2024 15:01:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 03/31] hw/core: Include vaddr.h from cpu.h Date: Tue, 30 Jan 2024 09:00:53 +1000 Message-Id: <20240129230121.8091-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569640574100003 Content-Type: text/plain; charset="utf-8" From: Anton Johansson cpu-common.h is only needed for vaddr Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-8-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 238c02c05e..db58f12233 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -22,8 +22,8 @@ =20 #include "hw/qdev-core.h" #include "disas/dis-asm.h" -#include "exec/cpu-common.h" #include "exec/hwaddr.h" +#include "exec/vaddr.h" #include "exec/memattrs.h" #include "exec/tlb-common.h" #include "qapi/qapi-types-run-state.h" --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569963; cv=none; d=zohomail.com; s=zohoarc; b=ewakPqsbCovdMnB0EY3JBKOJ/HyjrXvRDlnAmpjYIrzQIePZE5DT5pQbzNfxx/mo8F46IvYNHZJ8Dwxu0VhntvyZkmBFGOkuECgR+fKF529FjG68GWu5Xmq5izSgvfmPUgL5P2b3Tb26uwnDF/1Ne590U58gF5uv8t/1yNgLitY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569963; h=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=9+/x34hZ0Savjf5fK/vjCGUP8dkpzXoOGlANXKjp7EA=; b=dNtZ8wa0yTbnSkEYm3P0QzvCP842+t8AIXxNxelZPQAJ8lLyjgibHK1oMkSQffqDuXUGdTgSs3SkQsrY/P6OdLvLGcYHqeDM+ZHM4aOhvh5E7uwesQpUsmI7vNWIP2W9waot7F+Nvd5nG0NJL1A7R9wDXLjR9dP6ZpjWDQtqGjI= 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 1706569963535217.08756239595505; Mon, 29 Jan 2024 15:12:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadO-0005xg-TU; Mon, 29 Jan 2024 18:01:46 -0500 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 1rUadI-0005v6-2o for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:40 -0500 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadF-0008Np-77 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:39 -0500 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6e1352dd653so559522a34.2 for ; Mon, 29 Jan 2024 15:01:36 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569295; x=1707174095; 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=9+/x34hZ0Savjf5fK/vjCGUP8dkpzXoOGlANXKjp7EA=; b=WGZwP0KhITZQjdxgvoorOCSzITI3NAVMlCHVcigytIj07dWjToaA8YGxm31GugUpPU bV/DPGpYKLtkVudM8hYFBMzhqi0a3BZvLyxJ5rb2cp46w3bqc65oHXF/kx2oK0YUMC7u 50bBxG3FJB35wETanamr7wImqBv2o2WqhWB06SE5CtBY0La/nsbp12JBbBuC2eyvN0ZJ HuOt00SnbLuf2dP1fc8BolPAoOl+/Hetr8OszQcQHKy9Vdb+R2Bq+L5pc0X+LgLOdoh3 GM3D24LdDUtRjqpRDnJDekCwNmPO4iZ1wC5cOnAUN/8FWwCiViX1FsNsqA1yRo3GX2br Q9lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569295; x=1707174095; 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=9+/x34hZ0Savjf5fK/vjCGUP8dkpzXoOGlANXKjp7EA=; b=Ns098JYTd8HTDo0rG86o29mJ2eF0IOiWx5FcTjz8RgKiDmeR4svJ36en19ED2zg/3M DvtAcCZ5441aGkzhnnw+TTJ/RiheigZb7s9uJMw3CNvOCfvnIwNJLtTYwUQoGYjFGhMM +A2TZsT6PCCDk75X+IeIQjylw0dquwGjb6wUYwzjj4py/OTAGM9L4RIqocR7ArCf3SKi nQN8Ufpu9/yvfE6JBIWrJqPZxdSjuIgYWfzU9i1vZBmiP2gCrhBdaAUfqOrNhW/a7wTv RzKKrD4q3rFvkuKe2hz2xIjftbN3Fkv7OKulA2tQEqkWdyiWt0c29PJfVWIr0ROB2Emh lAjQ== X-Gm-Message-State: AOJu0YwjNibAOTQL35BpcgwXOugq15MehgtUwSE5PwX5Xa4cdB3tfQVK tCERMLXkVdA7aL2EYGA0IKZJ3VqTjuThh1KtSJU9c/zcNoOCNXGSgNGAI12FDs0nlHYc32b41OF wIF0= X-Google-Smtp-Source: AGHT+IEbVoIFYWjj/pfJz5yb8TNljovz/mgrADFgDRoipZg3gInQE+60cpKeFYFZsA9z4hV1gzi58Q== X-Received: by 2002:a05:6358:63a5:b0:178:6d3d:4cc1 with SMTP id k37-20020a05635863a500b001786d3d4cc1mr3100664rwh.24.1706569295376; Mon, 29 Jan 2024 15:01:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 04/31] target: Use vaddr in gen_intermediate_code Date: Tue, 30 Jan 2024 09:00:54 +1000 Message-Id: <20240129230121.8091-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::335; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569965401100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Makes gen_intermediate_code() signature target agnostic so the function can be called from accel/tcg/translate-all.c without target specifics. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-9-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/translator.h | 2 +- target/alpha/translate.c | 2 +- target/arm/tcg/translate.c | 2 +- target/avr/translate.c | 2 +- target/cris/translate.c | 2 +- target/hexagon/translate.c | 2 +- target/hppa/translate.c | 2 +- target/i386/tcg/translate.c | 2 +- target/loongarch/tcg/translate.c | 2 +- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 2 +- target/mips/tcg/translate.c | 2 +- target/nios2/translate.c | 2 +- target/openrisc/translate.c | 2 +- target/ppc/translate.c | 2 +- target/riscv/translate.c | 2 +- target/rx/translate.c | 2 +- target/s390x/tcg/translate.c | 2 +- target/sh4/translate.c | 2 +- target/sparc/translate.c | 2 +- target/tricore/translate.c | 2 +- target/xtensa/translate.c | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/exec/translator.h b/include/exec/translator.h index 6d3f59d095..b0412ea6b6 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -33,7 +33,7 @@ * the target-specific DisasContext, and then invoke translator_loop. */ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc); + vaddr pc, void *host_pc); =20 /** * DisasJumpType: diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 32333081d8..134eb7225b 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -2971,7 +2971,7 @@ static const TranslatorOps alpha_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &alpha_tr_ops, &dc.ba= se); diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index b3660173d1..5fa8249723 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -9691,7 +9691,7 @@ static const TranslatorOps thumb_translator_ops =3D { =20 /* generate intermediate code for basic block 'tb'. */ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc =3D { }; const TranslatorOps *ops =3D &arm_translator_ops; diff --git a/target/avr/translate.c b/target/avr/translate.c index cdffa04519..e5dd057799 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -2805,7 +2805,7 @@ static const TranslatorOps avr_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc =3D { }; translator_loop(cs, tb, max_insns, pc, host_pc, &avr_tr_ops, &dc.base); diff --git a/target/cris/translate.c b/target/cris/translate.c index b3974ba0bb..ee1402a9a3 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3172,7 +3172,7 @@ static const TranslatorOps cris_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cs, tb, max_insns, pc, host_pc, &cris_tr_ops, &dc.base= ); diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 95579ae243..a14211cf68 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -1154,7 +1154,7 @@ static const TranslatorOps hexagon_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3ef39b1bd7..08d09d50d7 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4631,7 +4631,7 @@ static const TranslatorOps hppa_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; translator_loop(cs, tb, max_insns, pc, host_pc, &hppa_tr_ops, &ctx.bas= e); diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index e193c74472..2808903661 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7088,7 +7088,7 @@ static const TranslatorOps i386_tr_ops =3D { =20 /* generate intermediate code for basic block 'tb'. */ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; =20 diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/transl= ate.c index 21f4db6fbd..235515c629 100644 --- a/target/loongarch/tcg/translate.c +++ b/target/loongarch/tcg/translate.c @@ -343,7 +343,7 @@ static const TranslatorOps loongarch_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4a0b0b2703..5ec88c5f0d 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6088,7 +6088,7 @@ static const TranslatorOps m68k_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &m68k_tr_ops, &dc.bas= e); diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 49bfb4a0ea..2e628647d1 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1792,7 +1792,7 @@ static const TranslatorOps mb_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cpu, tb, max_insns, pc, host_pc, &mb_tr_ops, &dc.base); diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 13e43fa3b6..e10232738c 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -15554,7 +15554,7 @@ static const TranslatorOps mips_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/nios2/translate.c b/target/nios2/translate.c index e806623594..3078372b36 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -1036,7 +1036,7 @@ static const TranslatorOps nios2_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; translator_loop(cs, tb, max_insns, pc, host_pc, &nios2_tr_ops, &dc.bas= e); diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index ecff4412b7..d4cbc5eaea 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1658,7 +1658,7 @@ static const TranslatorOps openrisc_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 329da4d518..049f636927 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -7518,7 +7518,7 @@ static const TranslatorOps ppc_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 071fbad7ef..ab18899122 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1287,7 +1287,7 @@ static const TranslatorOps riscv_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/rx/translate.c b/target/rx/translate.c index c6ce717a95..2265bd14ac 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -2266,7 +2266,7 @@ static const TranslatorOps rx_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; =20 diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 8df00b7df9..a5fd9cccaa 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6547,7 +6547,7 @@ static const TranslatorOps s390x_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc; =20 diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 81f825f125..6a6d862b10 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -2317,7 +2317,7 @@ static const TranslatorOps sh4_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; =20 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 9387299559..97184fa403 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5327,7 +5327,7 @@ static const TranslatorOps sparc_tr_ops =3D { }; =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc =3D {}; =20 diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 66553d1be0..f1156c39e7 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8472,7 +8472,7 @@ static const TranslatorOps tricore_tr_ops =3D { =20 =20 void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_in= sns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext ctx; translator_loop(cs, tb, max_insns, pc, host_pc, diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 87947236ca..e4772462b5 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1239,7 +1239,7 @@ static const TranslatorOps xtensa_translator_ops =3D { }; =20 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_i= nsns, - target_ulong pc, void *host_pc) + vaddr pc, void *host_pc) { DisasContext dc =3D {}; translator_loop(cpu, tb, max_insns, pc, host_pc, --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569800; cv=none; d=zohomail.com; s=zohoarc; b=eP3vJR/SJNYqo9aeYN3c6MdwpIZ5fVfYgstdQ14o9CkXVcpIkRx/mma1/JfjzUiK2OnwOUroYYD5WBGTMQHvS5zU+skzZamEQ4tMR/VyT+IiA0eH5ryEVS8Q/zm0M9Yoxl+U5nOjZ6JxTJWYDNGzm1GLzfTYYAWCS26+YL4Jr8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569800; h=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=8stgI+xO0LshRlV+dbOXjfDk9OWAAP8Iuj6nGWfVSvI=; b=ny/k9aHL7NWGHhNGtOEtw+9bLn7W8AD66sMuulw/9sFdLEEjUfTexEPbEAB+05YxmGFfmTrxbl8GWf5PWwnRLJBP0zI7APJqUg9Frtf+uvgdzVyuoSJywK8qy9C5Y1FJ/4KmoqxWcqOs+4CFSb+Jq3T3B4ERtON1NUDSmYimM9Y= 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 1706569800468676.4666113997247; Mon, 29 Jan 2024 15:10:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadR-0005yl-Hz; Mon, 29 Jan 2024 18:01:49 -0500 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 1rUadJ-0005vX-M4 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:42 -0500 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 1rUadH-0008O3-Rs for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:41 -0500 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6ddc5faeb7fso2586105b3a.3 for ; Mon, 29 Jan 2024 15:01:38 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569297; x=1707174097; 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=8stgI+xO0LshRlV+dbOXjfDk9OWAAP8Iuj6nGWfVSvI=; b=iDnS4hClWK/DxvqZ9MMgNP6ExE3IpFdVbNi+JPAXdyK08gWF8TEqlH35qJqYy+nvHZ zRWG+xKYzRWrJsKFjKRlpCOOJMpAYEdG9gJ398/Ra1PablQT4A3qDSvjfDw6dQ58C/Zv YXfuGsKM2ZyXMJvLZTbsAjzJTqwYE7c7SQRsBZdD/8AMS/Rajlst/HBtr+v6khySf+Aq Q2Qr6Iu+DJr67otHW1ET96jZ53Nk3UvyndJk7FYtdpJGDU5M5H5+AyHq+HthPnmmgCBJ KJy0pdOfZwWmauc7nIQRqMXIPovuc7bKfMzOt7bWIvfVvpzLNa40CGaNCspPnbl6xCle 1sag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569297; x=1707174097; 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=8stgI+xO0LshRlV+dbOXjfDk9OWAAP8Iuj6nGWfVSvI=; b=f/xh5e0INHpwavyztFy9uobO85vx5tjklXGeHxCPwzsVGrmd9kqIuqd2EZGtn3fwU2 o8kvfL/aDpZyyZ8rGW2A1KxWGS0XLK8iWXZmBrDf5HOMOQfSZTi9aIpU5tO/Bp7EUnEM vBD7wMC28fb81vH2HHLtnUPi1WqDYuBp80vx3lwtgyd8GP14vLsDwOR4Wqdp57FXDP+E qF67gNzZ8/eNaBFo5CSpycnFnjRY+roruuluIiamFPXPOYa0L5qFvqXnBJXZHVCnnM6L Za0/b3oNVmUJy43XHZ9vmgEQtUTL+jIG7A78Y71SvSC2ZqAPFvlL218X82iJMZHDuTZB 9xiA== X-Gm-Message-State: AOJu0Yz7kqQ+T8wHOIA9/PUIRuuRQ+JJBmEyNGTp9cgVHUvleO1xLEK7 MU3DHHbyrF/cxxNL58d0qcV9yRWyLn6IQp6JunsyQ1YY15BlM3pyg0XSObAuP0vyNDQWneAYm60 BKWE= X-Google-Smtp-Source: AGHT+IGgMFErPY/vdQjdjE2ZD7eumBf+/6RgbeeCKTCcjWSpd5sC0qlJeMBhOErl3KvnRrYT1BzRYg== X-Received: by 2002:a05:6a00:4e58:b0:6d9:c201:66f0 with SMTP id gu24-20020a056a004e5800b006d9c20166f0mr4561881pfb.27.1706569297431; Mon, 29 Jan 2024 15:01:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 05/31] include/exec: Use vaddr in DisasContextBase for virtual addresses Date: Tue, 30 Jan 2024 09:00:55 +1000 Message-Id: <20240129230121.8091-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569800973100005 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Updates target/ QEMU_LOG macros to use VADDR_PRIx for printing updated DisasContextBase fields. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-10-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/translator.h | 6 +++--- target/mips/tcg/translate.h | 3 ++- target/hexagon/translate.c | 3 ++- target/m68k/translate.c | 2 +- target/mips/tcg/translate.c | 12 ++++++------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/exec/translator.h b/include/exec/translator.h index b0412ea6b6..51624feb10 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -79,8 +79,8 @@ typedef enum DisasJumpType { */ typedef struct DisasContextBase { TranslationBlock *tb; - target_ulong pc_first; - target_ulong pc_next; + vaddr pc_first; + vaddr pc_next; DisasJumpType is_jmp; int num_insns; int max_insns; @@ -235,7 +235,7 @@ void translator_fake_ldb(uint8_t insn8, abi_ptr pc); * Translators can use this to enforce the rule that only single-insn * translation blocks are allowed to cross page boundaries. */ -static inline bool is_same_page(const DisasContextBase *db, target_ulong a= ddr) +static inline bool is_same_page(const DisasContextBase *db, vaddr addr) { return ((addr ^ db->pc_first) & TARGET_PAGE_MASK) =3D=3D 0; } diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index cffcfeab8c..93a78b8121 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -202,7 +202,8 @@ extern TCGv bcond; do { = \ if (MIPS_DEBUG_DISAS) { = \ qemu_log_mask(CPU_LOG_TB_IN_ASM, = \ - TARGET_FMT_lx ": %08x Invalid %s %03x %03x %03x\= n", \ + "%016" VADDR_PRIx = \ + ": %08x Invalid %s %03x %03x %03x\n", = \ ctx->base.pc_next, ctx->opcode, op, = \ ctx->opcode >> 26, ctx->opcode & 0x3F, = \ ((ctx->opcode >> 16) & 0x1F)); = \ diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index a14211cf68..f163eefe97 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -234,7 +234,8 @@ static int read_packet_words(CPUHexagonState *env, Disa= sContext *ctx, g_assert(ctx->base.num_insns =3D=3D 1); } =20 - HEX_DEBUG_LOG("decode_packet: pc =3D 0x%x\n", ctx->base.pc_next); + HEX_DEBUG_LOG("decode_packet: pc =3D 0x%" VADDR_PRIx "\n", + ctx->base.pc_next); HEX_DEBUG_LOG(" words =3D { "); for (int i =3D 0; i < nwords; i++) { HEX_DEBUG_LOG("0x%x, ", words[i]); diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 5ec88c5f0d..f886190f88 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1457,7 +1457,7 @@ DISAS_INSN(undef) * for the 680x0 series, as well as those that are implemented * but actually illegal for CPU32 or pre-68020. */ - qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x\n", + qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %" VADDR_PRIx "\= n", insn, s->base.pc_next); gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); } diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index e10232738c..12094cc1e7 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4585,8 +4585,8 @@ static void gen_compute_branch(DisasContext *ctx, uin= t32_t opc, =20 if (ctx->hflags & MIPS_HFLAG_BMASK) { #ifdef MIPS_DEBUG_DISAS - LOG_DISAS("Branch in delay / forbidden slot at PC 0x" - TARGET_FMT_lx "\n", ctx->base.pc_next); + LOG_DISAS("Branch in delay / forbidden slot at PC 0x%016" + VADDR_PRIx "\n", ctx->base.pc_next); #endif gen_reserved_instruction(ctx); goto out; @@ -9061,8 +9061,8 @@ static void gen_compute_branch1_r6(DisasContext *ctx,= uint32_t op, =20 if (ctx->hflags & MIPS_HFLAG_BMASK) { #ifdef MIPS_DEBUG_DISAS - LOG_DISAS("Branch in delay / forbidden slot at PC 0x" TARGET_FMT_lx - "\n", ctx->base.pc_next); + LOG_DISAS("Branch in delay / forbidden slot at PC 0x%016" + VADDR_PRIx "\n", ctx->base.pc_next); #endif gen_reserved_instruction(ctx); return; @@ -11274,8 +11274,8 @@ static void gen_compute_compact_branch(DisasContext= *ctx, uint32_t opc, =20 if (ctx->hflags & MIPS_HFLAG_BMASK) { #ifdef MIPS_DEBUG_DISAS - LOG_DISAS("Branch in delay / forbidden slot at PC 0x" TARGET_FMT_lx - "\n", ctx->base.pc_next); + LOG_DISAS("Branch in delay / forbidden slot at PC 0x%016" + VADDR_PRIx "\n", ctx->base.pc_next); #endif gen_reserved_instruction(ctx); return; --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569988; cv=none; d=zohomail.com; s=zohoarc; b=LidA2DzX34wacTMokFifqopjoEbgtep5EmC2RnG9OWlCJcW4zxIemfqSghY959OyH80cKqNcJQRvf+4k4iKRoTM13ACbLbix4eR37HqLTlbwXRT+rbb63J0jsxL6KPAFI797HaVjhFcOsnmy7tp7sN8WhWXd36UvgbJLceRRb2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569988; h=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=Abpnrf3mk/IImEiBxCwuY+1bvCj+UYnsd1PobWXi05Q=; b=NmcU+1CugC17cxoZ7zUiliYxsKHcf576V/pn36RrvddgZNSwBNcHU9Cx/aQR4ypPcS2cATMqPb4havj8xD0KgyY+fXxtQ0hPyah1pqP/4VFS7pvVzjvfsSU6l56YrCKbYywcI+serhL2yYCj9kPJQzNx3uA+8A4iDRlFOnpE3bE= 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 1706569988882812.6914034388338; Mon, 29 Jan 2024 15:13:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadO-0005wn-EB; Mon, 29 Jan 2024 18:01:46 -0500 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 1rUadK-0005vZ-PH for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:42 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadJ-0008OH-1z for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:42 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-290fb65531eso1752052a91.2 for ; Mon, 29 Jan 2024 15:01:40 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569299; x=1707174099; 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=Abpnrf3mk/IImEiBxCwuY+1bvCj+UYnsd1PobWXi05Q=; b=uZ6n8tn5t+JMXA2i/yJSgSFeHaUhJXNqdwRx+J7IwqppiwhWGTwdFw0UNQJyVnuHfU N92imwoBiFmmcnm8SnKzVyeHjthNzmbp7UdKXvOeJMJ1SWU7aCrUWOBQGAHdOjzJXKKq zuGtIMranO5bmETHSpA94Pnh2XWg+3mJxCCrVTNWCd5pZ3Y6RkxRtsBoP6430fI6nXyQ YF1SFtQt9fQNBbXo58wC8Xa6WgxIUtCnXhG+608lfwHehixT0KDwc0ES41LgBQxfVBVK YO/ExHu9Gi0q4RTpMsnVlGSCYGeb6JZATDW8rJLtmj+G2d5cDfHdbiOEqxMp5I0T9n4H c5DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569299; x=1707174099; 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=Abpnrf3mk/IImEiBxCwuY+1bvCj+UYnsd1PobWXi05Q=; b=Ay6RgPkidwXzePK/u2W+wDErxctlBmttfhAPlTCYJV+7o2f5vi8HT3ySVbGnWqhAhU mBYXBIbcEmYQzOPBycGkp70BL3rYUhlgX9dESxmxH3axhd/DUlvYi3F4hI3blmZY65Nu quizZ5DpdhVCU+XHeQ+fLArz+i45KP5/8wj0TtvH5rvu3zFmvSe1SdiDRpzEAfpJfjm+ zBj4vec5an7SbVF0C5R996PrlwwrlMAwDYrW9CTwVkBojIWzOGNmhCWp7F+FUg6+7Ups HyFmEBX+HmhBSV29DrpDjwOv4vLr7McP4z5Eb+s7xW2wcMEjEIl0wjqO4WkFrZZaVzHV kQiw== X-Gm-Message-State: AOJu0YyNb8keWOla8DLzl57WT/m1jL4DXXMpt5Jc6G+CsagcrKEweg8i ptEOxWfifI9xNnucTW+Fgy1aj2DTBBAW9WIYIZp2KfgPElfqXzEV+zgtqsxtiGicOU7QgInBcf+ HaP8= X-Google-Smtp-Source: AGHT+IFWHDVrCfPNw5E7Z4tqYWzqy1D84bDOoWfso9aYKVcfE7c+mZdbAWzNTdfjXck4JWK4ywRJTw== X-Received: by 2002:a05:6a20:9398:b0:19c:999e:b7a5 with SMTP id x24-20020a056a20939800b0019c999eb7a5mr3862829pzh.53.1706569299439; Mon, 29 Jan 2024 15:01:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 06/31] include/exec: typedef abi_ptr to vaddr Date: Tue, 30 Jan 2024 09:00:56 +1000 Message-Id: <20240129230121.8091-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569989382100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-11-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 6061e33ac9..eb8f3f0595 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -121,8 +121,8 @@ static inline bool guest_range_valid_untagged(abi_ulong= start, abi_ulong len) h2g_nocheck(x); \ }) #else -typedef target_ulong abi_ptr; -#define TARGET_ABI_FMT_ptr TARGET_FMT_lx +typedef vaddr abi_ptr; +#define TARGET_ABI_FMT_ptr VADDR_PRIx #endif =20 uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr); --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569937; cv=none; d=zohomail.com; s=zohoarc; b=mLBvVBc2G4LEgMifsLLTP811gccAEooWvgKZ3Xg/NKRo7wxptZV+UFuS88ilL8hY3c/ZeNwFmg9opG6sc47Vrs92S5rHfWrbmyXW8fcpE8lnqAZnrdyo9xGprUKUA91XfFFzUMTiOpxCnip1M5aSOwiOHQhExVgfxeGS+zvYzhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569937; h=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=rGwTnZnscqahFsCYdn6DyT5/GdGMGcaavMpKxhe75qA=; b=Wp1UivHUHzn5lNfSXcDFYrrNYyV9SkEC8ntABw0Zh+Pa6JS5rsoaSdRbfhaf9oXNACfpp3Vbe+01k9K5lzv/jCTyRCmvWzdFYkExHu9U4SlD9dB5VBPkSald7xO+CA7HPlDLQNAi8+XymXMWUiMI2LZZScoxinyoKHLp5UIs49A= 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 1706569937737789.2162646317839; Mon, 29 Jan 2024 15:12:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadP-0005y4-VK; Mon, 29 Jan 2024 18:01:47 -0500 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 1rUadN-0005wV-18 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:45 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadL-0008OZ-2C for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:44 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3be44e0a7a5so779286b6e.2 for ; Mon, 29 Jan 2024 15:01:42 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569301; x=1707174101; 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=rGwTnZnscqahFsCYdn6DyT5/GdGMGcaavMpKxhe75qA=; b=QZABSXPqjeBP0DhEvvMmD718jfKE1Vra1hpOD73C+aJW4jYg+9RpCwyhljWByvTi+k q0kwh/TWiYER+QKePMqu7wHzq1ZmzmX+Uyc3TlzUO7VLbYeiOcXtcF6x93//pDzRdwc0 F9HHCGJJ4PfHNhx+5T4kTY0I2ndoc2rnLYMRV77D9uaVb3rr/g8PYzuMuKILRNNHP2Pe EvZySRYUiQoobalOMeKE03Rjr4TspZiOtfdtHdNCxc3TYP1XwOqdK7+oveB85rqje9i8 JiJ7RfD7m2n/ufoooyX59eqgSmHhdw4NWWgsehcQZh8zLSQHK2La7RziQoywvYscr6FN lZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569301; x=1707174101; 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=rGwTnZnscqahFsCYdn6DyT5/GdGMGcaavMpKxhe75qA=; b=L14AodzEojSPtOIlFtN2jNiJL8Sb/AMtR7dzuZ5BLrSd8Q7T81UuJsp4ZSAV4quTk6 iX4i+X0zwkDhWi3I6gP0c5a4m2ZC3XqdObU6G8LaJJt3onhtYpGnpm+gb8Nezi2bYWpi ycY8QrcHdHs3vWT0hIqZJGNQWHUwEC9n9WMvRTczsA8OSFIGWUr+cPVIlQ/Bi/4kwM3m /1NWBNCrtweYZxWw4oIplB9o/axtYPmyLlIv9909BC8GLbNIkYWFHMtkx5Sz27D3HXEF 7Vq7P32xduy+McEmxPtLTRnmO/MgZkxE0h41UZ3zFQa8mPxy0Of064bmT5PtOB7VM/9Z T/Hw== X-Gm-Message-State: AOJu0Yxo7e7wypgqIwry5ow1I7X8HaJtow/tPPMd/COSgy0cT8P/YWpU dE5fDsM2GcoX0cUxc2iLI1R1jlYc2Doe9bBFjK2Mj42M79QUh89LMDLoCgobwLUULhkRjo43m0x ND4Y= X-Google-Smtp-Source: AGHT+IFpPy6dD6/hHj6+lY9rJOFOMfZHIGpdqBnBPdtEXUY9yU3Fn5Xgsq9FdwsNnC/Xzdcvrov4oQ== X-Received: by 2002:a05:6358:725:b0:176:8a8e:213c with SMTP id e37-20020a056358072500b001768a8e213cmr4980535rwj.3.1706569301498; Mon, 29 Jan 2024 15:01:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 07/31] include/exec: Move PAGE_* macros to common header Date: Tue, 30 Jan 2024 09:00:57 +1000 Message-Id: <20240129230121.8091-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569939272100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson These don't vary across targets and are used in soon-to-be common code (cputlb.c). Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-15-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 24 ------------------------ include/exec/cpu-common.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 5340907cfd..edee87d3f4 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -171,34 +171,10 @@ extern const TargetPageBits target_page; =20 #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) =20 -/* same as PROT_xxx */ -#define PAGE_READ 0x0001 -#define PAGE_WRITE 0x0002 -#define PAGE_EXEC 0x0004 -#define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC) -#define PAGE_VALID 0x0008 -/* - * Original state of the write flag (used when tracking self-modifying cod= e) - */ -#define PAGE_WRITE_ORG 0x0010 -/* - * Invalidate the TLB entry immediately, helpful for s390x - * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs= () - */ -#define PAGE_WRITE_INV 0x0020 -/* For use with page_set_flags: page is being replaced; target_data cleare= d. */ -#define PAGE_RESET 0x0040 -/* For linux-user, indicates that the page is MAP_ANON. */ -#define PAGE_ANON 0x0080 - #if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY) /* FIXME: Code that sets/uses this is broken and needs to go away. */ #define PAGE_RESERVED 0x0100 #endif -/* Target-specific bits that will be used via page_get_flags(). */ -#define PAGE_TARGET_1 0x0200 -#define PAGE_TARGET_2 0x0400 - /* * For linux-user, indicates that the page is mapped with the same semanti= cs * in both guest and host. diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 3109c6b67d..608708ea48 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -206,4 +206,34 @@ G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, ui= ntptr_t pc); G_NORETURN void cpu_loop_exit(CPUState *cpu); G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); =20 +/* same as PROT_xxx */ +#define PAGE_READ 0x0001 +#define PAGE_WRITE 0x0002 +#define PAGE_EXEC 0x0004 +#define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC) +#define PAGE_VALID 0x0008 +/* + * Original state of the write flag (used when tracking self-modifying cod= e) + */ +#define PAGE_WRITE_ORG 0x0010 +/* + * Invalidate the TLB entry immediately, helpful for s390x + * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs= () + */ +#define PAGE_WRITE_INV 0x0020 +/* For use with page_set_flags: page is being replaced; target_data cleare= d. */ +#define PAGE_RESET 0x0040 +/* For linux-user, indicates that the page is MAP_ANON. */ +#define PAGE_ANON 0x0080 + +/* Target-specific bits that will be used via page_get_flags(). */ +#define PAGE_TARGET_1 0x0200 +#define PAGE_TARGET_2 0x0400 + +/* + * For linux-user, indicates that the page is mapped with the same semanti= cs + * in both guest and host. + */ +#define PAGE_PASSTHROUGH 0x0800 + #endif /* CPU_COMMON_H */ --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569556; cv=none; d=zohomail.com; s=zohoarc; b=TYu9B/8MLZyQnQ7YNpjwNfu3+FMu1MYkyFFLW1jKz/S22LVkvujq8fgK91OkuJsjcGjtiiV94U36DUU3JDFlmF0YABSwpuW2OjZcKycW7x6Q8vTr/SQiV1np2m8wPhifMGe++ZguWOVE9YBfeCn+Y2e2pRSAXTMI7NQBiB681Qw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569556; 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=blFzc6YcDRkiR8B9Edly+GRoesCmaBH2nX316LvuRkc=; b=DLgU6TKdle2/mRQ6KDWPBzOeWKPKtQHB49nJ2MROdrDyDObMewmSWMzh1mj5oaEBdXs6hZ/ysPlSSLoYAOHeXHsu8GFCk3Xp5VFsDuzhi/yN6L+FFZoxQ++qRXBSQH3Jfg5dKtXchqGsJaAxJhIj/q/OgVBvcuMKD/JMWXvcLlw= 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 1706569556145226.98049802397577; Mon, 29 Jan 2024 15:05:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadQ-0005yG-7D; Mon, 29 Jan 2024 18:01:48 -0500 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 1rUadP-0005xq-0c for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:47 -0500 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadM-0008Oq-W9 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:46 -0500 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6ddf26eba3cso2121606a34.0 for ; Mon, 29 Jan 2024 15:01:44 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569304; x=1707174104; 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=blFzc6YcDRkiR8B9Edly+GRoesCmaBH2nX316LvuRkc=; b=KCjk9Luj2kwf1EnQVSxcIkrXxyH/tKdy/egGxxDPQbThu5IOqzJ1XtOm933Veg5I38 ZOs0ToLj3oN4yoSerUuPTXlUau3n1LpAFzVUQK95eR/NR4fgdx8MuaJYmq+AOZrdMCaI H/DrJtXmZiPa5RzVRGe1EEvs9iNYug0DAdYTd4JndeGfZX+84v4t2sPMsu46h+OQ9sDG bdqvup+A9sMOO/z5GRDZkf0S9s3O7ByRZu5vkZOkvJVkUAVGwsjbRe59284gaWy5mOQD PFYs0IX7b69BbXGzt2rbqirwb1KbVGwfWtSmTjTDjsIUuHfaPVse9lNoJ/5SxEBqAfuN sq5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569304; x=1707174104; 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=blFzc6YcDRkiR8B9Edly+GRoesCmaBH2nX316LvuRkc=; b=Kst6v1iEIUNVaV2wSdx9IRwHqp7Ol2Yz80sH/E5H+BxHttL5BqZ/ub1AmlcoX9ppwy xyl+XJRbGWNhtVr3erHGtjydNhEMNsgZBqdnPGUZuLIadmXmQuDpSp81r3Hm16BurvY0 PyKsH4mGUled/wtVrUm6PQrSuZFadsS/TVCdpzCW/fUHNgj9nR0Oc46ACEuSq+xRXYaJ +ZN9pL/N8qs86AwZrW8rx8SHmC1VJpqGZI503w5gtE0LRI+2d31jjkdavc70k7OSe0W/ p/TyEFAf6H+Zf24ObEOeDNzXNjV1kQ41R0EhByzt2ECqzZNHPI2wqnHcVP5VLSHQu3B7 goDA== X-Gm-Message-State: AOJu0YyDSnfC+/SeWVGwlK302/7nWLdE/0WmuABEHZQwiPxFnhARvoe1 FISlw5ntyTFvzFnrktggxn8q5lBaTGYSfiUheoryOtvS5V7XmzRkiDlx4k/IbgPPk4ctptaQTNV ExsU= X-Google-Smtp-Source: AGHT+IF7pWujJumVMn2IoJ2nvf83N6fpWpLtQiwiO6wZuUaxCSc0KBf/tIVhUbpU/p4JD+IJp3oLKw== X-Received: by 2002:a05:6358:4b4e:b0:178:7d95:2913 with SMTP id ks14-20020a0563584b4e00b001787d952913mr2074311rwc.34.1706569303886; Mon, 29 Jan 2024 15:01:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/31] include/exec: Move cpu_*()/cpu_env() to common header Date: Tue, 30 Jan 2024 09:00:58 +1000 Message-Id: <20240129230121.8091-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::32c; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569558379100003 From: Anton Johansson Functions are target independent. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-17-anjo@rev.ng> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 25 ------------------------- include/exec/cpu-common.h | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index edee87d3f4..8501a33dbf 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -384,33 +384,8 @@ static inline bool tlb_hit(uint64_t tlb_addr, vaddr ad= dr) =20 #endif /* !CONFIG_USER_ONLY */ =20 -/* accel/tcg/cpu-exec.c */ -int cpu_exec(CPUState *cpu); - /* Validate correct placement of CPUArchState. */ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) !=3D 0); QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) !=3D sizeof(CPUState)); =20 -/** - * env_archcpu(env) - * @env: The architecture environment - * - * Return the ArchCPU associated with the environment. - */ -static inline ArchCPU *env_archcpu(CPUArchState *env) -{ - return (void *)env - sizeof(CPUState); -} - -/** - * env_cpu(env) - * @env: The architecture environment - * - * Return the CPUState associated with the environment. - */ -static inline CPUState *env_cpu(CPUArchState *env) -{ - return (void *)env - sizeof(CPUState); -} - #endif /* CPU_ALL_H */ diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 608708ea48..dcbd5f5783 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -7,6 +7,7 @@ #ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" #endif +#include "hw/core/cpu.h" =20 #define EXCP_INTERRUPT 0x10000 /* async interruption */ #define EXCP_HLT 0x10001 /* hlt instruction reached */ @@ -236,4 +237,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, u= intptr_t pc); */ #define PAGE_PASSTHROUGH 0x0800 =20 +/* accel/tcg/cpu-exec.c */ +int cpu_exec(CPUState *cpu); + +/** + * env_archcpu(env) + * @env: The architecture environment + * + * Return the ArchCPU associated with the environment. + */ +static inline ArchCPU *env_archcpu(CPUArchState *env) +{ + return (void *)env - sizeof(CPUState); +} + +/** + * env_cpu(env) + * @env: The architecture environment + * + * Return the CPUState associated with the environment. + */ +static inline CPUState *env_cpu(CPUArchState *env) +{ + return (void *)env - sizeof(CPUState); +} + #endif /* CPU_COMMON_H */ --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569833; cv=none; d=zohomail.com; s=zohoarc; b=gy6r56FlB+TtEoeuBaOVyGAPuL8lTMXh4UIV2EnIRU3w1bH8aGDhWVdfAZCWMTuOp+iRtFGcWZ+C7ikXB+J/lBvCvrf9tCR8n4AsiwOfXygprCWqTAMWF9xgCqKrSr6QHvJoMSWvqhO40N19k0KZAZLckc+sCiKpVQtmAXElGpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569833; h=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=0IsJCYKuWrursPA6kPyaSh6Iig/if/7dsXp1H2oDJMs=; b=NUKBRte5LzrizOH1LUQhfKyo5RFJOIGRe2mdb1dKUN7EnwfpCWVRG0gtjk9ZRU3TZpz1b54RA7HJgrN6Yx2D/OpNYvX2mr7SHFSaZgkaKFaYGumopEUxjWp0y3rwih0qdHnFauNYVrkYcOyOm95R6Bih/EL5O58RIPXfzwhdezw= 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 1706569833091617.2898613192024; Mon, 29 Jan 2024 15:10:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUads-0006HS-Fk; Mon, 29 Jan 2024 18:02:17 -0500 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 1rUada-00060q-Is for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:02 -0500 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadQ-0008P5-1Q for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:49 -0500 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-59a0fb8a802so1709592eaf.1 for ; Mon, 29 Jan 2024 15:01:47 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569306; x=1707174106; 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=0IsJCYKuWrursPA6kPyaSh6Iig/if/7dsXp1H2oDJMs=; b=DKQq7lvvL04mHhcWP2tZAhBMd10a3cTJRG9kx+4f2yCSWEBy5h++ZJ8KVCPCzKM/Hw HfanTbXsiJDTlCJ/TWtD7c5PfwdyMmiDS8M78Exa9+Tvc6yp29rXDA9m402+JiBY5MkW x26ddsW+HI3vNLjdl3ptvz426emQoemm0VMGq+04vpYMK+kyEVNGDT6d7cexVQ69sQZi qTpsAMnziISpHwtMPhdoH1s8Hj3ig3iwXilkZ0hFAyw3YT53lwefrGX4h1EUZ4t8ZxI5 3xR35rCIWevH7b5Whlv+iq+AnO8oMFUKJIZ/aWCDr8G5kmwpmLprbJrOmQlI1WwxnE6v vyeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569306; x=1707174106; 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=0IsJCYKuWrursPA6kPyaSh6Iig/if/7dsXp1H2oDJMs=; b=FpLsGvzbpSwpoGbd4YMpss2K35KHKcvEy7IQZc4CRwWdqhB6oiuAUZbTW8qhBR/wh+ C6OqlwpdQ6gwUntCY129lv/7bYTzm8JFUTzqA9SzwVm677/AIYIWWbMMCWUL5RAIUCu6 Nf40m5LHgAOviDhhRDmKl3gH8UfKaZXq5BMMA2W/r+d42BSVX5rL1oo7siTKBp94ELbo KPhRQRxUSmulRzwIY8L53uikFEm/XXr/4gm14FtZmGCelHpmfN9YbV1i/Bc5y35i5D0B R0+w8/rEHk8GY5ywsOpDEDG16GJgakATRdNS8lQgOd35aqiOjIQ39MULCr51XXJ5goaG F6sQ== X-Gm-Message-State: AOJu0YyLeArIT4GGpdX7ex1jv8nh5maPDqW9l7uzz7vXpgywvobZWd86 GC4FujDlX0jGpsU98t9rnwzekakM6qeKx/fPTDIUgk58Rq/iggInobzFr9WorMha7zERCrCClC3 GaMY= X-Google-Smtp-Source: AGHT+IHIPKf9PzEMlhSDLryiovNY3w5s4jjNWpPoBC0npz4kFb7fhMwRlORNMpUcizD7qMaStlBu7g== X-Received: by 2002:a05:6358:4425:b0:176:81c5:f377 with SMTP id z37-20020a056358442500b0017681c5f377mr6922383rwc.36.1706569305919; Mon, 29 Jan 2024 15:01:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 09/31] include/hw/core: Move do_interrupt in TCGCPUOps Date: Tue, 30 Jan 2024 09:00:59 +1000 Message-Id: <20240129230121.8091-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569835046100011 Content-Type: text/plain; charset="utf-8" From: Anton Johansson The ifdef out of which it is moved is not quite right: do_interrupt is only needed for system mode. Move it to the top of a different ifdef block, which preserves its position within the structure for that case. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-18-anjo@rev.ng> [rth: Split from a larger patch and simplified.] Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 479713a36e..d6fe55d471 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -58,11 +58,6 @@ struct TCGCPUOps { * cpu execution loop (hack for x86 user mode). */ void (*fake_user_interrupt)(CPUState *cpu); -#else - /** - * @do_interrupt: Callback for interrupt handling. - */ - void (*do_interrupt)(CPUState *cpu); #endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_USER_ONLY /** @@ -114,6 +109,8 @@ struct TCGCPUOps { void (*record_sigbus)(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra); #else + /** @do_interrupt: Callback for interrupt handling. */ + void (*do_interrupt)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569548; cv=none; d=zohomail.com; s=zohoarc; b=OuAWmua6/JNz5QA3Etp+ObZ0srCB9wpq6A44ELkthtv6Tg9JnBKkktM25n9sYV0QbxTUHOls6WP6x8XJ9YcG7gbtYdAu/OsRHimn9DF6/k83+6XIVxloexCeSdGQ6YNztxRtXfU5BzIS0lmOzGIpBX/8xxEvnn2oWju+OX2b6RU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569548; h=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=o1cRBtAgGqadhUih0VNs9If35/tfCXiaB3lrOMREblM=; b=ixVuHGiM5Bm5ivMjETgzCz6DSf/WMxGtgef3Oduv/TPoz+z80kBas0rPxuRDXtSAsQ7BxDM+C8Ux7P2DfZ7zC5dz3+sxeBXgIMaOskoHAi+2lrSHNMJuc8NjN4ozLEH/xtbAjRC3BS6jrIJmdMt8cGLtv9NeY4cdoQJ/mUD+GKU= 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 1706569548310655.8262804192007; Mon, 29 Jan 2024 15:05:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadp-0006Dn-V6; Mon, 29 Jan 2024 18:02:15 -0500 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 1rUadc-00062g-Ee for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:03 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUada-0008PU-AN for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:01:59 -0500 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5cf2d73a183so3262050a12.1 for ; Mon, 29 Jan 2024 15:01:48 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569308; x=1707174108; 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=o1cRBtAgGqadhUih0VNs9If35/tfCXiaB3lrOMREblM=; b=i5a9rgVDIiTJH2x6Zna+rMGZ9ry3IYVk12yXaZjqkGd0ipwbh1qz+uFM8ikkt1K3sW rvfwg71e/nnRRbyAS6SWY0cNaUuQQvJuDloXw4Hsbl3y/t0JYlkXFmPYRGvJSl88fAT8 iYFd7gcPg2MLycCgTnWudsY0X0bnVBUIDIVU3M1mJInUUoE+XWCV1PzglwHNpECPnUR1 z1eZR4oNZlhuO2X50GB+V2jttHlE4Vq7GcRcostcFnwkqfNj63QmVHiJcgJmCMSaQ0dw JP/yQTPjvgy8zJiv+aP+QqMQ2Ba6PetblYCYEnJs/NXdWMYbJDJS+RftkrG9b5MRMus3 nlDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569308; x=1707174108; 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=o1cRBtAgGqadhUih0VNs9If35/tfCXiaB3lrOMREblM=; b=MkWhUQ5n5y4gDbJlbB6LUNTBjL7RbsZUihdsAXLFXfHrU38EGShHfNxtLW3JUIzZTr Oym42LFrMsjdLif66MjU4E3lhU+AaTtqY3uzgEgRndmEuoZgQog/0CmCmF/2MBhDyLno vHymHKGL2NDJ4GQoiZh7z6HuY8NjDAlluYcgksHGFreCvxe2pCU95983hXJAlA10pBio wKLhVWZPxglebM4bcQjWkPtv6BjYqr6jN8taElK81lI/dj90APhOdcO4GpBANsl3MWkA sXrAVssRqjwdlE8Vs9m4IbjlyaORsSy/SlcbhD7rsWlKxUryvD+cyK405XK3Styaiu7Y d6Tw== X-Gm-Message-State: AOJu0YwEsjiyec9x6D1l0Gt9Daf1qObvIG5usxGRoAaoYK99tzVHoL/i 62kvPVr52yKNtAENESqNKhwILycjIz1jDn3fCJ7J4V/r4Q+ttEl67ZvHir3t2e9OvR38RoMpj+2 mciQ= X-Google-Smtp-Source: AGHT+IF5hjK4eLfBJDqxqEY2kQrCH8RgQJ+bIVa1n6TDVT3tEbSY3KYWxOIyJua5WeEe6segQxYqkA== X-Received: by 2002:a05:6a20:144e:b0:19d:e644:7c9 with SMTP id a14-20020a056a20144e00b0019de64407c9mr37092pzi.22.1706569307936; Mon, 29 Jan 2024 15:01:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 10/31] include/hw/core: Remove i386 conditional on fake_user_interrupt Date: Tue, 30 Jan 2024 09:01:00 +1000 Message-Id: <20240129230121.8091-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569550344100003 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Always include fake_user_interrupt in user-only build, despite only being used for i386. This will enable cpu-exec.c to be compiled only once. Signed-off-by: Anton Johansson Message-ID: <20240119144024.14289-18-anjo@rev.ng> [rth: Split out of a larger patch; remove TARGET_I386 conditional.] Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index d6fe55d471..3ed279836f 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -50,7 +50,7 @@ struct TCGCPUOps { void (*debug_excp_handler)(CPUState *cpu); =20 #ifdef NEED_CPU_H -#if defined(CONFIG_USER_ONLY) && defined(TARGET_I386) +#ifdef CONFIG_USER_ONLY /** * @fake_user_interrupt: Callback for 'fake exception' handling. * @@ -58,8 +58,7 @@ struct TCGCPUOps { * cpu execution loop (hack for x86 user mode). */ void (*fake_user_interrupt)(CPUState *cpu); -#endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ -#ifdef CONFIG_USER_ONLY + /** * record_sigsegv: * @cpu: cpu context --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569392; cv=none; d=zohomail.com; s=zohoarc; b=au1dNe4bnTu4HtIN5YCWr9SVslgArAbKQ7iwCX9Qpwx2r0tVWnDJT73HFNehUrjWgR+/uEPVRfXDTL7i+R5N8zWkJy8Oxm+TuG9iV8UMpn1KiZU/GhvrhPnz8IjO91Kl7n9si6v9eul3v7xKihReoJUrh2YE5eOou40ftYUBIJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569392; h=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=5lOMiA1d/7RQJUfbMVKZZ3ZFzC3WxOo3rdXkjjDSQz4=; b=SvQzoOETJyPdUK+KtUNnfqNRpymDIPD4tk9WFPTF5bfoJJWVgFIGVTpnU5dBhY6ND7KWVSA/UvfFGvYOAfNVl4VXsMWkeB/ZzDVU1xTPT9q9tl5Ll4KXgFQ0E+X3IlygH4EUvPjeve/vZZn/pLu8R6G+h6AikmAkQ/28XKkDn8U= 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 1706569392069718.0398351522246; Mon, 29 Jan 2024 15:03:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUae0-0006es-AG; Mon, 29 Jan 2024 18:02:24 -0500 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 1rUade-00062w-Ff for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:04 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUada-0008Pd-B3 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:01 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6ddcfbc5a5fso2733087b3a.2 for ; Mon, 29 Jan 2024 15:01:51 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569310; x=1707174110; 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=5lOMiA1d/7RQJUfbMVKZZ3ZFzC3WxOo3rdXkjjDSQz4=; b=XT0LggRzRrIApt+Q7m9N/WWu60TPCq1L7O0GtBJTPAYi1w4K5MZJvzQLKVeBZ4q32C QnoNfYpvsb3+2fgXUFwZZY90Kb1idoZjW1K2MiygHx9Q5zap3YyzjwoVsqp9Xi3X2sIJ Qq+6r6+0L7SnQYqMwaLeZNSc9DvtL/DhCTigYQ/opvKzLKAoroIcw87bws5l1vMAsk8V yB9i1GtMmNRPOdSMsTYLoH5x50LrZJTKNZAQkPr3GilKjbFp2vQlqioxFS7i/D992IKb dS0OX8/2z5aIVBYO5853YLNytKoitBBqPEC0Haosa09dTu7snCm5pNH+HzDgc89rR2G1 o8ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569310; x=1707174110; 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=5lOMiA1d/7RQJUfbMVKZZ3ZFzC3WxOo3rdXkjjDSQz4=; b=Ybhyh6WF0tm8a44AGbwdM7QXdH7iXvK+X7xzFPb4SFTb8omErxNiFMS2/I9opV0k3D Jjg3ydL8yevWYkhIoZWtlUcgoMC8s3xNVCS8GKOb0wbRCndd9WcezB1BjqokI/SZvRdn 6AGMpaHJvYr+MUdO4VIjidux6xm+aZPSboFSf/ZdggwLQu/4FfjtbAzXdQKCbuXrtE2s wIWTgRhMdwpxm4VSbPWz1qzMgA2h2fK400VOn+YqZmySdP2HuDWcsSnslTC9k/v0ss9/ LTs+b3CWH3WTmsVLfXLXmvH7LZ6eBT4NyAswvxS6KaIwwbnKEqMYWw7iGJ53YessrK+e o28g== X-Gm-Message-State: AOJu0YyrcesB8GPkFUfAxLCYHG/koeyWJCTZebbK4B7uBgTlcDDYzZCl D/ZWqdi+F0vgapSIMsLJ5zNFiTJ00wNgwvDdNZm6GJUTaJ5ePCIYKph9AqWKLKUX1FXouqkXhjK rKAM= X-Google-Smtp-Source: AGHT+IEYRSgt4QIqIk2YlDG5pBQVSzxajexuIaxrEM8kcEqjTdGQ8Omq4HfvL7JHkp+DGQ6MaAI6lw== X-Received: by 2002:a62:cdcd:0:b0:6db:ca49:9ce3 with SMTP id o196-20020a62cdcd000000b006dbca499ce3mr5257249pfg.6.1706569310012; Mon, 29 Jan 2024 15:01:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich Subject: [PULL 11/31] linux-user: Allow gdbstub to ignore page protection Date: Tue, 30 Jan 2024 09:01:01 +1000 Message-Id: <20240129230121.8091-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569393973100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich gdbserver ignores page protection by virtue of using /proc/$pid/mem. Teach qemu gdbstub to do this too. This will not work if /proc is not mounted; accept this limitation. One alternative is to temporarily grant the missing PROT_* bit, but this is inherently racy. Another alternative is self-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20240129093410.3151-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- cpu-target.c | 78 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index f6e07c3deb..958d63e882 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -382,6 +382,9 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, vaddr l, page; void * p; uint8_t *buf =3D ptr; + ssize_t written; + int ret =3D -1; + int fd =3D -1; =20 while (len > 0) { page =3D addr & TARGET_PAGE_MASK; @@ -389,30 +392,75 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, if (l > len) l =3D len; flags =3D page_get_flags(page); - if (!(flags & PAGE_VALID)) - return -1; + if (!(flags & PAGE_VALID)) { + goto out_close; + } if (is_write) { - if (!(flags & PAGE_WRITE)) - return -1; + if (flags & PAGE_WRITE) { + /* XXX: this code should not depend on lock_user */ + p =3D lock_user(VERIFY_WRITE, addr, l, 0); + if (!p) { + goto out_close; + } + memcpy(p, buf, l); + unlock_user(p, addr, l); + } else { + /* Bypass the host page protection using ptrace. */ + if (fd =3D=3D -1) { + fd =3D open("/proc/self/mem", O_WRONLY); + if (fd =3D=3D -1) { + goto out; + } + } + /* + * If there is a TranslationBlock and we weren't bypassing= the + * host page protection, the memcpy() above would SEGV, + * ultimately leading to page_unprotect(). So invalidate t= he + * translations manually. Both invalidation and pwrite() m= ust + * be under mmap_lock() in order to prevent the creation of + * another TranslationBlock in between. + */ + mmap_lock(); + tb_invalidate_phys_range(addr, addr + l - 1); + written =3D pwrite(fd, buf, l, + (off_t)(uintptr_t)g2h_untagged(addr)); + mmap_unlock(); + if (written !=3D l) { + goto out_close; + } + } + } else if (flags & PAGE_READ) { /* XXX: this code should not depend on lock_user */ - if (!(p =3D lock_user(VERIFY_WRITE, addr, l, 0))) - return -1; - memcpy(p, buf, l); - unlock_user(p, addr, l); - } else { - if (!(flags & PAGE_READ)) - return -1; - /* XXX: this code should not depend on lock_user */ - if (!(p =3D lock_user(VERIFY_READ, addr, l, 1))) - return -1; + p =3D lock_user(VERIFY_READ, addr, l, 1); + if (!p) { + goto out_close; + } memcpy(buf, p, l); unlock_user(p, addr, 0); + } else { + /* Bypass the host page protection using ptrace. */ + if (fd =3D=3D -1) { + fd =3D open("/proc/self/mem", O_RDONLY); + if (fd =3D=3D -1) { + goto out; + } + } + if (pread(fd, buf, l, + (off_t)(uintptr_t)g2h_untagged(addr)) !=3D l) { + goto out_close; + } } len -=3D l; buf +=3D l; addr +=3D l; } - return 0; + ret =3D 0; +out_close: + if (fd !=3D -1) { + close(fd); + } +out: + return ret; } #endif =20 --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569420; cv=none; d=zohomail.com; s=zohoarc; b=bTbThO33uf2idqm04k9D2N8B5+pgtUrT6a9STgBju07l6lNm0v82x1v0oUySwdHi6UMqcSj4lR27nV2rH1rmVKBmGTcNIEEdz37un1c5uthyjrrL23HAGUxQerlQYVEEUHpnFpgbPDnChsOG1NSxKOmBMX6Ia7LGgEdHsq3szwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569420; h=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=dVpO3eVaybrYtGXvIjJnOv6+J8+14JOgiWCfY0AXuD8=; b=jl3kUfYQZxGOWFdkwlO5p+i1qhk/qZx5D9OErhZX0ISJbe+vz7qXRquw5vcwTQ0WIlur1zdCIBnql6NKpql2vPgYt3iEtqREyVkLmB1mWhqHZyCqkB7RaRkeEatk2/zIklwxuFQXJqVWX8foGGAXi/sEJ+eIvG9gW3CTsxigMII= 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 1706569420382986.8459864666152; Mon, 29 Jan 2024 15:03:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUady-0006Vo-5o; Mon, 29 Jan 2024 18:02:22 -0500 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 1rUadg-00063B-PB for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:06 -0500 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUada-0008Pj-CO for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:04 -0500 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3be5973913bso538970b6e.3 for ; Mon, 29 Jan 2024 15:01:53 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569312; x=1707174112; 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=dVpO3eVaybrYtGXvIjJnOv6+J8+14JOgiWCfY0AXuD8=; b=fBrr8/dUZKsBvi61WqGQ70MLnnz0xbqbpsgpvTjVt7B67EZFNxkXQ1FXWpqYbua4IR xOdIgrZt6cAQt1QYKkPXCz0Q+uXLZpeqmreozdsBXgR2OTnGZESQRPx0+dGCe2GW8G7P XayNUn2bHgi3hJLDl5O8fFLzFKEROkzLDuEOAE6oK/3FYp0DZEOPV6JNWbAw+/crKOtP eP1EyJWk68DBNZNo9sCYUtCSQBJPO1y508s2AkTrOhWZMLt25f/XUWGK19U3/Ew4IPwh +lCAJlFxHe2Jpw3xWF7AGYy5r/68uEwU46rMAwXM57r4UOzRAmYioMBmeLbxg44pcY6G M5nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569312; x=1707174112; 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=dVpO3eVaybrYtGXvIjJnOv6+J8+14JOgiWCfY0AXuD8=; b=f9Mc9apwKYfMomkf2BT0j1h2GSlKpn+wvFCl1vIXjOjwgXDIdj8LnLRLg9V5JTJBat iVsZ3/IAyzvMENfVWhGMwIn0ZwPAIuXHsRPfN/fsDpg0mSvxL/xJs8qFLv0Cs+82B3nL KDhGSAuZxo4ogP7u4s7tAitTpg7QmQVvMKIXmdzOOGADi7GJ2CSY6jfO4xj4etyb0htd +crWuWe20Q8BQ5QAqclI6ZFsHS/xnZhWlENlaKA7A0oTCGuC/3rncTfAdYAgS2yW6WA0 +fLKVvbpRQ+EY4YdJmtfm9/PH88r3WW8A+7SAHYw0gMq650w7PU8k1lzB/3PR46uMVhx M4OA== X-Gm-Message-State: AOJu0YwvCQkP797uZRKoPcsge9uXawMvHLszwhPeqyTn8zUF4oacykqH PxV4wJYc4fl1JI1/43WIWQFsFol++AphnvNgsjZDbuTXVcAIKN2IL2TbugOy9/E1lGlFHEiFdr7 0FDE= X-Google-Smtp-Source: AGHT+IGpfCa2QGsukC7mH0V0Zsctl7Vuv65YzQOb/C/+S4JmjxqZ2KsPC6vvEx2NuLarwUMjMuR54w== X-Received: by 2002:a05:6808:13cd:b0:3bd:c4cf:bd29 with SMTP id d13-20020a05680813cd00b003bdc4cfbd29mr4255200oiw.22.1706569312110; Mon, 29 Jan 2024 15:01:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich Subject: [PULL 12/31] tests/tcg: Factor out gdbstub test functions Date: Tue, 30 Jan 2024 09:01:02 +1000 Message-Id: <20240129230121.8091-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569422142100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya Leoshkevich Message-Id: <20240129093410.3151-3-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/guest-debug/run-test.py | 7 ++- tests/guest-debug/test_gdbstub.py | 60 +++++++++++++++++++ tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 34 +---------- tests/tcg/aarch64/gdbstub/test-sve.py | 33 +--------- tests/tcg/multiarch/gdbstub/interrupt.py | 47 ++------------- tests/tcg/multiarch/gdbstub/memory.py | 39 +----------- tests/tcg/multiarch/gdbstub/registers.py | 41 ++----------- tests/tcg/multiarch/gdbstub/sha1.py | 38 ++---------- .../multiarch/gdbstub/test-proc-mappings.py | 39 +----------- .../multiarch/gdbstub/test-qxfer-auxv-read.py | 37 +----------- .../gdbstub/test-thread-breakpoint.py | 37 +----------- tests/tcg/s390x/gdbstub/test-signals-s390x.py | 42 +------------ tests/tcg/s390x/gdbstub/test-svc.py | 39 +----------- 13 files changed, 98 insertions(+), 395 deletions(-) create mode 100644 tests/guest-debug/test_gdbstub.py diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index b13b27d4b1..368ff8a890 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -97,7 +97,12 @@ def log(output, msg): sleep(1) log(output, "GDB CMD: %s" % (gdb_cmd)) =20 - result =3D subprocess.call(gdb_cmd, shell=3DTrue, stdout=3Doutput, std= err=3Dstderr) + gdb_env =3D dict(os.environ) + gdb_pythonpath =3D gdb_env.get("PYTHONPATH", "").split(os.pathsep) + gdb_pythonpath.append(os.path.dirname(os.path.realpath(__file__))) + gdb_env["PYTHONPATH"] =3D os.pathsep.join(gdb_pythonpath) + result =3D subprocess.call(gdb_cmd, shell=3DTrue, stdout=3Doutput, std= err=3Dstderr, + env=3Dgdb_env) =20 # A result of greater than 128 indicates a fatal signal (likely a # crash due to gdb internal failure). That's a problem for GDB and diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdb= stub.py new file mode 100644 index 0000000000..7f71d34da1 --- /dev/null +++ b/tests/guest-debug/test_gdbstub.py @@ -0,0 +1,60 @@ +"""Helper functions for gdbstub testing + +""" +from __future__ import print_function +import gdb +import os +import sys +import traceback + +fail_count =3D 0 + + +def report(cond, msg): + """Report success/fail of a test""" + if cond: + print("PASS: {}".format(msg)) + else: + print("FAIL: {}".format(msg)) + global fail_count + fail_count +=3D 1 + + +def main(test, expected_arch=3DNone): + """Run a test function + + This runs as the script it sourced (via -x, via run-test.py).""" + try: + inferior =3D gdb.selected_inferior() + arch =3D inferior.architecture() + print("ATTACHED: {}".format(arch.name())) + if expected_arch is not None: + report(arch.name() =3D=3D expected_arch, + "connected to {}".format(expected_arch)) + except (gdb.error, AttributeError): + print("SKIP: not connected") + exit(0) + + if gdb.parse_and_eval("$pc") =3D=3D 0: + print("SKIP: PC not set") + exit(0) + + try: + test() + except: + print("GDB Exception:") + traceback.print_exc(file=3Dsys.stdout) + global fail_count + fail_count +=3D 1 + if "QEMU_TEST_INTERACTIVE" in os.environ: + import code + code.InteractiveConsole(locals=3Dglobals()).interact() + raise + + try: + gdb.execute("kill") + except gdb.error: + pass + + print("All tests complete: {} failures".format(fail_count)) + exit(fail_count) diff --git a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py b/tests/tcg/aarch6= 4/gdbstub/test-sve-ioctl.py index ee8d467e59..a78a3a2514 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +++ b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py @@ -8,19 +8,10 @@ # =20 import gdb -import sys +from test_gdbstub import main, report =20 initial_vlen =3D 0 -failcount =3D 0 =20 -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 class TestBreakpoint(gdb.Breakpoint): def __init__(self, sym_name=3D"__sve_ld_done"): @@ -64,26 +55,5 @@ def run_test(): =20 gdb.execute("c") =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - report(arch.name() =3D=3D "aarch64", "connected to aarch64") -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -try: - # Run the actual tests - run_test() -except: - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - import code - code.InteractiveConsole(locals=3Dglobals()).interact() - raise - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test, expected_arch=3D"aarch64") diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbs= tub/test-sve.py index afd8ece98d..84cdcd4a32 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve.py +++ b/tests/tcg/aarch64/gdbstub/test-sve.py @@ -6,20 +6,10 @@ # =20 import gdb -import sys +from test_gdbstub import main, report =20 MAGIC =3D 0xDEADBEEF =20 -failcount =3D 0 - -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 def run_test(): "Run through the tests one by one" @@ -54,24 +44,5 @@ def run_test(): report(str(v.type) =3D=3D "uint64_t", "size of %s" % (reg)) report(int(v) =3D=3D MAGIC, "%s is 0x%x" % (reg, MAGIC)) =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - report(arch.name() =3D=3D "aarch64", "connected to aarch64") -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -try: - # Run the actual tests - run_test() -except: - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - -print("All tests complete: %d failures" % failcount) - -exit(failcount) +main(run_test, expected_arch=3D"aarch64") diff --git a/tests/tcg/multiarch/gdbstub/interrupt.py b/tests/tcg/multiarch= /gdbstub/interrupt.py index c016e7afbb..90a45b5140 100644 --- a/tests/tcg/multiarch/gdbstub/interrupt.py +++ b/tests/tcg/multiarch/gdbstub/interrupt.py @@ -8,19 +8,7 @@ # =20 import gdb -import sys - -failcount =3D 0 - - -def report(cond, msg): - "Report success/fail of test" - if cond: - print("PASS: %s" % (msg)) - else: - print("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 +from test_gdbstub import main, report =20 =20 def check_interrupt(thread): @@ -59,6 +47,9 @@ def run_test(): Test if interrupting the code always lands us on the same thread when running with scheduler-lock enabled. """ + if len(gdb.selected_inferior().threads()) =3D=3D 1: + print("SKIP: set to run on a single thread") + exit(0) =20 gdb.execute("set scheduler-locking on") for thread in gdb.selected_inferior().threads(): @@ -66,32 +57,4 @@ def run_test(): "thread %d resumes correctly on interrupt" % thread.num) =20 =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) - -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) -if len(gdb.selected_inferior().threads()) =3D=3D 1: - print("SKIP: set to run on a single thread") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -# Finally kill the inferior and exit gdb with a count of failures -gdb.execute("kill") -exit(failcount) +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/memory.py b/tests/tcg/multiarch/gd= bstub/memory.py index fb1d06b7bb..532b92e7fb 100644 --- a/tests/tcg/multiarch/gdbstub/memory.py +++ b/tests/tcg/multiarch/gdbstub/memory.py @@ -9,18 +9,7 @@ =20 import gdb import sys - -failcount =3D 0 - - -def report(cond, msg): - "Report success/fail of test" - if cond: - print("PASS: %s" % (msg)) - else: - print("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 +from test_gdbstub import main, report =20 =20 def check_step(): @@ -99,29 +88,5 @@ def run_test(): =20 report(cbp.hit_count =3D=3D 0, "didn't reach backstop") =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -# Finally kill the inferior and exit gdb with a count of failures -gdb.execute("kill") -exit(failcount) +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/registers.py b/tests/tcg/multiarch= /gdbstub/registers.py index 688c061107..b3d13cb077 100644 --- a/tests/tcg/multiarch/gdbstub/registers.py +++ b/tests/tcg/multiarch/gdbstub/registers.py @@ -7,20 +7,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 import gdb -import sys import xml.etree.ElementTree as ET +from test_gdbstub import main, report + =20 initial_vlen =3D 0 -failcount =3D 0 - -def report(cond, msg): - "Report success/fail of test." - if cond: - print("PASS: %s" % (msg)) - else: - print("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 =20 def fetch_xml_regmap(): @@ -75,6 +66,7 @@ def fetch_xml_regmap(): =20 return reg_map =20 + def get_register_by_regnum(reg_map, regnum): """ Helper to find a register from the map via its XML regnum @@ -84,6 +76,7 @@ def get_register_by_regnum(reg_map, regnum): return entry return None =20 + def crosscheck_remote_xml(reg_map): """ Cross-check the list of remote-registers with the XML info. @@ -144,6 +137,7 @@ def crosscheck_remote_xml(reg_map): elif "seen" not in x_reg: print(f"{x_reg} wasn't seen in remote-registers") =20 + def initial_register_read(reg_map): """ Do an initial read of all registers that we know gdb cares about @@ -214,27 +208,4 @@ def run_test(): complete_and_diff(reg_map) =20 =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) - -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - run_test() -except (gdb.error): - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/sha1.py b/tests/tcg/multiarch/gdbs= tub/sha1.py index 416728415f..1ce711a402 100644 --- a/tests/tcg/multiarch/gdbstub/sha1.py +++ b/tests/tcg/multiarch/gdbstub/sha1.py @@ -7,19 +7,11 @@ # =20 import gdb -import sys +from test_gdbstub import main, report + =20 initial_vlen =3D 0 -failcount =3D 0 =20 -def report(cond, msg): - "Report success/fail of test" - if cond: - print("PASS: %s" % (msg)) - else: - print("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 def check_break(sym_name): "Setup breakpoint, continue and check we stopped." @@ -35,6 +27,7 @@ def check_break(sym_name): =20 bp.delete() =20 + def run_test(): "Run through the tests one by one" =20 @@ -57,28 +50,5 @@ def run_test(): # finally check we don't barf inspecting registers gdb.execute("info registers") =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/= multiarch/gdbstub/test-proc-mappings.py index 04ec61d219..564613fabf 100644 --- a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py +++ b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py @@ -3,20 +3,7 @@ This runs as a sourced script (via -x, via run-test.py).""" from __future__ import print_function import gdb -import sys - - -n_failures =3D 0 - - -def report(cond, msg): - """Report success/fail of a test""" - if cond: - print("PASS: {}".format(msg)) - else: - print("FAIL: {}".format(msg)) - global n_failures - n_failures +=3D 1 +from test_gdbstub import main, report =20 =20 def run_test(): @@ -37,26 +24,4 @@ def run_test(): # report("/sha1" in mappings, "Found the test binary name in the mappi= ngs") =20 =20 -def main(): - """Prepare the environment and run through the tests""" - try: - inferior =3D gdb.selected_inferior() - print("ATTACHED: {}".format(inferior.architecture().name())) - except (gdb.error, AttributeError): - print("SKIPPING (not connected)") - exit(0) - - if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - - try: - # Run the actual tests - run_test() - except gdb.error: - report(False, "GDB Exception: {}".format(sys.exc_info()[0])) - print("All tests complete: %d failures" % n_failures) - exit(n_failures) - - -main() +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py b/tests/tc= g/multiarch/gdbstub/test-qxfer-auxv-read.py index 926fa962b7..00c26ab4a9 100644 --- a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py +++ b/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py @@ -6,18 +6,8 @@ # =20 import gdb -import sys +from test_gdbstub import main, report =20 -failcount =3D 0 - -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 def run_test(): "Run through the tests one by one" @@ -26,28 +16,5 @@ def run_test(): report(isinstance(auxv, str), "Fetched auxv from inferior") report(auxv.find("sha1"), "Found test binary name in auxv") =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test) diff --git a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py b/tests/= tcg/multiarch/gdbstub/test-thread-breakpoint.py index e57d2a8db8..4d6b6b9fbe 100644 --- a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py +++ b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py @@ -6,18 +6,8 @@ # =20 import gdb -import sys +from test_gdbstub import main, report =20 -failcount =3D 0 - -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 =20 def run_test(): "Run through the tests one by one" @@ -29,28 +19,5 @@ def run_test(): frame =3D gdb.selected_frame() report(str(frame.function()) =3D=3D "thread1_func", "break @ %s"%frame) =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) =20 -if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test) diff --git a/tests/tcg/s390x/gdbstub/test-signals-s390x.py b/tests/tcg/s390= x/gdbstub/test-signals-s390x.py index ca2bbc0b03..b6b7b39fc4 100644 --- a/tests/tcg/s390x/gdbstub/test-signals-s390x.py +++ b/tests/tcg/s390x/gdbstub/test-signals-s390x.py @@ -7,19 +7,7 @@ # =20 import gdb -import sys - -failcount =3D 0 - - -def report(cond, msg): - """Report success/fail of test""" - if cond: - print("PASS: %s" % (msg)) - else: - print("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 +from test_gdbstub import main, report =20 =20 def run_test(): @@ -42,31 +30,7 @@ def run_test(): gdb.Breakpoint("_exit") gdb.execute("c") status =3D int(gdb.parse_and_eval("$r2")) - report(status =3D=3D 0, "status =3D=3D 0"); + report(status =3D=3D 0, "status =3D=3D 0") =20 =20 -# -# This runs as the script it sourced (via -x, via run-test.py) -# -try: - inferior =3D gdb.selected_inferior() - arch =3D inferior.architecture() - print("ATTACHED: %s" % arch.name()) -except (gdb.error, AttributeError): - print("SKIPPING (not connected)", file=3Dsys.stderr) - exit(0) - -if gdb.parse_and_eval("$pc") =3D=3D 0: - print("SKIP: PC not set") - exit(0) - -try: - # Run the actual tests - run_test() -except (gdb.error): - print("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - pass - -print("All tests complete: %d failures" % failcount) -exit(failcount) +main(run_test) diff --git a/tests/tcg/s390x/gdbstub/test-svc.py b/tests/tcg/s390x/gdbstub/= test-svc.py index 804705fede..17210b4e02 100644 --- a/tests/tcg/s390x/gdbstub/test-svc.py +++ b/tests/tcg/s390x/gdbstub/test-svc.py @@ -3,20 +3,7 @@ This runs as a sourced script (via -x, via run-test.py).""" from __future__ import print_function import gdb -import sys - - -n_failures =3D 0 - - -def report(cond, msg): - """Report success/fail of a test""" - if cond: - print("PASS: {}".format(msg)) - else: - print("FAIL: {}".format(msg)) - global n_failures - n_failures +=3D 1 +from test_gdbstub import main, report =20 =20 def run_test(): @@ -35,26 +22,4 @@ def run_test(): gdb.execute("si") =20 =20 -def main(): - """Prepare the environment and run through the tests""" - try: - inferior =3D gdb.selected_inferior() - print("ATTACHED: {}".format(inferior.architecture().name())) - except (gdb.error, AttributeError): - print("SKIPPING (not connected)") - exit(0) - - if gdb.parse_and_eval('$pc') =3D=3D 0: - print("SKIP: PC not set") - exit(0) - - try: - # Run the actual tests - run_test() - except gdb.error: - report(False, "GDB Exception: {}".format(sys.exc_info()[0])) - print("All tests complete: %d failures" % n_failures) - exit(n_failures) - - -main() +main(run_test) --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706570039; cv=none; d=zohomail.com; s=zohoarc; b=ifCli8/N1Iq/u/KoDKC4ykh+J6z92YdTAePnHAap388fo+B+P1ZWKt7EohZkwIMPJ/giLlnQkES1QcpvLzNNEErUCW7Pm5kPkDRIg9/jaCDk5+xDZJjaCIs7g6A70BOM4E3UI2lqTTSV5pHZWFdaEKV+8S1S5QSEIklBLnQYHYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706570039; h=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=8orTCABPFUUDzwNSDUEvK5qkKcVY4K7vUOekf3tCG7U=; b=JeSKYfaw+AudorzwYCFBSz85J7bG8IpGEJCoJh8f02dSuITOJqv/RQs9v9T+BhYKSqxbZaJqNfM8MdbQ2qKJLVBX6KJu0Gdb+r1U9LqYFfgEVvITwu8Njii3HHwxtuHJPEVCSP8RD9dGUrJjQtcY8d/P5KRmDsEXplhzTOxKFcY= 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 1706570039656430.6860602122747; Mon, 29 Jan 2024 15:13:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadu-0006PM-UA; Mon, 29 Jan 2024 18:02:18 -0500 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 1rUade-00062x-G1 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:04 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUada-0008Q5-Ce for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:01 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3be6df6bc9bso616807b6e.0 for ; Mon, 29 Jan 2024 15:01:57 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569316; x=1707174116; 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=8orTCABPFUUDzwNSDUEvK5qkKcVY4K7vUOekf3tCG7U=; b=s0Ix1+XUuYAvdYXNH0BnLDG6xHCo+YwC7uyoSVHcafM8DpLaxOMssDmiMiwNXF1YJW 8+ockuTgjdmAw+dwZ3lHI2SD296fUT4R6SF0wkJcAiR9433EtLj6rgfZLR66y08cX6Ov ok3Lf1hSr2zr6/8/zQboxZR+O0Gd6e1n3uK+PpZECGRS2MIcqUduziRK9eAkOKrkPhkG DVxtPriGK2m+XxXBOl+NRRldlrqrjDQkNHCb/pL8/WUVG/vItRAHv1aNjQbARjaPrFEY 5Ra6e4AZviuk8iLA2eIFj6t5uE3A8uYpS0JG0XnU6cqZAsP6iVJFaZCqzfGw7WJPJdZ4 nNUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569316; x=1707174116; 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=8orTCABPFUUDzwNSDUEvK5qkKcVY4K7vUOekf3tCG7U=; b=aTreowmSbR4OWOw2ZsDrO95uwFTwY6i5cu/AzfPJ9dWNMcv76uMyUV9VjQyshLDvxk SkOJlDpJiJO0612BeZlkHDq19Cl2dXYmlloHwP2ilApFzyvv/6d4XcSefzScbnyHTHla xOi110YuTkTmCG46cizIFHgK5JQEDYnlwhHPXj07+mzu0YU5z0EmzW35fAYlC6LX8vM1 lLZCPlEkJMZSWPTtbe+uc5BNStOVgZ3jTRbGVHs89C7jFXYCJwn+II6b2aErGRgPrvr8 1VzcvcY0AZZcx79idwfrnHqI43p73cM1Qvbu2hrtyVTxL2JwkbsASjcnmrLn+fRaqgQs muSg== X-Gm-Message-State: AOJu0YxmPCC7RF+9zXSAgKkcPpquXYPkcpBMDkTB3SeoDuORj5dhLbLs ngkjoeejgUhieeuYJ1dVSS7twKqH+LlX7tjWa/OVq1TBezghwAGwiNpcCuNaWqqxr2viadaJcP9 TGpE= X-Google-Smtp-Source: AGHT+IFtEk+1WQ49ELjOr1vP/DFATbDtzvQvitrY/achWWenrATrwzb03TpkFyWM09aNhCocEnwBJw== X-Received: by 2002:a05:6358:7e50:b0:178:85dd:fb1b with SMTP id p16-20020a0563587e5000b0017885ddfb1bmr685018rwm.64.1706569316323; Mon, 29 Jan 2024 15:01:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich Subject: [PULL 13/31] tests/tcg: Add the PROT_NONE gdbstub test Date: Tue, 30 Jan 2024 09:01:03 +1000 Message-Id: <20240129230121.8091-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706570041556100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich Message-Id: <20240129093410.3151-4-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/prot-none.c | 40 ++++++++++++++++++++++++ tests/tcg/multiarch/Makefile.target | 9 +++++- tests/tcg/multiarch/gdbstub/prot-none.py | 36 +++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/multiarch/prot-none.c create mode 100644 tests/tcg/multiarch/gdbstub/prot-none.py diff --git a/tests/tcg/multiarch/prot-none.c b/tests/tcg/multiarch/prot-non= e.c new file mode 100644 index 0000000000..dc56aadb3c --- /dev/null +++ b/tests/tcg/multiarch/prot-none.c @@ -0,0 +1,40 @@ +/* + * Test that GDB can access PROT_NONE pages. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include + +void break_here(void *q) +{ +} + +int main(void) +{ + long pagesize =3D sysconf(_SC_PAGESIZE); + void *p, *q; + int err; + + p =3D mmap(NULL, pagesize * 2, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + assert(p !=3D MAP_FAILED); + q =3D p + pagesize - 1; + strcpy(q, "42"); + + err =3D mprotect(p, pagesize * 2, PROT_NONE); + assert(err =3D=3D 0); + + break_here(q); + + err =3D mprotect(p, pagesize * 2, PROT_READ); + assert(err =3D=3D 0); + if (getenv("PROT_NONE_PY")) { + assert(strcmp(q, "24") =3D=3D 0); + } + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.target index d31ba8d6ae..315a2e1358 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -101,13 +101,20 @@ run-gdbstub-registers: sha512 --bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \ checking register enumeration) =20 +run-gdbstub-prot-none: prot-none + $(call run-test, $@, env PROT_NONE_PY=3D1 $(GDB_SCRIPT) \ + --gdb $(GDB) \ + --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/prot-none.py, \ + accessing PROT_NONE memory) + else run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%= ,,$(TARGET_NAME)) support") endif EXTRA_RUNS +=3D run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ run-gdbstub-proc-mappings run-gdbstub-thread-breakpoint \ - run-gdbstub-registers + run-gdbstub-registers run-gdbstub-prot-none =20 # ARM Compatible Semi Hosting Tests # diff --git a/tests/tcg/multiarch/gdbstub/prot-none.py b/tests/tcg/multiarch= /gdbstub/prot-none.py new file mode 100644 index 0000000000..e829d3ebc5 --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/prot-none.py @@ -0,0 +1,36 @@ +"""Test that GDB can access PROT_NONE pages. + +This runs as a sourced script (via -x, via run-test.py). + +SPDX-License-Identifier: GPL-2.0-or-later +""" +import ctypes +from test_gdbstub import main, report + + +def probe_proc_self_mem(): + buf =3D ctypes.create_string_buffer(b'aaa') + try: + with open("/proc/self/mem", "rb") as fp: + fp.seek(ctypes.addressof(buf)) + return fp.read(3) =3D=3D b'aaa' + except OSError: + return False + + +def run_test(): + """Run through the tests one by one""" + if not probe_proc_self_mem: + print("SKIP: /proc/self/mem is not usable") + exit(0) + gdb.Breakpoint("break_here") + gdb.execute("continue") + val =3D gdb.parse_and_eval("*(char[2] *)q").string() + report(val =3D=3D "42", "{} =3D=3D 42".format(val)) + gdb.execute("set *(char[3] *)q =3D \"24\"") + gdb.execute("continue") + exitcode =3D int(gdb.parse_and_eval("$_exitcode")) + report(exitcode =3D=3D 0, "{} =3D=3D 0".format(exitcode)) + + +main(run_test) --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569764; cv=none; d=zohomail.com; s=zohoarc; b=JNa+d6GSCnwtI7PGYGer5TFoiznH4fD8eZYr1GEOEZFQNbN9wGw7OP6GHrzfS/PE9Rvr7jFG2S3BHXycLiXpMGEuTbOXlLy/RybEESf/daL+qfXrh02OQlHKVxE8P3TV54fjDNBuFxr9ZbBHm/ilCjwK48/ewFS+BTiwZv0gD3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569764; 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=42rrYlbSzYYq+E3YR3sViyWhIobfUBJl0iAP/F+r6Tc=; b=PtxH5BvDu5CBf6SqOPngK0xYRTK98cWQgNun7ttZsu0Q1DeWHE+H1Z90KOwFYd1Ez+BY8l7Lw+jp+7ppwUj+kfXRx+AX5U6MV2r6xtUmOnA/OpquzyiFDm6lg/lQmCAotpNZkbCG8Mc1Tn4TjSR+ClyfPqpG/P2v0m9rDjJesPI= 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 170656976436784.51455132421142; Mon, 29 Jan 2024 15:09:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUae2-0006mW-Fr; Mon, 29 Jan 2024 18:02:26 -0500 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 1rUadi-00063u-28 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:07 -0500 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 1rUade-0008Qr-5t for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:05 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6daf694b439so1472946b3a.1 for ; Mon, 29 Jan 2024 15:02:01 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569320; x=1707174120; 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=42rrYlbSzYYq+E3YR3sViyWhIobfUBJl0iAP/F+r6Tc=; b=LWhUTsKB59I+RnkuB3o3HoaXtH0ZxROHl3jqW27pCOQMdC36tW0aL0RJR4NC9EXHQ/ Q3kkUHjb4lqZh0cDbM5exb+kht0FAMfk83Uhk+h1numKVlUrfEOd5W04iZPMCYnUyCJM CY1LCPRJzpjQ1L+AWm7r/dpn6kxN6dC+Z8NVkb/IQjlqgz7m/t8LtVFQe1qY+M7kemx0 HFuc6CQY7Vq4xBynrSDwRyGB+wRSXEpD0Z+6+o5yU1OBBDfTFBCHAM0x1QvRlu3mvMAJ b8yqFd/wG/w3TEUMKrR7SOhMceQJEza/BD39e74q/TzMz0fXx+noYrbCA0RL6yOmX2ur fCTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569320; x=1707174120; 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=42rrYlbSzYYq+E3YR3sViyWhIobfUBJl0iAP/F+r6Tc=; b=wIfF61Sc6IuWnaYA+bqc97B9vrdQkA+wUxI53ATomQIFtpmXieOpq9tya2j2hxioaj eyoK+uSwb896sOaoYX2mkZP2qlhoBJ5/j9FygjmAExYKTOPfDA+sSt2G2fNeZmr28BUr F05LIL1INJc89d1wTXRQR3YcXFIK4mji46rUUTGzAjf2dFKfJeBiOrA2+/kqCFy4t/7E 57TZgFAL6C7J1Y3VYo05CdJML5zBO9ONvm9Y03uYs8OaamfpQ4/avbKwO/0PYHe4DskA OvHbmvGnU0GjZKRhokNyqULzbzfdpYKITzflPVgzjPLPNh2UP7upMXm1Yzeu49sOapRg uogA== X-Gm-Message-State: AOJu0Yz++vtx0h0AvjMUc2xa5uH+Wu5Z/qS/YXfJPKwHxz4ymUsZgG5I kolLFw/Da+1XkHLFY7tXaD8zNfCp4jCVk3X0Vj7QUw6o5C89O6VF08nlkTsnSYKgFDggv6eKqis L6rs= X-Google-Smtp-Source: AGHT+IGvCsTUMZhyIqRVohkh87v+URknO9UlFk0yLsazaQ1z08LgX+dCUbUYGSD9yedeURkRKUVR9Q== X-Received: by 2002:aa7:8e9e:0:b0:6dd:8660:3adb with SMTP id a30-20020aa78e9e000000b006dd86603adbmr3154026pfr.31.1706569318948; Mon, 29 Jan 2024 15:01:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 14/31] accel/tcg/cpu-exec: Use RCU_READ_LOCK_GUARD Date: Tue, 30 Jan 2024 09:01:04 +1000 Message-Id: <20240129230121.8091-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569764870100003 From: Philippe Mathieu-Daud=C3=A9 Replace the manual rcu_read_(un)lock calls in cpu_exec(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240124074201.8239-2-philmd@linaro.org> [rth: Use RCU_READ_LOCK_GUARD not WITH_RCU_READ_LOCK_GUARD] Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 40c268bfa1..950dad63cb 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1050,7 +1050,7 @@ int cpu_exec(CPUState *cpu) return EXCP_HALTED; } =20 - rcu_read_lock(); + RCU_READ_LOCK_GUARD(); cpu_exec_enter(cpu); =20 /* @@ -1064,8 +1064,6 @@ int cpu_exec(CPUState *cpu) ret =3D cpu_exec_setjmp(cpu, &sc); =20 cpu_exec_exit(cpu); - rcu_read_unlock(); - return ret; } =20 --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569433; cv=none; d=zohomail.com; s=zohoarc; b=I2ENh4DDP09zBnhXNNBYgUBl9L5fKTf9JSt6oI/jkPS5QL4LZbKYELoQ1BpMnRg9uXLAhOsb+X6kxMJA2Ic1JTmmgKOl5Jqnvf5Noda0z47byyvau04SYvFvmYHsqeYdAcVL2HLbrusAIGA6x1UL88gCjMTilbQvbsdJghAV2JI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569433; 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=5Gt1CNQckx8yO7WR3bedyoAfBxjm8E850nOtIhoFZIA=; b=H5r6RaU+T4U6aTPlUqUEI58mrswNDxHcG6GS6ojNhHOaWeUdXumOjXUWeNGvZnDUdMi7i2ZxVKs0rxEVyg4KXJ/HROJSfw6iqajM4DvWgIDeaXTxkltq789eYJfn36pw9Umbmf1osKIsfKvbgu5oQZS706YD0TBy+FSMkxPysJE= 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 1706569433454376.76419206511343; Mon, 29 Jan 2024 15:03:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadw-0006Tb-6e; Mon, 29 Jan 2024 18:02:20 -0500 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 1rUadn-0006Ay-Um for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:13 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadl-0008Rf-IS for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:11 -0500 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3be90c51299so67889b6e.0 for ; Mon, 29 Jan 2024 15:02:07 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569327; x=1707174127; 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=5Gt1CNQckx8yO7WR3bedyoAfBxjm8E850nOtIhoFZIA=; b=liAm0qEGAT5CPMNMTF74YVhX58qk/Y+umBrY6r48Wv6mtypzrWQBknZg5QpoUhPAIm iU2R5S7FwgySpQiZKA0azdRl2Z4ZtW7f8NKpcf7r4nwll4u+Qc6fS4uJxOtsWk1AjhPA /9tbi12o2PODK2tVgt1fifrOT6HIjBvzWjd+tYt0773mMjl6DRnb+mbKwkTcC0TqWQKA HwAFm5RNl8Y9a8+TP797R/FkFniivc7k/edb3q2DbUlMic92ZpzL6TazShwBApcJxyGo AU19mSQQLab26c7pWd7DZxtAmXc/A2XefqMuNTZvAlidv4uNDwUopNQKzX5GbEYYYgga P+OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569327; x=1707174127; 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=5Gt1CNQckx8yO7WR3bedyoAfBxjm8E850nOtIhoFZIA=; b=YK7lrNKtVAjeNM/luNaHliBKANDQMlHAamDqbPvWFR9dUfzLUIEL2djGDP+Gnp+agj +EAk7vBq4NIF3Moazi0i9AKQrc7dQTqVoLRCzm0KBjyaMEPu2vzb4VRSA6lEvSHKZA73 pp6QS7/b5d81Ki1ETKzLas8Te7QqEcd/7OWbq29QR3aaVlxQUZgbPXdob8V4E+2RwDPD ejeXbtHBbhlA9M21pBPksZH1AfajuVrUC/69DmO9Ytue8hSQZfNQnfD8zwgB0bX17+oA htQJG2cgmP6QvMo0KGQhxzZLQfUIKvhJ56XfVgCr3kNoNK1YjLxb+ajK3g637OEhU0bv OoKw== X-Gm-Message-State: AOJu0YxredOa74n3WJw/CejsiT5zAlKU6saRXvpWthKITD+01a6tethv jqdlFCfoih3sGhWEcgWy6aAxzBfKlc/xvM3RRrD8TlHz++OAbnLV6qoxiXx1YDdzGeBECssAKR8 uQy8= X-Google-Smtp-Source: AGHT+IGl5qkCFKV8jIy/9n/R/wMnz/o+NTrEd9xwkYZw7NxskIbfImC4zvTj+MHBOr5qf8iaojxL4w== X-Received: by 2002:a05:6808:1805:b0:3be:7a42:cd5a with SMTP id bh5-20020a056808180500b003be7a42cd5amr1782905oib.46.1706569327067; Mon, 29 Jan 2024 15:02:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 15/31] target: Make qemu_target_page_mask() available for *-user Date: Tue, 30 Jan 2024 09:01:05 +1000 Message-Id: <20240129230121.8091-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569434024100001 From: Ilya Leoshkevich Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Signed-off-by: Ilya Leoshkevich Message-ID: <20231208003754.3688038-2-iii@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240124075609.14756-2-philmd@linaro.org> Reviewed-by: Richard Henderson [rth: Split out change to accel/tcg/perf.c] Signed-off-by: Richard Henderson --- system/physmem.c | 5 ----- target/target-common.c | 10 ++++++++++ target/meson.build | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 target/target-common.c diff --git a/system/physmem.c b/system/physmem.c index cc68a79763..5e66d9ae36 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3431,11 +3431,6 @@ size_t qemu_target_page_size(void) return TARGET_PAGE_SIZE; } =20 -int qemu_target_page_mask(void) -{ - return TARGET_PAGE_MASK; -} - int qemu_target_page_bits(void) { return TARGET_PAGE_BITS; diff --git a/target/target-common.c b/target/target-common.c new file mode 100644 index 0000000000..903b10cfe4 --- /dev/null +++ b/target/target-common.c @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include "qemu/osdep.h" + +#include "cpu.h" +#include "exec/target_page.h" + +int qemu_target_page_mask(void) +{ + return TARGET_PAGE_MASK; +} diff --git a/target/meson.build b/target/meson.build index a53a60486f..dee2ac47e0 100644 --- a/target/meson.build +++ b/target/meson.build @@ -19,3 +19,5 @@ subdir('sh4') subdir('sparc') subdir('tricore') subdir('xtensa') + +specific_ss.add(files('target-common.c')) --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569800; cv=none; d=zohomail.com; s=zohoarc; b=AkKulvwXN/dh1jFOjixPkICNgISOgGGnhzcBeQAkIaM7kCUsEHY4S5pj8/slZGZfUtpi6A/HablOqPefG54BKMKkhS1SAy4Rfma2VeG/CwsxzS7VBVUpKl3KBgKQNRO70xTQF9DXbWwqVBGJEZpDWvZEqlzAbSiSW+gy1R4r658= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569800; 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=qYcGKO9y7L+9nQKGBMKS98rrLGXyxY/fBFTDvtgcJC4=; b=KicbUoppULJNSTFMGgqQlHar8W2yC4DdQOIGprswvsfQs2bjIKrN+BS/q5CycUJTg2jsDGEChorup8hLBTTpXyuyc1h+QVV+rINjxwpM0WtYbT40pio+ZC2unOdWnbCkPshWJC1w4YiA9RDDAJY6GsbVjLR4f9iAX3et15Uxuzs= 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 1706569800448304.6069224039927; Mon, 29 Jan 2024 15:10:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUady-0006Vs-2y; Mon, 29 Jan 2024 18:02:22 -0500 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 1rUadp-0006BN-8r for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:13 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadn-0008S0-Ju for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:12 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3be3753e002so805653b6e.1 for ; Mon, 29 Jan 2024 15:02:11 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569330; x=1707174130; 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=qYcGKO9y7L+9nQKGBMKS98rrLGXyxY/fBFTDvtgcJC4=; b=Rxl/VITV8Y/bXMaO62TtB9n2lta5ynEBH8WEs0TzcrqJtqdo83mATO85xHH1JjC7LQ CXGDanNmnf1irhZdTXK+OR8tp7xcv9Ny1eXLyQePBUf3dRE9gzviL0EdQk0CJOSwU3v+ bBxylUcPKATNwpQSa0FlH6XzVhEP/UOO9Cb7DzjPmkb59HU1cAjE/gMgHnOGO3wekCH1 uWu+/i4slzpVeFWS2qCK67C7ghmBiJWgINBO5KGzvf9nsOQxeJz1U6O520ighJWhWtyP gW4RkgDEVrgoOzHfdmSCCaCVU4OXoE/TFmhNKF1GV8oBoNQ0mnXep0fw+Wh84KIM+CCf 2w5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569330; x=1707174130; 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=qYcGKO9y7L+9nQKGBMKS98rrLGXyxY/fBFTDvtgcJC4=; b=TRHrExM1hwxkZ1Uwdija4sxm9I6kGM3dhrSSLoesX9V7PqRNJ+CyEr9aB4SPsqgN6l 1mIKwpDGqgtKwIIy1eqP5+ay5dSEKcS8E1poyrQC9XpwFAlNXLuV9rCRW3V/QlgBUHAT QE+ZENSYdCWsRfaiEtACM3sE56378FfwibDATjbY2uDDT3PaOh9chmWAyNgyzyJANW5T FPx+Z4UrDXbkh1h3HMrvr1LJQfgtWcS0uo4zCyNyKWfDPMrgCSemqMG6P5Ot3jkifWYK xuMduXj05kqQTT+XbXpfoYPWGvqby6LKROrZQzr3SKyrLQ+k6NCO90CMYFXYQEwo7RB6 oJUQ== X-Gm-Message-State: AOJu0YwYBZBpcqp2xyd31WWiZSF9184rib8OirGjld2swhx2dzRWs1+v GPkVuzNHnSQE3pXZwSZv2TJ4jCGnmlUVJ5E/5KI9vysWwmapOtelTHKye60c6B6GFWKKiL2SRe1 SDbA= X-Google-Smtp-Source: AGHT+IHO2vMWUCKwP+CKOFpiif7GKnI8W80zMD7g5F6kLh7XuphMOC2pV466UmncBTR9QKOAJaMCzg== X-Received: by 2002:a05:6808:144e:b0:3be:c63:adb7 with SMTP id x14-20020a056808144e00b003be0c63adb7mr5908986oiv.38.1706569330243; Mon, 29 Jan 2024 15:02:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 16/31] accel/tcg: Make use of qemu_target_page_mask() in perf.c Date: Tue, 30 Jan 2024 09:01:06 +1000 Message-Id: <20240129230121.8091-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569800974100006 From: Ilya Leoshkevich Stop using TARGET_PAGE_MASK in order to make perf.c more target-agnostic. Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231212003837.64090-2-iii@linux.ibm.com> Reviewed-by: Richard Henderson Message-Id: <20240125054631.78867-2-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/perf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index cd1aa99a7e..ba75c1bbe4 100644 --- a/accel/tcg/perf.c +++ b/accel/tcg/perf.c @@ -10,6 +10,7 @@ =20 #include "qemu/osdep.h" #include "elf.h" +#include "exec/target_page.h" #include "exec/exec-all.h" #include "qemu/timer.h" #include "tcg/tcg.h" @@ -335,7 +336,7 @@ void perf_report_code(uint64_t guest_pc, TranslationBlo= ck *tb, /* FIXME: This replicates the restore_state_to_opc() logic. */ q[insn].address =3D gen_insn_data[insn * start_words + 0]; if (tb_cflags(tb) & CF_PCREL) { - q[insn].address |=3D (guest_pc & TARGET_PAGE_MASK); + q[insn].address |=3D (guest_pc & qemu_target_page_mask()); } else { #if defined(TARGET_I386) q[insn].address -=3D tb->cs_base; --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569528; cv=none; d=zohomail.com; s=zohoarc; b=GjHYa54Wje1GAOS5xMnn+TA3ik9EpRBQDmYzs5vet50Jyagj1LmfmgbkiVe55nrBpeKy/r5SG33K/OoxfQdf9HOu4f1wpYBQIpDTu4thpdxFsxjhjHp1Ry9CJQxNt11LvV2tf9Nh2EztFXPXk0APICx/ZOqlpxBEcZhW6RUXmmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569528; 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=4bfmq9Mg4HxfU53OW0oPle9hQIH8zXg09YsWAHRVD1c=; b=RP1ltTpNnY0yQsWXDdaf0VgT68Om9ZcvAS8znK61fNkmIIqOWzcQ9/ioAVyX2zrxuDILpF6sdBD4RJjC0xnhUka98AwbmrptdI4J8+8u1tgtRMV/tdbc+RDmy5eGa71tK/LxvDh0z6EayQ+khh4/pxJ6FpQFuZbsbUn2czcdr20= 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 1706569528657580.8916756823538; Mon, 29 Jan 2024 15:05:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUadz-0006c0-N3; Mon, 29 Jan 2024 18:02:23 -0500 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 1rUadt-0006JG-Kt for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:17 -0500 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadr-0008Sg-Gb for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:17 -0500 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-595ac2b6c59so2334399eaf.2 for ; Mon, 29 Jan 2024 15:02:13 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569333; x=1707174133; 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=4bfmq9Mg4HxfU53OW0oPle9hQIH8zXg09YsWAHRVD1c=; b=vxmA47zgQ8yDI+I2G/5AmpdpGf63Sxab1fvJKowqrbuapwXFfZMXbUKuyrzNgWG181 k1zazv2daTAIjTiGjAfcwRC8bx8H38LaMYCDdfWv5N1js1u41RsRwpTUuUr9p4jAAHNF 5K4mNsi8MRh+XisYA+Hn4zPOOE0T+n2F2WFXUZG0F1ZJPk6vBF3psIv5unMDEGwATYJ8 aSeekEtFOIo3h+gzKErjkx801293DD1yZyGIELetTihrdhF4dtB/YbufE6EBB0hHfJHw nyC6kOkj1GWwE/Pqy44jBL6Om5HSAyVMiPMqAgRNO4NnET3izmTKezC0RSeiaCeSzWlI VCLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569333; x=1707174133; 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=4bfmq9Mg4HxfU53OW0oPle9hQIH8zXg09YsWAHRVD1c=; b=p00PBofq3XLl1mRQoE5SlG/N8+nQXGncWXiU+9NMoG6co8b3+0HE5b366HaBuygPFo 0acBCzsuAm+rI6g/5yN/reW/AfSYo//9FvD0NjTBCV7ESK5OBiJbTW4ks6HioHqctq8V pd1jT1R98AuimHzBMfBtViFWrV6Qpxzfpg1yhLdb6igJWozwa1olS9q4q1r91usnSy6V xUPx4NVjCLbAlNwXNaZfLW8OfcmZBRMHqKCxZ8H7XYacr0LE+Q/KHPQXbSrfVuzqS5YO xkLh1BivvIgJbaej2JQinL92usnLS00ZGYLV4baS5H2HgHJsVODiuHxoC4KIo6KZxzZu uiMQ== X-Gm-Message-State: AOJu0YyLkgKA2qj21WtfDTIAV018OAbzHOCro2LS9Y13szI3YNX8n7kQ TfGKYT8WJqCtFeU+daXXPU70B5eFP2PhKcZlkvWlki6J5NTBzWWfWpVuYtbkeijl22W6UBGpaqX aAUI= X-Google-Smtp-Source: AGHT+IHoDrW7QWN9H/tLJDH3NN+mFr2kdUnYWJKqusufGCdPb7aEMGCN5RK8WyFxWBDUOsaT36AJwA== X-Received: by 2002:a05:6358:5913:b0:178:77cc:a0f1 with SMTP id g19-20020a056358591300b0017877cca0f1mr2072515rwf.48.1706569332896; Mon, 29 Jan 2024 15:02:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 17/31] tcg: Make tb_cflags() usable from target-agnostic code Date: Tue, 30 Jan 2024 09:01:07 +1000 Message-Id: <20240129230121.8091-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::c2f; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569530299100003 From: Ilya Leoshkevich Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-ID: <20231212003837.64090-3-iii@linux.ibm.com> Message-Id: <20240125054631.78867-3-philmd@linaro.org> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 6 ------ include/exec/translation-block.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index df3d93a2e2..ce36bb10d4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -459,12 +459,6 @@ int probe_access_full_mmu(CPUArchState *env, vaddr add= r, int size, =20 #endif =20 -/* Hide the qatomic_read to make code a little easier on the eyes */ -static inline uint32_t tb_cflags(const TranslationBlock *tb) -{ - return qatomic_read(&tb->cflags); -} - static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb) { #ifdef CONFIG_USER_ONLY diff --git a/include/exec/translation-block.h b/include/exec/translation-bl= ock.h index e2b26e16da..48211c890a 100644 --- a/include/exec/translation-block.h +++ b/include/exec/translation-block.h @@ -145,4 +145,10 @@ struct TranslationBlock { /* The alignment given to TranslationBlock during allocation. */ #define CODE_GEN_ALIGN 16 =20 +/* Hide the qatomic_read to make code a little easier on the eyes */ +static inline uint32_t tb_cflags(const TranslationBlock *tb) +{ + return qatomic_read(&tb->cflags); +} + #endif /* EXEC_TRANSLATION_BLOCK_H */ --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569772; cv=none; d=zohomail.com; s=zohoarc; b=CfSvCb938KKP2l6osHQknUlydePPipcHo37x5F/qclAeEfMDzHmAuXNAuDm+OM8Lq896tnoUNP/3ynS0gTck7YsJeBVKn5gsLtO3QYs4035CbhxmBU0BgVBjroQTh2VqcAgM4UtdzJriyEGJuCTH8FtsR7HXKSAA6lYSCPPBDI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569772; 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=TByYFDCUWCaxnnHjASz8MJMk4paFqdDSnL+kqN7t/Zk=; b=PilXX8uw6ODHDDD9YKbnH1ieA6zSQKdRCIt/0DNeyzTN5JLnuPVQZTvju0Ql0IAHBPz+wp9hXPwJW9SJVIPmdh37Lq/bON5fk8eE1n9F5boO7gltsSI+4G/CCmPZ04zGjpIe0B393aQMmdnts+QzZrkTfpVjQ63Szr5niCdQ9OI= 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 1706569772398824.2213565630384; Mon, 29 Jan 2024 15:09:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUaeV-0006qW-9b; Mon, 29 Jan 2024 18:03:00 -0500 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 1rUadv-0006Sz-OL for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:19 -0500 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 1rUadt-0008UI-Vf for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:19 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6ddc0c02593so1489436b3a.3 for ; Mon, 29 Jan 2024 15:02:17 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569336; x=1707174136; 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=TByYFDCUWCaxnnHjASz8MJMk4paFqdDSnL+kqN7t/Zk=; b=hSCT53HDAci2j+cCdASuI7LxpjcndbObfO9x000oCavtVAIyfDXs4Z+QcrB/yjf2Bg bfDyj4Srd985+vLPKMD2t3h74shHB7M3oXKXtQvkl4DVAOyxHLAnzl5e8fYvSFIZoKI7 zuQZt0lnRHLM5A3lNUAyYgKLmImTi2s4x0fKb+9oOd6qG2MdXFW+yeLsAghMIfstRdBB VmvJYUbKsOIPXnftMJ6fwePC5NAq8LLmy9NgcyCDtHrPPPUxJr0N5yJOGSWeoLvnj1U4 QzK38jroyY4cKTbBalcC75/tyeyQwjgFPbT9mx99zvgjjJkHHXBN3XNxb9h279oh75fE s8yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569336; x=1707174136; 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=TByYFDCUWCaxnnHjASz8MJMk4paFqdDSnL+kqN7t/Zk=; b=QxkvA2oG58vc0tfoLC8yH/hyHdLJipZVbUH8zFgsAKfXBQCqkYgV7Yp4wqITZiKVpS 4yo3cuHfCeQIoRvV6xQTgWH3WCqSBDtS8brvTQGd6MPsYKIba4ynTbcs6H6QB5hkEE3N fYH7ZFoyyqOghVqNQ0GVRr38sBiMc8cf4t4RRs9D2zs+I0jVruAuiLZlgV0vZIuhPJhj aTQgRfOLfFamrdqb/YyyccVWukKNnxqK3/+Q5NS6XGOteFcoAKcydpdLa/TNRbR1+lYw SGOCVECp3KCcR3W9wBsqEMzaCUjHEWWsA1QcM2bfULrBeolHe4/ijkhkNhDC6KWQ5AAE nFfA== X-Gm-Message-State: AOJu0Yw/YY0703Llfwo4MoZKGGJoEQnM87oqxG2N+ZjKW1b+6H+qQjBf EIXtw+22tJ/uAk708dUM99NUKtwuL4aI/4yTU3Z8G2gcETEjUqA9wVOCpbpjIoCi9QTx7nJAKb8 rBTQ= X-Google-Smtp-Source: AGHT+IHnxPh5JFlKRym7vnV6mjfqqT14mWr35zTT2N1sxiVR7oOuddJWz3JvRSWO7TBWdv71iomttg== X-Received: by 2002:a05:6a00:2d0c:b0:6db:c6b3:25e5 with SMTP id fa12-20020a056a002d0c00b006dbc6b325e5mr3553233pfb.12.1706569335181; Mon, 29 Jan 2024 15:02:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 18/31] accel/tcg: Remove #ifdef TARGET_I386 from perf.c Date: Tue, 30 Jan 2024 09:01:08 +1000 Message-Id: <20240129230121.8091-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569772928100001 From: Ilya Leoshkevich Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-ID: <20231212003837.64090-4-iii@linux.ibm.com> Message-Id: <20240125054631.78867-4-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/perf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index ba75c1bbe4..68a46b1b52 100644 --- a/accel/tcg/perf.c +++ b/accel/tcg/perf.c @@ -337,10 +337,6 @@ void perf_report_code(uint64_t guest_pc, TranslationBl= ock *tb, q[insn].address =3D gen_insn_data[insn * start_words + 0]; if (tb_cflags(tb) & CF_PCREL) { q[insn].address |=3D (guest_pc & qemu_target_page_mask()); - } else { -#if defined(TARGET_I386) - q[insn].address -=3D tb->cs_base; -#endif } q[insn].flags =3D DEBUGINFO_SYMBOL | (jitdump ? DEBUGINFO_LINE : 0= ); } --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569589; cv=none; d=zohomail.com; s=zohoarc; b=GDVmVAihSumnGdYcIemXEKZZCx/vY6brwAZIo4sQdjKrOyJZIvrFaOMgGJyLWgIxP3UL2zvK45vgSH2oGNO0ipGLo75tX0jVj48PvRT6chKXf3ywWtKNfUJgKtP7zYtzqGBXzaneGZIwjhmlCajoOShVNeRyfd/vV5PLSqKnvFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569589; 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=MmzrBNQK2eDwb+/K0EzCDtsTU1SD4iiHNXZIgeBMj8o=; b=WD/xLYbXFyn+9gw2b0z72eAOs965tc3JIX6ByimYRuuEQstQMFQj5xeIoacnwqicogw/M9eLdy1bBbz5lk8bs3jqNDcMO/SETeGQRMS/pHHo6TEX1FYTwUxPMtb2IOtQfAal41ZjOUWDpK44iGeIcJfvGikwB2hbZyP04c4PZuA= 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 1706569589760761.8725137585543; Mon, 29 Jan 2024 15:06:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUae3-0006nS-1h; Mon, 29 Jan 2024 18:02:27 -0500 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 1rUadx-0006W5-9D for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:22 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadv-0008US-2b for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:20 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6de24201aa6so1057966b3a.2 for ; Mon, 29 Jan 2024 15:02:18 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569338; x=1707174138; 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=MmzrBNQK2eDwb+/K0EzCDtsTU1SD4iiHNXZIgeBMj8o=; b=xlIilcGnalkvK4ddm6B/XB0qAKs/G7/V1tgYnRoWzuOI6wewrCXd0qHsZcgleuCB90 RQ6H5alWmJA+zCToARsRR6NSLGanS7sEMsutkNUT34iWA5AnoL+Q80kt5iaVlVkqOpe2 L++uMONxgylKGps1M9om1IP2XKi/GUjD1X9ZQsWHRtLMMavP3hv7XLaaBlfRprhaZzh+ ABJqcjOf5fFY7SOg+e+mryslldmx8KTANpFbPJNlahNiIRrVr2xklYGxAgho13ZipfAF FpGt2sv4SRKQsDjoyuEgNOYy4XtTaviFuf4fyux+m05VwOPF5rfR8jW7/gZjC8Kyr2Uz ligw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569338; x=1707174138; 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=MmzrBNQK2eDwb+/K0EzCDtsTU1SD4iiHNXZIgeBMj8o=; b=kw19q5Rh5Jxuo6PbXFXLwSvAI4MN/kIuVHrqPt4HOzTWnj8beMyo8dk9ABjvX9CFvZ E+Eotng7COpU4LUncYVSnys3akmTsMOW8GmGQPpfkrTXVwQKKNyoIJ8uW/XtlhbASAU3 gjqbtT0pIDTtvZVQtDlj0RW0RRuTtSSQoOVczz2JlxVpAs0TLEnXc3ANLiSaETBhPIAy TITWZU4aFwHnmSaQm7Lmf08odxfRJJg9Y9wOfurR2rEtBuscrPoRK73ku3SH8+y0rsTj rjSWrbLcektrRO10YLJRsgHr8Uj+mx3BQijX4QWYR0wGZ/gwMBHtmRM6TPkM9Q5hte8m H0tw== X-Gm-Message-State: AOJu0Yzc/GtqLFAHVaICG+k/WNJ6l9plgBQ/PslnX5/bgJel+SLe0Azw LXvZz2lOFZqHw8ervl/y7+gP891FWvNBX1ZnaSLxNsjzT5vNw3t8ZzFoGgIP2/WLaOea9Q7XEes Ufhc= X-Google-Smtp-Source: AGHT+IGkxkirXd/IyFRi4AgJLEbEwLJbjBz7WWsgqnY4gkifuj1lV0YtGWPwZgoomyKUEh/ReSf/Pg== X-Received: by 2002:a05:6a00:1798:b0:6db:d5b5:e380 with SMTP id s24-20020a056a00179800b006dbd5b5e380mr5067325pfg.24.1706569337663; Mon, 29 Jan 2024 15:02:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 19/31] accel/tcg: Move perf and debuginfo support to tcg/ Date: Tue, 30 Jan 2024 09:01:09 +1000 Message-Id: <20240129230121.8091-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569590450100003 From: Ilya Leoshkevich tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-ID: <20231212003837.64090-5-iii@linux.ibm.com> Message-Id: <20240125054631.78867-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- {accel =3D> include}/tcg/debuginfo.h | 4 ++-- {accel =3D> include}/tcg/perf.h | 4 ++-- accel/tcg/translate-all.c | 2 +- hw/core/loader.c | 2 +- linux-user/elfload.c | 2 +- linux-user/exit.c | 2 +- linux-user/main.c | 2 +- system/vl.c | 2 +- {accel/tcg =3D> tcg}/debuginfo.c | 3 +-- {accel/tcg =3D> tcg}/perf.c | 7 +++---- tcg/tcg.c | 2 +- accel/tcg/meson.build | 4 ---- tcg/meson.build | 5 +++++ 13 files changed, 20 insertions(+), 21 deletions(-) rename {accel =3D> include}/tcg/debuginfo.h (96%) rename {accel =3D> include}/tcg/perf.h (95%) rename {accel/tcg =3D> tcg}/debuginfo.c (98%) rename {accel/tcg =3D> tcg}/perf.c (99%) diff --git a/accel/tcg/debuginfo.h b/include/tcg/debuginfo.h similarity index 96% rename from accel/tcg/debuginfo.h rename to include/tcg/debuginfo.h index f064e1c144..858535b5da 100644 --- a/accel/tcg/debuginfo.h +++ b/include/tcg/debuginfo.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ =20 -#ifndef ACCEL_TCG_DEBUGINFO_H -#define ACCEL_TCG_DEBUGINFO_H +#ifndef TCG_DEBUGINFO_H +#define TCG_DEBUGINFO_H =20 #include "qemu/bitops.h" =20 diff --git a/accel/tcg/perf.h b/include/tcg/perf.h similarity index 95% rename from accel/tcg/perf.h rename to include/tcg/perf.h index f92dd52c69..c96b5920a3 100644 --- a/accel/tcg/perf.h +++ b/include/tcg/perf.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ =20 -#ifndef ACCEL_TCG_PERF_H -#define ACCEL_TCG_PERF_H +#ifndef TCG_PERF_H +#define TCG_PERF_H =20 #if defined(CONFIG_TCG) && defined(CONFIG_LINUX) /* Start writing perf-.map. */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 1737bb3da5..1c695efe02 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -63,7 +63,7 @@ #include "tb-context.h" #include "internal-common.h" #include "internal-target.h" -#include "perf.h" +#include "tcg/perf.h" #include "tcg/insn-start-words.h" =20 TBContext tb_ctx; diff --git a/hw/core/loader.c b/hw/core/loader.c index e7a9b3775b..b8e52f3fb0 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -62,7 +62,7 @@ #include "hw/boards.h" #include "qemu/cutils.h" #include "sysemu/runstate.h" -#include "accel/tcg/debuginfo.h" +#include "tcg/debuginfo.h" =20 #include =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index daf7ef8435..b8eef893d0 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -22,7 +22,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "target_signal.h" -#include "accel/tcg/debuginfo.h" +#include "tcg/debuginfo.h" =20 #ifdef TARGET_ARM #include "target/arm/cpu-features.h" diff --git a/linux-user/exit.c b/linux-user/exit.c index 50266314e0..1ff8fe4f07 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -17,7 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #include "gdbstub/syscalls.h" #include "qemu.h" #include "user-internals.h" diff --git a/linux-user/main.c b/linux-user/main.c index c9470eeccf..74b2fbb393 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -54,7 +54,7 @@ #include "signal-common.h" #include "loader.h" #include "user-mmap.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" =20 #ifdef CONFIG_SEMIHOSTING #include "semihosting/semihost.h" diff --git a/system/vl.c b/system/vl.c index 788d88ea03..60fd1e56b6 100644 --- a/system/vl.c +++ b/system/vl.c @@ -96,7 +96,7 @@ #endif #include "sysemu/qtest.h" #ifdef CONFIG_TCG -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #endif =20 #include "disas/disas.h" diff --git a/accel/tcg/debuginfo.c b/tcg/debuginfo.c similarity index 98% rename from accel/tcg/debuginfo.c rename to tcg/debuginfo.c index 71c66d04d1..3753f7ef67 100644 --- a/accel/tcg/debuginfo.c +++ b/tcg/debuginfo.c @@ -6,11 +6,10 @@ =20 #include "qemu/osdep.h" #include "qemu/lockable.h" +#include "tcg/debuginfo.h" =20 #include =20 -#include "debuginfo.h" - static QemuMutex lock; static Dwfl *dwfl; static const Dwfl_Callbacks dwfl_callbacks =3D { diff --git a/accel/tcg/perf.c b/tcg/perf.c similarity index 99% rename from accel/tcg/perf.c rename to tcg/perf.c index 68a46b1b52..412a987d95 100644 --- a/accel/tcg/perf.c +++ b/tcg/perf.c @@ -11,13 +11,12 @@ #include "qemu/osdep.h" #include "elf.h" #include "exec/target_page.h" -#include "exec/exec-all.h" +#include "exec/translation-block.h" #include "qemu/timer.h" +#include "tcg/debuginfo.h" +#include "tcg/perf.h" #include "tcg/tcg.h" =20 -#include "debuginfo.h" -#include "perf.h" - static FILE *safe_fopen_w(const char *path) { int saved_errno; diff --git a/tcg/tcg.c b/tcg/tcg.c index e2c38f6d11..eeff4c1d51 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -55,7 +55,7 @@ #include "tcg/tcg-ldst.h" #include "tcg/tcg-temp-internal.h" #include "tcg-internal.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #ifdef CONFIG_USER_ONLY #include "exec/user/guest-base.h" #endif diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index c15ac9ac8f..46f7d53eeb 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -16,10 +16,6 @@ tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('= user-exec-stub.c')) if get_option('plugins') tcg_ss.add(files('plugin-gen.c')) endif -tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) -if host_os =3D=3D 'linux' - tcg_ss.add(files('perf.c')) -endif specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) =20 specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( diff --git a/tcg/meson.build b/tcg/meson.build index 5afdec1e1a..8251589fd4 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -22,6 +22,11 @@ if get_option('tcg_interpreter') tcg_ss.add(files('tci.c')) endif =20 +tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) +if host_os =3D=3D 'linux' + tcg_ss.add(files('perf.c')) +endif + tcg_ss =3D tcg_ss.apply({}) =20 libtcg_user =3D static_library('tcg_user', --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569437; cv=none; d=zohomail.com; s=zohoarc; b=kobn3IS3pAxU/b6TD0kRkfCPNouAAO4arh/MPHMb5igBqpglDUZ28Bv2dJMrOVYwBnk4pTCgrvMLNmX3SSy1GS4D7Mjy3szveMKrV1KLZk0Jai64SswoWWcvNtkvcpObwrjDvmyPbbR5ThosOU/6FuZpkLJ1w/jj5T4cTDH3nOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569437; 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=XRwZFjq4cQsQYmD6HoikyRyAnRDJPSlCSVsphAQE8HU=; b=NeUC2wnEUJhHVlZk4+c3p+xi93cjya/wmBmi9Zu0ylVVZJkxTTiHInnEN/NpcOynum7A26Q/jxHhdInPo5eKxaodlJhaJZuZ7gj6bWBo2dSm1GJWrgE1F+9BmfKf7+JaLC3oW5ggC7nOb+atHmE2h/dAUYCI0YiphIRzHTwv5Q8= 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 1706569437927806.6098208185479; Mon, 29 Jan 2024 15:03:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUaed-0007Cl-OD; Mon, 29 Jan 2024 18:03:09 -0500 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 1rUady-0006ai-P7 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:23 -0500 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUadx-0008Uo-4F for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:22 -0500 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6e125818649so1072695a34.1 for ; Mon, 29 Jan 2024 15:02:20 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569340; x=1707174140; 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=XRwZFjq4cQsQYmD6HoikyRyAnRDJPSlCSVsphAQE8HU=; b=jPnXsN7a63Jo5SRhn+7XsyM6JYNB0yBDd0BsOtzKYr8enQtUiq6n6Sn5+h+Njij9VO MS0TsY+7Pbpm3BusDmziWvHlEJ/zM/M6CdOGUTNnU7ZCvyk4YB6OpLdBThKqANYjU67p vmYls2k4E4qEe82xQCBF1X4e24q/5Gx4oggACuL6Let3GSWUCzVH5sueeO+QdU+Vlmcr b0tY9Goz2PkvuZIiCnrBWUEcBq4jMAo+zOkIjTAonijddBv6kUPm2jPMLPkQBCZQOalv 6OfSgsC73NbXLA5eqKWMQOBQEaPTWOWnJ+WqDfR9juE4D4v3gUrYTLt0SyXxtE33r6Pd nCtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569340; x=1707174140; 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=XRwZFjq4cQsQYmD6HoikyRyAnRDJPSlCSVsphAQE8HU=; b=s6P6RPwzzYj1ejcfY43IgKnFL8meezjxOS3UZ7l2fLSea6MHc+4D1E7yJzJUxn9ah6 x1LrSlgZJLRWHZ07DbbF1a2bNER2LwXs3BY2xgQ0wSULpFD1c9FyArrmxR+xP2vlb3om 0lL0CHyh0SVA/G9939e3C6QVts9H3vxmym+Gbb940OREaHDv8Qwu01m7tnDJVMvSmgDe IcKs16jxTZotw7v2d2+nsNY/14TVrPaXXO3qdf8haNfBB5QY1X3UqIlStB5O429WaGct PjG5kyLImzh7aoHPLu/lxb7/27cm0FIOtQPbfH39Ayu7fvdM8k+K4gd39G8cHj4IrTzG XjjQ== X-Gm-Message-State: AOJu0YxTnFP6FrPaajA7WZL5PtM4V515uAhJT8B7u0ECXSLRbNKz3AYl cR2xuIHAB+FkxWoQG3HpwWH4ZejfqzQefhlEJk3bhCJ+MGYAISl0v5NJiVT0GtTJGNGrjmTspKn UGDw= X-Google-Smtp-Source: AGHT+IEvc7J8yHYX4/mdJEiooUFZueyqz8kgJTLAAwDuUrWpB4kZ0zbhHcuGr06gnx6+VGRjmR2JMQ== X-Received: by 2002:a05:6358:5982:b0:176:80c4:a44b with SMTP id c2-20020a056358598200b0017680c4a44bmr6622585rwf.9.1706569339994; Mon, 29 Jan 2024 15:02:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 20/31] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson Date: Tue, 30 Jan 2024 09:01:10 +1000 Message-Id: <20240129230121.8091-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::336; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569440020100003 From: Philippe Mathieu-Daud=C3=A9 tcg_ss[] source set contains target-specific units. Rename it as 'tcg_specific_ss[]' for clarity. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-2-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 46f7d53eeb..aef80de967 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,8 +1,8 @@ -tcg_ss =3D ss.source_set() common_ss.add(when: 'CONFIG_TCG', if_true: files( 'cpu-exec-common.c', )) -tcg_ss.add(files( +tcg_specific_ss =3D ss.source_set() +tcg_specific_ss.add(files( 'tcg-all.c', 'cpu-exec.c', 'tb-maint.c', @@ -11,12 +11,12 @@ tcg_ss.add(files( 'translate-all.c', 'translator.c', )) -tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) -tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) +tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c'= )) +tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec= -stub.c')) if get_option('plugins') - tcg_ss.add(files('plugin-gen.c')) + tcg_specific_ss.add(files('plugin-gen.c')) endif -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) +specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) =20 specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( 'cputlb.c', --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569448; cv=none; d=zohomail.com; s=zohoarc; b=CICXQOYn2t9hCRETsiACtqVB/wzZcmF1XMUSBR0xsnuPqedOLyNa/tCt1K6gimXKAkJ/EdJOhc/IPKPmIgMTwCEnLRw/5OxASEd+xWYL/bniOXQLe5cSgO6PKshsn8shuT+nyzHpny6V4xQYrT+L5u7z3+PkGjLK4qNq4MzCqlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569448; 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=IeBfHlDAifxu4F1/UNQzzGCEUArq4HbYf2mScaRZKZ4=; b=URTAFXMw0jWtYWRuB7huosVBXETBZKxmAm5U9EH5B/9IanH1qcLKPs88iPGWuX4xnVSWd6B2ozW97b46n+R/p2vM4vBCuBpoKxoresWRTZbTkrGmdm4ehhTTkk5xp26B7HpO8m3BQq6hzIW0YryFdGWa9Apxkbk5vkqTHPyQlFE= 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 1706569448623532.3320212880691; Mon, 29 Jan 2024 15:04:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUafa-0007if-Fr; Mon, 29 Jan 2024 18:04:03 -0500 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 1rUae1-0006lq-RB for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:26 -0500 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 1rUadz-0008V9-Sx for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:25 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6ddc5faeb7fso2586395b3a.3 for ; Mon, 29 Jan 2024 15:02:23 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569342; x=1707174142; 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=IeBfHlDAifxu4F1/UNQzzGCEUArq4HbYf2mScaRZKZ4=; b=R+i/ymPyT3LhQ9KcRwcs2NEiEGaDmz3bXPpSK3CmDbTXzujNDRf/qhxw6WfhmjKs7d nE0rSdjhBXYQeXbM3c/01lChxCAEWkXPtrVeo8xsYmVZkH5w0jhNM/+UDT93tboWKneF c3fdlnrqxdX3pL94xTb3QrHMrMPZXYC+zn/oB5EwRLyXDWzHUAZjphgUn7+LDMW213io NhBKd6Dj5+zg/LCCcjcKlDpAVZh6E6TFXDTzL9MP1Zl3iTzN0bJvV5VS3LE85IyJzImY jqTrIrSoqVMwofeBP2012wPWPgqBpY8gxpamoBn7CD8JBav7QTheDIr1cLX86SGjMV5X +yOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569342; x=1707174142; 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=IeBfHlDAifxu4F1/UNQzzGCEUArq4HbYf2mScaRZKZ4=; b=WEMcUKWfThRfCTCyHy3ZG/fAwQKWOx6fOtuE+726AAOWAph+z4Nj4eGaJjfL0Fr56N wqgcPvO0C+BXf4CuU+X0tkDf+MUENOJE/894sIahREXtAEAGaqc1xzmaD+GRyV+63lXb ITHFdzXSRqIJaNYgZUK10Hj3fyCovyps5iwKxI0vApcQHuxqjMNSPcFEfsuI5P9DBMN6 WOf45V7zdOlm77SZD0nPrNr1wybsp2ig2BBbSP0EgdHDB5Z3mH9+7ZTThVGhhVhKV72a eoiy5bPMfyioi9ftdxUKUvfThBNKxixtzW3yVAiz+R/J/4SogXgAZLqtezFdFsJ46FZ7 /93g== X-Gm-Message-State: AOJu0YzZSRC1BwaNaloukyZH8PLWLF9GC6bie2plLLTz9Vs1sXU/jG26 ztRF8TGdEbg3BehOAw20Unp34wsy64pMER9ZSO/v7OnlA25+aJwJSArJThDq6LhZINmFR9FiZC9 2Pks= X-Google-Smtp-Source: AGHT+IElodDrhcfyaV5dBLowKtw8DZw8outmvFYRbBKYomg6QZnZcRGlFXSEbz/OHRPcrZEDPchoxQ== X-Received: by 2002:a05:6a00:2d21:b0:6de:2f30:9aa4 with SMTP id fa33-20020a056a002d2100b006de2f309aa4mr2988012pfb.33.1706569342315; Mon, 29 Jan 2024 15:02:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 21/31] accel/tcg: Rename tcg_cpus_destroy() -> tcg_cpu_destroy() Date: Tue, 30 Jan 2024 09:01:11 +1000 Message-Id: <20240129230121.8091-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569450109100003 From: Philippe Mathieu-Daud=C3=A9 tcg_cpus_destroy() operates on a single vCPU, rename it as 'tcg_cpu_destroy'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20240124101639.30056-3-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index f9bc6330e2..17c7ed00eb 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -14,7 +14,7 @@ =20 #include "sysemu/cpus.h" =20 -void tcg_cpus_destroy(CPUState *cpu); +void tcg_cpu_destroy(CPUState *cpu); int tcg_cpus_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttc= g.c index af7307013a..bcba314a65 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -118,7 +118,7 @@ static void *mttcg_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); =20 - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); bql_unlock(); rcu_remove_force_rcu_notifier(&force_rcu.notifier); rcu_unregister_thread(); diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 3208035d85..0617f66b5b 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -131,7 +131,7 @@ static void rr_deal_with_unplugged_cpus(void) =20 CPU_FOREACH(cpu) { if (cpu->unplug && !cpu_can_run(cpu)) { - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); break; } } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 813065c0ec..9b84b84218 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -63,7 +63,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel) cpu->tcg_cflags |=3D cflags; } =20 -void tcg_cpus_destroy(CPUState *cpu) +void tcg_cpu_destroy(CPUState *cpu) { cpu_thread_signal_destroyed(cpu); } --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569550; cv=none; d=zohomail.com; s=zohoarc; b=M4rafKKh+3bo24awUQ2oYBxpsS69UBZLVlpUprjRm3MwwREHCBKXLgmtWNGMZPUs3ySMMY8idFfJM797GIgD+veuMI0wfH8dWEnYSmVrHwHWebNa2KHF9S2QLrIY90V4vgiZe41gvM31Nx+AwrvnMYnzjMeB9TnD+nlErVTse80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569550; 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=h0D5wvbqCBKDS3PIRJ2u8mID+Ysdp5Zl/usWtkQWmMI=; b=FdfHhKczB8KKVW1Z/+K2D7AJyIABSFD6AhbL/beaPHSzertwfjGBl+f/I5GYJT+NcYyq0JHbJMS3NKbgsbsgCajR7PO8MpeSWnGBG6/agNrt6Zksj5JHkWiB5TsDoQb7yY5+w6BqbqYKB8Bxr5Hg0DSCLRTb+W8k1n56CWW/ZgU= 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 1706569550586689.4149722193449; Mon, 29 Jan 2024 15:05:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUag9-0008KA-Ic; Mon, 29 Jan 2024 18:04:41 -0500 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 1rUae4-0006qE-Je for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:29 -0500 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUae2-0008W5-My for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:28 -0500 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3bda741ad7dso2953502b6e.1 for ; Mon, 29 Jan 2024 15:02:26 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569345; x=1707174145; 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=h0D5wvbqCBKDS3PIRJ2u8mID+Ysdp5Zl/usWtkQWmMI=; b=v20khRcTMp+4YR+Pd6g9IL+U3udxDQlZopse4FOoCtSicqb8mDYE+/mzleN3qbJ3UE ziPUjcChU9QSQgmxRk35uB9SLkmJtvnJ9rQwXEYd0DD68O1bjouDupLSr86AnE+pVvwo toHp64IaEttiurUQeTU283ln7zGwcYVKFosqIZ44NOsVyaWZ0YYKzNFoPzKUqVGSKunP IpL3HRLCPoFFzZQSSckHEMeS+t4MmMB9AozId9vjZF3o9HStkq+AGpd/5epCq0woqqWS TtB+tTm/ebqSdqfL88QbRdvvWqgOwLhilayTx2DtV2vtnLX8SL7VVWGy+r3U21bO39WI yYkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569345; x=1707174145; 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=h0D5wvbqCBKDS3PIRJ2u8mID+Ysdp5Zl/usWtkQWmMI=; b=I5+BCFfUPA6YtTcK+tveHKGxmcz/hOrhS5/ZMKJBWwVJL3p8GoOpG3lg1LgrMLXnER mjeJw3tpu6vaPf9qeuuPt4lJ0nyckKbScAK6FSfcednedE4MTPzf9W31gYc37MxR+sZj K0jfaRDArLiGm6pvmXR32KR2vaw4uj+Y5/uTxlSU/5pOH+wPSm6dzvNL1Ird+G6ORoND JDZwFw2VDoqOEWaS/YU9lm8TSfZSsKi8XFKpsSmMikZoS71YY/mVOCZXcpotibwsYBsX yx0HuW8XCffkOIr25Wfusc8YoQMKjrsjCPAojiSOIJbc1q6ASbVxI2nWyXN9RbIoZdZG bN0Q== X-Gm-Message-State: AOJu0YyQ0C6TlDVggzHHYAb5+vWBjYRpKHlHCR+RT2ELjCE1hbDKAEo1 lMifhXZ4o/04DsGtzvSvx7YJIJ5iQMyuf0sWqx9j/kyeqpzpm+aofJCqNuQohH8UYMTnkAtZXSk vyio= X-Google-Smtp-Source: AGHT+IE0qaf2IhZyAm/EP38aegeAxmpymypqC8H7cQ3lVwyTV/eFIY5am23rtwZ7RS/4ozXMSEqyrg== X-Received: by 2002:a05:6808:1983:b0:3be:31d5:6dda with SMTP id bj3-20020a056808198300b003be31d56ddamr787551oib.10.1706569345527; Mon, 29 Jan 2024 15:02:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 22/31] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec() Date: Tue, 30 Jan 2024 09:01:12 +1000 Message-Id: <20240129230121.8091-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569552332100007 From: Philippe Mathieu-Daud=C3=A9 tcg_cpus_exec() operates on a single vCPU, rename it as 'tcg_cpu_exec'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-4-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index 17c7ed00eb..44c4079972 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -15,7 +15,7 @@ #include "sysemu/cpus.h" =20 void tcg_cpu_destroy(CPUState *cpu); -int tcg_cpus_exec(CPUState *cpu); +int tcg_cpu_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); =20 diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttc= g.c index bcba314a65..c552b45b8e 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -92,7 +92,7 @@ static void *mttcg_cpu_thread_fn(void *arg) if (cpu_can_run(cpu)) { int r; bql_unlock(); - r =3D tcg_cpus_exec(cpu); + r =3D tcg_cpu_exec(cpu); bql_lock(); switch (r) { case EXCP_DEBUG: diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 0617f66b5b..894e73e52c 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -258,7 +258,7 @@ static void *rr_cpu_thread_fn(void *arg) if (icount_enabled()) { icount_prepare_for_run(cpu, cpu_budget); } - r =3D tcg_cpus_exec(cpu); + r =3D tcg_cpu_exec(cpu); if (icount_enabled()) { icount_process_data(cpu); } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 9b84b84218..9c957f421c 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -68,7 +68,7 @@ void tcg_cpu_destroy(CPUState *cpu) cpu_thread_signal_destroyed(cpu); } =20 -int tcg_cpus_exec(CPUState *cpu) +int tcg_cpu_exec(CPUState *cpu) { int ret; assert(tcg_enabled()); --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569823; cv=none; d=zohomail.com; s=zohoarc; b=FTXG0grLeRho9X4vBOhCQbOHjwhBrnFP09AQsbhVryStAvE2ksorLczgh8k7h13XnYl6hjT20JTT3Axcvf0RESLhapULxLVZvm1bPIVBXtrgACFy6xuIOxabyGf/38wI/+5ZyB2uECBilCPnq/0nF4pkEe9/jlLd+FZMgBekWWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569823; 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=KBlDdwmyjv7tUZ+vrc7gzPX/GnCAY0S/Ek9bZNdkYsBf45VMNxmJNzoBHPol9yX2XbJEaMzRWftofB2DB+rfd+k5tTXTQ8YHFwm3K1z5v9zNv3NeukG6RJ54j9MDT/aZC8rJ+PBhb5dBuFSgSSDvtKANvOyiLTcOUJuy1G/hTs4= 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 1706569823617344.0065989897604; Mon, 29 Jan 2024 15:10:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUahz-0001LV-7b; Mon, 29 Jan 2024 18:06:33 -0500 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 1rUae6-0006sG-Ku for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:35 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUae5-0008WF-27 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:30 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3bd5c4cffefso3816524b6e.1 for ; Mon, 29 Jan 2024 15:02:28 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569348; x=1707174148; 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=kfRdOoz+g2RIk+p6AuS/Cwv2hzBb50eRc64tuheJ0uSUFIaHl/IPFwO7PgbnifufvJ 6Ks7N3rR9wptrNObZG7DGWOymX+AUsc9D7RGo/lXQ9La9FL7GFQU/aXYG1/5/d7Zt/cY /47cR0vMK1nzSujpDs4QWL/4fZjIIyeUCV3hNpY/tT1BWiisSb0+1VYwfQnTMyYvZLRR 7f3NuzdOtv7A92i2z53pIkFUqr/x0uMhyWqjhbWG3DKUamXI1rIQTl+Et695fkziULx0 xRnP/I9+IJyBzJ7CN+uc3B0jXChS7TGQMC+4TQATg2okd2ezH7sbL1QiWzoCeHgZ71fR BX2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569348; x=1707174148; 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=dtSWOOgJ0KGJ2tu+cQhPlu+bbns1xyzYVU5FbKnPvNwfxxdRWqG/ab2NCDMa1s43Az a3LK2utjMLLobhjvOdV+4Oh4ClHXjULaEKIEtd91C02vFfDDGDxtpGnlmKCVo8NaUE7a b+h35b6qPhzNfZj1AnzO7bdEQreDanISogGREsIa2I30p+JCpgH6E/bT5rY2fxqLEuyG 1vQFJFBpE77TJQOdoUXQS8s3DozpXXMjvEcr8DZA9ktaVVOT4CKTn4baA7Y4i6h6u5Sw SKB5E+R7AgcuZ1DxTrp3K7FIHCoomaTaJi3l6hifMuZIEa/Cl20pSZPKRoEX+jIpBfy5 DxtA== X-Gm-Message-State: AOJu0YxTsL9vA4r0WHIbu+QxZgVq+8rzduHymEgoxhuinYnJhIvZ2JMV mTHdb/av7Fnvp1QaQkB05tu9G9J6l6RtHphjFqhy3tfFAEWHa/FAHuDwWXf5ewS1rJYoauX5pN3 9FqY= X-Google-Smtp-Source: AGHT+IHrXV+SHsLevEC6WcoFT/qLsMXpYjKdUrQVtcclDvbpYFKjaAqncxYGUNdhbtbLLHrRPJIJZw== X-Received: by 2002:a05:6358:524b:b0:176:91b9:831 with SMTP id c11-20020a056358524b00b0017691b90831mr4710648rwa.63.1706569347855; Mon, 29 Jan 2024 15:02:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 23/31] accel/tcg: Un-inline icount_exit_request() for clarity Date: Tue, 30 Jan 2024 09:01:13 +1000 Message-Id: <20240129230121.8091-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569825280100003 From: Philippe Mathieu-Daud=C3=A9 Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 950dad63cb..f2535a2991 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -777,6 +777,17 @@ static inline bool need_replay_interrupt(int interrupt= _request) } #endif /* !CONFIG_USER_ONLY */ =20 +static inline bool icount_exit_request(CPUState *cpu) +{ + if (!icount_enabled()) { + return false; + } + if (cpu->cflags_next_tb !=3D -1 && !(cpu->cflags_next_tb & CF_USE_ICOU= NT)) { + return false; + } + return cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0; +} + static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { @@ -882,10 +893,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } =20 /* Finally, check if we need to exit to the main loop. */ - if (unlikely(qatomic_read(&cpu->exit_request)) - || (icount_enabled() - && (cpu->cflags_next_tb =3D=3D -1 || cpu->cflags_next_tb & CF_= USE_ICOUNT) - && cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0))= { + if (unlikely(qatomic_read(&cpu->exit_request)) || icount_exit_request(= cpu)) { qatomic_set(&cpu->exit_request, 0); if (cpu->exception_index =3D=3D -1) { cpu->exception_index =3D EXCP_INTERRUPT; --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706570001; cv=none; d=zohomail.com; s=zohoarc; b=BezPi6SFqb7mIJhDPIljnFnSSsTFPc7g4MoHizX9k27oNeUPYPRP5i+Uygqq2uPZBECx1/b+2pGn6E9pe53v8TpsqxOh9WtBya35acQgGUw2niOMH6fpYxa4hkymug73mAmKVM2Vl3JikDUK0TfKVi30mhm6Md4zTI11auW7rAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706570001; 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=nX2hnguDgyihezTVjMva+754f8p35uMs4yuEeO0w5ns=; b=BMnEfqOnqKkHQhlzRxR6oN5n08z5BMNjP1UbNpQU4/8GW5DR3zNMNrd2+RmYDK9YoTWJf0FeXQm0Evp25to17KjAqcAjcVQ8UxfExjVMm02XOmmhQSXr1Kwd2oTzTa8ps519jdBLXyKY+jrOKoD4xBnU0vyJBlSqyE7YjX2irbg= 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 1706570001510313.86819648693233; Mon, 29 Jan 2024 15:13:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUahO-0000nd-AN; Mon, 29 Jan 2024 18:05:56 -0500 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 1rUaeC-0006yF-Tw for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:44 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUae7-000051-Oe for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:35 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1d75ea3a9b6so27726175ad.2 for ; Mon, 29 Jan 2024 15:02:31 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569350; x=1707174150; 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=nX2hnguDgyihezTVjMva+754f8p35uMs4yuEeO0w5ns=; b=UdEGj7ZS34jcKQM3fW4ISdVHTYiKKYGmN41F9t91EcpgJkQX6rzeNDyEc2ACrKjFGK oe6FlCVe9I63lb6JCd9bepjWbG3/W3cSxI/c+ohnJM1zLHNU47Fem2+7qgLOz/uTfaAL KCjuLQjRRa67IFMziEqg6WKzBUhZrhSBs7HiWSKo3CX4BZ9fJ8Fle5MxDh9TNohLuTRg zBhBOIO4RBXE2SDsttl6jQgrBwleahT/hnmBiu73aE/ClyGGWpjIG8l61hb2hIljwi/B k6J0zfI7XqCpojF5C657PToSYfq3q+H+gco93weUAUw355e0thIsKm88RumB1Z+58OJy 9Kqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569350; x=1707174150; 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=nX2hnguDgyihezTVjMva+754f8p35uMs4yuEeO0w5ns=; b=pBR74uJL3573c5CXjZNo2HkajzC67R9nQu16xPmxC3U2OHBSjNePZFJwAaL+T9Ru5O ZHt7D55D6ZWMQLxK24lJhc0yI5+Qh/he1+zyfLzKWDeZrGX16nyDiClLq9wjPfIm8Xn0 Q3Q0D14KidCR9sk9g9P3L5AIObIv9zFwXTktWFdvSBTE8GJXimHprf0zMDHkBOa7XERV zvg1pJEvFtyoRYsGGw7w6Z5uJ1ata5yAqnWMf4HKgTCZ0jt9sGOL5aUJ8OnnKTwewhgh g8toV9NlMnQXZfCININg5gtM4O2qHGVWDIYF+CobaIvoSWioPRWQfjTQOggyhH0XlfsR s28A== X-Gm-Message-State: AOJu0Yy+i6CaXQ5aFcBq80AFXdCZx3TypqvJOed2eI5Cx+Vs2n95XngV bnUbBekV9/uLLaY11FCipvwiMech3UzjgUiRKozrsW+H1l+EcRoVOsLq40U4OkdBXDiL4nxAW3b wfNM= X-Google-Smtp-Source: AGHT+IHlI03KCtGvoLkXA0JexPI7/MWFJmSkwV3fPAz9wT6emxcRrys/35mQnIXYvXUZGGuN8+SpIQ== X-Received: by 2002:a05:6a21:196:b0:19c:6ce1:d62b with SMTP id le22-20020a056a21019600b0019c6ce1d62bmr6920577pzb.9.1706569350065; Mon, 29 Jan 2024 15:02:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 24/31] include/qemu: Add TCGCPUOps typedef to typedefs.h Date: Tue, 30 Jan 2024 09:01:14 +1000 Message-Id: <20240129230121.8091-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706570003440100001 QEMU coding style recommends using structure typedefs. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 5 +---- include/qemu/typedefs.h | 1 + bsd-user/signal.c | 4 ++-- linux-user/signal.c | 4 ++-- target/alpha/cpu.c | 2 +- target/arm/cpu.c | 2 +- target/arm/tcg/cpu32.c | 2 +- target/avr/cpu.c | 2 +- target/cris/cpu.c | 4 ++-- target/hexagon/cpu.c | 2 +- target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/loongarch/cpu.c | 2 +- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/ppc/cpu_init.c | 2 +- target/riscv/tcg/tcg-cpu.c | 2 +- target/rx/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tricore/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 26 files changed, 29 insertions(+), 31 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index db58f12233..2c284d6397 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -90,9 +90,6 @@ typedef enum MMUAccessType { =20 typedef struct CPUWatchpoint CPUWatchpoint; =20 -/* see tcg-cpu-ops.h */ -struct TCGCPUOps; - /* see accel-cpu.h */ struct AccelCPUClass; =20 @@ -177,7 +174,7 @@ struct CPUClass { const struct SysemuCPUOps *sysemu_ops; =20 /* when TCG is not available, this pointer is NULL */ - const struct TCGCPUOps *tcg_ops; + const TCGCPUOps *tcg_ops; =20 /* * if not NULL, this is called in order for the CPUClass to initialize diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 5abdbc3874..d7c703b4ae 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -131,6 +131,7 @@ typedef struct Range Range; typedef struct ReservedRegion ReservedRegion; typedef struct SHPCDevice SHPCDevice; typedef struct SSIBus SSIBus; +typedef struct TCGCPUOps TCGCPUOps; typedef struct TCGHelperInfo TCGHelperInfo; typedef struct TranslationBlock TranslationBlock; typedef struct VirtIODevice VirtIODevice; diff --git a/bsd-user/signal.c b/bsd-user/signal.c index ca31470772..f4352e4530 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -1022,7 +1022,7 @@ void process_pending_signals(CPUArchState *env) void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, MMUAccessType access_type, bool maperr, uintptr= _t ra) { - const struct TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; =20 if (tcg_ops->record_sigsegv) { tcg_ops->record_sigsegv(cpu, addr, access_type, maperr, ra); @@ -1038,7 +1038,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulon= g addr, void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, MMUAccessType access_type, uintptr_t ra) { - const struct TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; =20 if (tcg_ops->record_sigbus) { tcg_ops->record_sigbus(cpu, addr, access_type, ra); diff --git a/linux-user/signal.c b/linux-user/signal.c index c9527adfa3..d3e62ab030 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -671,7 +671,7 @@ void force_sigsegv(int oldsig) void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, MMUAccessType access_type, bool maperr, uintptr= _t ra) { - const struct TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; =20 if (tcg_ops->record_sigsegv) { tcg_ops->record_sigsegv(cpu, addr, access_type, maperr, ra); @@ -687,7 +687,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong = addr, void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, MMUAccessType access_type, uintptr_t ra) { - const struct TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops =3D CPU_GET_CLASS(cpu)->tcg_ops; =20 if (tcg_ops->record_sigbus) { tcg_ops->record_sigbus(cpu, addr, access_type, ra); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index b8ed29e343..de705c3703 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -203,7 +203,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps alpha_tcg_ops =3D { +static const TCGCPUOps alpha_tcg_ops =3D { .initialize =3D alpha_translate_init, .restore_state_to_opc =3D alpha_restore_state_to_opc, =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b60e103046..6a96b245f2 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2458,7 +2458,7 @@ static const struct SysemuCPUOps arm_sysemu_ops =3D { #endif =20 #ifdef CONFIG_TCG -static const struct TCGCPUOps arm_tcg_ops =3D { +static const TCGCPUOps arm_tcg_ops =3D { .initialize =3D arm_translate_init, .synchronize_from_tb =3D arm_cpu_synchronize_from_tb, .debug_excp_handler =3D arm_debug_excp_handler, diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c index d9e0e2a4dd..1125305115 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -1018,7 +1018,7 @@ static void pxa270c5_initfn(Object *obj) cpu->reset_sctlr =3D 0x00000078; } =20 -static const struct TCGCPUOps arm_v7m_tcg_ops =3D { +static const TCGCPUOps arm_v7m_tcg_ops =3D { .initialize =3D arm_translate_init, .synchronize_from_tb =3D arm_cpu_synchronize_from_tb, .debug_excp_handler =3D arm_debug_excp_handler, diff --git a/target/avr/cpu.c b/target/avr/cpu.c index f5cbdc4a8c..1c68748b24 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -210,7 +210,7 @@ static const struct SysemuCPUOps avr_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps avr_tcg_ops =3D { +static const TCGCPUOps avr_tcg_ops =3D { .initialize =3D avr_cpu_tcg_init, .synchronize_from_tb =3D avr_cpu_synchronize_from_tb, .restore_state_to_opc =3D avr_restore_state_to_opc, diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 9ba08e8b0c..6349148b65 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -178,7 +178,7 @@ static const struct SysemuCPUOps cris_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps crisv10_tcg_ops =3D { +static const TCGCPUOps crisv10_tcg_ops =3D { .initialize =3D cris_initialize_crisv10_tcg, .restore_state_to_opc =3D cris_restore_state_to_opc, =20 @@ -189,7 +189,7 @@ static const struct TCGCPUOps crisv10_tcg_ops =3D { #endif /* !CONFIG_USER_ONLY */ }; =20 -static const struct TCGCPUOps crisv32_tcg_ops =3D { +static const TCGCPUOps crisv32_tcg_ops =3D { .initialize =3D cris_initialize_tcg, .restore_state_to_opc =3D cris_restore_state_to_opc, =20 diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index c0cd739e15..759ea62814 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -337,7 +337,7 @@ static void hexagon_cpu_init(Object *obj) =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps hexagon_tcg_ops =3D { +static const TCGCPUOps hexagon_tcg_ops =3D { .initialize =3D hexagon_translate_init, .synchronize_from_tb =3D hexagon_cpu_synchronize_from_tb, .restore_state_to_opc =3D hexagon_restore_state_to_opc, diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 14e17fa9aa..3c019855b4 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -170,7 +170,7 @@ static const struct SysemuCPUOps hppa_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps hppa_tcg_ops =3D { +static const TCGCPUOps hppa_tcg_ops =3D { .initialize =3D hppa_translate_init, .synchronize_from_tb =3D hppa_cpu_synchronize_from_tb, .restore_state_to_opc =3D hppa_restore_state_to_opc, diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index e1405b7be9..8e148e9bc4 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -106,7 +106,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps x86_tcg_ops =3D { +static const TCGCPUOps x86_tcg_ops =3D { .initialize =3D tcg_x86_init, .synchronize_from_tb =3D x86_cpu_synchronize_from_tb, .restore_state_to_opc =3D x86_restore_state_to_opc, diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 064540397d..dd3e46a726 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -734,7 +734,7 @@ void loongarch_cpu_dump_state(CPUState *cs, FILE *f, in= t flags) #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 -static struct TCGCPUOps loongarch_tcg_ops =3D { +static TCGCPUOps loongarch_tcg_ops =3D { .initialize =3D loongarch_translate_init, .synchronize_from_tb =3D loongarch_cpu_synchronize_from_tb, .restore_state_to_opc =3D loongarch_restore_state_to_opc, diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 1421e77c2c..44000f5869 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -525,7 +525,7 @@ static const struct SysemuCPUOps m68k_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps m68k_tcg_ops =3D { +static const TCGCPUOps m68k_tcg_ops =3D { .initialize =3D m68k_tcg_init, .restore_state_to_opc =3D m68k_restore_state_to_opc, =20 diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index bbb3335cad..2318ad7013 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -387,7 +387,7 @@ static const struct SysemuCPUOps mb_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps mb_tcg_ops =3D { +static const TCGCPUOps mb_tcg_ops =3D { .initialize =3D mb_tcg_init, .synchronize_from_tb =3D mb_cpu_synchronize_from_tb, .restore_state_to_opc =3D mb_restore_state_to_opc, diff --git a/target/mips/cpu.c b/target/mips/cpu.c index a0023edd43..df544ab39b 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -549,7 +549,7 @@ static const struct SysemuCPUOps mips_sysemu_ops =3D { * NB: cannot be const, as some elements are changed for specific * mips hardware (see hw/mips/jazz.c). */ -static const struct TCGCPUOps mips_tcg_ops =3D { +static const TCGCPUOps mips_tcg_ops =3D { .initialize =3D mips_tcg_init, .synchronize_from_tb =3D mips_cpu_synchronize_from_tb, .restore_state_to_opc =3D mips_restore_state_to_opc, diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index a27732bf2b..596c0c5617 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -354,7 +354,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps nios2_tcg_ops =3D { +static const TCGCPUOps nios2_tcg_ops =3D { .initialize =3D nios2_tcg_init, .restore_state_to_opc =3D nios2_restore_state_to_opc, =20 diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 381ebe00d3..477d49d4bc 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -213,7 +213,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps openrisc_tcg_ops =3D { +static const TCGCPUOps openrisc_tcg_ops =3D { .initialize =3D openrisc_translate_init, .synchronize_from_tb =3D openrisc_cpu_synchronize_from_tb, .restore_state_to_opc =3D openrisc_restore_state_to_opc, diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 344196a8ce..23eb5522b6 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7332,7 +7332,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops =3D { #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps ppc_tcg_ops =3D { +static const TCGCPUOps ppc_tcg_ops =3D { .initialize =3D ppc_translate_init, .restore_state_to_opc =3D ppc_restore_state_to_opc, =20 diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 994ca1cdf9..b7da92783b 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -129,7 +129,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, env->bins =3D data[1]; } =20 -static const struct TCGCPUOps riscv_tcg_ops =3D { +static const TCGCPUOps riscv_tcg_ops =3D { .initialize =3D riscv_translate_init, .synchronize_from_tb =3D riscv_cpu_synchronize_from_tb, .restore_state_to_opc =3D riscv_restore_state_to_opc, diff --git a/target/rx/cpu.c b/target/rx/cpu.c index c5ffeffe32..353132dac2 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -178,7 +178,7 @@ static const struct SysemuCPUOps rx_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps rx_tcg_ops =3D { +static const TCGCPUOps rx_tcg_ops =3D { .initialize =3D rx_translate_init, .synchronize_from_tb =3D rx_cpu_synchronize_from_tb, .restore_state_to_opc =3D rx_restore_state_to_opc, diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 6acfa1c91b..7f123863dc 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -319,7 +319,7 @@ static void s390_cpu_reset_full(DeviceState *dev) #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps s390_tcg_ops =3D { +static const TCGCPUOps s390_tcg_ops =3D { .initialize =3D s390x_translate_init, .restore_state_to_opc =3D s390x_restore_state_to_opc, =20 diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 806a0ef875..39772955b5 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -237,7 +237,7 @@ static const struct SysemuCPUOps sh4_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps superh_tcg_ops =3D { +static const TCGCPUOps superh_tcg_ops =3D { .initialize =3D sh4_translate_init, .synchronize_from_tb =3D superh_cpu_synchronize_from_tb, .restore_state_to_opc =3D superh_restore_state_to_opc, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index befa7fc4eb..7d0d629a3d 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -874,7 +874,7 @@ static const struct SysemuCPUOps sparc_sysemu_ops =3D { #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps sparc_tcg_ops =3D { +static const TCGCPUOps sparc_tcg_ops =3D { .initialize =3D sparc_tcg_init, .synchronize_from_tb =3D sparc_cpu_synchronize_from_tb, .restore_state_to_opc =3D sparc_restore_state_to_opc, diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 8acacdf0c0..e6d91c74b5 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -173,7 +173,7 @@ static const struct SysemuCPUOps tricore_sysemu_ops =3D= { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps tricore_tcg_ops =3D { +static const TCGCPUOps tricore_tcg_ops =3D { .initialize =3D tricore_tcg_init, .synchronize_from_tb =3D tricore_cpu_synchronize_from_tb, .restore_state_to_opc =3D tricore_restore_state_to_opc, diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 99c0ca130f..62020b1f33 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -222,7 +222,7 @@ static const struct SysemuCPUOps xtensa_sysemu_ops =3D { =20 #include "hw/core/tcg-cpu-ops.h" =20 -static const struct TCGCPUOps xtensa_tcg_ops =3D { +static const TCGCPUOps xtensa_tcg_ops =3D { .initialize =3D xtensa_translate_init, .debug_excp_handler =3D xtensa_breakpoint_handler, .restore_state_to_opc =3D xtensa_restore_state_to_opc, --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569590; cv=none; d=zohomail.com; s=zohoarc; b=J0YGUPZbKyepP85DkZ9LQC9DkUcrum3UcXeLndoaVewEJtMH76v6hp4kyDisRkz8a7/crHHbyQ9VmaOzHd6J9DvJWOjnOZHic+hL6xSNmaD/aGrfJjcJWFe7fekhspqeFahz8umyY22I5sk+QdXtU65B/Ut4/ngbz+Hl3ZSz9jk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569590; 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=mOPcVGQzJ6S800tkZazccfXJHRzcbDUG6SoAa/uVeRg=; b=GJMbsq8Ui4WbW9kypbmzRHegK5s7qHr+Tf1P1ASbareRzrdvUX2KUfE3i/+01GcBmDp32CFYPfUPkCAbkUFa09hch+dKCXtJiWP2jY511SJhsc2ZcYDqBWUz+YkPwLs25JgYuhYnGx5SbF8Eu/KAywHYKDSfWfDFXKVNPfFJ2Qo= 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 1706569590445503.90139084360294; Mon, 29 Jan 2024 15:06:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUagT-0008Up-HO; Mon, 29 Jan 2024 18:05:00 -0500 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 1rUaeB-0006xo-7v for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:39 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUae9-00005H-Lm for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:34 -0500 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ddc0c02593so1489575b3a.3 for ; Mon, 29 Jan 2024 15:02:33 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569352; x=1707174152; 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=mOPcVGQzJ6S800tkZazccfXJHRzcbDUG6SoAa/uVeRg=; b=utIwoHYBZ2XpeKrSNphEJ/8P7a+iq70nO4oAQitxwzJtWvzxPlWUmeYCi0qGy/QaWi sLQKtkbaTgyThnTp+U0pJXF1um47feB2kp63nZX7d0l7Y/nwXfU6fKU/JFT0wW4C/6NU NS2h0NtsJc8U6avH6YefOPJZwcHA+JCEhjqjVtdg2+m4mDKYMUVO1CIFzls3NILlaDLk Pz+8u4+HYA5jNuwMKUxgHVMRLfn2ctL2c2XqQ6TF/shchAxSKQ0r/8kmuh0FRhfEVOCt 0CxOoeplMqPDoj4r+raZg/o9nqhymYTSLtR5QVTZL/76VsPxgrlpDsYoXgDgIBkL753R xXVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569352; x=1707174152; 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=mOPcVGQzJ6S800tkZazccfXJHRzcbDUG6SoAa/uVeRg=; b=qCcJ87UUx8BdBmIkqj3nQyieDOa+JdSvyhbeo2dXQRx2CHESjaQQeKpUxvREidw4TD i+8GFWoRudPhtpxHBeO5IuTVuuX3PAHUIwfW8GnQKSbhsjlK3DF+nNTG+kNj2moNpuqo yp5y9z+mca0cuGmWkazl+3QoZr0JVymmxkvsfS1QeEUCfkiX0dfWme92bIGaeLoCm9Hx LGDjuwgdEP/RXNS6HzPSCc7jMkO55PY1AE4ce1us5rS5wE79exyBb+QY3Yb6NjoUBIOR PDCDrWJIBnKi8RsXiD4/zhFNHVAzISCXcv4qLI6sMZWCxz6nIx5YCqIGCXND9G0VwJ5P tXBQ== X-Gm-Message-State: AOJu0YxTikyOc2qRcqGH4C2hyAYb5fwjG3xVYJ+Cy5Ow9wE9dVYwHVoj N9B4kLaPZ3LlPheT3pnn42XKLEl1Occt/KnQTQES2TVh4s4uxsuX32GuCGlHSCkTTzsoJTGETnk XhWo= X-Google-Smtp-Source: AGHT+IEOs4hYoxBzj6NRdLGYBdhNm+09r6c0rK57T204LDDquNjtMyBvBPTJaK8Wuf+yPKji2GoXFQ== X-Received: by 2002:a05:6a00:2f13:b0:6dd:b12f:c394 with SMTP id fe19-20020a056a002f1300b006ddb12fc394mr2848911pfb.32.1706569352011; Mon, 29 Jan 2024 15:02:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 25/31] target/loongarch: Constify loongarch_tcg_ops Date: Tue, 30 Jan 2024 09:01:15 +1000 Message-Id: <20240129230121.8091-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569592488100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index dd3e46a726..fb8dde7def 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -734,7 +734,7 @@ void loongarch_cpu_dump_state(CPUState *cs, FILE *f, in= t flags) #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 -static TCGCPUOps loongarch_tcg_ops =3D { +static const TCGCPUOps loongarch_tcg_ops =3D { .initialize =3D loongarch_translate_init, .synchronize_from_tb =3D loongarch_cpu_synchronize_from_tb, .restore_state_to_opc =3D loongarch_restore_state_to_opc, --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569952; cv=none; d=zohomail.com; s=zohoarc; b=DaITxenj1sdB+Oo66hpNcyLtBtz1GZaJDq7O/vMPs4+lRxJGSRhKG2aX6KOQdpg9aLozCHPr4xkpRatjjqHhMss8n4mXKn4NMuGezZvooLAmm6+3I5LjzBH0QnzJGNOWczylfu7xuRAQMyffisLkuLMYGc+LUylYeQLHK3k4hIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569952; 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=7BY3FC/8lb12NjJs4/taRcBSMiYCFRNyNU57iKW6Ebg=; b=k8sRig4PUxhoJuO1pDx3PbRoNWUgNRng1x6UAWmkyneDj7ksVqQgpp2mJ0403L42C8POnBxXvRwCvqDmHsNALAjvpyiv82EUjXP498e13eGBSCuYpq1EROhQcB1wbbRYhnFzg4l09ApbQwW6aET0Ru3g/NbGmDBO11tYuSz5v3Y= 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 1706569952838708.4564888967532; Mon, 29 Jan 2024 15:12:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUajV-000307-ID; Mon, 29 Jan 2024 18:08:06 -0500 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 1rUaeE-0006yO-HI for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaeC-00005Q-Gu for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:38 -0500 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-59a1896b45eso1149595eaf.1 for ; Mon, 29 Jan 2024 15:02:34 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569354; x=1707174154; 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=7BY3FC/8lb12NjJs4/taRcBSMiYCFRNyNU57iKW6Ebg=; b=ZSPB/XlROGKHclBdMiV9WZmy/BzSp409OvFUsbK7VlEU6yndZ27o9WzuUmq6F217UM jXZeukLLVKrnwv291ftUWwKb0pM8KWJ2TC8ior9Dwg9l3nEqTzVElsrnNqxHq9TKKLGM CA8+bs30O0MuSdCfx7TY1tKxY6aDrCk9dx937GHcf+T7n9XLySJJuQ0Bot+sf4e4reuA eTdyCTTwRdv+YbEOxa6pE3tVTBPaK6OGlCRFphSrS66qJYnrteD5eJYpxt755HyGTwpa dW6hxOqDfslQd5G0SwBGCSE6G4kovFGY8oznWX7mp5RlR+wYA5nIaw1e8EGpF/DJ1AdU 2Rgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569354; x=1707174154; 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=7BY3FC/8lb12NjJs4/taRcBSMiYCFRNyNU57iKW6Ebg=; b=n/l7lVp3JmmRu1DRUfwg/m/8tOaD3CwrDhyaVb2zeYDjY6TT3mPRhv2cy7Q2eekPJK vtl/1GS2llTJa/cGFKJpGeve/BmggoAwqWBLAnMcV9JehSX9S4Kqv0P7KVexIPP+yLE7 AqolnuOBUvfY0jYipG5BSJFIa/xP3Ido0YrMLypBz6vB5d7DDqOs/fOivWSEnr5GKxby E7b+oh7IULoGRSZN3ZqBLvxmMy+xxbx3TJIBSUvDnJA72uhGplvWhpKkYczwT9XJ72K3 9H0OftusEbjVvsuRR32I8gDNDHpzsY1FDZ8EaKGvk8rgIn2jwBIbqthnzxTzCAoy56pb mNcA== X-Gm-Message-State: AOJu0YxlVIfy+y3e+eBtMK7RmZJhkIZ5NxwsERDk3/pmUihsB0fEXbee qGeQ3YcKITTv741czIZDEoXiggldzg4TGUn14eg0qvumqJYjBrz4ESSNH6wxKIOochgjLR+h+xO haeg= X-Google-Smtp-Source: AGHT+IHKaEWq3K6xRYFttQ7vmsuYSHO75hEiXZLC7nBIct0Ko59Zqhh3Wcjzhz+00GEtJetrusC0bg== X-Received: by 2002:a05:6358:722:b0:178:6463:d40b with SMTP id e34-20020a056358072200b001786463d40bmr6929010rwj.17.1706569353860; Mon, 29 Jan 2024 15:02:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 26/31] accel/tcg: Use CPUState.cc instead of CPU_GET_CLASS in cpu-exec.c Date: Tue, 30 Jan 2024 09:01:16 +1000 Message-Id: <20240129230121.8091-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::c2f; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569953311100001 Content-Type: text/plain; charset="utf-8" CPU_GET_CLASS does runtime type checking; use the cached copy of the class instead. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 109 ++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f2535a2991..3aebf46849 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -343,9 +343,9 @@ static bool check_for_breakpoints_slow(CPUState *cpu, v= addr pc, #ifdef CONFIG_USER_ONLY g_assert_not_reached(); #else - CPUClass *cc =3D CPU_GET_CLASS(cpu); - assert(cc->tcg_ops->debug_check_breakpoint); - match_bp =3D cc->tcg_ops->debug_check_breakpoint(cpu); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + assert(tcg_ops->debug_check_breakpoint); + match_bp =3D tcg_ops->debug_check_breakpoint(cpu); #endif } =20 @@ -462,10 +462,11 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int= *tb_exit) * counter hit zero); we must restore the guest PC to the address * of the start of the TB. */ - CPUClass *cc =3D CPU_GET_CLASS(cpu); + CPUClass *cc =3D cpu->cc; + const TCGCPUOps *tcg_ops =3D cc->tcg_ops; =20 - if (cc->tcg_ops->synchronize_from_tb) { - cc->tcg_ops->synchronize_from_tb(cpu, last_tb); + if (tcg_ops->synchronize_from_tb) { + tcg_ops->synchronize_from_tb(cpu, last_tb); } else { tcg_debug_assert(!(tb_cflags(last_tb) & CF_PCREL)); assert(cc->set_pc); @@ -497,19 +498,19 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int= *tb_exit) =20 static void cpu_exec_enter(CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; =20 - if (cc->tcg_ops->cpu_exec_enter) { - cc->tcg_ops->cpu_exec_enter(cpu); + if (tcg_ops->cpu_exec_enter) { + tcg_ops->cpu_exec_enter(cpu); } } =20 static void cpu_exec_exit(CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; =20 - if (cc->tcg_ops->cpu_exec_exit) { - cc->tcg_ops->cpu_exec_exit(cpu); + if (tcg_ops->cpu_exec_exit) { + tcg_ops->cpu_exec_exit(cpu); } } =20 @@ -685,7 +686,7 @@ static inline bool cpu_handle_halt(CPUState *cpu) =20 static inline void cpu_handle_debug_exception(CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; CPUWatchpoint *wp; =20 if (!cpu->watchpoint_hit) { @@ -694,8 +695,8 @@ static inline void cpu_handle_debug_exception(CPUState = *cpu) } } =20 - if (cc->tcg_ops->debug_excp_handler) { - cc->tcg_ops->debug_excp_handler(cpu); + if (tcg_ops->debug_excp_handler) { + tcg_ops->debug_excp_handler(cpu); } } =20 @@ -712,6 +713,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) #endif return false; } + if (cpu->exception_index >=3D EXCP_INTERRUPT) { /* exit request from the cpu execution loop */ *ret =3D cpu->exception_index; @@ -720,43 +722,45 @@ static inline bool cpu_handle_exception(CPUState *cpu= , int *ret) } cpu->exception_index =3D -1; return true; - } else { -#if defined(CONFIG_USER_ONLY) - /* if user mode only, we simulate a fake exception - which will be handled outside the cpu execution - loop */ -#if defined(TARGET_I386) - CPUClass *cc =3D CPU_GET_CLASS(cpu); - cc->tcg_ops->fake_user_interrupt(cpu); -#endif /* TARGET_I386 */ - *ret =3D cpu->exception_index; - cpu->exception_index =3D -1; - return true; -#else - if (replay_exception()) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - bql_lock(); - cc->tcg_ops->do_interrupt(cpu); - bql_unlock(); - cpu->exception_index =3D -1; + } =20 - if (unlikely(cpu->singlestep_enabled)) { - /* - * After processing the exception, ensure an EXCP_DEBUG is - * raised when single-stepping so that GDB doesn't miss the - * next instruction. - */ - *ret =3D EXCP_DEBUG; - cpu_handle_debug_exception(cpu); - return true; - } - } else if (!replay_has_interrupt()) { - /* give a chance to iothread in replay mode */ - *ret =3D EXCP_INTERRUPT; +#if defined(CONFIG_USER_ONLY) + /* + * If user mode only, we simulate a fake exception which will be + * handled outside the cpu execution loop. + */ +#if defined(TARGET_I386) + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + tcg_ops->fake_user_interrupt(cpu); +#endif /* TARGET_I386 */ + *ret =3D cpu->exception_index; + cpu->exception_index =3D -1; + return true; +#else + if (replay_exception()) { + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + + bql_lock(); + tcg_ops->do_interrupt(cpu); + bql_unlock(); + cpu->exception_index =3D -1; + + if (unlikely(cpu->singlestep_enabled)) { + /* + * After processing the exception, ensure an EXCP_DEBUG is + * raised when single-stepping so that GDB doesn't miss the + * next instruction. + */ + *ret =3D EXCP_DEBUG; + cpu_handle_debug_exception(cpu); return true; } -#endif + } else if (!replay_has_interrupt()) { + /* give a chance to iothread in replay mode */ + *ret =3D EXCP_INTERRUPT; + return true; } +#endif =20 return false; } @@ -856,10 +860,10 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, True when it is, and we should restart on a new TB, and via longjmp via cpu_loop_exit. */ else { - CPUClass *cc =3D CPU_GET_CLASS(cpu); + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; =20 - if (cc->tcg_ops->cpu_exec_interrupt && - cc->tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { + if (tcg_ops->cpu_exec_interrupt && + tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { if (need_replay_interrupt(interrupt_request)) { replay_interrupt(); } @@ -1078,10 +1082,9 @@ int cpu_exec(CPUState *cpu) bool tcg_exec_realizefn(CPUState *cpu, Error **errp) { static bool tcg_target_initialized; - CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 if (!tcg_target_initialized) { - cc->tcg_ops->initialize(); + cpu->cc->tcg_ops->initialize(); tcg_target_initialized =3D true; } =20 --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569802; cv=none; d=zohomail.com; s=zohoarc; b=DE+qUI7Lz/Q1fpLdpzQUvlXL9XvD25cPqfC+0hv567/7XyjKkl4jXbZ+G27BpXm9AntKV6dHX3v5Uz0KBb0nWI/zpOic1ekvM6Ml78j4oSf9EgKzSMpPI6yVK02hkjccmkrMJ5FWQ+S9HH0d8+07vWiNtXXJO6DdSONcDzXTTiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569802; 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=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=nXi+VfJa17N9B4uge3KHJN3vp58baS0c6JJV9ZRUGPZqCLBgs/J9pVXSbsG96oT63Y1IziL7jN977MwVLerhz8keLhUrIse90YBn/kSyDS/gseUQTMEUHbR71flgyI6mrZPOPCg3me6bfaPmIEBaT7bKkjz7/6Yi8/TojSdK+OU= 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 1706569802474788.6394498238249; Mon, 29 Jan 2024 15:10:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUaj8-0002Uz-Ci; Mon, 29 Jan 2024 18:07:47 -0500 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 1rUaeI-00071f-CF for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaeD-000063-NJ for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:39 -0500 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ddb1115e82so2246348b3a.0 for ; Mon, 29 Jan 2024 15:02:37 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569356; x=1707174156; 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=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=PSQjnajTyl9ULQX7bFv2kBA1oMwHCivUIbTfGCN2gAe+oMFDAzSeoTZLhmA7mRUvTP I5sPwSbOFvbB/rf21bJ+r2dpTf2Zf78qKRukIV8T8CR6vh/C4yKx75txJYPrcGxWMlek O5WBYp1kHgfGNSc1M5km9Yul/yht7Xy5HWQ3g+g+/2B7F3t1fRO/e6y1g1tLtKIrthjH uuS2BPVY8NYnrr1FH2TnaoRX91mEH9a7vjgDjWa9WQ7r+uQTzOgSpaHwtfu2sVYZGlMu v74Cdng3e+o7+Hldny/aYRDtfkO+YJBxIVKFVRq44S3W+e1ZSHBgF5HPqpByCydMFTse So1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569356; x=1707174156; 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=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=GWxNwhFCBARH/ZQ5496YhRx0+61ILRZI2YbvCANQVx8ylxem9/67IohZfglSP6OQ1Q JAHn1iv8G5sgpWxpjgnUO+GdGzI5TmfCLazEWVwN8wcagoRM4ztPDZkjhNquGRLDBQSg 9O02DhsIlBzE4Lq33cqlIVwb5HOLGo4uTmBUscZm7GqGk3ZXwN0Pd7uGWaHotJIRZfMu F9ub3wmbgr2WG8h2PZY767bHHMLqZe4UPxpldI+Ap2/2vplIe8Jf2umGqcoEfVAvJJ4u 5phhX/qjWxIQe6xoSX84dNrEUriDPiUZ1Ix/a2FOsmk7OTf1fJhObzvMjq7B+ZXgb3dB JSlA== X-Gm-Message-State: AOJu0YwP/1PbJqqecYOrwqYimzi8QdAdeiDRSO49VotfjNF3TDgaFgrQ 1WK9wqY3FqzQQfhOwlbS/coLwkM4x1ezx7GO/Ei6oWk4SlrhHo+7Pn5OutUW1yaWeroRRgiIJJh DmgI= X-Google-Smtp-Source: AGHT+IHOwt5Y2iUxnaANB/q8/PiNJll6Q7FnOty1Wca9G4vtbnbzVhPN/gwYjg70gOfbPxFk2ej/xQ== X-Received: by 2002:a62:61c4:0:b0:6de:3b41:2877 with SMTP id v187-20020a6261c4000000b006de3b412877mr1265863pfb.25.1706569356416; Mon, 29 Jan 2024 15:02:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Pavel Dovgalyuk Subject: [PULL 27/31] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler Date: Tue, 30 Jan 2024 09:01:17 +1000 Message-Id: <20240129230121.8091-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569803179100001 From: Philippe Mathieu-Daud=C3=A9 In order to make accel/tcg/ target agnostic, introduce the need_replay_interrupt() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Reviewed-by: Pavel Dovgalyuk Message-Id: <20240124101639.30056-7-philmd@linaro.org> Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 5 +++++ accel/tcg/cpu-exec.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 3ed279836f..013867b890 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -166,6 +166,11 @@ struct TCGCPUOps { */ bool (*io_recompile_replay_branch)(CPUState *cpu, const TranslationBlock *tb); + /** + * @need_replay_interrupt: Return %true if @interrupt_request + * needs to be recorded for replay purposes. + */ + bool (*need_replay_interrupt)(int interrupt_request); #endif /* !CONFIG_USER_ONLY */ #endif /* NEED_CPU_H */ =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 3aebf46849..34d10eb173 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -771,12 +771,14 @@ static inline bool cpu_handle_exception(CPUState *cpu= , int *ret) * "real" interrupt event later. It does not need to be recorded for * replay purposes. */ -static inline bool need_replay_interrupt(int interrupt_request) +static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_requ= est) { #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); #else - return true; + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + return !tcg_ops->need_replay_interrupt + || tcg_ops->need_replay_interrupt(interrupt_request); #endif } #endif /* !CONFIG_USER_ONLY */ @@ -864,7 +866,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, =20 if (tcg_ops->cpu_exec_interrupt && tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { - if (need_replay_interrupt(interrupt_request)) { + if (need_replay_interrupt(cpu, interrupt_request)) { replay_interrupt(); } /* --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569831; cv=none; d=zohomail.com; s=zohoarc; b=RinAbvfyA7TLVZKblWJPFBRqBGsiJ92FBsMMi6NSCibymyuuh1AFgH4De9Kz15c+R994+AS1Eip52iIOTtTeCV3U5QxGh8TycOcRfGJ+OezUZJx2U+c+16RiMX97jRsj3zgDhjBSCJuQgh+NsZ2lynqc3LAecvyc3WKu0yYRWCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569831; 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; b=JVxr6vDGwEP9+6LWP/Y9Mjb2o6RG0Uh96/X+ZIOoFGvNFjHATRp7MLRBKTUSt3o/wTrUpns7/ObO3zAGBYlhZNI2PF+TzWiNGgtI+ak01ggg5/XRFlXldmITtZkucr18AaAWQpHUX0XJS14zO6M3aqfaPnNGRTI0pa2Egbv7ei4= 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 170656983169623.041253165769376; Mon, 29 Jan 2024 15:10:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUahL-0000iy-Ax; Mon, 29 Jan 2024 18:05:53 -0500 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 1rUaeK-00071p-2a for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 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 1rUaeI-00006Y-4E for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:43 -0500 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6de2f8d6fb9so897969b3a.1 for ; Mon, 29 Jan 2024 15:02:40 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569359; x=1707174159; 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; b=sooDS/uM4hC35MJivQ+xbLeHExTRUUbNzAy+KZnJ7DtLon+X5/urcmSyWQFg91YeYP ZYCTHEkVwzcNDTZw0MbMzgAn2iOy1SmMW1E6WstppT3N6siseAml50b1a2IxS9M7ajXz C+khQ9otXwmdL+ZqBdYCmP7qvVp0r36/XqMQx7YmZwx0IGpHE8MSIPAvqoCdrzzT1J/g Hyq0VVz0q22EkhMyW6D/SF6ERHC/lgQG79iDRpCJEVCzdUKV30X5yxuxPkTzMx2XuWMP aUNGeQtNFuUXWAapx2wPK8lwPd9xiSeCB9WuBOsCwCEPuumxZGtv7nGL9PvrcckMx2pJ eqNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569359; x=1707174159; 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; b=UI44gmW1ihA39Fkc4M55G44eWi4zt1sUewU+O7RAD0lCRraRE6J3k8T43825/3w4M7 mlquyPCe7o6/VDv3AWnANkc95BfPC4hf+lLEQrL2OCOptiWNKKH8Wc3Kjc8Z9XI4H/fk p0AtLObsIXWEJ0hYQMA09Q0OSl/lzWuuB/bB/3uC0o2Nu3eQmU660lvh048qRYK0RGCE UMmTYUvdHeP3D1n+g/QsCR9QOTMco9AD+V7kuKfP0RoYqQZC72LTpKbl2V0zsmhbAC/h UiLPcroMAzu9AIqZ8a4iphGoVzm+iqkqkC2yCvAEVEK0polqesjPh+rDdO/TEyPJ1oLV VgmQ== X-Gm-Message-State: AOJu0Yx8IJAAoyLY8TkwRb6qm67sEJe+WlZc+ZETOiTu9/E8Z94AEs9y AGEkNNX+ParrQBk2Vh3nL0oX4Qm+u1u3kBKEKm4eRKY7NBFHoqx/Z5HpVIxzcI96ekYoEp3A+FC fcLs= X-Google-Smtp-Source: AGHT+IFfutpfShcyJ0cuGZWntYac7/5yuWGYaPYWZfxlzCJoQhEODJG98KYt1qys665/99btQvbf5w== X-Received: by 2002:a62:ce08:0:b0:6dd:c135:54e9 with SMTP id y8-20020a62ce08000000b006ddc13554e9mr4690929pfg.9.1706569358976; Mon, 29 Jan 2024 15:02:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Pavel Dovgalyuk Subject: [PULL 28/31] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Date: Tue, 30 Jan 2024 09:01:18 +1000 Message-Id: <20240129230121.8091-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569833083100007 From: Philippe Mathieu-Daud=C3=A9 Move this x86-specific code out of the generic accel/tcg/. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240124101639.30056-8-philmd@linaro.org> Signed-off-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 4 ---- target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index ce34b737bb..253b1f561e 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_S= PACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 34d10eb173..2eacd694ea 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -773,13 +773,9 @@ static inline bool cpu_handle_exception(CPUState *cpu,= int *ret) */ static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_requ= est) { -#if defined(TARGET_I386) - return !(interrupt_request & CPU_INTERRUPT_POLL); -#else const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; return !tcg_ops->need_replay_interrupt || tcg_ops->need_replay_interrupt(interrupt_request); -#endif } #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/s= eg_helper.c index 1cb5a0db45..e6f42282bb 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 +bool x86_need_replay_interrupt(int interrupt_request) +{ + /* + * CPU_INTERRUPT_POLL is a virtual event which gets converted into a + * "real" interrupt event later. It does not need to be recorded for + * replay purposes. + */ + return !(interrupt_request & CPU_INTERRUPT_POLL); +} + bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu =3D X86_CPU(cs); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 8e148e9bc4..5bdcf45199 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -123,6 +123,7 @@ static const TCGCPUOps x86_tcg_ops =3D { .do_unaligned_access =3D x86_cpu_do_unaligned_access, .debug_excp_handler =3D breakpoint_handler, .debug_check_breakpoint =3D x86_debug_check_breakpoint, + .need_replay_interrupt =3D x86_need_replay_interrupt, #endif /* !CONFIG_USER_ONLY */ }; =20 --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569657; cv=none; d=zohomail.com; s=zohoarc; b=PIPDrXJcAXIuw7LhCiS+p8vdlSJfGhs/LVN3s5iN1AqKoucOb9XPEXG0/r8qb+LH803TzuJdL1hJs8Wd7GgDGP7sr0EgkZkX8O3FSzVynNPTqUaSLCNXL1zlLYRdK0dqFlBqv5H3anzlfWzKbrQOTvoMbgDslc7Z5HsQHfKhZ90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569657; 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=2hwCZNX7r6WcP/DB6F59Yv2bYfXzcZik2wXoCrV2EBg=; b=mgPGsA7R3UE0ld/P34nauhf1bSJFS6ZWnAbNIoVAlS4R7BfMXHHAFhzhNMmEVHlmbf4yPTZGWO+19lcicO1rRI5Vqyu/yBs68jd6Liis469ikm5xvVSBdUNVBqQQujXCf+PHv1z/2SPGxGpzKpRSIvs4zPXG7wRKQFJBhS0Xl+Y= 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 1706569657267619.8823163987537; Mon, 29 Jan 2024 15:07:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUafU-0007e1-MJ; Mon, 29 Jan 2024 18:04:00 -0500 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 1rUaeJ-00071n-OS for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaeI-00006g-4N for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:43 -0500 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3be62ccda4bso738160b6e.1 for ; Mon, 29 Jan 2024 15:02:41 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569361; x=1707174161; 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=2hwCZNX7r6WcP/DB6F59Yv2bYfXzcZik2wXoCrV2EBg=; b=CdT4eWumuD93e7Xp9Np0/b9qZ0wYgOLGpKeLbNRcMI4XOWDpLbfdi9bb9nhlrGzgjL +UdtBPmakmeEpaN9JN9oeNbFV0spiCSCa2PmFjRzAt41a09p9w3z2xbEiHZMdTprqCgt awgg7GBGSDGDmNS8vafpu00wbo0FAlytcoaRt6fdZVILutS47wfQhJioWEOIHwfGN2iA fMxHGAT0NoB2bRRz820wbgIUhjUYOlEQHkyKCS0rsr7F2VBev5fap0GboL7IWv9LZes/ +/upB8V5KqA69IqEP+OCSQL6GH12QvXeKhlHwSemUFyGCQ495QcpNI11kh1v/vrES1/N 79mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569361; x=1707174161; 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=2hwCZNX7r6WcP/DB6F59Yv2bYfXzcZik2wXoCrV2EBg=; b=OIV9b4Q4Ubq9z0cPHWSIcYfgWNAlj7W2CWUXoqtEO9jToIn8ys3jt2exG35b3BT5/U 8tHaLi6sM9DqXEtlqcCxZ6FRX8gGGnDkOzu+ekYRDaRlOUNshBFsr/bj3zZ63z6uTeju CKWE///a5ob5Q3LZj10SV+CbdYcdXkflfGp0HL0t/3ibFUt5z6nUh5xWlqctFJAnP9CJ x8dD8tvXSGPxEnuFoj+zzthuFtken1Maxf7Xbcb/4Iuc84SFgS7FDEuJfHMfvNUzIE6E fLs9x6lOdgUADc11usi+mNfIPdDtWkYjuoTeO8RBBa/U4iNVKPUYnFtY2R9LiCA/X9IM 4tow== X-Gm-Message-State: AOJu0Yy8FPn29RXHH5KCuJDAD+g8RXSBM1d6B3UKfzNV9nbBAt73SSo4 mlPTeAcBPm/pxCjBXGCsvKUlYSKRHEZtsA7Cv6jDBJ/855f2sS/yaI+Po4pKAzOwCz307xi029V aXnM= X-Google-Smtp-Source: AGHT+IHA/Y5g49IFO+MhSt5OayanC5SuKfj4hRJbbi7ZUZDlKhrhV3YTNZx3yXfFitcmzqSwN8WU3A== X-Received: by 2002:a05:6808:1b08:b0:3be:7667:4eef with SMTP id bx8-20020a0568081b0800b003be76674eefmr1963750oib.27.1706569360793; Mon, 29 Jan 2024 15:02:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 29/31] accel/tcg: Inline need_replay_interrupt Date: Tue, 30 Jan 2024 09:01:19 +1000 Message-Id: <20240129230121.8091-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569658618100003 Content-Type: text/plain; charset="utf-8" The function is now trivial, and with inlining we can re-use the calling function's tcg_ops variable. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 2eacd694ea..75f7ba7bed 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -765,20 +765,6 @@ static inline bool cpu_handle_exception(CPUState *cpu,= int *ret) return false; } =20 -#ifndef CONFIG_USER_ONLY -/* - * CPU_INTERRUPT_POLL is a virtual event which gets converted into a - * "real" interrupt event later. It does not need to be recorded for - * replay purposes. - */ -static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_requ= est) -{ - const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; - return !tcg_ops->need_replay_interrupt - || tcg_ops->need_replay_interrupt(interrupt_request); -} -#endif /* !CONFIG_USER_ONLY */ - static inline bool icount_exit_request(CPUState *cpu) { if (!icount_enabled()) { @@ -862,7 +848,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, =20 if (tcg_ops->cpu_exec_interrupt && tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { - if (need_replay_interrupt(cpu, interrupt_request)) { + if (!tcg_ops->need_replay_interrupt || + tcg_ops->need_replay_interrupt(interrupt_request)) { replay_interrupt(); } /* --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569831; cv=none; d=zohomail.com; s=zohoarc; b=XJaBFGHGjzzdBIBPjh93Nl/A+6L3JLWFu9yZtPROMFxzYdJlrwn16IrpzM/aYNLprlPqo0iNI1ZhEgQwNUOQDxga6hGLmww21WmGZmtbsR55rf88YGiRFXgRmhoIkFl0eGS4NYDyEidrfDvX2njwkU9zWcN/HOtsILkEi47FB8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569831; 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=LMqE9xBix0QLmyhH8Xqft/09pdbioiePfeACz0Kfp3o=; b=Gy8TwqCgKSCQDxsNYOo9v+q/DEutyVFooPCQgIVZiG2CSizHkFlj7V+IZeRc/8Pzd3LvovLcmNowMyHvOnkqsYsUuwPQ7HbelB9lZWwmrh3T0/E6U0XAWcVJjMy+adrdTyc43UMyxcb8JfLHRECwTOKkiKp6VAT3a+V3wULZ1K8= 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 1706569831917859.1331100090815; Mon, 29 Jan 2024 15:10:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUaiZ-0001wF-Pp; Mon, 29 Jan 2024 18:07:08 -0500 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 1rUaeL-00071t-UL for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaeK-00006w-CM for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:45 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5ceb3fe708eso1893948a12.3 for ; Mon, 29 Jan 2024 15:02:44 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569363; x=1707174163; 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=LMqE9xBix0QLmyhH8Xqft/09pdbioiePfeACz0Kfp3o=; b=GxVbeobXyukq/7EU/PumPAVCcRQEAtbkUoERBWlN9Zh0ewen2iAgU1Pfsl/EUXFSdz DJW07cnUw4W+l5IY0YXG4xQI9YoSocW7T4GqcWjYR11EaBGHkYWnKs8ihNdO9hFA045a aSoJ/rjlb18Sxgrvehe8vLg6nllFksIdgFp0vB+2YVvDahWAiT+O0Fa+BDBl5iXdARhN aJ0F2PmLMgQhBmhKgc8ADndtflsdf43+uk3Lh+1wkq8PExJLQfPF4UC94wRqAFR3e27a UMiuh2HGGqNIh2HcCfNXh+d4AcIpDdPX1QLsxbyICHqzVhFfHWNV2QFxdFg78Dxr2wDc msLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569363; x=1707174163; 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=LMqE9xBix0QLmyhH8Xqft/09pdbioiePfeACz0Kfp3o=; b=LtaXZyJ6Ez+LQoEnJz97rCcm4W4ohrTxK5c9g3czBkewz18/+pZF5XDOHEqTLRMjUP ZLtxW27LJ/2JXpsjX5nWw/GxmY+4OSuaoiwqwqJo0OjocbMsUdmGEGY9ywKnfc5W8swM CVfF5W1rrE3yGKI4R+AAoNf3YLnCr1GuL8jI4v1yMvbHyonke1UMnEqbNxoCUmBs9Pmm uMUObowpciezFCQUxFtJQw07ETCs1ma/91V3/SbwsgmFKwKQ5fOuJdNWWqqvK4d5fFFg JwOEgKpxto22cd7R/KO5i78M1ADrxyCTPUoWPj82OQzlUj+5DEoxD2zIuW0TehJgvpP1 aRPw== X-Gm-Message-State: AOJu0YzzaeLkT5HkYF+ieYh5gow9IbibpfNJWTVUx+yJRYOUxn4SX/4k EUVqfFIUFctwi34tEEplgXegzO4yXNv58PbAVaIa0rREGjnQSrhUGTuagIYzAK9RYsqN6w56VBY gou8= X-Google-Smtp-Source: AGHT+IG+R3LTB6yCd/x/bYgAbylxb7xk4a6uga4FWdmXFQvteacb6JBPJVZMR3wlJP7QZyLTugS0Fg== X-Received: by 2002:a17:902:654e:b0:1d8:d583:1811 with SMTP id d14-20020a170902654e00b001d8d5831811mr2756844pln.38.1706569363053; Mon, 29 Jan 2024 15:02:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 30/31] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler Date: Tue, 30 Jan 2024 09:01:20 +1000 Message-Id: <20240129230121.8091-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569833052100005 From: Philippe Mathieu-Daud=C3=A9 In order to make accel/tcg/ target agnostic, introduce the cpu_exec_halt() handler. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240124101639.30056-9-philmd@linaro.org> Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 2 ++ accel/tcg/cpu-exec.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 013867b890..bf8ff8e3ee 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -112,6 +112,8 @@ struct TCGCPUOps { void (*do_interrupt)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); + /** @cpu_exec_halt: Callback for handling halt in cpu_exec */ + void (*cpu_exec_halt)(CPUState *cpu); /** * @tlb_fill: Handle a softmmu tlb miss * diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 75f7ba7bed..82627b12b8 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -664,6 +664,8 @@ static inline bool cpu_handle_halt(CPUState *cpu) { #ifndef CONFIG_USER_ONLY if (cpu->halted) { + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + #if defined(TARGET_I386) if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { X86CPU *x86_cpu =3D X86_CPU(cpu); @@ -673,6 +675,9 @@ static inline bool cpu_handle_halt(CPUState *cpu) bql_unlock(); } #endif /* TARGET_I386 */ + if (tcg_ops->cpu_exec_halt) { + tcg_ops->cpu_exec_halt(cpu); + } if (!cpu_has_work(cpu)) { return true; } --=20 2.34.1 From nobody Tue Nov 26 15:17:25 2024 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=1706569792; cv=none; d=zohomail.com; s=zohoarc; b=nBcGVARqtH9rSoHgY6rO7UJlU1Gmsxex71nTso6dWkSJsXPXrLMc2sGRwLF4N58V9eaeq51U7sNtsmP98lercLBbwLaBmnXxjA9TLP3YDupQwcyDGc2Bpj0GbCJU80EZtTJP73um91+rJVuHFi6K5yEc20TfV0sdm4iENPuaiaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706569792; 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=T/uaC3GU2r5ag1NYLRtG0R3ws3tDO6FtLPMPWrHI/7I=; b=Xccq+zFuTtf5b6QOuyDICH0L/Ym7RCdVxvMCaZFi1m9im1OD2J0pdFCE5Gz8AJemCIP0bCUmG88ScCOhDimuO8fgiSbCXpLzOsg0PfPDypqfSmx+XZhp+tgXarGftR72B+h6t0Hl3o+aClq6VF0ZosgGZT/HfH81waJDQSe1Cww= 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 1706569792190121.89662155327414; Mon, 29 Jan 2024 15:09:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUai2-0001Ph-9W; Mon, 29 Jan 2024 18:06:40 -0500 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 1rUaeT-000750-Id for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:03:00 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaeN-00007H-9w for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:48 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d8ef977f1eso6923735ad.0 for ; Mon, 29 Jan 2024 15:02:46 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569365; x=1707174165; 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=T/uaC3GU2r5ag1NYLRtG0R3ws3tDO6FtLPMPWrHI/7I=; b=SmySVDk4CLGNNNDAGdf+kN3ViZI28aPf1/OUMu5YqX1fspLJMu8HxE8HeG6e4jJbkB uGz5Vg+zIZX8ZLRcqs5JfeLWhliaBqckfw/L8I6H13bzZXQdyV5p88Wx7XY2cl3u2LQ+ v5gtJxr4LqOlMrTHAAY15Hs6UmzOIAPmVrHCe+OyqisGCAnps4RED/9cRCC/qBUo+tVx nYqAHUymJ4K3iuh9/Ld/6AUXSLpTU9IJm3rKwd/D0w8yWScIsREduRF3L4VGV5mof+6t 0mB9CF19pqBnGtSrJi0GPbvMo0x3pNMZ10BRbnRMDymN5+4e3ciZ0ZTjBM4U8St1roFO gUPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569365; x=1707174165; 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=T/uaC3GU2r5ag1NYLRtG0R3ws3tDO6FtLPMPWrHI/7I=; b=dQqcmMLsM8Tqol4WLRPCj+6mAeLeuoZtyc4pk0WhvyUZYibSowwGKaqBRKhG70buWp grwxHu0tHaQt3zwDBNiQnDUC8TsXt2Mp2k8Nt4rvyCC68h4PINhme90iI7LBzB7/1cTu /zGM4tzbvej/MZSF49I2ynL0nF4Cp8KMRUtI9AgxgddvMDjo7DvLaywp96+oB/aAXr66 r6gnZMSkW0LhnXzEd2Sknj2b4YPmU9t2trvmtDoJR+qQxS0nbri78GpynWn5hePKDGd2 Cw1kwz9mCeuEakVSiHySOXeTb3b+SP3hasT4EGtIZVUfSsnTK1QrmQiAvh7G/B5JuScm 8iKg== X-Gm-Message-State: AOJu0Yzole6WjA5uvlERdoGy5rk8LWagXvlj5JcOn45Wlq+epZeW/OZ/ N1D007noIcojs/ACrsr0tJOrBEstU4MgBnXYmypOZUjqYUqmFnPaGh0pWybvKqQ2fzgFL9mom9q Jul8= X-Google-Smtp-Source: AGHT+IF2dmmVJC6HuYJkxe9w/Awo0+4xM3RYdghfxsA15ZbmrTFy+cTLpP+Gv8g3rLy1aw4xqG02sg== X-Received: by 2002:a05:6a20:b90a:b0:19c:a484:290e with SMTP id fe10-20020a056a20b90a00b0019ca484290emr1885572pzb.2.1706569365363; Mon, 29 Jan 2024 15:02:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 31/31] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/ Date: Tue, 30 Jan 2024 09:01:21 +1000 Message-Id: <20240129230121.8091-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-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::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706569792956100003 From: Philippe Mathieu-Daud=C3=A9 Move this x86-specific code out of the generic accel/tcg/. Reported-by: Anton Johansson Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240124101639.30056-10-philmd@linaro.org> Signed-off-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 12 ------------ target/i386/tcg/sysemu/seg_helper.c | 13 +++++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 253b1f561e..effc2c1c98 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_S= PACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +void x86_cpu_exec_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 82627b12b8..977576ca14 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -30,9 +30,6 @@ #include "qemu/rcu.h" #include "exec/log.h" #include "qemu/main-loop.h" -#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) -#include "hw/i386/apic.h" -#endif #include "sysemu/cpus.h" #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" @@ -666,15 +663,6 @@ static inline bool cpu_handle_halt(CPUState *cpu) if (cpu->halted) { const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; =20 -#if defined(TARGET_I386) - if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { - X86CPU *x86_cpu =3D X86_CPU(cpu); - bql_lock(); - apic_poll_irq(x86_cpu->apic_state); - cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); - bql_unlock(); - } -#endif /* TARGET_I386 */ if (tcg_ops->cpu_exec_halt) { tcg_ops->cpu_exec_halt(cpu); } diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/s= eg_helper.c index e6f42282bb..2db8083748 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" @@ -127,6 +128,18 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 +void x86_cpu_exec_halt(CPUState *cpu) +{ + if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + X86CPU *x86_cpu =3D X86_CPU(cpu); + + bql_lock(); + apic_poll_irq(x86_cpu->apic_state); + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); + bql_unlock(); + } +} + bool x86_need_replay_interrupt(int interrupt_request) { /* diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 5bdcf45199..cca19cd40e 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -119,6 +119,7 @@ static const TCGCPUOps x86_tcg_ops =3D { #else .tlb_fill =3D x86_cpu_tlb_fill, .do_interrupt =3D x86_cpu_do_interrupt, + .cpu_exec_halt =3D x86_cpu_exec_halt, .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, .do_unaligned_access =3D x86_cpu_do_unaligned_access, .debug_excp_handler =3D breakpoint_handler, --=20 2.34.1