Skip to content

Commit 2c89b5a

Browse files
committed
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220120-1' into staging
target-arm: * hw/intc/arm_gicv3_its: Fix various minor bugs * hw/arm/aspeed: Add the i3c device to the AST2600 SoC * hw/arm: kudo: add lm75s behind bus 1 switch at 75 * hw/arm/virt: Fix support for running guests on hosts with restricted IPA ranges * hw/intc/arm_gic: Allow reset of the running priority * hw/intc/arm_gic: Implement read of GICC_IIDR * hw/arm/virt: Support for virtio-mem-pci * hw/arm/virt: Support CPU cluster on ARM virt machine * docs/can: convert to restructuredText * hw/net: Move MV88W8618 network device out of hw/arm/ directory * hw/arm/virt: KVM: Enable PAuth when supported by the host # gpg: Signature made Thu 20 Jan 2022 16:12:12 GMT # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "[email protected]" # gpg: Good signature from "Peter Maydell <[email protected]>" [ultimate] # gpg: aka "Peter Maydell <[email protected]>" [ultimate] # gpg: aka "Peter Maydell <[email protected]>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20220120-1: (38 commits) hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR hw/intc/arm_gicv3_its: Range-check ICID before indexing into collection table hw/intc/arm_gicv3_its: Check indexes before use, not after hw/intc/arm_gicv3_its: Factor out "find address of table entry" code hw/intc/arm_gicv3_its: Fix return codes in process_mapd() hw/intc/arm_gicv3_its: Fix return codes in process_mapc() hw/intc/arm_gicv3_its: Fix return codes in process_mapti() hw/intc/arm_gicv3_its: Refactor process_its_cmd() to reduce nesting hw/intc/arm_gicv3_its: Fix return codes in process_its_cmd() hw/intc/arm_gicv3_its: Use enum for return value of process_* functions hw/intc/arm_gicv3_its: Don't use data if reading command failed hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention hw/intc/arm_gicv3_its: Fix event ID bounds checks hw/arm/aspeed: Add the i3c device to the AST2600 SoC hw/misc/aspeed_i3c.c: Introduce a dummy AST2600 I3C model. hw/arm: kudo add lm75s behind bus 1 switch at 75 hw/arm/virt: Drop superfluous checks against highmem hw/arm/virt: Disable highmem devices that don't fit in the PA range hw/arm/virt: Use the PA range to compute the memory map ... Signed-off-by: Peter Maydell <[email protected]>
2 parents 47fa1ad + b9d383a commit 2c89b5a

31 files changed

+1457
-763
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,8 @@ M: Peter Maydell <[email protected]>
774774
775775
S: Odd Fixes
776776
F: hw/arm/musicpal.c
777+
F: hw/net/mv88w8618_eth.c
778+
F: include/hw/net/mv88w8618_eth.h
777779
F: docs/system/arm/musicpal.rst
778780

779781
Nuvoton NPCM7xx

docs/system/arm/cpu-features.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ TCG VCPU Features
217217
TCG VCPU features are CPU features that are specific to TCG.
218218
Below is the list of TCG VCPU features and their descriptions.
219219

220-
pauth Enable or disable ``FEAT_Pauth``, pointer
221-
authentication. By default, the feature is
222-
enabled with ``-cpu max``.
223-
224220
pauth-impdef When ``FEAT_Pauth`` is enabled, either the
225221
*impdef* (Implementation Defined) algorithm
226222
is enabled or the *architected* QARMA algorithm

docs/system/device-emulation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Emulated Devices
8282
.. toctree::
8383
:maxdepth: 1
8484

85+
devices/can.rst
8586
devices/ivshmem.rst
8687
devices/net.rst
8788
devices/nvme.rst

docs/can.txt renamed to docs/system/devices/can.rst

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
QEMU CAN bus emulation support
2-
==============================
3-
1+
CAN Bus Emulation Support
2+
=========================
43
The CAN bus emulation provides mechanism to connect multiple
54
emulated CAN controller chips together by one or multiple CAN busses
65
(the controller device "canbus" parameter). The individual busses
@@ -32,34 +31,39 @@ emulated environment for testing and RTEMS GSoC slot has been donated
3231
to work on CAN hardware emulation on QEMU.
3332

