qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions
Date: Tue, 16 Mar 2021 16:37:46 +0100	[thread overview]
Message-ID: <b1dc01eb-0090-e47e-2731-c1920d9cda42@redhat.com> (raw)
In-Reply-To: <20210314232913.2607360-6-f4bug@amsat.org>

(+Peter, comment below)

On 03/15/21 00:29, Philippe Mathieu-Daudé wrote:
> Restrict CPU I/O instructions to architectures providing
> I/O bus.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/qtest/libqos/fw_cfg.h | 3 +++
>  tests/qtest/libqos/fw_cfg.c | 2 ++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/tests/qtest/libqos/fw_cfg.h b/tests/qtest/libqos/fw_cfg.h
> index c6a7cf8cf05..3bfb6d6d55b 100644
> --- a/tests/qtest/libqos/fw_cfg.h
> +++ b/tests/qtest/libqos/fw_cfg.h
> @@ -36,6 +36,8 @@ size_t qfw_cfg_get_file(QFWCFG *fw_cfg, const char *filename,
>  
>  QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base);
>  void mm_fw_cfg_uninit(QFWCFG *fw_cfg);
> +
> +#ifdef TARGET_HAS_IOPORT
>  QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base);
>  void io_fw_cfg_uninit(QFWCFG *fw_cfg);
>  
> @@ -48,6 +50,7 @@ static inline void pc_fw_cfg_uninit(QFWCFG *fw_cfg)
>  {
>      io_fw_cfg_uninit(fw_cfg);
>  }
> +#endif /* TARGET_HAS_IOPORT */
>  
>  G_DEFINE_AUTOPTR_CLEANUP_FUNC(QFWCFG, mm_fw_cfg_uninit)
>  
> diff --git a/tests/qtest/libqos/fw_cfg.c b/tests/qtest/libqos/fw_cfg.c
> index 6b8e1babe51..db2b83f5212 100644
> --- a/tests/qtest/libqos/fw_cfg.c
> +++ b/tests/qtest/libqos/fw_cfg.c
> @@ -131,6 +131,7 @@ void mm_fw_cfg_uninit(QFWCFG *fw_cfg)
>      g_free(fw_cfg);
>  }
>  
> +#ifdef TARGET_HAS_IOPORT
>  static void io_fw_cfg_select(QFWCFG *fw_cfg, uint16_t key)
>  {
>      qtest_outw(fw_cfg->qts, fw_cfg->base, key);
> @@ -162,3 +163,4 @@ void io_fw_cfg_uninit(QFWCFG *fw_cfg)
>  {
>      g_free(fw_cfg);
>  }
> +#endif /* TARGET_HAS_IOPORT */
> 

I'm not sure the macro name is ideal; the PCI host on aarch64/"virt"
emulates IO Ports (it's possible to allocate PCI IO resources on
"virt"). From patch#3, TARGET_HAS_IOPORT does not seem to extend to arm64.

I guess the intent is OK in both patches #3 and #5.

Thanks
Laszlo



  reply	other threads:[~2021-03-16 15:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 23:29 [RFC PATCH 0/8] softmmu: Restrict CPU I/O instructions Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 1/8] softmmu/physmem: Rename io_mem_unassigned -> unassigned_mr Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 2/8] exec: Extract CPU I/O instructions to "cpu-io.h" Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 3/8] target: Introduce TARGET_HAS_IOPORT Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions Philippe Mathieu-Daudé
2021-03-15  1:27   ` Alexander Bulekov
2021-03-15  5:14   ` Thomas Huth
2021-03-15 10:13     ` Philippe Mathieu-Daudé
2021-03-17 17:47     ` Paolo Bonzini
2021-03-14 23:29 ` [RFC PATCH 5/8] qtest/libqos: " Philippe Mathieu-Daudé
2021-03-16 15:37   ` Laszlo Ersek [this message]
2021-03-16 15:43     ` Richard Henderson
2021-03-16 15:55       ` Philippe Mathieu-Daudé
2021-03-17 15:59         ` Laszlo Ersek
2021-03-17 16:24           ` Philippe Mathieu-Daudé
2021-03-17 17:17             ` Laszlo Ersek
2021-03-14 23:29 ` [RFC PATCH 6/8] qtest: " Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 7/8] monitor: " Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 8/8] softmmu: " 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=b1dc01eb-0090-e47e-2731-c1920d9cda42@redhat.com \
    --to=lersek@redhat.com \
    --cc=cfontana@suse.de \
    --cc=f4bug@amsat.org \
    --cc=kraxel@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).