All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Stafford Horne" <shorne@gmail.com>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"Marek Vasut" <marex@denx.de>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Fabiano Rosas" <farosas@linux.ibm.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>, "Greg Kurz" <groug@kaod.org>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Anton Johansson" <anjo@rev.ng>,
	qemu-ppc@nongnu.org, "Chris Wulff" <crwulff@gmail.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PATCH-for-8.0 1/4] cputlb: Restrict SavedIOTLB to system emulation
Date: Thu, 08 Dec 2022 08:40:09 +0000	[thread overview]
Message-ID: <87lenis2xs.fsf@linaro.org> (raw)
In-Reply-To: <20221207174129.77593-2-philmd@linaro.org>


Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Commit 2f3a57ee47 ("cputlb: ensure we save the IOTLB data in
> case of reset") added the SavedIOTLB structure -- which is
> system emulation specific -- in the generic CPUState structure.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  accel/tcg/cputlb.c    | 4 ++--
>  include/hw/core/cpu.h | 6 ++++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 6f1c00682b..0ea96fbcdf 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1395,7 +1395,7 @@ static uint64_t io_readx(CPUArchState *env, CPUTLBEntryFull *full,
>  static void save_iotlb_data(CPUState *cs, MemoryRegionSection *section,
>                              hwaddr mr_offset)
>  {
> -#ifdef CONFIG_PLUGIN
> +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY)

cputlb is softmmu only so I don't think we need to check CONFIG_USER_ONLY here.

>      SavedIOTLB *saved = &cs->saved_iotlb;
>      saved->section = section;
>      saved->mr_offset = mr_offset;
> @@ -1699,7 +1699,7 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr,
>      return qemu_ram_addr_from_host_nofail(p);
>  }
>  
> -#ifdef CONFIG_PLUGIN
> +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY)
>  /*
>   * Perform a TLB lookup and populate the qemu_plugin_hwaddr structure.
>   * This should be a hot path as we will have just looked this path up
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index 8830546121..bc3229ae13 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -222,7 +222,7 @@ struct CPUWatchpoint {
>      QTAILQ_ENTRY(CPUWatchpoint) entry;
>  };
>  
> -#ifdef CONFIG_PLUGIN
> +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY)
>  /*
>   * For plugins we sometime need to save the resolved iotlb data before
>   * the memory regions get moved around  by io_writex.
> @@ -406,9 +406,11 @@ struct CPUState {
>  
>  #ifdef CONFIG_PLUGIN
>      GArray *plugin_mem_cbs;
> +#if !defined(CONFIG_USER_ONLY)
>      /* saved iotlb data from io_writex */
>      SavedIOTLB saved_iotlb;
> -#endif
> +#endif /* !CONFIG_USER_ONLY */
> +#endif /* CONFIG_PLUGIN */
>  
>      /* TODO Move common fields from CPUArchState here. */
>      int cpu_index;


-- 
Alex Bennée


  reply	other threads:[~2022-12-08  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 17:41 [PATCH-for-8.0 0/4] target/cpu: System/User cleanups around hwaddr/vaddr Philippe Mathieu-Daudé
2022-12-07 17:41 ` [PATCH-for-8.0 1/4] cputlb: Restrict SavedIOTLB to system emulation Philippe Mathieu-Daudé
2022-12-08  8:40   ` Alex Bennée [this message]
2022-12-08 10:00     ` Philippe Mathieu-Daudé
2022-12-07 17:41 ` [PATCH-for-8.0 2/4] gdbstub: Use vaddr type for generic insert/remove_breakpoint() API Philippe Mathieu-Daudé
2022-12-07 18:08   ` Fabiano Rosas
2022-12-07 18:17     ` Philippe Mathieu-Daudé
2022-12-07 18:23   ` Peter Maydell
2022-12-07 18:27     ` Philippe Mathieu-Daudé
2022-12-07 20:15       ` Peter Maydell
2022-12-08  9:59         ` Philippe Mathieu-Daudé
2022-12-07 17:41 ` [PATCH-for-8.0 3/4] target/cpu: Restrict cpu_get_phys_page_debug() handlers to sysemu Philippe Mathieu-Daudé
2022-12-07 17:41 ` [PATCH-for-8.0 4/4] target/sparc: Cleanup around sparc_cpu_do_unaligned_access() Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lenis2xs.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=anjo@rev.ng \
    --cc=atar4qemu@gmail.com \
    --cc=clg@kaod.org \
    --cc=crwulff@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=farosas@linux.ibm.com \
    --cc=groug@kaod.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=marex@denx.de \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shorne@gmail.com \
    --cc=wangyanan55@huawei.com \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.