From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610902103; cv=none; d=zohomail.com; s=zohoarc; b=bov8i7Jx0rC1J0KJ7uiGfrS7thDRcTZOfYurXsAloJUZy+BP0ryQJGqiBAhzdCcsnxSgSnimksRTwA5z3hO4vNxygj03qSbSTF3LgilodAbWdOWwlUCelgvIFd4yjqIHhidgRYRu4jC1IRtlsqvdK9pv/aR9w46Q7uEeJLkjH/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902103; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xDfrjU7kI1sr1RDYArfADvyCVAF59u47MTJHcFAtFYw=; b=HI5RpqWJ11jLg8eFAa4JhGSagvxi4U0aioO3pPM5Pmb2Fy2/KXJV80tUkbuDFtpo/Y9jkWisvo7TiXVklrOpprl6G1LF1C59P1QroaRpduzunqACkqOw5b9O0869iJ7dt33zSrST0GjUOYzSGvKXUwxf4XakmFaurpIETmQN7SM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 1610902103111441.67458517998216; Sun, 17 Jan 2021 08:48:23 -0800 (PST) Received: by mail-wr1-f46.google.com with SMTP id v15so10542685wrx.4 for ; Sun, 17 Jan 2021 08:48:22 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id z8sm6534364wmi.44.2021.01.17.08.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xDfrjU7kI1sr1RDYArfADvyCVAF59u47MTJHcFAtFYw=; b=imypN1rpJz8e9ZiUVoWa5BvlKtQwgK3bobVSemLSV2fQI/G/nxGfkN3Dh/t3Jhbr3n 8bZBILuu60QBQ7xAoA8kQmQS5RAx5aIEtbXRw9XzgcDJsrmK0MuFeO76eEn2uPQ7g0/1 Pt6braFeW9twcm2rR7yOffloNtuZIfkOofdLP7Sm0JSS/BLaH25O2WbzPFN3YVbHI7xz BT8WHnhK3WGIA1OWM1AcunLhtiNjZ0u4DFbyreiYEi2Y3Mg6wvbI+0Q9In0HdFQPVNcJ 9cazlGS4KC6nXg3tHGgFe93hipJ8SVErgraOPNiCzHEEVJXgxOZIj7q8m/GdV4skKI/k IXLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xDfrjU7kI1sr1RDYArfADvyCVAF59u47MTJHcFAtFYw=; b=Gcwljb6RyJnlk8kO4xj6lTutBuq/X4O65H8khd0NWT04H/62b6xYV3cVdUd94WYcLl GyHJBHcVhGElPP8URGI/VCXytK7dCCE5KuGjnuiZD6ruDnsNdxhDaItaMjgjZlmEeLfh gq4w/oSSFAPe3xtvAJwQf9qI3Vi4Lj4K7nvyhNwWHBy7DUd/2OPZQ27eRkkHrVtn0hDo yG8ajumuPW/5XsWHaihqq0ILSKR1IUlLlwaPBY+dZ3d8tazpFwGd0oVmUy4NIpCdE/Qc LQ8ccZAHnGlz2ZvsLthcrcMVTtmbO3K7KGIMDm0tsjHs5g1FdKTeXCXKY6cFZ+VnUcwA L9mQ== X-Gm-Message-State: AOAM532Kga//62baeTCEQkKQn30vqnbEgRsMzhuT20FjMQ5quhoJAudM uH0+rxdr9Rrmfzeu2yrrvrc= X-Google-Smtp-Source: ABdhPJydWQhkpkd8PD68Pwm/KDlDLBr8mI9TKOIEAKbpff8AfzxUeVQ/T4xf4p5ziObbNqPqkRJE/w== X-Received: by 2002:a5d:6443:: with SMTP id d3mr21803331wrw.422.1610902101470; Sun, 17 Jan 2021 08:48:21 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/6] accel/tcg: Make cpu_gen_init() static Date: Sun, 17 Jan 2021 17:48:08 +0100 Message-Id: <20210117164813.4101761-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) cpu_gen_init() is TCG specific, only used in tcg/translate-all.c. No need to export it to other accelerators, declare it statically. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana --- We could also inline the 1-line call.. --- include/exec/exec-all.h | 2 -- accel/tcg/translate-all.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 2e5b4bba48f..516013e735a 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -47,8 +47,6 @@ void gen_intermediate_code(CPUState *cpu, TranslationBloc= k *tb, int max_insns); void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb, target_ulong *data); =20 -void cpu_gen_init(void); - /** * cpu_restore_state: * @cpu: the vCPU state is to be restore to diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index e9de6ff9dd7..ca7ef6aa177 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -243,7 +243,7 @@ static void page_table_config_init(void) assert(v_l2_levels >=3D 0); } =20 -void cpu_gen_init(void) +static void cpu_gen_init(void) { tcg_context_init(&tcg_init_ctx); } --=20 2.26.2 From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) client-ip=209.85.221.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610902110; cv=none; d=zohomail.com; s=zohoarc; b=Xl2ErBEKmKZP1Q3ffASLrwnqdSvdzhQDKYy1o6zKSmsF1PBBXeaGfby42yBcU90WY2iwPTodp/bH4PgHvUAPjqAPjqb2C73MyLiXfX3kyxu4SSsIWAT+UQt94uXGc6L4BLx0a7NOR0EQzYbLm1J2+rAc9JjmN+PZ4WMwZlj1KiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902110; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K3CQSqrytpiHS5Sve5/wJnq6BGWF/nQ2DFQWKfnG4qE=; b=l3yn57bU7uKXprEccxxUNyjqJ2XWRmetQlcTgspgVj1TlgQMVJWyeza/MLIVkw4gT9sTNG8PaPd5zTi+kSMcmVzqxDhpYkRyQCfCP8EGt5xD8wIbNuG0mlQrEZ4jt8Bzie777+58QZVSUE0rLkHFYBPQEugCi+M0fTa+wbsRvO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.zohomail.com with SMTPS id 1610902110359515.2055227911629; Sun, 17 Jan 2021 08:48:30 -0800 (PST) Received: by mail-wr1-f48.google.com with SMTP id y17so14191750wrr.10 for ; Sun, 17 Jan 2021 08:48:27 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id i16sm22755267wrx.89.2021.01.17.08.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K3CQSqrytpiHS5Sve5/wJnq6BGWF/nQ2DFQWKfnG4qE=; b=ak+8WZa6ga6z2O6djG4mmWplZS3o+nsf+wJk6RWvPFGsj1RGzEET5tK6mNxXZ/9zXD YUoAZOQ5G55p0DidsHSJadJHFWlgqbUUvKpfVrF+ji7RU3YQieaOwKAnrovwK8y2gWZy nkVmVXhvRUUdNWTF+oLrX5ZNOKMtXiTDQjEPXL7gvzLY9y23Rvf3LSlyQUsIlO+Eoef/ qD/FKqEAZgSoF4Z0/2QBMk536wsthb+zYtZ6nLY4wp+FsiKVAX1+n2EyNO+yKcrKr3WJ JcmjS1tVvLLxCC45c40JVmbqv0Rf7jB30rf0S6KG5Rmn8W+lsHRLvpokH35r6aos+Qxb r9oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K3CQSqrytpiHS5Sve5/wJnq6BGWF/nQ2DFQWKfnG4qE=; b=OZvRD+C3pV6UrNoAAPn1lLQ54jUX6sFrMzou0UT7T3SthnEvjeWEBICsAsCnuSor+s E77AXn/9qLtmyS76A4wVB2pQLIDPgVOSRGAkFZIPKHi+NQuUDWT26d7jjiLvE0RW6FG+ oUl+5+48BgAbxF2Uc7G0E+eKawORZ/W6PDGvxpQ50Fx2pMkGnA+0vNM86OzMLnWkPjG7 kqYzmxOuWThPjMx/B9ZgG/W5TU5J8O+2k6MK85XjqV54tcEpwcsHRL+8p76kf+Jslqfc QpVwiD60n+pz4rnMOLo6W6Ftl8XobNlWHrPeNz1mq6Jogxme7XDDfikbIqqPN5R78ACb ZoPw== X-Gm-Message-State: AOAM533P1rBtKxCKl5BfCGWvHc77CIsqexAu30DO3rI05gUqGWNAbbo2 Tch3Xw0hBBv0lebxfBQ3hbI= X-Google-Smtp-Source: ABdhPJxJB4TinkeAcxOO1nH8psKfQDrExlvlGEAeQKeFeHBdkKFyUqn8+DyYmDenmEtY2rKtJrMkgw== X-Received: by 2002:a5d:61ca:: with SMTP id q10mr22541873wrv.124.1610902106676; Sun, 17 Jan 2021 08:48:26 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/6] accel/tcg: Restrict tb_flush_jmp_cache() from other accelerators Date: Sun, 17 Jan 2021 17:48:09 +0100 Message-Id: <20210117164813.4101761-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) tb_flush_jmp_cache() is only called within TCG accelerator, declare it locally. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- We could also inline it in cputlb.c, the single user. --- accel/tcg/internal.h | 16 ++++++++++++++++ include/exec/exec-all.h | 3 --- accel/tcg/cputlb.c | 1 + accel/tcg/translate-all.c | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 accel/tcg/internal.h diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h new file mode 100644 index 00000000000..4981d98dbfd --- /dev/null +++ b/accel/tcg/internal.h @@ -0,0 +1,16 @@ +/* + * internal execution defines for qemu + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ACCEL_TCG_INTERNAL_H +#define ACCEL_TCG_INTERNAL_H + +#include "exec/exec-all.h" + +void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); + +#endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 516013e735a..1e3e7cf8e78 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -663,9 +663,6 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *e= nv, target_ulong addr, void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); =20 -/* exec.c */ -void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); - MemoryRegionSection * address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, hwaddr *xlat, hwaddr *plen, diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index ced3dc077ec..b1f0f404aa5 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -36,6 +36,7 @@ #include "exec/translate-all.h" #include "trace/trace-root.h" #include "trace/mem.h" +#include "internal.h" #ifdef CONFIG_PLUGIN #include "qemu/plugin-memory.h" #endif diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ca7ef6aa177..6427bf87ae0 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -60,6 +60,7 @@ #include "sysemu/cpu-timers.h" #include "sysemu/tcg.h" #include "qapi/error.h" +#include "internal.h" =20 /* #define DEBUG_TB_INVALIDATE */ /* #define DEBUG_TB_FLUSH */ --=20 2.26.2 From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1610902113; cv=none; d=zohomail.com; s=zohoarc; b=bpnCY3Ie2VAixl8RcCJ72MBE1D108IJczmMBNoW7l4edHFT5mjmZbzwD/A1nxDzsUwbqNIkNg7kaXIn/FF3ec0rQPBQM8UzUVaYmPx2Tt+3mRqehAdSRNENomgTMdR0XB1nuSU+AKBuJiTpkF0ZXhQ/8Lj5uLtv9Zp4n3okr4NY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902113; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M+HpPEQqognf7v2xJO1YwF1kLY3q7UZCQOxgisP0pmM=; b=iDDTJy+lWYZdDS3fzA9JaNXlBKNY/vO93GCJsMuoFn0zh5P5aw9vYPJykq1AOs69fmMcexEdwnLt2Hl2Yqv4rr3zF6kZiUKx4LiWvreK2M2BNmTtoXi7JzdrTD28zf3nKrirfn+Xpd6Q9EZiGJ50yrsezpiYZmjBCM0tKFx+8MU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1610902113499504.4525219857692; Sun, 17 Jan 2021 08:48:33 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id i63so11508761wma.4 for ; Sun, 17 Jan 2021 08:48:32 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id m21sm20417930wml.13.2021.01.17.08.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M+HpPEQqognf7v2xJO1YwF1kLY3q7UZCQOxgisP0pmM=; b=mJ679iFbMt3sP7yU0ineY+fyD72GONZTja09Y9dg17a4/Ketas17aGVpUkQhXHtTYI C3bXG376c6LWwP5d8jj/bJ1PI/dJGTq58wUeyhJ80C2k0CgcQbhU9pq+0Yzrw3QFOY7F CaNgZxPmy7XA4e4XZ+Qa0dkymG1qu9qTXrGItryg7KcBSXyJqOCinpfiQx0X0nypY75E ASjNon1piPd60kvUFAiza4gSU/MUnkRsm8jUs6eIvRyBqpVTaGSOJ9wIO4xIgcli1RYq U3IIT0rpCm5fmbPCVmmdts3TRU7uQwYRdmnmL5gkFRrvESVRQahskNbo56ZNodpAlxS4 nk2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M+HpPEQqognf7v2xJO1YwF1kLY3q7UZCQOxgisP0pmM=; b=G/zJklJPGG+5tTjcw09YmoJouvZpKVEguOaOMDqXMYJp3L3RMlHBh3p5Mzx/nUeJcc 9x3X4s2FEX9MA8kend99WVPpzZfq4nlWAN+LRunoOX4iOI0XdreVT27PyfxVFT+kSkXm DOrZBNLY0XKq7q/bMF7BQKux70XzOmkwR5dU+UMUkLqmL5jrBZWqJJL13NT3KNIasC2J xiE2Lb4WxSQ4wjwgv5c83RQIQp0Ydyn5kal8mDgWdPcAcColYPvG2UQTnaJbuyAEXsqv 6K+YRWQZe1zFNklg4qp+8TQN5dU4h2Ej9qhKRsSKi9IdTEu7teb7ToXKbvGj4NXYNlcr IrhA== X-Gm-Message-State: AOAM531cTnNBZcSyIgspQomun4i/+jL/uzMISfBkoj1zgr5tFiz20m3b xRYmcnKwH4sTce4Ub7d2PhA= X-Google-Smtp-Source: ABdhPJzp9vjIIGvDeVzlAXp2DZjbQFoWApyHnpsOnF507hGOciz+x7QHsxRErpen725WDVu+dL3f7A== X-Received: by 2002:a05:600c:354a:: with SMTP id i10mr15192145wmq.188.1610902111757; Sun, 17 Jan 2021 08:48:31 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/6] accel/tcg: Restrict tb_gen_code() from other accelerators Date: Sun, 17 Jan 2021 17:48:10 +0100 Message-Id: <20210117164813.4101761-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) tb_gen_code() is only called within TCG accelerator, declare it locally. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- accel/tcg/internal.h | 5 +++++ include/exec/exec-all.h | 5 ----- accel/tcg/cpu-exec.c | 1 + accel/tcg/user-exec.c | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 4981d98dbfd..f7e18c3498b 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -11,6 +11,11 @@ =20 #include "exec/exec-all.h" =20 +TranslationBlock *tb_gen_code(CPUState *cpu, + target_ulong pc, target_ulong cs_base, + uint32_t flags, + int cflags); + void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); =20 #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 1e3e7cf8e78..3acc7c2943a 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -64,11 +64,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t searched= _pc, bool will_exit); =20 void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); -TranslationBlock *tb_gen_code(CPUState *cpu, - target_ulong pc, target_ulong cs_base, - uint32_t flags, - int cflags); - void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e0df9b6a1dd..43676ae8d13 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -41,6 +41,7 @@ #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" #include "sysemu/replay.h" +#include "internal.h" =20 /* -icount align implementation. */ =20 diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1215b55ca08..05f3c09cbf9 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -28,6 +28,7 @@ #include "qemu/atomic128.h" #include "trace/trace-root.h" #include "trace/mem.h" +#include "internal.h" =20 #undef EAX #undef ECX --=20 2.26.2 From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) client-ip=209.85.128.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610902118; cv=none; d=zohomail.com; s=zohoarc; b=CPovVhxwL7b11E6kHQDmso5g/B0RZhtcAXOtDWda/gR8qBA92lIsPKfFJr9BWBskQoJY+ee7oSGtjPgni7KHT2CDjNtMipwYjtV9J2w2RIYZiwoBCoCMBE+oQ0VJY25OO/6tVO1K5jldiYVoE6sUidyhK8YgFXgu4ZF5QAYBm+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902118; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IdvZXWO0/2ft9HXnEBMCvSFP098rRCS4xqKPXBAMD88=; b=kdpfWjpHDjUbYk1qMd9PHguwaX6o77/dKt6iW7aUpIkB4I3Nl14DnXkCF3kGibEh1VJFDC21xsfYLZuSOJhFsaDnzyZQv25s8kgQxtLXf1b7+RpMXFWsv71XFn3axcZxjwQefky6Z2F9LZ4W61CnPr9X/voHpo+4yOumv9xgmOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.zohomail.com with SMTPS id 1610902118492924.5403654268644; Sun, 17 Jan 2021 08:48:38 -0800 (PST) Received: by mail-wm1-f53.google.com with SMTP id g10so11836312wmh.2 for ; Sun, 17 Jan 2021 08:48:37 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id z8sm6535372wmi.44.2021.01.17.08.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IdvZXWO0/2ft9HXnEBMCvSFP098rRCS4xqKPXBAMD88=; b=q+LybSz3hTQG0sdPiNPSWhBg9FIBb5NC04B+Ee7coimMmQUjrU7/FZA9BvTIhQ4HfU kKW+SH8zd7As6FUdm4x5fthoVMyvGH+YzcWQNfD/h2+y4m8jCz3OIY4gUhAYRZV+AGXt 0QXYqU5oun5JFRRzIn0NcfkqE0PRy7iBr9krpEQt9Ne5XR7+15L/Y0LDh6Xc9Q7QPrj9 7xk/5Oi6uOwAHbhfxsVUWN+9lw92zm4EIASm+uTgnGNVPDIZ6o1NUnmmGzWwQsaQThCp edAv1lrJSzgeN/XcHBnRTTkNv1aZRWFI9eZ6Uld9SzZd3owXCRFas807ENarK7R/Yb6A 6z1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IdvZXWO0/2ft9HXnEBMCvSFP098rRCS4xqKPXBAMD88=; b=RADH1o5j+b5KGT8MEqTZH8/7sPI+OrL3au55HVwfGaB8FYxnLmiA+lxwSiWqFWI5ve R5jmfBt///5UUltiefMcfX1JZwO8CYn2x6TlzKyso/IXdbY0WET/2TY6XT8WBrS1JO3o LEQyVjuWCNEYufsSbW8cKPtN+FD2MMpiru3jkTX4g+tXd9mTYo42Ga3rLxtblGJZm/wR CWtJ1gGlb/al96xYexNqNC7WHy8pHSIVHWu/HyUkkcPQkKzQi68siPKOdvQ3+fsinRVI 7O/HfDoIWOgpYrdWGa9CkVTgHhecvgQpN9vXVw/U8f0ad1Q2qCVC87qqawtS/Mooa8N3 NSaw== X-Gm-Message-State: AOAM531UcwUX8FPcXrgzdRb9DzEbPiY7gAbIcNkz52TevmR6kNDLRB52 QtVlZaPN56LE+0LzMmSfDpQ= X-Google-Smtp-Source: ABdhPJySu7s0H+ZsCwsLugDNtCt67aIogtEi2clUdX79r66Ba+dIzNkbv397uoZyfTRIlrO7ANThQQ== X-Received: by 2002:a7b:c3d3:: with SMTP id t19mr8998552wmj.151.1610902116757; Sun, 17 Jan 2021 08:48:36 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/6] accel/tcg: Declare missing cpu_loop_exit*() stubs Date: Sun, 17 Jan 2021 17:48:11 +0100 Message-Id: <20210117164813.4101761-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) cpu_loop_exit*() functions are declared in accel/tcg/cpu-exec-common.c, and are not available when TCG accelerator is not built. Add stubs so linking without TCG succeed. Problematic files: - hw/semihosting/console.c in qemu_semihosting_console_inc() - hw/ppc/spapr_hcall.c in h_confer() - hw/s390x/ipl.c in s390_ipl_reset_request() - hw/misc/mips_itu.c Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- I suppose the s390x kvm-only build didn't catch this because of compiler optimization: in s390_ipl_reset_request(): 640 if (tcg_enabled()) { 641 cpu_loop_exit(cs); 642 } and "sysemu/tcg.h" is: 13 #ifdef CONFIG_TCG 14 extern bool tcg_allowed; 15 #define tcg_enabled() (tcg_allowed) 16 #else 17 #define tcg_enabled() 0 18 #endif --- accel/stubs/tcg-stub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 8c18d3eabdd..2304606f8e0 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -28,3 +28,13 @@ void *probe_access(CPUArchState *env, target_ulong addr,= int size, /* Handled by hardware accelerator. */ g_assert_not_reached(); } + +void QEMU_NORETURN cpu_loop_exit(CPUState *cpu) +{ + g_assert_not_reached(); +} + +void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) +{ + g_assert_not_reached(); +} --=20 2.26.2 From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) client-ip=209.85.128.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610902123; cv=none; d=zohomail.com; s=zohoarc; b=cmNH5J0l9HAf2yRZBy6yUPzNT9V7eZ/Sih8pIJS0Z9tu+rVs+4NST7XYShoi1UoupIJu2X1/UHltHoZKweHrk8rjJmRlVmieiVx/aFY57rNJ12vhKUpNq0bQ3BY2Qh1kjtjy6f6Szr8MBkIc4+T20ZnyyRC0MuGIWXqpwywX9Mc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902123; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UZYwqIRQuLmBtaprCcoYNaqSL+UUeepn3F/UBlfKHSc=; b=Q9N1ojDcutBqVPYCLJuXupwzZwFv9YRa4yGfSdWBdxIQ59vz4qxt1EBahZRPjHC25VXpksTQgjVCnvxzn6enls1gQfP3uJUhjuqzGFxyeY4Kzz7LzxC8tQElZ0aELST8ikrX1YWiqTjMvkz/IbEVeiNWoggAexpmx2dhE7aU2GE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.zohomail.com with SMTPS id 1610902123819551.4282851055704; Sun, 17 Jan 2021 08:48:43 -0800 (PST) Received: by mail-wm1-f47.google.com with SMTP id u14so7636644wmq.4 for ; Sun, 17 Jan 2021 08:48:43 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id z8sm6535744wmi.44.2021.01.17.08.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UZYwqIRQuLmBtaprCcoYNaqSL+UUeepn3F/UBlfKHSc=; b=Mg7UU5eoMqdI+nhY0LeAI+Qune6QfeigS3jDa2pSJ88ArzDXWYZrZ4iZCTFhv27FAt XBkDE7fVKw5QFwafvoH0ltcr8Q58U18U/BPZWNGfiDzxDjB+7oz5dJRsHNW77x6nJ3dV ED01HFuzwdUXs6UTz0QxOoN3Vk1WDoxDtTjuJXjs4WKDDT5gEytfYnBs3/eUnXk32XWb 4ygGms+c3esnPgNyGHremMRkAJl4rfYE0FVGf5UAKtdcYjT2XckhjJCyYO5hSRxuLC5Z w15B8l0BqCWsKChRJqHksUu1fIqNC92+qgiGVdf4UjxU9OQJMp6NhbwP6JgDE/McaonR 2iOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UZYwqIRQuLmBtaprCcoYNaqSL+UUeepn3F/UBlfKHSc=; b=tnhqx7aGOtdqrS97zbW8CN0Eub1+kheOmTlVP1vIVhCpdGG9VKyIY9wy88MRbewKVd jtxZbDzuvoknVfhCZ4UjGTyvMSxg9l5fZS1zROtukF2hIyrJo25K3NemGCPGeLXR3Rhr uOStwRaRYOAXIS+rAvOGL0VrqmcgA8ltUjFfR6X0E+FYQVhGMDJfloGReM9NQX7+hZUU Z+YNCYxWpFVT1PEWInnzUkEe21pnywNE9IvtLeeN1WOc+2mJHKflZifcB06Z/B3Zer6S GvPmnUy3O/CyltmSEuiANxP5KS75M2BCXswboa2B6QWCFSp8RIHzqGWcbQYYVp+1IFA7 aQvg== X-Gm-Message-State: AOAM530E094zR0m8rhSzjDRXweeY/iMXTLZJXgfpvoKZBsi8Inq2deDG xUeGkUl5K4Beamz7Z1b6zD4= X-Google-Smtp-Source: ABdhPJzUybtrTFNUCU/BSNg/VvtwLquz2yYQGtaAQhiEDwZTLN4tVAZS9V8aRKVK73APW8fp0w0WOg== X-Received: by 2002:a05:600c:3549:: with SMTP id i9mr16527154wmq.89.1610902122108; Sun, 17 Jan 2021 08:48:42 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 5/6] accel/tcg: Restrict cpu_io_recompile() from other accelerators Date: Sun, 17 Jan 2021 17:48:12 +0100 Message-Id: <20210117164813.4101761-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) As cpu_io_recompile() is only called within TCG accelerator in cputlb.c, declare it locally. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because not sure if other accelerator could implement this. --- accel/tcg/internal.h | 2 ++ include/exec/exec-all.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index f7e18c3498b..c72a69e4d63 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -18,4 +18,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, =20 void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); =20 +void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); + #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 3acc7c2943a..125000bcf70 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -63,7 +63,6 @@ void restore_state_to_opc(CPUArchState *env, TranslationB= lock *tb, bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exi= t); =20 void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); -void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); --=20 2.26.2 From nobody Mon May 6 02:57:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610902129; cv=none; d=zohomail.com; s=zohoarc; b=P5jS9tHkt5W1/HKZ1dJHll2W1JxjzWr4M3kEw1bvC2R6B9o7Uj4DBVMOCLlqE8KvOxrkxfdc9vUvyEgvMn7Elw3mqtETydAvPOC0A8i5cphV6strKAMU1iLBFg9gRESPLUSldQOeJEqKP+8iXxN0hNN0c//gmIoxJs3QPEBg4kA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610902129; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qrc7nsDG3FWYyx7ue2FQKi4KA+9IIfDo7x9aiypq15A=; b=NQ/XX43w37gnTbpCt+S3H2/9l2TCL5iHshu0U3tvYTQaWq9vfCiw+TTXOpbjFE5HU4qDV2fpdApM9LxGZWCT4beNZrHLRsAyYtr34ZutKs9arjIT0zdQJ9zbCAIZyeoLbnS7J+E4pLnDeI72qI6p+jzX54hU2ABxvQuaGx3aeSo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1610902129065387.2653792221421; Sun, 17 Jan 2021 08:48:49 -0800 (PST) Received: by mail-wr1-f50.google.com with SMTP id 7so6959774wrz.0 for ; Sun, 17 Jan 2021 08:48:48 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id r20sm27374693wrg.66.2021.01.17.08.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qrc7nsDG3FWYyx7ue2FQKi4KA+9IIfDo7x9aiypq15A=; b=E32zuVYxWLsH4GDKEMZXzXPX4V9TYli0Xg6FqBdIaROyfGC7vjQb1Z7rpurhRkjGNS Ld5y5/DFAFVLFgvbpKOvY2EUSRwe5K++OxLYeXOK3iH3t2Cb1D+pdkNEPdvTreQdB4sT 55JjxRz69I/CwZWj2RR+3/WfBjqHBnn5O4Esg89SDurOerSxeo0bHGAVA9TlPZaI4qkk vu04Tl3qmoloWFeDIgncmOMrytoZwvONmxTYC5X53kAy4ZYUUdXZ8gjqxl2YGq1PX6eX XwNVDV87pvT0vurwWNul2aG1ObI5x9JloEkT0xIapZ4v+qsl0BBc5R8PLVHkwBZZeO5J 4ggw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Qrc7nsDG3FWYyx7ue2FQKi4KA+9IIfDo7x9aiypq15A=; b=Rt2tm6gXpWcmRBn0KevsyteS5As34ytlaYhjPjBOv/JQwUxrScaPObTQQzgCvNNQv4 YXViI2dJP8dqJgxbJ45+653chpK/AyMzK3G698i2y6S+9VB56C2ZvQDVP4w0eOXre06S Sr8enxCXxwyPAHLUODtf73zFmtQBb7adejDuWtSDihWTocTJrQu8OCOV7fJG5unrUe7D 06nbrP0nuGrH5nRy6PomPTbSKDlVGNnguh5MxXQjTDzPCd0iFuoyil6G9qXtM2fvNKCQ N+FtrBLNGff+7rPPRjFI87IfF/D0RObzRQaVi+TxIvsT3dOMtsfxJ4tcXniYZQG6W4AT zzng== X-Gm-Message-State: AOAM532dQ1KbfEeCSXVForoI2o/8nesizsHYxni+lbIKykOVkth9sOdx Y5cfivGrsUlMldKIoVR0wRI= X-Google-Smtp-Source: ABdhPJx30sU2mlGVYbzDuAhucMNms3y8calEJ/yFf5v0bA21fSR37afAvB7opQRCJGMErmW8O6Nzxw== X-Received: by 2002:a5d:5105:: with SMTP id s5mr16279432wrt.252.1610902127372; Sun, 17 Jan 2021 08:48:47 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Claudio Fontana , Huacai Chen , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 6/6] softmmu: Restrict watchpoint handlers to TCG accelerator Date: Sun, 17 Jan 2021 17:48:13 +0100 Message-Id: <20210117164813.4101761-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210117164813.4101761-1-f4bug@amsat.org> References: <20210117164813.4101761-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Watchpoint funtions use cpu_restore_state() which is only available when TCG accelerator is built. Restrict them to TCG. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because we could keep that code by adding an empty stub for cpu_restore_state(), but it is unclear as the function is named generically. --- include/hw/core/cpu.h | 4 ++-- softmmu/physmem.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 140fa32a5e3..1b4af30db04 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1033,7 +1033,7 @@ static inline bool cpu_breakpoint_test(CPUState *cpu,= vaddr pc, int mask) return false; } =20 -#ifdef CONFIG_USER_ONLY +#if !defined(CONFIG_TCG) || defined(CONFIG_USER_ONLY) static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr l= en, int flags, CPUWatchpoint **watchpo= int) { @@ -1098,7 +1098,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, = vaddr len, * If no watchpoint is registered for the range, the result is 0. */ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len); -#endif +#endif /* !CONFIG_TCG || CONFIG_USER_ONLY */ =20 /** * cpu_get_address_space: diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 65602ed548e..5135a6371b5 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -765,6 +765,7 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, int = asidx) return cpu->cpu_ases[asidx].as; } =20 +#ifdef CONFIG_TCG /* Add a watchpoint. */ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, int flags, CPUWatchpoint **watchpoint) @@ -873,6 +874,7 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr= addr, vaddr len) } return ret; } +#endif /* CONFIG_TCG */ =20 /* Called from RCU critical section */ static RAMBlock *qemu_get_ram_block(ram_addr_t addr) @@ -2356,6 +2358,7 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr) return block->offset + offset; } =20 +#ifdef CONFIG_TCG /* Generate a debug exception if a watchpoint has been hit. */ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, MemTxAttrs attrs, int flags, uintptr_t ra) @@ -2424,6 +2427,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, = vaddr len, } } } +#endif /* CONFIG_TCG */ =20 static MemTxResult flatview_read(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len); --=20 2.26.2