Skip to content

Commit 7433709

Browse files
committed
Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging
Misc HW patches queue - Silent unuseful DTC warnings (Philippe) - Unify QDev hotplug decision logic (Akihiko) - Rework XilinX EthLite RAM buffers (Philippe) - Convert vmcoreinfo to 3-phase reset (Philippe) - Convert HPPA CPUs to 3-phase reset (Helge) - Fix UFS endianness issue (Keoseong) - Introduce pci_set_enabled (Akihiko) - Clarify Enclave and Firecracker relationship (Alexander) - Set SDHCI DMA interrupt status bit in correct place (Bernhard) - Fix leak in cryptodev-vhost-user backend (Gabriel) - Fixes on PCI USB XHCI (Phil) - Convert DPRINTF to trace events (Nikita, Bernhard) - Remove &first_cpu in TriCore machine (Philippe) - Checkpatch style cleanups (Bibo) - MAINTAINERS updates (Marcin, Gustavo, Akihiko) - Add default configuration for b4 tool (Jiaxun) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmeFTq0ACgkQ4+MsLN6t # wN6F2RAA0hhgXYf1BAn0DQI5O/oOzt6WzkwL/yQhKff1piWMcCZbHCOn8JHETE4R # QTqg+OMGuw4Q55YSwqwHW98JIQI/lRbSUX9Vc3km4QxED5owHiqu9wk//KSLv3TY # y86CRbibb0Uy6vEM4J1WK6ATiLePWZ6qzePQX59f9YEagTLM2XO2DasRu+wGDbt+ # 96fPnT7Tx2Bu5jU8+sZ36mw3wWSJo/pLQBE9siH4N33v2I5ntmMs1Lbe7QscDDsw # 1+OOti3lB4q5chNMYNQyPxvz75QIi9et7wREJM9Vt03OpEpj+vWMGzwZFNLfOmeu # eApgcQP/k6z1+pAGjEo5mwNOZcZtR9I/3Uf/sONvO0N5FlJq9CSOTs7L2EddcFzM # lVDZjwEHIoU1xCohqNy2A0Q1s20dNfBEjPEUCuh+tIvFk9cy1L8uZtBVFNUCb33J # Jq8KAkqXAaVj2tHGa27DwFjSTo4olU/G0WO4AQZNwdxvMQwX88gHOGMJkRmJPRVi # ErKD0/bBfVa6orEAorWYwQSnTP1H/2fGfF6rLtI5GvQtPc/jBG3+KpEOS+vc2nzG # 1fq+Kty8kWsU4Fpw3EUHvflnzG4Ujhuc/nJ+FyQhn89Erb49jxBlu25lQOLVRVa4 # gP+jsgi46+4goYzj1vrpTpBgFPFWKGCl1gGz17ij5WyvVXroRzA= # =+uup # -----END PGP SIGNATURE----- # gpg: Signature made Mon 13 Jan 2025 12:34:37 EST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <[email protected]>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'hw-misc-20250113' of https://github.com/philmd/qemu: (55 commits) Add a b4 configuration file MAINTAINERS: Update path to coreaudio.m MAINTAINERS: Add me as the maintainer for ivshmem-flat MAINTAINERS: remove myself from sbsa-ref hw/tricore/triboard: Remove unnecessary use of &first_cpu hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec backends/cryptodev-vhost-user: Fix local_error leaks hw/loongarch/virt: Checkpatch cleanup target/hppa: Speed up hppa_is_pa20() target/hppa: Set PC on vCPU reset target/hppa: Only set PSW 'M' bit on reset hw/hppa: Reset vCPUs calling resettable_reset() target/hppa: Convert hppa_cpu_init() to ResetHold handler tests: Add functional tests for HPPA machines tests/qtest/boot-serial-test: Correct HPPA machine name hw/gpio/imx_gpio: Turn DPRINTF() into trace events hw/i2c/imx_i2c: Convert DPRINTF() to trace events hw/char/imx_serial: Turn some DPRINTF() statements into trace events hw/misc/imx6_src: Convert DPRINTF() to trace events ... Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents e8aa7fd + 838cf72 commit 7433709

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+559
-311
lines changed

.b4-config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Common b4 settings that can be used to send patches to QEMU upstream.
3+
# https://b4.docs.kernel.org/
4+
#
5+
6+
[b4]
7+
send-series-to = [email protected]
8+
send-auto-to-cmd = echo
9+
send-auto-cc-cmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback
10+
am-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback -
11+
prep-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback -
12+
searchmask = https://lore.kernel.org/qemu-devel/?x=m&t=1&q=%s
13+
linkmask = https://lore.kernel.org/qemu-devel/%s
14+
linktrailermask = Message-ID: <%s>

