qemu-e2k/include
Jonathan Cameron aadfe32091 hw/cxl/host: Add support for CXL Fixed Memory Windows.
The concept of these is introduced in [1] in terms of the
description the CEDT ACPI table. The principal is more general.
Unlike once traffic hits the CXL root bridges, the host system
memory address routing is implementation defined and effectively
static once observable by standard / generic system software.
Each CXL Fixed Memory Windows (CFMW) is a region of PA space
which has fixed system dependent routing configured so that
accesses can be routed to the CXL devices below a set of target
root bridges. The accesses may be interleaved across multiple
root bridges.

For QEMU we could have fully specified these regions in terms
of a base PA + size, but as the absolute address does not matter
it is simpler to let individual platforms place the memory regions.

ExampleS:
-cxl-fixed-memory-window targets.0=cxl.0,size=128G
-cxl-fixed-memory-window targets.0=cxl.1,size=128G
-cxl-fixed-memory-window targets.0=cxl0,targets.1=cxl.1,size=256G,interleave-granularity=2k

Specifies
* 2x 128G regions not interleaved across root bridges, one for each of
  the root bridges with ids cxl.0 and cxl.1
* 256G region interleaved across root bridges with ids cxl.0 and cxl.1
with a 2k interleave granularity.

When system software enumerates the devices below a given root bridge
it can then decide which CFMW to use. If non interleave is desired
(or possible) it can use the appropriate CFMW for the root bridge in
question.  If there are suitable devices to interleave across the
two root bridges then it may use the 3rd CFMS.

A number of other designs were considered but the following constraints
made it hard to adapt existing QEMU approaches to this particular problem.
1) The size must be known before a specific architecture / board brings
   up it's PA memory map.  We need to set up an appropriate region.
2) Using links to the host bridges provides a clean command line interface
   but these links cannot be established until command line devices have
   been added.

Hence the two step process used here of first establishing the size,
interleave-ways and granularity + caching the ids of the host bridges
and then, once available finding the actual host bridges so they can
be used later to support interleave decoding.

[1] CXL 2.0 ECN: CEDT CFMWS & QTG DSM (computeexpresslink.org / specifications)

Signed-off-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Markus Armbruster <armbru@redhat.com> # QAPI Schema
Message-Id: <20220429144110.25167-28-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-05-13 07:57:26 -04:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block nbd/server: Allow MULTI_CONN for shared writable exports 2022-05-12 13:10:52 +02:00
chardev Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
crypto Clean up header guards that don't match their file name 2022-05-11 16:49:06 +02:00
disas disas: Remove old libopcode ppc disassembler 2022-05-09 08:21:05 +02:00
exec Clean up decorations and whitespace around header guards 2022-05-11 16:50:32 +02:00
fpu Clean up decorations and whitespace around header guards 2022-05-11 16:50:32 +02:00
hw hw/cxl/host: Add support for CXL Fixed Memory Windows. 2022-05-13 07:57:26 -04:00
io io: make qio_channel_command_new_pid() static 2022-05-03 15:47:59 +04:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration: Remove load_state_old and minimum_version_id_old 2022-03-02 18:20:45 +00:00
monitor Move error_printf_unless_qmp() with monitor unit 2022-04-21 17:09:09 +04:00
net Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
qapi include: move qdict_{crumple,flatten} declarations 2022-04-21 17:03:51 +04:00
qemu * small cleanups for pc-bios/optionrom Makefiles 2022-05-12 10:52:15 -07:00
qom compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED 2022-03-22 14:40:51 +04:00
scsi scsi: inline sg_io_sense_from_errno() into the callers. 2021-03-06 11:42:56 +01:00
semihosting semihosting: Move include/hw/semihosting/ -> include/semihosting/ 2021-03-10 15:34:12 +00:00
standard-headers headers: Add pvpanic.h 2022-03-06 05:08:23 -05:00
sysemu machine: use QAPI struct for boot configuration 2022-05-12 12:29:43 +02:00
tcg Normalize header guard symbol definition 2022-05-11 16:50:26 +02:00
ui Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
user Clean up decorations and whitespace around header guards 2022-05-11 16:50:32 +02:00
elf.h elf: Add machine type value for LoongArch 2021-12-21 13:17:06 -08:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qemu-main.h Simplify softmmu/main.c 2022-04-21 16:56:55 +04:00