3433
Examples how to use CAN emulation for SJA1000 based boards
35-
==========================================================
36-
34+
----------------------------------------------------------
3735
When QEMU with CAN PCI support is compiled then one of the next
3836
CAN boards can be selected
3937

40-
(1) CAN bus Kvaser PCI CAN-S (single SJA1000 channel) boad. QEMU startup options
38+
(1) CAN bus Kvaser PCI CAN-S (single SJA1000 channel) board. QEMU startup options::
39+
4140
-object can-bus,id=canbus0
4241
-device kvaser_pci,canbus=canbus0
43-
Add "can-host-socketcan" object to connect device to host system CAN bus
42+
43+
Add "can-host-socketcan" object to connect device to host system CAN bus::
44+
4445
-object can-host-socketcan,id=canhost0,if=can0,canbus=canbus0
4546

46-
(2) CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation
47+
(2) CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation::
48+
4749
-object can-bus,id=canbus0
4850
-device pcm3680_pci,canbus0=canbus0,canbus1=canbus0
4951

50-
another example:
52+
Another example::
53+
5154
-object can-bus,id=canbus0
5255
-object can-bus,id=canbus1
5356
-device pcm3680_pci,canbus0=canbus0,canbus1=canbus1
5457

55-
(3) CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation
56-
-device mioe3680_pci,canbus0=canbus0
58+
(3) CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation::
5759

60+
-device mioe3680_pci,canbus0=canbus0
5861

5962
The ''kvaser_pci'' board/device model is compatible with and has been tested with
60-
''kvaser_pci'' driver included in mainline Linux kernel.
63+
the ''kvaser_pci'' driver included in mainline Linux kernel.
6164
The tested setup was Linux 4.9 kernel on the host and guest side.
62-
Example for qemu-system-x86_64:
65+
66+
Example for qemu-system-x86_64::
6367

6468
qemu-system-x86_64 -accel kvm -kernel /boot/vmlinuz-4.9.0-4-amd64 \
6569
-initrd ramdisk.cpio \
@@ -69,7 +73,7 @@ Example for qemu-system-x86_64:
6973
-device kvaser_pci,canbus=canbus0 \
7074
-nographic -append "console=ttyS0"
7175

72-
Example for qemu-system-arm:
76+
Example for qemu-system-arm::
7377

7478
qemu-system-arm -cpu arm1176 -m 256 -M versatilepb \
7579
-kernel kernel-qemu-arm1176-versatilepb \
@@ -84,24 +88,23 @@ Example for qemu-system-arm:
8488
The CAN interface of the host system has to be configured for proper
8589
bitrate and set up. Configuration is not propagated from emulated
8690
devices through bus to the physical host device. Example configuration
87-
for 1 Mbit/s
91+
for 1 Mbit/s::
8892

8993
ip link set can0 type can bitrate 1000000
9094
ip link set can0 up
9195

9296
Virtual (host local only) can interface can be used on the host
93-
side instead of physical interface
97+
side instead of physical interface::
9498

9599
ip link add dev can0 type vcan
96100

97101
The CAN interface on the host side can be used to analyze CAN
98-
traffic with "candump" command which is included in "can-utils".
102+
traffic with "candump" command which is included in "can-utils"::
99103

100104
candump can0
101105

102106
CTU CAN FD support examples
103-
===========================
104-
107+
---------------------------
105108
This open-source core provides CAN FD support. CAN FD drames are
106109
delivered even to the host systems when SocketCAN interface is found
107110
CAN FD capable.
@@ -113,7 +116,7 @@ on the board.
113116
Example how to connect the canbus0-bus (virtual wire) to the host
114117
Linux system (SocketCAN used) and to both CTU CAN FD cores emulated
115118
on the corresponding PCI card expects that host system CAN bus
116-
is setup according to the previous SJA1000 section.
119+
is setup according to the previous SJA1000 section::
117120