MAINTAINERS

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ SBSA-REF
923923
M: Radoslaw Biernacki <[email protected]>
924924
M: Peter Maydell <[email protected]>
925925
R: Leif Lindholm <[email protected]>
926-
R: Marcin Juszkiewicz <[email protected]>
927926
928927
S: Maintained
929928
F: hw/arm/sbsa-ref.c
@@ -1203,6 +1202,7 @@ F: include/hw/pci-host/astro.h
12031202
F: include/hw/pci-host/dino.h
12041203
F: pc-bios/hppa-firmware.img
12051204
F: roms/seabios-hppa/
1205+
F: tests/functional/test_hppa_seabios.py
12061206

12071207
LoongArch Machines
12081208
------------------
@@ -2786,6 +2786,13 @@ F: hw/hyperv/hv-balloon*.h
27862786
F: include/hw/hyperv/dynmem-proto.h
27872787
F: include/hw/hyperv/hv-balloon.h
27882788

2789+
ivshmem-flat
2790+
M: Gustavo Romero <[email protected]>
2791+
S: Maintained
2792+
F: hw/misc/ivshmem-flat.c
2793+
F: include/hw/misc/ivshmem-flat.h
2794+
F: docs/system/devices/ivshmem-flat.rst
2795+
27892796
Subsystems
27902797
----------
27912798
Overall Audio backends
@@ -2794,7 +2801,7 @@ M: Marc-André Lureau <[email protected]>
27942801
S: Odd Fixes
27952802
F: audio/
27962803
X: audio/alsaaudio.c
2797-
X: audio/coreaudio.c
2804+
X: audio/coreaudio.m
27982805
X: audio/dsound*
27992806
X: audio/jackaudio.c
28002807
X: audio/ossaudio.c
@@ -2816,7 +2823,7 @@ M: Philippe Mathieu-Daudé <[email protected]>
28162823
R: Christian Schoenebeck <[email protected]>
28172824
R: Akihiko Odaki <[email protected]>
28182825
S: Odd Fixes
2819-
F: audio/coreaudio.c
2826+
F: audio/coreaudio.m
28202827

28212828
DSound Audio backend
28222829
M: Gerd Hoffmann <[email protected]>

backends/cryptodev-vhost-user.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ static int cryptodev_vhost_user_create_session(
281281
break;
282282

283283
default:
284-
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
285-
sess_info->op_code);
284+
error_report("Unsupported opcode :%" PRIu32 "", sess_info->op_code);
286285
return -VIRTIO_CRYPTO_NOTSUPP;
287286
}
288287

docs/system/i386/nitro-enclave.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the enclave VM gets a dynamic CID. Enclaves use an EIF (`Enclave Image Format`_)
1313
file which contains the necessary kernel, cmdline and ramdisk(s) to boot.
1414

1515
In QEMU, ``nitro-enclave`` is a machine type based on ``microvm`` similar to how
16-
AWS nitro enclaves are based on `Firecracker`_ microvm. This is useful for
16+
AWS nitro enclaves look like a `Firecracker`_ microvm. This is useful for
1717
local testing of EIF files using QEMU instead of running real AWS Nitro Enclaves
1818
which can be difficult for debugging due to its roots in security. The vsock
1919
device emulation is done using vhost-user-vsock which means another process that

hw/arm/musicpal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ static void musicpal_init(MachineState *machine)
12381238
qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL);
12391239

