All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron via <qemu-riscv@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sia Jee Heng <jeeheng.sia@starfivetech.com>,
	<qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
	<qemu-riscv@nongnu.org>, <mst@redhat.com>, <imammedo@redhat.com>,
	<anisinha@redhat.com>, <shannon.zhaosl@gmail.com>,
	<sunilvl@ventanamicro.com>, <palmer@dabbelt.com>,
	<alistair.francis@wdc.com>,  <bin.meng@windriver.com>,
	<liwei1518@gmail.com>, <dbarboza@ventanamicro.com>,
	 <zhiwei_liu@linux.alibaba.com>
Subject: Re: [RFC v1 3/3] hw/arm/virt-acpi-build.c: Enable CPU cache topology
Date: Fri, 2 Feb 2024 17:30:47 +0000	[thread overview]
Message-ID: <20240202173047.000053e9@Huawei.com> (raw)
In-Reply-To: <CAFEAcA80VjwM=uKEXfwtg9SVzX947of1Go2c0ph-r0DeyKbpMA@mail.gmail.com>

On Thu, 1 Feb 2024 16:06:55 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Mon, 29 Jan 2024 at 11:08, Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> >
> > On Mon, 29 Jan 2024 00:14:23 -0800
> > Sia Jee Heng <jeeheng.sia@starfivetech.com> wrote:
> >  
> > > Introduced a 3-layer cache for the ARM virtual machine.
> > >
> > > Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>  
> >
> > There are a bunch of CPU registers that also need updating to reflect the
> > described cache.
> > https://lore.kernel.org/qemu-devel/20230808115713.2613-3-Jonathan.Cameron@huawei.com/
> > It's called HACK for a reason ;)
> > But there is some discussion about this issue in the thread.
> >
> > The l1 etc also needs to reflect the CPU model.  This stuff needs to match.
> > Wrong information being passed to a VM is probably worse than no information.  
> 
> Yes. The ACPI table information, if we provide it, should be
> being generated from the CPU cache ID registers.

That + some additional information I think.

> 
> But I'm a bit confused about why the ACPI table has the cache
> topology in it -- can't the guest read the cache ID registers
> and figure it out for itself?

That's a philosophy question for the ARM architects :)

The registers focus on correctness (so what you need to flush etc,
where the point of coherence is and other fun)
not all the info needed for performance tuning. There is some stuff
on the cache type that I guess is more perf tuning related (sets etc)


They probably could have expanded the CPU registers to provide a lot
more information (which is what x86 effectively does). IIRC what is
there today for ARM is pretty much useless for anything placement
decision related (scheduling etc)  You can't tell what shares a cache
(or more fun cluster topology structures). 

It is hard in registers to define a nice flexible graph where
all sorts of fun topology of the system can be described.
PPTT provides that opportunity for a richer description.
Sure you could squirt out the equivalent table via registers,
but what's the point given we have firmware tables for this
sort of thing..

Jonathan


 

> 
> thanks
> -- PMM



WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-arm@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sia Jee Heng <jeeheng.sia@starfivetech.com>,
	<qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
	<qemu-riscv@nongnu.org>, <mst@redhat.com>, <imammedo@redhat.com>,
	<anisinha@redhat.com>, <shannon.zhaosl@gmail.com>,
	<sunilvl@ventanamicro.com>, <palmer@dabbelt.com>,
	<alistair.francis@wdc.com>,  <bin.meng@windriver.com>,
	<liwei1518@gmail.com>, <dbarboza@ventanamicro.com>,
	 <zhiwei_liu@linux.alibaba.com>
Subject: Re: [RFC v1 3/3] hw/arm/virt-acpi-build.c: Enable CPU cache topology
Date: Fri, 2 Feb 2024 17:30:47 +0000	[thread overview]
Message-ID: <20240202173047.000053e9@Huawei.com> (raw)
In-Reply-To: <CAFEAcA80VjwM=uKEXfwtg9SVzX947of1Go2c0ph-r0DeyKbpMA@mail.gmail.com>

On Thu, 1 Feb 2024 16:06:55 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Mon, 29 Jan 2024 at 11:08, Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> >
> > On Mon, 29 Jan 2024 00:14:23 -0800
> > Sia Jee Heng <jeeheng.sia@starfivetech.com> wrote:
> >  
> > > Introduced a 3-layer cache for the ARM virtual machine.
> > >
> > > Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>  
> >
> > There are a bunch of CPU registers that also need updating to reflect the
> > described cache.
> > https://lore.kernel.org/qemu-devel/20230808115713.2613-3-Jonathan.Cameron@huawei.com/
> > It's called HACK for a reason ;)
> > But there is some discussion about this issue in the thread.
> >
> > The l1 etc also needs to reflect the CPU model.  This stuff needs to match.
> > Wrong information being passed to a VM is probably worse than no information.  
> 
> Yes. The ACPI table information, if we provide it, should be
> being generated from the CPU cache ID registers.

That + some additional information I think.

> 
> But I'm a bit confused about why the ACPI table has the cache
> topology in it -- can't the guest read the cache ID registers
> and figure it out for itself?

That's a philosophy question for the ARM architects :)

The registers focus on correctness (so what you need to flush etc,
where the point of coherence is and other fun)
not all the info needed for performance tuning. There is some stuff
on the cache type that I guess is more perf tuning related (sets etc)


