>accelerator", so that we could get @accel
by ms->accelerator.
But considerring the user emulation, where the @ms is NULL, and for
these cases, it needs to bring current_accel() back in patch 32.
Anyway, this solution is also fine for me, so,
Reviewed-by: Zhao Liu
...But there'
gdbstub/system.c| 1 +
> linux-user/main.c | 1 +
> system/memory.c | 1 +
> target/i386/nvmm/nvmm-all.c | 1 +
> target/i386/whpx/whpx-all.c | 1 +
> 19 files changed, 70 insertions(+), 40 deletions(-)
> create mode 100644 include/accel/accel-ops.h
Reviewed-by: Zhao Liu
ACCEL_OPS_H
> -#define ACCEL_OPS_H
> +#ifndef ACCEL_CPU_OPS_H
> +#define ACCEL_CPU_OPS_H
Daniel mentioned "QEMU_" prefix is "best practice":
https://lore.kernel.org/qemu-devel/aadsmexeay45n...@redhat.com/
But I also think there's no need to change anything here for now. If
you agree, we can move in this direction in the future. So
Reviewed-by: Zhao Liu
| 1 +
> system/cpus.c | 9 +++--
> target/i386/nvmm/nvmm-accel-ops.c | 1 +
> target/i386/whpx/whpx-accel-ops.c | 1 +
> 8 files changed, 12 insertions(+), 6 deletions(-)
Reviewed-by: Zhao Liu
| 7 ---
> target/i386/nvmm/nvmm-accel-ops.c | 1 +
> target/i386/whpx/whpx-accel-ops.c | 1 +
> 8 files changed, 13 insertions(+), 3 deletions(-)
Reviewed-by: Zhao Liu
| 2 ++
> system/cpus.c | 6 ++
> target/i386/nvmm/nvmm-accel-ops.c | 3 +++
> target/i386/whpx/whpx-accel-ops.c | 3 +++
> 9 files changed, 21 insertions(+), 4 deletions(-)
Reviewed-by: Zhao Liu
thieu-Daudé
> ---
> include/system/accel-ops.h | 1 +
> accel/kvm/kvm-accel-ops.c | 1 +
> accel/qtest/qtest.c| 1 +
> accel/xen/xen-all.c| 1 +
> system/cpus.c | 7 ++-
> 5 files changed, 6 insertions(+), 5 deletions(-)
Reviewed-by: Zhao Liu
t; Nothing requires definitions from "exec/cpu-common.h",
> do not include this header.
>
> Signed-off-by: Philippe Mathieu-Daudé
> ---
> include/sysemu/numa.h | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Zhao Liu
---
> include/sysemu/accel-ops.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Zhao Liu
ng requires definitions from "exec/cpu-common.h",
> do not include this header.
>
> Signed-off-by: Philippe Mathieu-Daudé
> ---
> include/hw/xen/xen.h | 2 --
> 1 file changed, 2 deletions(-)
>
Reviewed-by: Zhao Liu
ifier s, m, v;
> @@
> S *s;
> ...
> F *v = &s->m;
> <+...
> -&s->m
> +v
> ...+>
>
> Inspired-by: Zhao Liu
Thanks!
> Signed-off-by: Philippe Mathieu-Daudé
> ---
> hw/display/ati.c
| 3 +-
> target/i386/tcg/tcg-cpu.c| 14 +++---
> target/i386/tcg/user/excp_helper.c | 6 ++--
> target/i386/tcg/user/seg_helper.c| 3 +-
> 21 files changed, 67 insertions(+), 158 deletions(-)
Reviewed-by: Zhao Liu
>
> diff --git a/target/i386/hvf/vmx.h b/target/i
target/i386/tcg/user/excp_helper.c
index b3bdb7831a7a..02fcd64fc080 100644
--- a/target/i386/tcg/user/excp_helper.c
+++ b/target/i386/tcg/user/excp_helper.c
@@ -52,6 +52,5 @@ void x86_cpu_record_sigsegv(CPUState *cs, vaddr addr,
void x86_cpu_record_sigbus(CPUState *cs, vaddr addr,
MMUAccessType access_type, uintptr_t ra)
{
-X86CPU *cpu = X86_CPU(cs);
-handle_unaligned_access(&cpu->env, addr, access_type, ra);
+handle_unaligned_access(cpu_env(cs), addr, access_type, ra);
}
[snip]
LGTM.
Reviewed-by: Zhao Liu
Hi maintainers,
Just a ping. Welcome your feedbacks!
We wonder if the current RFC is an appropriate attempt towards the final
hybrid topology.
Thanks,
Zhao
On Thu, Nov 30, 2023 at 10:41:22PM +0800, Zhao Liu wrote:
> Date: Thu, 30 Nov 2023 22:41:22 +0800
> From: Zhao Liu
> Subject: [
From: Zhao Liu
Support user-child for topology devices.
This will affect these 2 aspects:
1. For the basic topology device (with DEVICE_CATEGORY_CPU_DEF
category), user could specify "parent" to build the topology
relationship from cli. And cpu-slot will collect all topology
From: Zhao Liu
QOM topology allows user to create topology tree from cli without -smp,
in this case, validate the topology tree to meet the smp requirement.
Currently, for compatibility with MachineState.smp, initialize
MachineState.smp from topology tree in this case.
Signed-off-by: Zhao Liu
From: Zhao Liu
Topology relationship is based on child<> property, therefore introduce
a new user-child interface to help bus-less devices create child<>
property from cli.
User-child interface works in qdev_set_id(), where the child<> property
is created for cli devices.
Wi
From: Zhao Liu
The properties setting does not conflict with the creation of child<>
property.
Pre-setting the device's properties can help the device's parent
selection. Some topology devices (e.g., CPUs that support hotplug)
usually define topology sub indexes as properties, a
From: Zhao Liu
QOM topology needs to search parent cpu-core for hotplugged CPU to
create topology child<> property in qdev_set_id().
This process is before x86_cpu_pre_plug(), thus place 2 helpers
x86_cpu_assign_apic_id() and x86_cpu_assign_topo_id() in
x86_cpu_search_parent_pre_plug() t
From: Zhao Liu
When we support child<> property creation from cli, the peripheral
container (/machine/peripheral) may not be the direct parent of the
devices created from cli.
For this case, add a helper to resolve path from non-direct parent.
Signed-off-by: Zhao Liu
---
include/qom/ob
From: Zhao Liu
After i386 supports QOM topology, drop original topology logic.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 52 +++
1 file changed, 11 insertions(+), 41 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 99f6c502de43
From: Zhao Liu
For QOM topology, maximum number of CPUs and the number of plugged CPUs
are configured in core level.
Iterate through all the cpu-cores to determine how many CPUs should be
created in each cpu-core.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 32
From: Zhao Liu
Currently, the devices added by "-device" are linked via bus, and are
set the parent as peripheral-anon or peripheral containers of the
machine.
But this is not enough for building CPU topology hierarchies as:
1. The relationship between different CPU hierarchie
From: Zhao Liu
Topology devices are required to complete CPU topology building before
*_init_cpus() in MachineClass.init().
Add a qemu_create_cli_base_devices() before board initialization to
help create and realize topology devices from cli early.
Signed-off-by: Zhao Liu
---
system/vl.c
From: Zhao Liu
Set MachineClass.smp_props.possible_cpus_qom_granu and
TopoClass.search_parent_pre_plug for i386.
So far, the i386 topology is based on the QOM topology.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 1 +
target/i386/cpu.c | 4
2 files changed, 5 insertions(+)
diff
From: Zhao Liu
x86_cpu_new() is only invoked in x86.c. Declear it as static in x86.c.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 3 ++-
include/hw/i386/x86.h | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index b3d054889bba
From: Zhao Liu
The CPU slot, as the root of the topology tree, is responsible for
global topology information collection and updates.
When a new topology device is added to/deleted from the topology tree,
update the corresponding information in the slot.
Signed-off-by: Zhao Liu
---
hw/core
From: Zhao Liu
For QOM topology, these 2 helpers are needed for hotplugged CPU to
verify its topology sub indexes and then search its parent core.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 173 --
1 file changed, 96 insertions(+), 77 deletions
From: Zhao Liu
Abstract the root of topology tree as a special topology device
"cpu-slot".
Signed-off-by: Zhao Liu
---
MAINTAINERS| 2 ++
hw/core/cpu-slot.c | 48 ++
hw/core/meson.build| 1 +
include/hw/core/cpu-s
From: Zhao Liu
Abstract book level as a topology device "cpu-book" to allow user to
create book level topology from cli and later the cpu-books could be
added into topology tree.
In addition, mark the cpu-book as DEVICE_CATEGORY_CPU_DEF category to
indicate it belongs to the
From: Zhao Liu
For the architecture supports QOM topology (the field
MachineClass.possible_cpus_qom_granu is set), implement smp QOM topology
tree from MachineState.smp.
Signed-off-by: Zhao Liu
---
hw/core/cpu-slot.c | 217 +
hw/core/machine-smp.c
From: Zhao Liu
For QOM topology, CPU should be inserted under its parent core.
Extend x86_cpu_new() to allow caller to specify topology parent.
Signed-off-by: Zhao Liu
---
hw/i386/x86.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/i386/x86.c b/hw
From: Zhao Liu
Abstract die level as a topology device "cpu-die" to allow user to
create die level topology from cli and later the cpu-dies could be added
into topology tree.
In addition, mark the cpu-die as DEVICE_CATEGORY_CPU_DEF category to
indicate it belongs to the basic CPU defi
From: Zhao Liu
Implement CPUTopoClass.check_topo_child() in cpu-slot to be compatible
with the limitations of the current smp topology.
Signed-off-by: Zhao Liu
---
hw/core/cpu-slot.c | 37 +
hw/core/cpu-topo.c | 2 +-
include/hw/core/cpu
From: Zhao Liu
Abstract drawer level as a topology device "cpu-drawer" to allow user to
create drawer level topology from cli and later the cpu-drawers could be
added into topology tree.
In addition, mark the cpu-drawer as DEVICE_CATEGORY_CPU_DEF category to
indicate it belongs to the
From: Zhao Liu
Add a cpu-slot in machine as the root of topology tree to maintain the
QOM topology.
Signed-off-by: Zhao Liu
---
hw/core/cpu-slot.c | 31 +++
include/hw/boards.h| 2 ++
include/hw/core/cpu-slot.h | 7 +++
system/vl.c
From: Zhao Liu
Since we will extend cpu-cluster to build CPU topology in virtualization
case via -device, remove the original limitition.
Signed-off-by: Zhao Liu
---
hw/cpu/cluster.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c
index 27ab9e25a265
From: Zhao Liu
Currenltly cpu-cluster is used in TCG case to organize CPUs with the
same type.
Wrap 2 things into TCG specific areas:
1. cluster-id:
The cluster-id in TCG case is global, since no higher topology
container above cluster. To simplify the logic of cluster topology
in
From: Zhao Liu
Maintain the cores queue at cpu-slot to facilitate direct traversal
of all cores.
Signed-off-by: Zhao Liu
---
hw/core/cpu-slot.c | 43 ++
include/hw/core/cpu-slot.h | 9
include/hw/cpu/core.h | 2 ++
3 files changed
From: Zhao Liu
Convert CPU to topology device then its parent topology devices could
count the number of CPUs when new CPUs are added into topology tree.
Note since CPUs are created from *_init_cpus() in MachineClass.init() or
added from hotplug way, it depends on board initialization. Thus CPU
From: Zhao Liu
Hi list,
This series is our latest attempt after the previous RFC [1] about
hybrid topology support, which is based on the commit 4705fc0c8511
("Merge tag 'pull-for-8.2-fixes-231123-1' of https://gitlab.com/
stsquad/qemu into staging") with our previous c
From: Zhao Liu
Convert cpu-core to topology device then user could create core level
topology from cli and later the cpu-cores could be added into topology
tree.
In addition, mark the common cpu-core as DEVICE_CATEGORY_CPU_DEF
category to indicate it belongs to the basic CPU definition and
From: Zhao Liu
When the core abstraction is applied for the architecture support CPU
hotplug, the plugged CPUs and unplugged CPUs are distributed among the
cores created in the topology tree.
Add plugged_threads field to help cpu-core decide to how many CPUs to
create.
Signed-off-by: Zhao Liu
From: Zhao Liu
Abstract socket level as a topology device "cpu-socket" to allow user to
create socket level topology from cli and later the cpu-sockets could be
added into topology tree.
In addition, mark the cpu-socket as DEVICE_CATEGORY_CPU_DEF category to
indicate it belongs to the
From: Zhao Liu
Topology index is used to identify the topology child under the same
parent topology device.
This field corresponds to the topology sub index (e.g., socket-id/
core-id/thread-id) used for addressing.
Signed-off-by: Zhao Liu
---
hw/core/cpu-topo.c | 77
From: Zhao Liu
Convert cpu-cluster to topology device then user could create cluster
level topology from cli and later the cpu-clusters could be added into
topology tree.
In addition, mark the cpu-cluster as DEVICE_CATEGORY_CPU_DEF category to
indicate it belongs to the basic CPU definition and
From: Zhao Liu
When a new topology child is to be inserted into the topology tree, its
parents (including non-direct parents) need to check if this child is
supported.
Add the virtual method to allow topology device to check the support for
their topology children.
Signed-off-by: Zhao Liu
From: Zhao Liu
Update the comment to make the cpu-cluster description more general for
both TCG and accel cases.
Signed-off-by: Zhao Liu
---
hw/cpu/cluster.c | 2 +-
include/hw/cpu/cluster.h | 20 +++-
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/hw
From: Zhao Liu
To keep the same naming style as cpu-core, rename CPUClusterState to
CPUCluster.
Signed-off-by: Zhao Liu
---
gdbstub/system.c | 2 +-
hw/cpu/cluster.c | 8
include/hw/arm/armsse.h| 2 +-
include/hw/arm/xlnx-versal.h
From: Zhao Liu
PPC supports CPU hotplug at core granularity, thus ppc-core only accepts
all CPUs in a core are plugged.
Check if plugged_threads and nr_threads are equal when ppc-core
realizes.
Signed-off-by: Zhao Liu
---
hw/ppc/ppc_core.c | 18 ++
include/hw/ppc
From: Zhao Liu
PPC (spapr) supports hotplugs at the core granularity (spapr core) and
treats core-id as the global id for all cores.
But other architectures that support hotplugging at CPU granularity,
use core-id as the local id to indicate the core within the parent
topology container instand
From: Zhao Liu
The topology devices will be organized as a topology tree. Each topology
device may have many topology children with lower topology level.
Add the helpers to traverse the CPU topology tree.
Signed-off-by: Zhao Liu
---
hw/core/cpu-topo.c | 41
From: Zhao Liu
When a new topology device is inserted into the topology tree,
its'parents (including non-direct parent) need to update topology
information.
Add the virtual method to help parents on topology tree update
topology information statistics.
Signed-off-by: Zhao Liu
---
hw/cor
From: Zhao Liu
Topology devices are used to define CPUs and need to be created and
realized before the board initialization.
Use this new catogory to identify such special devices.
Signed-off-by: Zhao Liu
---
include/hw/qdev-core.h | 1 +
system/qdev-monitor.c | 1 +
2 files changed, 2
From: Zhao Liu
To create more flexible CPU topologies (both symmetric and
heterogeneous) via the "-device" interface, it is necessary to convert
the current CPU topology hierarchies into the special CPU topology
devices.
The CPU topology will be built as a tree, and the devic
From: Zhao Liu
Topology devices need to be created and realized before board
initialization.
Allow qdev_device_add() to specify category to help create topology
devices early.
Signed-off-by: Zhao Liu
---
hw/net/virtio-net.c| 2 +-
hw/usb/xen-usb.c | 3 ++-
include/monitor/qdev.h
56 matches
Mail list logo