12401240
/* Logically OR both UART IRQs together */
1241-
uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
1241+
uart_orgate = qdev_new(TYPE_OR_IRQ);
12421242
object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
12431243
qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
12441244
qdev_connect_gpio_out(uart_orgate, 0,

hw/char/imx_serial.c

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "qemu/log.h"
2828
#include "qemu/module.h"
2929
#include "qemu/fifo32.h"
30+
#include "trace.h"
3031

3132
#ifndef DEBUG_IMX_UART
3233
#define DEBUG_IMX_UART 0
@@ -184,10 +185,10 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset,
184185
unsigned size)
185186
{
186187
IMXSerialState *s = (IMXSerialState *)opaque;
188+
Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
187189
uint32_t c, rx_used;
188190
uint8_t rxtl = s->ufcr & TL_MASK;
189-
190-
DPRINTF("read(offset=0x%" HWADDR_PRIx ")\n", offset);
191+
uint64_t value;
191192

192193
switch (offset >> 2) {
193194
case 0x0: /* URXD */
@@ -208,49 +209,67 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset,
208209
imx_serial_rx_fifo_ageing_timer_restart(s);
209210
qemu_chr_fe_accept_input(&s->chr);
210211
}
211-
return c;
212+
value = c;
213+
break;
212214

213215
case 0x20: /* UCR1 */
214-
return s->ucr1;
216+
value = s->ucr1;
217+
break;
215218

216219
case 0x21: /* UCR2 */
217-
return s->ucr2;
220+
value = s->ucr2;
221+
break;
218222

219223
case 0x25: /* USR1 */
220-
return s->usr1;
224+
value = s->usr1;
225+
break;
221226

222227
case 0x26: /* USR2 */
223-
return s->usr2;
228+
value = s->usr2;
229+
break;
224230

225231
case 0x2A: /* BRM Modulator */
226-
return s->ubmr;
232+
value = s->ubmr;
233+
break;
227234

228235
case 0x2B: /* Baud Rate Count */
229-
return s->ubrc;
236+
value = s->ubrc;
237+
break;
230238

231239
case 0x2d: /* Test register */
232-
return s->uts1;
240+
value = s->uts1;
241+
break;
233242

234243
case 0x24: /* UFCR */
235-
return s->ufcr;
244+
value = s->ufcr;
245+
break;
236246

237247
case 0x2c:
238-
return s->onems;
248+
value = s->onems;
249+
break;
239250

240251
case 0x22: /* UCR3 */
241-
return s->ucr3;
252+
value = s->ucr3;
253+
break;
242254

243255
case 0x23: /* UCR4 */
244-
return s->ucr4;
256+
value = s->ucr4;
257+
break;
245258

246259
case 0x29: /* BRM Incremental */
247-
return 0x0; /* TODO */
260+
value = 0x0; /* TODO */
261+
break;
248262

249263
default:
250264
qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
251265
HWADDR_PRIx "\n", TYPE_IMX_SERIAL, __func__, offset);
252-
return 0;
266+
value = 0;
267+
break;
253268
}
269+
270+
trace_imx_serial_read(chr ? chr->label : "NODEV", offset, value);
271+
272+
return value;
254273
}
255274

256275
static void imx_serial_write(void *opaque, hwaddr offset,
@@ -260,8 +279,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
260279
Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
261280
unsigned char ch;
262281

263-
DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
264-
offset, (unsigned int)value, chr ? chr->label : "NODEV");
282+
trace_imx_serial_write(chr ? chr->label : "NODEV", offset, value);
265283