118121
qemu-system-x86_64 -enable-kvm -kernel /boot/vmlinuz-4.19.52+ \
119122
-initrd ramdisk.cpio \
@@ -125,7 +128,7 @@ is setup according to the previous SJA1000 section.
125128
-device ctucan_pci,canbus0=canbus0-bus,canbus1=canbus0-bus \
126129
-nographic
127130

128-
Setup of CTU CAN FD controller in a guest Linux system
131+
Setup of CTU CAN FD controller in a guest Linux system::
129132

130133
insmod ctucanfd.ko || modprobe ctucanfd
131134
insmod ctucanfd_pci.ko || modprobe ctucanfd_pci
@@ -150,49 +153,36 @@ Setup of CTU CAN FD controller in a guest Linux system
150153
/bin/ip link set $ifc up
151154
done
152155

153-
The test can run for example
156+
The test can run for example::
154157

155158
candump can1
156159

157-
in the guest system and next commands in the host system for basic CAN
160+
in the guest system and next commands in the host system for basic CAN::
158161

159162
cangen can0
160163

161-
for CAN FD without bitrate switch
164+
for CAN FD without bitrate switch::
162165

163166
cangen can0 -f
164167

165-
and with bitrate switch
168+
and with bitrate switch::
166169

167170
cangen can0 -b
168171

169172
The test can be run viceversa, generate messages in the guest system and capture them
170173
in the host one and much more combinations.
171174

172175
Links to other resources
173-
========================
174-
175-
(1) CAN related projects at Czech Technical University, Faculty of Electrical Engineering
176-
http://canbus.pages.fel.cvut.cz/
177-
(2) Repository with development can-pci branch at Czech Technical University
178-
https://gitlab.fel.cvut.cz/canbus/qemu-canbus
179-
(3) RTEMS page describing project
180-
https://devel.rtems.org/wiki/Developer/Simulators/QEMU/CANEmulation
181-
(4) RTLWS 2015 article about the project and its use with CANopen emulation
182-
http://cmp.felk.cvut.cz/~pisa/can/doc/rtlws-17-pisa-qemu-can.pdf
183-
(5) GNU/Linux, CAN and CANopen in Real-time Control Applications
184-
Slides from LinuxDays 2017 (include updated RTLWS 2015 content)
185-
https://www.linuxdays.cz/2017/video/Pavel_Pisa-CAN_canopen.pdf
186-
(6) Linux SocketCAN utilities
187-
https://github.com/linux-can/can-utils/
188-
(7) CTU CAN FD project including core VHDL design, Linux driver,
189-
test utilities etc.
190-
https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core
191-
(8) CTU CAN FD Core Datasheet Documentation
192-
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/Progdokum.pdf
193-
(9) CTU CAN FD Core System Architecture Documentation
194-
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/ctu_can_fd_architecture.pdf
195-
(10) CTU CAN FD Driver Documentation
196-
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/driver_doc/ctucanfd-driver.html
197-
(11) Integration with PCIe interfacing for Intel/Altera Cyclone IV based board
198-
https://gitlab.fel.cvut.cz/canbus/pcie-ctu_can_fd
176+
------------------------
177+
178+
(1) `CAN related projects at Czech Technical University, Faculty of Electrical Engineering <http://canbus.pages.fel.cvut.cz>`_
179+
(2) `Repository with development can-pci branch at Czech Technical University <https://gitlab.fel.cvut.cz/canbus/qemu-canbus>`_
180+
(3) `RTEMS page describing project <https://devel.rtems.org/wiki/Developer/Simulators/QEMU/CANEmulation>`_
181+
(4) `RTLWS 2015 article about the project and its use with CANopen emulation <http://cmp.felk.cvut.cz/~pisa/can/doc/rtlws-17-pisa-qemu-can.pdf>`_
182+
(5) `GNU/Linux, CAN and CANopen in Real-time Control Applications Slides from LinuxDays 2017 (include updated RTLWS 2015 content) <https://www.linuxdays.cz/2017/video/Pavel_Pisa-CAN_canopen.pdf>`_
183+
(6) `Linux SocketCAN utilities <https://github.com/linux-can/can-utils>`_
184+
(7) `CTU CAN FD project including core VHDL design, Linux driver, test utilities etc. <https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core>`_
185+
(8) `CTU CAN FD Core Datasheet Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/Progdokum.pdf>`_
186+
(9) `CTU CAN FD Core System Architecture Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/ctu_can_fd_architecture.pdf>`_
187+
(10) `CTU CAN FD Driver Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/driver_doc/ctucanfd-driver.html>`_
188+
(11) `Integration with PCIe interfacing for Intel/Altera Cyclone IV based board <https://gitlab.fel.cvut.cz/canbus/pcie-ctu_can_fd>`_