They probably could have expanded the CPU registers to provide a lot
more information (which is what x86 effectively does). IIRC what is
there today for ARM is pretty much useless for anything placement
decision related (scheduling etc)  You can't tell what shares a cache
(or more fun cluster topology structures). 

It is hard in registers to define a nice flexible graph where
all sorts of fun topology of the system can be described.
PPTT provides that opportunity for a richer description.
Sure you could squirt out the equivalent table via registers,
but what's the point given we have firmware tables for this
sort of thing..

Jonathan


 

> 
> thanks
> -- PMM


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sia Jee Heng <jeeheng.sia@starfivetech.com>,
	<qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
	<qemu-riscv@nongnu.org>, <mst@redhat.com>, <imammedo@redhat.com>,
	<anisinha@redhat.com>, <shannon.zhaosl@gmail.com>,
	<sunilvl@ventanamicro.com>, <palmer@dabbelt.com>,
	<alistair.francis@wdc.com>,  <bin.meng@windriver.com>,
	<liwei1518@gmail.com>, <dbarboza@ventanamicro.com>,
	 <zhiwei_liu@linux.alibaba.com>
Subject: Re: [RFC v1 3/3] hw/arm/virt-acpi-build.c: Enable CPU cache topology
Date: Fri, 2 Feb 2024 17:30:47 +0000	[thread overview]
Message-ID: <20240202173047.000053e9@Huawei.com> (raw)
In-Reply-To: <CAFEAcA80VjwM=uKEXfwtg9SVzX947of1Go2c0ph-r0DeyKbpMA@mail.gmail.com>

On Thu, 1 Feb 2024 16:06:55 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Mon, 29 Jan 2024 at 11:08, Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> >
> > On Mon, 29 Jan 2024 00:14:23 -0800
> > Sia Jee Heng <jeeheng.sia@starfivetech.com> wrote:
> >  
> > > Introduced a 3-layer cache for the ARM virtual machine.
> > >
> > > Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>  
> >
> > There are a bunch of CPU registers that also need updating to reflect the
> > described cache.
> > https://lore.kernel.org/qemu-devel/20230808115713.2613-3-Jonathan.Cameron@huawei.com/
> > It's called HACK for a reason ;)
> > But there is some discussion about this issue in the thread.
> >
> > The l1 etc also needs to reflect the CPU model.  This stuff needs to match.
> > Wrong information being passed to a VM is probably worse than no information.  
> 
> Yes. The ACPI table information, if we provide it, should be
> being generated from the CPU cache ID registers.

That + some additional information I think.

> 
> But I'm a bit confused about why the ACPI table has the cache
> topology in it -- can't the guest read the cache ID registers
> and figure it out for itself?

That's a philosophy question for the ARM architects :)

The registers focus on correctness (so what you need to flush etc,
where the point of coherence is and other fun)
not all the info needed for performance tuning. There is some stuff
on the cache type that I guess is more perf tuning related (sets etc)


They probably could have expanded the CPU registers to provide a lot
more information (which is what x86 effectively does). IIRC what is
there today for ARM is pretty much useless for anything placement
decision related (scheduling etc)  You can't tell what shares a cache
(or more fun cluster topology structures). 

It is hard in registers to define a nice flexible graph where
all sorts of fun topology of the system can be described.
PPTT provides that opportunity for a richer description.
Sure you could squirt out the equivalent table via registers,
but what's the point given we have firmware tables for this
sort of thing..

Jonathan


 

> 
> thanks
> -- PMM



  reply	other threads:[~2024-02-02 17:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29  8:14 [RFC v1 0/3] Add cache structure table creation for PPTT table Sia Jee Heng
2024-01-29  8:14 ` [RFC v1 1/3] hw/acpi/aml-build: " Sia Jee Heng
2024-01-29 11:02   ` Jonathan Cameron via
2024-01-29 11:02     ` Jonathan Cameron via
2024-01-29 11:02     ` Jonathan Cameron via
2024-01-30  5:00     ` JeeHeng Sia
2024-01-31 15:53       ` Jonathan Cameron via
2024-01-31 15:53         ` Jonathan Cameron via
2024-01-31 15:53         ` Jonathan Cameron via
2024-01-29  8:14 ` [RFC v1 2/3] hw/riscv/virt-acpi-build.c: Generate " Sia Jee Heng
2024-01-29  8:14 ` [RFC v1 3/3] hw/arm/virt-acpi-build.c: Enable CPU cache topology Sia Jee Heng
2024-01-29 11:08   ` Jonathan Cameron via
2024-01-29 11:08     ` Jonathan Cameron via
2024-01-29 11:08     ` Jonathan Cameron via
2024-01-30  5:03     ` JeeHeng Sia
2024-01-31 15:56       ` Jonathan Cameron via
2024-01-31 15:56         ` Jonathan Cameron via
2024-01-31 15:56         ` Jonathan Cameron via
2024-02-01 16:06     ` Peter Maydell
2024-02-02 17:30       ` Jonathan Cameron via [this message]
2024-02-02 17:30         ` Jonathan Cameron via
2024-02-02 17:30         ` 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=20240202173047.000053e9@Huawei.com \
    --to=qemu-riscv@nongnu.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=alistair.francis@wdc.com \
    --cc=anisinha@redhat.com \
    --cc=bin.meng@windriver.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=imammedo@redhat.com \
    --cc=jeeheng.sia@starfivetech.com \
    --cc=liwei1518@gmail.com \
    --cc=mst@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=sunilvl@ventanamicro.com \
    --cc=zhiwei_liu@linux.alibaba.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 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.