266284
switch (offset >> 2) {
267285
case 0x10: /* UTXD */
@@ -373,9 +391,11 @@ static int imx_can_receive(void *opaque)
373391
static void imx_put_data(void *opaque, uint32_t value)
374392
{
375393
IMXSerialState *s = (IMXSerialState *)opaque;
394+
Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
376395
uint8_t rxtl = s->ufcr & TL_MASK;
377396

378-
DPRINTF("received char\n");
397+
trace_imx_serial_put_data(chr ? chr->label : "NODEV", value);
398+
379399
imx_serial_rx_fifo_push(s, value);
380400
if (fifo32_num_used(&s->rx_fifo) >= rxtl) {
381401
s->usr1 |= USR1_RRDY;

hw/char/stm32f2xx_usart.c

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,7 @@
3030
#include "qemu/log.h"
3131
#include "qemu/module.h"
3232

33-
#ifndef STM_USART_ERR_DEBUG
34-
#define STM_USART_ERR_DEBUG 0
35-
#endif
36-
37-
#define DB_PRINT_L(lvl, fmt, args...) do { \
38-
if (STM_USART_ERR_DEBUG >= lvl) { \
39-
qemu_log("%s: " fmt, __func__, ## args); \
40-
} \
41-
} while (0)
42-
43-
#define DB_PRINT(fmt, args...) DB_PRINT_L(1, fmt, ## args)
33+
#include "trace.h"
4434

4535
static int stm32f2xx_usart_can_receive(void *opaque)
4636
{
@@ -67,10 +57,11 @@ static void stm32f2xx_update_irq(STM32F2XXUsartState *s)
6757
static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size)
6858
{
6959
STM32F2XXUsartState *s = opaque;
60+
DeviceState *d = DEVICE(s);
7061

7162
if (!(s->usart_cr1 & USART_CR1_UE && s->usart_cr1 & USART_CR1_RE)) {
7263
/* USART not enabled - drop the chars */
73-
DB_PRINT("Dropping the chars\n");
64+
trace_stm32f2xx_usart_drop(d->id);
7465
return;
7566
}
7667

@@ -79,7 +70,7 @@ static void stm32f2xx_usart_receive(void *opaque, const uint8_t *buf, int size)
7970

8071
stm32f2xx_update_irq(s);
8172

82-
DB_PRINT("Receiving: %c\n", s->usart_dr);
73+
trace_stm32f2xx_usart_receive(d->id, *buf);
8374
}
8475

8576
static void stm32f2xx_usart_reset(DeviceState *dev)
@@ -101,49 +92,55 @@ static uint64_t stm32f2xx_usart_read(void *opaque, hwaddr addr,
10192
unsigned int size)
10293
{
10394
STM32F2XXUsartState *s = opaque;
104-
uint64_t retvalue;
105-
106-
DB_PRINT("Read 0x%"HWADDR_PRIx"\n", addr);
95+
DeviceState *d = DEVICE(s);
96+
uint64_t retvalue = 0;
10797

10898
switch (addr) {
10999
case USART_SR:
110100
retvalue = s->usart_sr;
111101
qemu_chr_fe_accept_input(&s->chr);
112-
return retvalue;
102+
break;
113103
case USART_DR:
114-
DB_PRINT("Value: 0x%" PRIx32 ", %c\n", s->usart_dr, (char) s->usart_dr);
115104
retvalue = s->usart_dr & 0x3FF;
116105
s->usart_sr &= ~USART_SR_RXNE;
117106
qemu_chr_fe_accept_input(&s->chr);
118107
stm32f2xx_update_irq(s);
119-
return retvalue;
108+
break;
120109
case USART_BRR:
121-
return s->usart_brr;
110+
retvalue = s->usart_brr;
111+
break;
122112
case USART_CR1:
123-
return s->usart_cr1;
113+
retvalue = s->usart_cr1;
114+
break;
124115
case USART_CR2:
125-
return s->usart_cr2;
116+
retvalue = s->usart_cr2;
117+
break;
126118
case USART_CR3:
127-
return s->usart_cr3;
119+
retvalue = s->usart_cr3;
120+
break;
128121
case USART_GTPR:
129-
return s->usart_gtpr;
122+
retvalue = s->usart_gtpr;
123+
break;
130124
default:
131125
qemu_log_mask(LOG_GUEST_ERROR,
132126
"%s: Bad offset 0x%"HWADDR_PRIx"\n", __func__, addr);
133127
return 0;
134128
}
135129

136-
return 0;
130+
trace_stm32f2xx_usart_read(d->id, size, addr, retvalue);
131+
132+
return retvalue;
137133
}
138134

139135
static void stm32f2xx_usart_write(void *opaque, hwaddr addr,
140136
uint64_t val64, unsigned int size)
141137
{
142138
STM32F2XXUsartState *s = opaque;
139+
DeviceState *d = DEVICE(s);
143140
uint32_t value = val64;
144141
unsigned char ch;
145142

146-
DB_PRINT("Write 0x%" PRIx32 ", 0x%"HWADDR_PRIx"\n", value, addr);
143+
trace_stm32f2xx_usart_write(d->id, size, addr, val64);
147144

148145
switch (addr) {
149146
case USART_SR:

hw/char/trace-events

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ escc_sunkbd_event_out(int ch) "Translated keycode 0x%2.2x"
5252
escc_kbd_command(int val) "Command %d"
5353
escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=0x%01x"
5454

55+
# imx_serial.c
56+
imx_serial_read(const char *chrname, uint64_t addr, uint64_t value) "%s:[0x%03" PRIu64 "] -> 0x%08" PRIx64
57+
imx_serial_write(const char *chrname, uint64_t addr, uint64_t value) "%s:[0x%03" PRIu64 "] <- 0x%08" PRIx64
58+
imx_serial_put_data(const char *chrname, uint32_t value) "%s: 0x%" PRIx32
59+
5560
# pl011.c
5661
pl011_irq_state(int level) "irq state %d"
5762
pl011_read(uint32_t addr, uint32_t value, const char *regname) "addr 0x%03x value 0x%08x reg %s"
@@ -125,3 +130,9 @@ xen_console_unrealize(unsigned int idx) "idx %u"
125130
xen_console_realize(unsigned int idx, const char *chrdev) "idx %u chrdev %s"
126131
xen_console_device_create(unsigned int idx) "idx %u"
127132
xen_console_device_destroy(unsigned int idx) "idx %u"
133+
134+
# stm32f2xx_usart.c
135+
stm32f2xx_usart_read(char *id, unsigned size, uint64_t ofs, uint64_t val) " %s size %d ofs 0x%02" PRIx64 " -> 0x%02" PRIx64
136+
stm32f2xx_usart_write(char *id, unsigned size, uint64_t ofs, uint64_t val) "%s size %d ofs 0x%02" PRIx64 " <- 0x%02" PRIx64
137+
stm32f2xx_usart_drop(char *id) " %s dropping the chars"
138+
stm32f2xx_usart_receive(char *id, uint8_t chr) " %s receiving '%c'"

0 commit comments

Comments
 (0)