hw/acpi/aml-build.c

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,11 @@ static void build_processor_hierarchy_node(GArray *tbl, uint32_t flags,
20012001
void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms,
20022002
const char *oem_id, const char *oem_table_id)
20032003
{
2004-
int pptt_start = table_data->len;
2004+
MachineClass *mc = MACHINE_GET_CLASS(ms);
2005+
GQueue *list = g_queue_new();
2006+
guint pptt_start = table_data->len;
2007+
guint parent_offset;
2008+
guint length, i;
20052009
int uid = 0;
20062010
int socket;
20072011
AcpiTable table = { .sig = "PPTT", .rev = 2,
@@ -2010,9 +2014,8 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms,
20102014
acpi_table_begin(&table, table_data);
20112015

20122016
for (socket = 0; socket < ms->smp.sockets; socket++) {
2013-
uint32_t socket_offset = table_data->len - pptt_start;
2014-
int core;
2015-
2017+
g_queue_push_tail(list,
2018+
GUINT_TO_POINTER(table_data->len - pptt_start));
20162019
build_processor_hierarchy_node(
20172020
table_data,
20182021
/*
@@ -2021,35 +2024,64 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms,
20212024
*/
20222025
(1 << 0),
20232026
0, socket, NULL, 0);
2027+
}
20242028

2025-
for (core = 0; core < ms->smp.cores; core++) {
2026-
uint32_t core_offset = table_data->len - pptt_start;
2027-
int thread;
2029+
if (mc->smp_props.clusters_supported) {
2030+
length = g_queue_get_length(list);
2031+
for (i = 0; i < length; i++) {
2032+
int cluster;
2033+
2034+
parent_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
2035+
for (cluster = 0; cluster < ms->smp.clusters; cluster++) {
2036+
g_queue_push_tail(list,
2037+
GUINT_TO_POINTER(table_data->len - pptt_start));
2038+
build_processor_hierarchy_node(
2039+
table_data,
2040+
(0 << 0), /* not a physical package */
2041+
parent_offset, cluster, NULL, 0);
2042+
}
2043+
}
2044+
}
20282045

2046+
length = g_queue_get_length(list);
2047+
for (i = 0; i < length; i++) {
2048+
int core;
2049+
2050+
parent_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
2051+
for (core = 0; core < ms->smp.cores; core++) {
20292052
if (ms->smp.threads > 1) {
2053+
g_queue_push_tail(list,
2054+
GUINT_TO_POINTER(table_data->len - pptt_start));
20302055
build_processor_hierarchy_node(
20312056
table_data,
20322057
(0 << 0), /* not a physical package */
2033-
socket_offset, core, NULL, 0);
2034-
2035-
for (thread = 0; thread < ms->smp.threads; thread++) {
2036-
build_processor_hierarchy_node(
2037-
table_data,
2038-
(1 << 1) | /* ACPI Processor ID valid */
2039-
(1 << 2) | /* Processor is a Thread */
2040-
(1 << 3), /* Node is a Leaf */
2041-
core_offset, uid++, NULL, 0);
2042-
}
2058+
parent_offset, core, NULL, 0);
20432059
} else {
20442060
build_processor_hierarchy_node(
20452061
table_data,
20462062
(1 << 1) | /* ACPI Processor ID valid */
20472063
(1 << 3), /* Node is a Leaf */
2048-
socket_offset, uid++, NULL, 0);
2064+
parent_offset, uid++, NULL, 0);
20492065
}
20502066
}
20512067
}
20522068

2069+
length = g_queue_get_length(list);
2070+
for (i = 0; i < length; i++) {
2071+
int thread;
2072+
2073+
parent_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
2074+
for (thread = 0; thread < ms->smp.threads; thread++) {
2075+
build_processor_hierarchy_node(
2076+
table_data,
2077+
(1 << 1) | /* ACPI Processor ID valid */
2078+
(1 << 2) | /* Processor is a Thread */
2079+
(1 << 3), /* Node is a Leaf */
2080+
parent_offset, uid++, NULL, 0);
2081+
}
2082+
}
2083+
2084+
g_queue_free(list);
20532085
acpi_table_end(linker, &table);
20542086
}
20552087

