qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: qemu-devel@nongnu.org, "Fan Ni" <fan.ni@samsung.com>,
	mst@redhat.com, "Zhijian Li" <lizhijian@fujitsu.com>,
	"Itaru Kitayama" <itaru.kitayama@linux.dev>,
	linuxarm@huawei.com, linux-cxl@vger.kernel.org,
	qemu-arm@nongnu.org,
	"Yuquan Wang" <wangyuquan1236@phytium.com.cn>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alireza Sanaee" <alireza.sanaee@huawei.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v15 4/4] qtest/cxl: Add aarch64 virt test for CXL
Date: Fri, 13 Jun 2025 13:32:03 +0100	[thread overview]
Message-ID: <CAFEAcA8xVQUnReg-3jYENLmOMG_PeJ-ACLQa0dRoLBzxQ+9Svg@mail.gmail.com> (raw)
In-Reply-To: <20250612134338.1871023-5-Jonathan.Cameron@huawei.com>

On Thu, 12 Jun 2025 at 14:45, Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> Add a single complex case for aarch64 virt machine.
> Given existing much more comprehensive tests for x86 cover the
> common functionality, a single test should be enough to verify
> that the aarch64 part continue to work.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> ---
> v15: Dropped tags due to changes in patches 2 and 3.
> ---
>  tests/qtest/cxl-test.c  | 59 ++++++++++++++++++++++++++++++++---------
>  tests/qtest/meson.build |  1 +
>  2 files changed, 47 insertions(+), 13 deletions(-)
>
> diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c
> index a600331843..c7189d6222 100644
> --- a/tests/qtest/cxl-test.c
> +++ b/tests/qtest/cxl-test.c
> @@ -19,6 +19,12 @@
>      "-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=53 " \
>      "-M cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=4G "
>
> +#define QEMU_VIRT_2PXB_CMD \
> +    "-machine virt,cxl=on -cpu max " \
> +    "-device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 " \
> +    "-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=53 " \
> +    "-M cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=4G "
> +
>  #define QEMU_RP \
>      "-device cxl-rp,id=rp0,bus=cxl.0,chassis=0,slot=0 "
>
> @@ -197,25 +203,52 @@ static void cxl_2pxb_4rp_4t3d(void)
>      qtest_end();
>      rmdir(tmpfs);
>  }
> +
> +static void cxl_virt_2pxb_4rp_4t3d(void)
> +{
> +    g_autoptr(GString) cmdline = g_string_new(NULL);
> +    char template[] = "/tmp/cxl-test-XXXXXX";
> +    const char *tmpfs;
> +
> +    tmpfs = mkdtemp(template);

We prefer g_mkdtemp() or g_dir_make_temp() over raw mkdtemp(),
I think. Other tests in this file use g_dir_make_tmp().

Also you aren't checking whether it failed.

> +
> +    g_string_printf(cmdline, QEMU_VIRT_2PXB_CMD QEMU_4RP QEMU_4T3D,
> +                    tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs,
> +                    tmpfs, tmpfs);
> +
> +    qtest_start(cmdline->str);

We never change the GString and only use its C representation,
so I think it's simpler to use
  g_autofree char *cmdline = NULL;
  ...
  cmdline = g_strdup_printf(...);

But I see all the other tests in this file are written this
way, so I'm ok with staying consistent to that here.

-- PMM


  parent reply	other threads:[~2025-06-13 12:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 13:43 [PATCH v15 0/4] arm/virt: CXL support via pxb_cxl Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 1/4] hw/cxl-host: Add an index field to CXLFixedMemoryWindow Jonathan Cameron via
2025-06-13  2:09   ` Zhijian Li (Fujitsu) via
2025-06-12 13:43 ` [PATCH v15 2/4] hw/cxl: Make the CXL fixed memory windows devices Jonathan Cameron via
2025-06-13  2:09   ` Zhijian Li (Fujitsu) via
2025-06-13 12:33   ` Peter Maydell
2025-06-13 13:09     ` Jonathan Cameron via
2025-06-13 16:08       ` Peter Maydell
2025-06-13 17:17         ` Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 3/4] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl Jonathan Cameron via
2025-06-13 12:57   ` Peter Maydell
2025-06-13 15:20     ` Jonathan Cameron via
2025-06-13 16:07       ` Peter Maydell
2025-06-13 17:21         ` Jonathan Cameron via
2025-06-25 16:08           ` Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 4/4] qtest/cxl: Add aarch64 virt test for CXL Jonathan Cameron via
2025-06-12 22:02   ` Itaru Kitayama
2025-06-13 12:32   ` Peter Maydell [this message]
2025-06-13 17:16     ` Jonathan Cameron via
2025-06-12 16:04 ` [PATCH v15 0/4] arm/virt: CXL support via pxb_cxl Peter Maydell
2025-06-12 16:33   ` Jonathan Cameron via
2025-06-13  5:07 ` Itaru Kitayama
2025-06-13 15:47   ` Jonathan Cameron via

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=CAFEAcA8xVQUnReg-3jYENLmOMG_PeJ-ACLQa0dRoLBzxQ+9Svg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alex.bennee@linaro.org \
    --cc=alireza.sanaee@huawei.com \
    --cc=fan.ni@samsung.com \
    --cc=itaru.kitayama@linux.dev \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lizhijian@fujitsu.com \
    --cc=mst@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyuquan1236@phytium.com.cn \
    /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).