hw/arm/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config ARM_VIRT
2828
select ACPI_HW_REDUCED
2929
select ACPI_APEI
3030
select ACPI_VIOT
31+
select VIRTIO_MEM_SUPPORTED
3132

3233
config CHEETAH
3334
bool
@@ -94,6 +95,9 @@ config MUSCA
9495
select SPLIT_IRQ
9596
select UNIMP
9697

98+
config MARVELL_88W8618
99+
bool
100+
97101
config MUSICPAL
98102
bool
99103
select OR_IRQ

hw/arm/aspeed_ast2600.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static const hwaddr aspeed_soc_ast2600_memmap[] = {
6161
[ASPEED_DEV_UART1] = 0x1E783000,
6262
[ASPEED_DEV_UART5] = 0x1E784000,
6363
[ASPEED_DEV_VUART] = 0x1E787000,
64+
[ASPEED_DEV_I3C] = 0x1E7A0000,
6465
[ASPEED_DEV_SDRAM] = 0x80000000,
6566
};
6667

@@ -108,6 +109,7 @@ static const int aspeed_soc_ast2600_irqmap[] = {
108109
[ASPEED_DEV_ETH4] = 33,
109110
[ASPEED_DEV_KCS] = 138, /* 138 -> 142 */
110111
[ASPEED_DEV_DP] = 62,
112+
[ASPEED_DEV_I3C] = 102, /* 102 -> 107 */
111113
};
112114

113115
static qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int ctrl)
@@ -223,6 +225,8 @@ static void aspeed_soc_ast2600_init(Object *obj)
223225

224226
snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
225227
object_initialize_child(obj, "hace", &s->hace, typename);
228+
229+
object_initialize_child(obj, "i3c", &s->i3c, TYPE_ASPEED_I3C);
226230
}
227231

228232
/*
@@ -523,6 +527,18 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
523527
sysbus_mmio_map(SYS_BUS_DEVICE(&s->hace), 0, sc->memmap[ASPEED_DEV_HACE]);
524528
sysbus_connect_irq(SYS_BUS_DEVICE(&s->hace), 0,
525529
aspeed_soc_get_irq(s, ASPEED_DEV_HACE));
530+
531+
/* I3C */
532+
if (!sysbus_realize(SYS_BUS_DEVICE(&s->i3c), errp)) {
533+
return;
534+
}
535+
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i3c), 0, sc->memmap[ASPEED_DEV_I3C]);
536+
for (i = 0; i < ASPEED_I3C_NR_DEVICES; i++) {
537+
qemu_irq irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore),
538+
sc->irqmap[ASPEED_DEV_I3C] + i);
539+
/* The AST2600 I3C controller has one IRQ per bus. */
540+
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i3c.devices[i]), 0, irq);
541+
}
526542
}
527543

528544
static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data)

0 commit comments

Comments
 (0)