[Qemu-devel] [Bug 1771570] Re: qemu-aarch64 $program > $file doesn't pipe output to file in 2.12.0
This issue is now marked as invalid, sorry for the trouble. qemu works just fine. The problem was with my linker configuration, it was using a different dynamic library for aarch64. Switching to a standard development stack solved my problem. ** Changed in: qemu Status: New => Invalid -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1771570 Title: qemu-aarch64 $program > $file doesn't pipe output to file in 2.12.0 Status in QEMU: Invalid Bug description: Running qemu-aarch64 $program > $file doesn't pipe anything to $file. The file is created but empty. qemu-aarch64 --help > $file works, so piping output in my system seems to work. qemu-x86_64 $program > $file works, too. I'm running version 2.12.0 build from source with ./configure && make Output of uname -a: Linux zhostname> 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1771570/+subscriptions
Re: [Qemu-devel] [PATCH v2 1/1] sandbox: disable -sandbox if CONFIG_SECCOMP undefined
在 2018/5/18 下午9:07, Ján Tomko 写道: On Fri, May 18, 2018 at 11:19:16AM +0200, Eduardo Otubo wrote: On 18/05/2018 - 09:52:12, Ján Tomko wrote: On Thu, May 17, 2018 at 02:41:09PM +0200, Eduardo Otubo wrote: > On 15/05/2018 - 19:33:48, Yi Min Zhao wrote: > > If CONFIG_SECCOMP is undefined, the option 'elevateprivileges' remains > > compiled. This would make libvirt set the corresponding capability and > > then trigger the guest startup fails. So this patch excludes the code > > regarding seccomp staff if CONFIG_SECCOMP is undefined. > > Just a sugestion for the next patch you send: If it's a single patch, you don't > need to format it with a cover-letter. Just put all the description in the body, > or if you need to add a text that shouldn't be included in the commit message, > just add it after the "---" after Signed-off-by. > > > > > Signed-off-by: Yi Min Zhao > > --- > > vl.c | 13 - > > 1 file changed, 8 insertions(+), 5 deletions(-) > > [...] Current libvirt logic assumes the -sandbox option is always present. (IIRC it was introduced in QEMU 1.1 and when we switched from help scraping to capability probing via QMP for QEMU 1.2, there was no way to detect it) This patch fixes the usage of QEMU new enough for seccomp blacklist (where libvirt enables the sandbox by default), but breaks the usage of QEMU with compiled out sandbox and setting seccomp_sandbox = 0 in libvirt's qemu.conf: error: internal error: process exited while connecting to monitor: qemu-git: -sandbox off: There is no option group 'sandbox' But now libvirt requires QEMU >= 1.5.0 which already supports query-command-line-options, so if you want the option gone completely --without-seccomp, I can add the code that probes for it and make seccomp_sandbox = 0 a no-op if it's compiled out. This looks like a good solution for the libvirt side. Can you add this support so we can merge this fix? Patches proposed: https://www.redhat.com/archives/libvir-list/2018-May/msg01430.html Jano Thanks for your work!
[Qemu-devel] [PATCH v3 0/8] linux-user: move socket.h definitions to CPU directories
Splitting out socket.h definitions helps to read the code and to fix the bugs... No code change, except for the last one that ports definitions from linux for sparc as the values are not the correct ones. v3: - rework ppc/sockbits.h to include generic/sockbits.h and to redefine needed values only. - fix definition of TARGET_SOCK_NONBLOCK in linux-user/socket.h v2: - move generic socket.h to generic/sockbits.h and include this file from arch without specific values - for ppc, only define the values that differ and include generic/sockbits.h - update ARCH_HAS_SOCKET_TYPES use to be like in the kernel - define TARGET_SO_REUSEPORT Laurent Vivier (8): linux-user: move mips socket.h definitions to mips/sockbits.h linux-user: move alpha socket.h definitions to alpha/sockbits.h linux-user: move sparc/sparc64 socket.h definitions to sparc/sockbits.h linux-user: move socket.h generic definitions to generic/sockbits.h linux-user: move ppc socket.h definitions to ppc/sockbits.h linux-user: update ARCH_HAS_SOCKET_TYPES use linux-user: copy sparc/sockbits.h definitions from linux linux-user: define TARGET_SO_REUSEPORT linux-user/aarch64/sockbits.h| 1 + linux-user/alpha/sockbits.h | 83 + linux-user/arm/sockbits.h| 1 + linux-user/cris/sockbits.h | 1 + linux-user/generic/sockbits.h| 58 ++ linux-user/hppa/sockbits.h | 33 +--- linux-user/i386/sockbits.h | 1 + linux-user/m68k/sockbits.h | 1 + linux-user/microblaze/sockbits.h | 1 + linux-user/mips/sockbits.h | 110 linux-user/mips64/sockbits.h | 1 + linux-user/nios2/sockbits.h | 1 + linux-user/openrisc/sockbits.h | 1 + linux-user/ppc/sockbits.h| 26 +++ linux-user/riscv/sockbits.h | 1 + linux-user/s390x/sockbits.h | 1 + linux-user/sh4/sockbits.h| 1 + linux-user/socket.h | 377 --- linux-user/sparc/sockbits.h | 111 linux-user/sparc64/sockbits.h| 1 + linux-user/tilegx/sockbits.h | 1 + linux-user/x86_64/sockbits.h | 1 + linux-user/xtensa/sockbits.h | 1 + 23 files changed, 443 insertions(+), 371 deletions(-) create mode 100644 linux-user/aarch64/sockbits.h create mode 100644 linux-user/alpha/sockbits.h create mode 100644 linux-user/arm/sockbits.h create mode 100644 linux-user/cris/sockbits.h create mode 100644 linux-user/generic/sockbits.h create mode 100644 linux-user/i386/sockbits.h create mode 100644 linux-user/m68k/sockbits.h create mode 100644 linux-user/microblaze/sockbits.h create mode 100644 linux-user/mips/sockbits.h create mode 100644 linux-user/mips64/sockbits.h create mode 100644 linux-user/nios2/sockbits.h create mode 100644 linux-user/openrisc/sockbits.h create mode 100644 linux-user/ppc/sockbits.h create mode 100644 linux-user/riscv/sockbits.h create mode 100644 linux-user/s390x/sockbits.h create mode 100644 linux-user/sh4/sockbits.h create mode 100644 linux-user/sparc/sockbits.h create mode 100644 linux-user/sparc64/sockbits.h create mode 100644 linux-user/tilegx/sockbits.h create mode 100644 linux-user/x86_64/sockbits.h create mode 100644 linux-user/xtensa/sockbits.h -- 2.14.3
[Qemu-devel] [PATCH v3 2/8] linux-user: move alpha socket.h definitions to alpha/sockbits.h
No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/alpha/sockbits.h | 113 linux-user/socket.h | 106 + 2 files changed, 114 insertions(+), 105 deletions(-) create mode 100644 linux-user/alpha/sockbits.h diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h new file mode 100644 index 00..4db3e52b67 --- /dev/null +++ b/linux-user/alpha/sockbits.h @@ -0,0 +1,113 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef ALPHA_SOCKBITS_H +#define ALPHA_SOCKBITS_H + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 0x + +#define TARGET_SO_DEBUG 0x0001 +#define TARGET_SO_REUSEADDR 0x0004 +#define TARGET_SO_KEEPALIVE 0x0008 +#define TARGET_SO_DONTROUTE 0x0010 +#define TARGET_SO_BROADCAST 0x0020 +#define TARGET_SO_LINGER0x0080 +#define TARGET_SO_OOBINLINE 0x0100 +/* To add :#define TARGET_SO_REUSEPORT 0x0200 */ + +#define TARGET_SO_TYPE 0x1008 +#define TARGET_SO_ERROR 0x1007 +#define TARGET_SO_SNDBUF0x1001 +#define TARGET_SO_RCVBUF0x1002 +#define TARGET_SO_SNDBUFFORCE 0x100a +#define TARGET_SO_RCVBUFFORCE 0x100b +#define TARGET_SO_RCVLOWAT 0x1010 +#define TARGET_SO_SNDLOWAT 0x1011 +#define TARGET_SO_RCVTIMEO 0x1012 +#define TARGET_SO_SNDTIMEO 0x1013 +#define TARGET_SO_ACCEPTCONN0x1014 +#define TARGET_SO_PROTOCOL 0x1028 +#define TARGET_SO_DOMAIN0x1029 + +/* linux-specific, might as well be the same as on i386 */ +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_BSDCOMPAT 14 + +#define TARGET_SO_PASSCRED 17 +#define TARGET_SO_PEERCRED 18 +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER26 +#define TARGET_SO_DETACH_FILTER27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define TARGET_SCM_TIMESTAMPTARGET_SO_TIMESTAMP + +#define TARGET_SO_PEERSEC 30 +#define TARGET_SO_PASSSEC 34 +#define TARGET_SO_TIMESTAMPNS 35 +#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 19 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 21 + +#define TARGET_SO_MARK 36 + +#define TARGET_SO_TIMESTAMPING 37 +#define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING + +#define TARGET_SO_RXQ_OVFL 40 + +#define TARGET_SO_WIFI_STATUS 41 +#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS +#define TARGET_SO_PEEK_OFF 42 + +/* Instruct lower device to use last 4-bytes of skb data as FCS */ +#define TARGET_SO_NOFCS 43 + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons ALPHA has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + *For writing rarp and other similar things on the user + *level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_STREAM = 1, + TARGET_SOCK_DGRAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP= 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 01000, + TARGET_SOCK_NONBLOCK= 0100, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#endif diff --git a/linux-user/socket.h b/linux-user/socket.h index 9c57da7a61..1328906205 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,110 +1,6 @@ -#if defined(TARGET_MIPS) || defined(TARGET_HPPA) +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) #include "sockbits.h" -#elif defined(TARGET_ALPHA) - -/* For setsockopt(2) */ -#define TARGET_SOL_SOCKET 0x - -#define TARGET_SO_DEBUG 0x0001 -#define TARGET_SO_REUSEADDR 0x0004 -#define TARGET_SO_KEEPALIVE 0x0008 -#define TARGET_SO_DONTROUTE 0x0010 -#define TARGET_SO
[Qemu-devel] [PATCH v3 1/8] linux-user: move mips socket.h definitions to mips/sockbits.h
No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/mips/sockbits.h | 110 +++ linux-user/mips64/sockbits.h | 1 + linux-user/socket.h | 106 + 3 files changed, 113 insertions(+), 104 deletions(-) create mode 100644 linux-user/mips/sockbits.h create mode 100644 linux-user/mips64/sockbits.h diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h new file mode 100644 index 00..3fe5ac88e7 --- /dev/null +++ b/linux-user/mips/sockbits.h @@ -0,0 +1,110 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef MIPS_SOCKBITS_H +#define MIPS_SOCKBITS_H +/* MIPS special values for constants */ + +/* + * For setsockopt(2) + * + * This defines are ABI conformant as far as Linux supports these ... + */ +#define TARGET_SOL_SOCKET 0x + +#define TARGET_SO_DEBUG0x0001 /* Record debugging information. */ +#define TARGET_SO_REUSEADDR0x0004 /* Allow reuse of local addresses. */ +#define TARGET_SO_KEEPALIVE0x0008 /* Keep connections alive and send + SIGPIPE when they die. */ +#define TARGET_SO_DONTROUTE0x0010 /* Don't do local routing. */ +#define TARGET_SO_BROADCAST0x0020 /* Allow transmission of + broadcast messages. */ +#define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable +* socket to transmit pending data. +*/ +#define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. +*/ +#if 0 +/* To add: Allow local address and port reuse. */ +#define TARGET_SO_REUSEPORT 0x0200 +#endif + +#define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ +#define TARGET_SO_STYLESO_TYPE /* Synonym */ +#define TARGET_SO_ERROR0x1007 /* get error status and clear */ +#define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */ +#define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */ +#define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ +#define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ +#define TARGET_SO_ACCEPTCONN 0x1009 + +/* linux-specific, might as well be the same as on i386 */ +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_BSDCOMPAT14 + +#define TARGET_SO_PASSCRED 17 +#define TARGET_SO_PEERCRED 18 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER26 +#define TARGET_SO_DETACH_FILTER27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP29 +#define SCM_TIMESTAMP SO_TIMESTAMP + +#define TARGET_SO_PEERSEC 30 +#define TARGET_SO_SNDBUFFORCE 31 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_PASSSEC 34 + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons MIPS has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + *For writing rarp and other similar things on the user + *level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_DGRAM = 1, + TARGET_SOCK_STREAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP= 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 0200, + TARGET_SOCK_NONBLOCK= 0200, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#endif diff
[Qemu-devel] [PATCH v3 3/8] linux-user: move sparc/sparc64 socket.h definitions to sparc/sockbits.h
No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/socket.h | 44 +--- linux-user/sparc/sockbits.h | 94 +++ linux-user/sparc64/sockbits.h | 1 + 3 files changed, 97 insertions(+), 42 deletions(-) create mode 100644 linux-user/sparc/sockbits.h create mode 100644 linux-user/sparc64/sockbits.h diff --git a/linux-user/socket.h b/linux-user/socket.h index 1328906205..8eb62ea3f2 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,49 +1,9 @@ -#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) || \ +defined(TARGET_SPARC) #include "sockbits.h" -#else - -#if defined(TARGET_SPARC) -/** sock_type - Socket types - * - * Please notice that for binary compat reasons SPARC has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - *For writing rarp and other similar things on the user - *level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - -#define ARCH_HAS_SOCKET_TYPES 1 - -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP= 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 02000, - TARGET_SOCK_NONBLOCK= 04, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ - -#define TARGET_SO_PASSSEC31 #else #define TARGET_SO_PASSSEC34 -#endif /* For setsockopt(2) */ #define TARGET_SOL_SOCKET 1 diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h new file mode 100644 index 00..385061c8b0 --- /dev/null +++ b/linux-user/sparc/sockbits.h @@ -0,0 +1,94 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef SPARC_SOCKBITS_H +#define SPARC_SOCKBITS_H + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons SPARC has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + *For writing rarp and other similar things on the user + *level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_STREAM = 1, + TARGET_SOCK_DGRAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP= 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 02000, + TARGET_SOCK_NONBLOCK= 04, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ + +#define TARGET_SO_PASSSEC31 + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 1 + +#define TARGET_SO_DEBUG1 +#define TARGET_SO_REUSEADDR2 +#define TARGET_SO_TYPE 3 +#define TARGET_SO_ERROR4 +#define TARGET_SO_DONTROUTE5 +#define TARGET_SO_BROADCAST6 +#define TARGET_SO_SNDBUF 7 +#define TARGET_SO_RCVBUF 8 +#define TARGET_SO_SNDBUFFORCE 32 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_KEEPALIVE9 +#define TARGET_SO_OOBINLINE10 +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_LINGER 13 +#define TARGET_SO_BSDCOMPAT14 +/* To add :#define TARGET_SO_REUSEPORT 1
[Qemu-devel] [PATCH v3 7/8] linux-user: copy sparc/sockbits.h definitions from linux
Values defined for sparc are not correct. Copy the content of "arch/sparc/include/uapi/asm/socket.h" to fix them. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell --- linux-user/sparc/sockbits.h | 131 +++- 1 file changed, 92 insertions(+), 39 deletions(-) diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h index 6434b07033..0a822e3e1f 100644 --- a/linux-user/sparc/sockbits.h +++ b/linux-user/sparc/sockbits.h @@ -8,51 +8,104 @@ #ifndef SPARC_SOCKBITS_H #define SPARC_SOCKBITS_H -#define TARGET_SO_PASSSEC31 - /* For setsockopt(2) */ -#define TARGET_SOL_SOCKET 1 - -#define TARGET_SO_DEBUG1 -#define TARGET_SO_REUSEADDR2 -#define TARGET_SO_TYPE 3 -#define TARGET_SO_ERROR4 -#define TARGET_SO_DONTROUTE5 -#define TARGET_SO_BROADCAST6 -#define TARGET_SO_SNDBUF 7 -#define TARGET_SO_RCVBUF 8 -#define TARGET_SO_SNDBUFFORCE 32 -#define TARGET_SO_RCVBUFFORCE 33 -#define TARGET_SO_KEEPALIVE9 -#define TARGET_SO_OOBINLINE10 -#define TARGET_SO_NO_CHECK 11 -#define TARGET_SO_PRIORITY 12 -#define TARGET_SO_LINGER 13 -#define TARGET_SO_BSDCOMPAT14 -/* To add :#define TARGET_SO_REUSEPORT 15 */ -#define TARGET_SO_PASSCRED 16 -#define TARGET_SO_PEERCRED 17 -#define TARGET_SO_RCVLOWAT 18 -#define TARGET_SO_SNDLOWAT 19 -#define TARGET_SO_RCVTIMEO 20 -#define TARGET_SO_SNDTIMEO 21 +#define TARGET_SOL_SOCKET 0x -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define TARGET_SO_SECURITY_AUTHENTICATION 22 -#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT23 -#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 +#define TARGET_SO_DEBUG0x0001 +#define TARGET_SO_PASSCRED 0x0002 +#define TARGET_SO_REUSEADDR0x0004 +#define TARGET_SO_KEEPALIVE0x0008 +#define TARGET_SO_DONTROUTE0x0010 +#define TARGET_SO_BROADCAST0x0020 +#define TARGET_SO_PEERCRED 0x0040 +#define TARGET_SO_LINGER 0x0080 +#define TARGET_SO_OOBINLINE0x0100 +#define TARGET_SO_REUSEPORT0x0200 +#define TARGET_SO_BSDCOMPAT0x0400 +#define TARGET_SO_RCVLOWAT 0x0800 +#define TARGET_SO_SNDLOWAT 0x1000 +#define TARGET_SO_RCVTIMEO 0x2000 +#define TARGET_SO_SNDTIMEO 0x4000 +#define TARGET_SO_ACCEPTCONN 0x8000 + +#define TARGET_SO_SNDBUF 0x1001 +#define TARGET_SO_RCVBUF 0x1002 +#define TARGET_SO_SNDBUFFORCE 0x100a +#define TARGET_SO_RCVBUFFORCE 0x100b +#define TARGET_SO_ERROR0x1007 +#define TARGET_SO_TYPE 0x1008 +#define TARGET_SO_PROTOCOL 0x1028 +#define TARGET_SO_DOMAIN 0x1029 + +/* Linux specific, keep the same. */ +#define TARGET_SO_NO_CHECK 0x000b +#define TARGET_SO_PRIORITY 0x000c -#define TARGET_SO_BINDTODEVICE 25 +#define TARGET_SO_BINDTODEVICE 0x000d -/* Socket filtering */ -#define TARGET_SO_ATTACH_FILTER26 -#define TARGET_SO_DETACH_FILTER27 +#define TARGET_SO_ATTACH_FILTER0x001a +#define TARGET_SO_DETACH_FILTER0x001b +#define TARGET_SO_GET_FILTER TARGET_SO_ATTACH_FILTER -#define TARGET_SO_PEERNAME 28 -#define TARGET_SO_TIMESTAMP29 +#define TARGET_SO_PEERNAME 0x001c +#define TARGET_SO_TIMESTAMP0x001d #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP -#define TARGET_SO_ACCEPTCONN 30 +#define TARGET_SO_PEERSEC 0x001e +#define TARGET_SO_PASSSEC 0x001f +#define TARGET_SO_TIMESTAMPNS 0x0021 +#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS + +#define TARGET_SO_MARK 0x0022 + +#define TARGET_SO_TIMESTAMPING 0x0023 +#define TARGET_SCM_TIMESTAMPINGTARGET_SO_TIMESTAMPING + +#define TARGET_SO_RXQ_OVFL 0x0024 + +#define TARGET_SO_WIFI_STATUS 0x0025 +#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS +#define TARGET_SO_PEEK_OFF 0x0026 + +/* Instruct lower device to use last 4-bytes of skb data as FCS */ +#define TARGET_SO_NOFCS0x0027 + +#define TARGET_SO_LOCK_FILTER 0x0028 + +#define TARGET_SO_SELECT_ERR_QUEUE 0x0029 + +#define TARGET_SO_BUSY_POLL0x0030 + +#define TARGET_SO_MAX_PACING_RATE 0x0031 -#define TARGET_SO_PEERSEC 31 +#define TARGET_SO_BPF_EXTENSIONS 0x0032 + +#define TARGET_SO_INCOMING_CPU 0x0033 + +#define TARGET_SO_ATTACH_BPF 0x0034 +#define TARGET_SO_DETACH_BPF TARGET_SO_DETACH_FILTER + +#define TARGET_SO_ATTACH_REUSEPORT_CBPF0x0035 +#define TARGET_SO_ATTACH_REUSEPORT_EBPF0x0036 + +#define TARGET_SO_CNX_ADVICE 0x0037 + +#define TARGET_SCM_TIMESTAMPING_OPT_STATS 0x0038 + +#define TARGET_SO_MEMINFO 0x0039 + +#define TARGET_SO_INCOMING_NAPI_ID 0x003a + +#define TARGET_SO_COOKIE 0x003b + +#define TARGET_SCM_TIMESTAMPING_PKTINFO0x00
[Qemu-devel] [PATCH v3 8/8] linux-user: define TARGET_SO_REUSEPORT
Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé --- linux-user/alpha/sockbits.h | 2 +- linux-user/generic/sockbits.h | 2 +- linux-user/mips/sockbits.h| 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h index f5397dd875..d54dc98c09 100644 --- a/linux-user/alpha/sockbits.h +++ b/linux-user/alpha/sockbits.h @@ -18,7 +18,7 @@ #define TARGET_SO_BROADCAST 0x0020 #define TARGET_SO_LINGER0x0080 #define TARGET_SO_OOBINLINE 0x0100 -/* To add :#define TARGET_SO_REUSEPORT 0x0200 */ +#define TARGET_SO_REUSEPORT 0x0200 #define TARGET_SO_TYPE 0x1008 #define TARGET_SO_ERROR 0x1007 diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index 99505f1f85..e44733c601 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -29,7 +29,7 @@ #define TARGET_SO_PRIORITY 12 #define TARGET_SO_LINGER 13 #define TARGET_SO_BSDCOMPAT14 -/* To add :#define TARGET_SO_REUSEPORT 15 */ +#define TARGET_SO_REUSEPORT15 #define TARGET_SO_PASSCRED 16 #define TARGET_SO_PEERCRED 17 #define TARGET_SO_RCVLOWAT 18 diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 370d13ed86..0f022cd598 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -28,10 +28,7 @@ */ #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */ -#if 0 -/* To add: Allow local address and port reuse. */ #define TARGET_SO_REUSEPORT 0x0200 -#endif #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ #define TARGET_SO_STYLESO_TYPE /* Synonym */ -- 2.14.3
[Qemu-devel] [PATCH v3 6/8] linux-user: update ARCH_HAS_SOCKET_TYPES use
to be like in the kernel and rename it TARGET_ARCH_HAS_SOCKET_TYPES Signed-off-by: Laurent Vivier --- linux-user/alpha/sockbits.h | 36 +++--- linux-user/hppa/sockbits.h | 33 +++- linux-user/mips/sockbits.h | 9 --- linux-user/socket.h | 62 +++-- linux-user/sparc/sockbits.h | 36 -- 5 files changed, 44 insertions(+), 132 deletions(-) diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h index 4db3e52b67..f5397dd875 100644 --- a/linux-user/alpha/sockbits.h +++ b/linux-user/alpha/sockbits.h @@ -75,39 +75,9 @@ /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define TARGET_SO_NOFCS 43 -/** sock_type - Socket types - * - * Please notice that for binary compat reasons ALPHA has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - *For writing rarp and other similar things on the user - *level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. +/* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefore we + * have to define SOCK_NONBLOCK to a different value here. */ +#define TARGET_SOCK_NONBLOCK 0x4000 -#define ARCH_HAS_SOCKET_TYPES 1 - -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP= 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 01000, - TARGET_SOCK_NONBLOCK= 0100, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ #endif diff --git a/linux-user/hppa/sockbits.h b/linux-user/hppa/sockbits.h index 5044619e16..2641aea859 100644 --- a/linux-user/hppa/sockbits.h +++ b/linux-user/hppa/sockbits.h @@ -64,34 +64,7 @@ #define TARGET_SO_CNX_ADVICE 0x402E -/** sock_type - Socket types - default values - * - * - * @SOCK_STREAM - stream (connection) socket - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - *For writing rarp and other similar things on the user - *level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. +/* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefore we + * have to define SOCK_NONBLOCK to a different value here. */ -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP= 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 01000, - TARGET_SOCK_NONBLOCK= 0x4000, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ - -#define ARCH_HAS_SOCKET_TYPES 1 +#define TARGET_SOCK_NONBLOCK 0x4000 diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 3fe5ac88e7..370d13ed86 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -91,7 +91,7 @@ * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. */ -#define ARCH_HAS_SOCKET_TYPES 1 +#define TARGET_ARCH_HAS_SOCKET_TYPES 1 enum sock_type { TARGET_SOCK_DGRAM = 1, @@ -101,10 +101,13 @@ enum sock_type { TARGET_SOCK_SEQPACKET = 5, TARGET_SOCK_DCCP= 6, TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 0200, - TARGET_SOCK_NONBLOCK= 0200, }; #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) #define TARGET_SOCK_TYPE_MASK0xf /* Covers up to TARGET_SOCK_MAX-1. */ + +/* Flags for socket, socketpair, paccept */ +#define TARGET_SOCK_CLOEXECTARGET_O_CLOEXEC +#define TARGET_SOCK_NONBLOCK TARGET_O_NONBLOCK + #endif diff --git a/linux-user/socket.h b/linux-user/socket.h index 135f438bdf..4c0b5c2dfa 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,35 +1,37 @@ - #include "sockbits.h" -#ifndef ARCH_HAS_SOCKET_TYPES -/** sock_type - Socket type
[Qemu-devel] [PATCH v3 4/8] linux-user: move socket.h generic definitions to generic/sockbits.h
and include the file from architectures without specific definitions Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell --- linux-user/aarch64/sockbits.h| 1 + linux-user/arm/sockbits.h| 1 + linux-user/cris/sockbits.h | 1 + linux-user/generic/sockbits.h| 67 linux-user/i386/sockbits.h | 1 + linux-user/m68k/sockbits.h | 1 + linux-user/microblaze/sockbits.h | 1 + linux-user/nios2/sockbits.h | 1 + linux-user/openrisc/sockbits.h | 1 + linux-user/ppc/sockbits.h| 1 + linux-user/riscv/sockbits.h | 1 + linux-user/s390x/sockbits.h | 1 + linux-user/sh4/sockbits.h| 1 + linux-user/socket.h | 61 linux-user/tilegx/sockbits.h | 1 + linux-user/x86_64/sockbits.h | 1 + linux-user/xtensa/sockbits.h | 1 + 17 files changed, 82 insertions(+), 61 deletions(-) create mode 100644 linux-user/aarch64/sockbits.h create mode 100644 linux-user/arm/sockbits.h create mode 100644 linux-user/cris/sockbits.h create mode 100644 linux-user/generic/sockbits.h create mode 100644 linux-user/i386/sockbits.h create mode 100644 linux-user/m68k/sockbits.h create mode 100644 linux-user/microblaze/sockbits.h create mode 100644 linux-user/nios2/sockbits.h create mode 100644 linux-user/openrisc/sockbits.h create mode 100644 linux-user/ppc/sockbits.h create mode 100644 linux-user/riscv/sockbits.h create mode 100644 linux-user/s390x/sockbits.h create mode 100644 linux-user/sh4/sockbits.h create mode 100644 linux-user/tilegx/sockbits.h create mode 100644 linux-user/x86_64/sockbits.h create mode 100644 linux-user/xtensa/sockbits.h diff --git a/linux-user/aarch64/sockbits.h b/linux-user/aarch64/sockbits.h new file mode 100644 index 00..0e4c8f012d --- /dev/null +++ b/linux-user/aarch64/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/arm/sockbits.h b/linux-user/arm/sockbits.h new file mode 100644 index 00..0e4c8f012d --- /dev/null +++ b/linux-user/arm/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/cris/sockbits.h b/linux-user/cris/sockbits.h new file mode 100644 index 00..0e4c8f012d --- /dev/null +++ b/linux-user/cris/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h new file mode 100644 index 00..093faf0a48 --- /dev/null +++ b/linux-user/generic/sockbits.h @@ -0,0 +1,67 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef GENERIC_SOCKBITS_H +#define GENERIC_SOCKBITS_H + +#define TARGET_SO_PASSSEC34 + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 1 + +#define TARGET_SO_DEBUG1 +#define TARGET_SO_REUSEADDR2 +#define TARGET_SO_TYPE 3 +#define TARGET_SO_ERROR4 +#define TARGET_SO_DONTROUTE5 +#define TARGET_SO_BROADCAST6 +#define TARGET_SO_SNDBUF 7 +#define TARGET_SO_RCVBUF 8 +#define TARGET_SO_SNDBUFFORCE 32 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_KEEPALIVE9 +#define TARGET_SO_OOBINLINE10 +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_LINGER 13 +#define TARGET_SO_BSDCOMPAT14 +/* To add :#define TARGET_SO_REUSEPORT 15 */ +#if defined(TARGET_PPC) +#define TARGET_SO_RCVLOWAT 16 +#define TARGET_SO_SNDLOWAT 17 +#define TARGET_SO_RCVTIMEO 18 +#define TARGET_SO_SNDTIMEO 19 +#define TARGET_SO_PASSCRED 20 +#define TARGET_SO_PEERCRED 21 +#else +#define TARGET_SO_PASSCRED 16 +#define TARGET_SO_PEERCRED 17 +#define TARGET_SO_RCVLOWAT 18 +#define TARGET_SO_SNDLOWAT 19 +#define TARGET_SO_RCVTIMEO 20 +#define TARGET_SO_SNDTIMEO 21 +#endif + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER26 +#define TARGET_SO_DETACH_FILTER27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP29 +#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP + +#define TARGET_SO_ACCEPTCONN 30 + +#define TARGET_SO_PEERSEC 31 +#endif diff --git a/linux-user/i386/sockbits.h b/linux-user/i386/sockbits.h new file mode 100644 index 00..0e4c8f012d --- /dev/null +++ b/linux-user/i386/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/m68k/sockbits.h b/linux-user/m68k/soc
[Qemu-devel] [PATCH v3 5/8] linux-user: move ppc socket.h definitions to ppc/sockbits.h
Change conditional #ifdef part by #undef of the symbols redefined for PPC relative to generic/socket.h Signed-off-by: Laurent Vivier --- linux-user/generic/sockbits.h | 9 - linux-user/ppc/sockbits.h | 25 + 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index 093faf0a48..99505f1f85 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -30,21 +30,12 @@ #define TARGET_SO_LINGER 13 #define TARGET_SO_BSDCOMPAT14 /* To add :#define TARGET_SO_REUSEPORT 15 */ -#if defined(TARGET_PPC) -#define TARGET_SO_RCVLOWAT 16 -#define TARGET_SO_SNDLOWAT 17 -#define TARGET_SO_RCVTIMEO 18 -#define TARGET_SO_SNDTIMEO 19 -#define TARGET_SO_PASSCRED 20 -#define TARGET_SO_PEERCRED 21 -#else #define TARGET_SO_PASSCRED 16 #define TARGET_SO_PEERCRED 17 #define TARGET_SO_RCVLOWAT 18 #define TARGET_SO_SNDLOWAT 19 #define TARGET_SO_RCVTIMEO 20 #define TARGET_SO_SNDTIMEO 21 -#endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define TARGET_SO_SECURITY_AUTHENTICATION 22 diff --git a/linux-user/ppc/sockbits.h b/linux-user/ppc/sockbits.h index 0e4c8f012d..ee453347a3 100644 --- a/linux-user/ppc/sockbits.h +++ b/linux-user/ppc/sockbits.h @@ -1 +1,26 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef PPC_SOCKBITS_H +#define PPC_SOCKBITS_H + #include "../generic/sockbits.h" + +#undef TARGET_SO_RCVLOWAT +#define TARGET_SO_RCVLOWAT 16 +#undef TARGET_SO_SNDLOWAT +#define TARGET_SO_SNDLOWAT 17 +#undef TARGET_SO_RCVTIMEO +#define TARGET_SO_RCVTIMEO 18 +#undef TARGET_SO_SNDTIMEO +#define TARGET_SO_SNDTIMEO 19 +#undef TARGET_SO_PASSCRED +#define TARGET_SO_PASSCRED 20 +#undef TARGET_SO_PEERCRED +#define TARGET_SO_PEERCRED 21 + +#endif -- 2.14.3
[Qemu-devel] [PATCH] cirrus: format code
replace tab with spaces and fix some comments Signed-off-by: zhenwei pi --- hw/display/cirrus_vga.c | 1662 +++ 1 file changed, 831 insertions(+), 831 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 138ae96..6319889 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -76,12 +76,12 @@ #define CIRRUS_MEMSIZE_512k0x08 #define CIRRUS_MEMSIZE_1M 0x10 #define CIRRUS_MEMSIZE_2M 0x18 -#define CIRRUS_MEMFLAGS_BANKSWITCH 0x80// bank switching is enabled. +#define CIRRUS_MEMFLAGS_BANKSWITCH 0x80// bank switching is enabled. // sequencer 0x12 #define CIRRUS_CURSOR_SHOW 0x01 #define CIRRUS_CURSOR_HIDDENPEL0x02 -#define CIRRUS_CURSOR_LARGE0x04// 64x64 if set, 32x32 if clear +#define CIRRUS_CURSOR_LARGE0x04// 64x64 if set, 32x32 if clear // sequencer 0x17 #define CIRRUS_BUSTYPE_VLBFAST 0x10 @@ -89,12 +89,12 @@ #define CIRRUS_BUSTYPE_VLBSLOW 0x30 #define CIRRUS_BUSTYPE_ISA 0x38 #define CIRRUS_MMIO_ENABLE 0x04 -#define CIRRUS_MMIO_USE_PCIADDR 0x40 // 0xb8000 if cleared. +#define CIRRUS_MMIO_USE_PCIADDR 0x40 // 0xb8000 if cleared. #define CIRRUS_MEMSIZEEXT_DOUBLE 0x80 // control 0x0b #define CIRRUS_BANKING_DUAL 0x01 -#define CIRRUS_BANKING_GRANULARITY_16K 0x20 // set:16k, clear:4k +#define CIRRUS_BANKING_GRANULARITY_16K 0x20 // set:16k, clear:4k // control 0x30 #define CIRRUS_BLTMODE_BACKWARDS0x01 @@ -143,43 +143,43 @@ #define CIRRUS_BLTMODEEXT_DWORDGRANULARITY 0x01 // memory-mapped IO -#define CIRRUS_MMIO_BLTBGCOLOR0x00 // dword -#define CIRRUS_MMIO_BLTFGCOLOR0x04 // dword -#define CIRRUS_MMIO_BLTWIDTH 0x08 // word -#define CIRRUS_MMIO_BLTHEIGHT 0x0a // word -#define CIRRUS_MMIO_BLTDESTPITCH 0x0c // word -#define CIRRUS_MMIO_BLTSRCPITCH 0x0e // word -#define CIRRUS_MMIO_BLTDESTADDR 0x10 // dword -#define CIRRUS_MMIO_BLTSRCADDR0x14 // dword -#define CIRRUS_MMIO_BLTWRITEMASK 0x17 // byte -#define CIRRUS_MMIO_BLTMODE 0x18 // byte -#define CIRRUS_MMIO_BLTROP0x1a // byte -#define CIRRUS_MMIO_BLTMODEEXT0x1b // byte -#define CIRRUS_MMIO_BLTTRANSPARENTCOLOR 0x1c // word? -#define CIRRUS_MMIO_BLTTRANSPARENTCOLORMASK 0x20 // word? -#define CIRRUS_MMIO_LINEARDRAW_START_X 0x24// word -#define CIRRUS_MMIO_LINEARDRAW_START_Y 0x26// word -#define CIRRUS_MMIO_LINEARDRAW_END_X 0x28 // word -#define CIRRUS_MMIO_LINEARDRAW_END_Y 0x2a // word -#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_INC 0x2c // byte -#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ROLLOVER 0x2d // byte -#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_MASK 0x2e // byte -#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ACCUM 0x2f// byte -#define CIRRUS_MMIO_BRESENHAM_K1 0x30 // word -#define CIRRUS_MMIO_BRESENHAM_K3 0x32 // word -#define CIRRUS_MMIO_BRESENHAM_ERROR 0x34 // word -#define CIRRUS_MMIO_BRESENHAM_DELTA_MAJOR 0x36 // word -#define CIRRUS_MMIO_BRESENHAM_DIRECTION 0x38 // byte -#define CIRRUS_MMIO_LINEDRAW_MODE 0x39 // byte -#define CIRRUS_MMIO_BLTSTATUS 0x40 // byte +#define CIRRUS_MMIO_BLTBGCOLOR0x00// dword +#define CIRRUS_MMIO_BLTFGCOLOR0x04// dword +#define CIRRUS_MMIO_BLTWIDTH 0x08// word +#define CIRRUS_MMIO_BLTHEIGHT 0x0a// word +#define CIRRUS_MMIO_BLTDESTPITCH 0x0c// word +#define CIRRUS_MMIO_BLTSRCPITCH 0x0e// word +#define CIRRUS_MMIO_BLTDESTADDR 0x10// dword +#define CIRRUS_MMIO_BLTSRCADDR0x14// dword +#define CIRRUS_MMIO_BLTWRITEMASK 0x17// byte +#define CIRRUS_MMIO_BLTMODE 0x18// byte +#define CIRRUS_MMIO_BLTROP0x1a// byte +#define CIRRUS_MMIO_BLTMODEEXT0x1b// byte +#define CIRRUS_MMIO_BLTTRANSPARENTCOLOR 0x1c // word? +#define CIRRUS_MMIO_BLTTRANSPARENTCOLORMASK 0x20 // word? +#define CIRRUS_MMIO_LINEARDRAW_START_X 0x24 // word +#define CIRRUS_MMIO_LINEARDRAW_START_Y 0x26 // word +#define CIRRUS_MMIO_LINEARDRAW_END_X 0x28// word +#define CIRRUS_MMIO_LINEARDRAW_END_Y 0x2a// word +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_INC 0x2c // byte +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ROLLOVER 0x2d// byte +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_MASK 0x2e// byte +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ACCUM 0x2f // byte +#define CIRRUS_MMIO_BRESENHAM_K1 0x30// word +#define CIRRUS_MMIO_BRESENHAM_K3 0x32// word +#define CIRRUS_MMIO_BRESENHAM_ERROR 0x34
Re: [Qemu-devel] [PATCH] cirrus: format code
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1526725312-32767-1-git-send-email-zhenwei...@youruncloud.com Subject: [Qemu-devel] [PATCH] cirrus: format code === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log --oneline $BASE.. | wc -l) failed=0 git config --local diff.renamelimit 0 git config --local diff.renames True git config --local diff.algorithm histogram commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..." if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then failed=1 echo fi n=$((n+1)) done exit $failed === TEST SCRIPT END === Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 From https://github.com/patchew-project/qemu * [new tag] patchew/1526725312-32767-1-git-send-email-zhenwei...@youruncloud.com -> patchew/1526725312-32767-1-git-send-email-zhenwei...@youruncloud.com Switched to a new branch 'test' 3c6433c293 cirrus: format code === OUTPUT BEGIN === Checking PATCH 1/1: cirrus: format code... ERROR: do not use C99 // comments #20: FILE: hw/display/cirrus_vga.c:79: +#define CIRRUS_MEMFLAGS_BANKSWITCH 0x80// bank switching is enabled. ERROR: do not use C99 // comments #26: FILE: hw/display/cirrus_vga.c:84: +#define CIRRUS_CURSOR_LARGE0x04// 64x64 if set, 32x32 if clear ERROR: do not use C99 // comments #35: FILE: hw/display/cirrus_vga.c:92: +#define CIRRUS_MMIO_USE_PCIADDR 0x40 // 0xb8000 if cleared. ERROR: do not use C99 // comments #41: FILE: hw/display/cirrus_vga.c:97: +#define CIRRUS_BANKING_GRANULARITY_16K 0x20 // set:16k, clear:4k ERROR: do not use C99 // comments #78: FILE: hw/display/cirrus_vga.c:146: +#define CIRRUS_MMIO_BLTBGCOLOR0x00// dword ERROR: do not use C99 // comments #79: FILE: hw/display/cirrus_vga.c:147: +#define CIRRUS_MMIO_BLTFGCOLOR0x04// dword ERROR: do not use C99 // comments #80: FILE: hw/display/cirrus_vga.c:148: +#define CIRRUS_MMIO_BLTWIDTH 0x08// word ERROR: do not use C99 // comments #81: FILE: hw/display/cirrus_vga.c:149: +#define CIRRUS_MMIO_BLTHEIGHT 0x0a// word ERROR: do not use C99 // comments #82: FILE: hw/display/cirrus_vga.c:150: +#define CIRRUS_MMIO_BLTDESTPITCH 0x0c// word ERROR: do not use C99 // comments #83: FILE: hw/display/cirrus_vga.c:151: +#define CIRRUS_MMIO_BLTSRCPITCH 0x0e// word ERROR: do not use C99 // comments #84: FILE: hw/display/cirrus_vga.c:152: +#define CIRRUS_MMIO_BLTDESTADDR 0x10// dword ERROR: do not use C99 // comments #85: FILE: hw/display/cirrus_vga.c:153: +#define CIRRUS_MMIO_BLTSRCADDR0x14// dword ERROR: do not use C99 // comments #86: FILE: hw/display/cirrus_vga.c:154: +#define CIRRUS_MMIO_BLTWRITEMASK 0x17// byte ERROR: do not use C99 // comments #87: FILE: hw/display/cirrus_vga.c:155: +#define CIRRUS_MMIO_BLTMODE 0x18// byte ERROR: do not use C99 // comments #88: FILE: hw/display/cirrus_vga.c:156: +#define CIRRUS_MMIO_BLTROP0x1a// byte ERROR: do not use C99 // comments #89: FILE: hw/display/cirrus_vga.c:157: +#define CIRRUS_MMIO_BLTMODEEXT0x1b// byte ERROR: do not use C99 // comments #90: FILE: hw/display/cirrus_vga.c:158: +#define CIRRUS_MMIO_BLTTRANSPARENTCOLOR 0x1c // word? ERROR: do not use C99 // comments #91: FILE: hw/display/cirrus_vga.c:159: +#define CIRRUS_MMIO_BLTTRANSPARENTCOLORMASK 0x20 // word? ERROR: do not use C99 // comments #92: FILE: hw/display/cirrus_vga.c:160: +#define CIRRUS_MMIO_LINEARDRAW_START_X 0x24 // word ERROR: do not use C99 // comments #93: FILE: hw/display/cirrus_vga.c:161: +#define CIRRUS_MMIO_LINEARDRAW_START_Y 0x26 // word ERROR: do not use C99 // comments #94: FILE: hw/display/cirrus_vga.c:162: +#define CIRRUS_MMIO_LINEARDRAW_END_X 0x28// word ERROR: do not use C99 // comments #95: FILE: hw/display/cirrus_vga.c:163: +#define CIRRUS_MMIO_LINEARDRAW_END_Y 0x2a// word ERROR: do not use C99 // comments #96: FILE: hw/display/cirrus_vga.c:164: +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_INC 0x2c // byte ERROR: do not use C99 // comments #97: FILE: hw/display/cirrus_vga.c:165: +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ROLLOVER 0x2d// byte ERROR: do not use C99 // comments #98: FILE: hw/display/cirrus_vga.c:166: +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_MASK 0x2e// byte ERROR: do not use C99 // comments #99: FILE: hw/display/cirrus_vga.c:167: +#define CIRRUS_MMIO_LINEARDRAW_LINESTYLE_ACCUM 0x2f // byte ERROR: do not use C99 // comments #100: FILE: hw/display/cirrus_vga.c:168: +#define CIRRUS_MMIO_BRE
Re: [Qemu-devel] [RFC PATCH 2/2] tests/Makefile: comment out flakey tests
On 19 May 2018 at 07:10, Thomas Huth wrote: > On 18.05.2018 20:31, Peter Maydell wrote: >> Another flaky test for the collection: >> >> TEST: tests/boot-serial-test... (pid=25144) >> /sparc64/boot-serial/sun4u: ** >> ERROR:/home/petmay01/linaro/qemu-for-merges/tests/boot-serial-test.c:140:check_guest_output: >> assertion failed: (output_ok) >> FAIL >> >> Probably another "overly optimistic timeout" setting. (Failed >> for me on x86-64 host just now.) > > That test normally finishes within 3 seconds on my machine. The test > timeout is 60 seconds. How much load did you have on that machine to go > from 3s to 60s ? The machine is my desktop box; I didn't notice anything too terrible while I was using it interactively at the same time the test build was running. The test build will run at -j8; it might also have been during a different -j8 build/test on the same machine for a different source tree. 60s is quite a long time, so maybe there's an intermittent deadlock in there instead... thanks -- PMM
[Qemu-devel] [Bug 1772165] [NEW] qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Public bug reported: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. ** Affects: qemu Importance: Undecided Status: New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Can you give the full QEMU command line you're using? (I suspect the reason for this error is that the board model you're using does not have a USB controller.) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
qemu-system-arm -M raspi2 -append "rw earlyprintk loglevel=8 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2" -cpu arm1176 -dtb bcm2709-rpi-2-b.dtb -hda DietPi_v6.8_RPi-ARMv6-Stretch.img -kernel kernel7.img -m 1G -smp 4 -serial stdio -usb -device usb- host,bus=001,vendorid=0x1d6b,productid=0x0002 ** Tags added: usb -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772166] [NEW] qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’
Public bug reported: Trying to compile qemu release 2.4.1 Getting compile error user-exec.c: In function ‘cpu_resume_from_signal’: user-exec.c:72:37: error: dereferencing pointer to incomplete type ‘struct ucontext’ sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); ^~ user-exec.c: In function ‘cpu_arm_signal_handler’: user-exec.c:214:41: error: dereferencing pointer to incomplete type ‘struct ucontext’ ** Affects: qemu Importance: Undecided Status: New ** Tags: 2.4.1 ** Tags added: 2.4.1 -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772166 Title: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’ Status in QEMU: New Bug description: Trying to compile qemu release 2.4.1 Getting compile error user-exec.c: In function ‘cpu_resume_from_signal’: user-exec.c:72:37: error: dereferencing pointer to incomplete type ‘struct ucontext’ sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); ^~ user-exec.c: In function ‘cpu_arm_signal_handler’: user-exec.c:214:41: error: dereferencing pointer to incomplete type ‘struct ucontext’ To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772166/+subscriptions
Re: [Qemu-devel] [Qemu-ppc] [PPC64] P5020DS: Booting from img possible (-drive)?
On 19 May 2018 at 08:15AM, Thomas Huth wrote: On 19.05.2018 06:58, Christian Zigotzky wrote: Thomas wrote: No clue, so just a blind guess: Is "CoreNet Generic" the right machine? What happens if you set "CONFIG_CORENET_GENERIC=n" in your kernel config? I think it‘s the right machine. It's likely the right selection for the real hardware, but it's maybe the wrong machine type for the QEMU ppce500 machine. Thomas Hello Thomas, Thanks for your reply. I compiled the RC5 of kernel 4.17 without corenet generic support today. ubuntu MATE 16.04 LTS PowerPC boots! qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -nographic -kernel /home/christian/Downloads/uImage-4.17-without_corenet -drive file=/home/christian/Dokumente/ubuntu_MATE_16.04.3_LTS_PowerPC_QEMU/ubuntu_MATE_16.04_PowerPC.img,index=0,if=virtio -net nic,vlan=0,model=e1000 -net user,vlan=0 -append "rw root=/dev/vda3" With the following command I can boot it with a VirtIO graphics cards. qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -kernel /home/christian/Downloads/uImage-4.17-without_corenet -drive file=/home/christian/Dokumente/ubuntu_MATE_16.04.3_LTS_PowerPC_QEMU/ubuntu_MATE_16.04_PowerPC.img,index=0,if=virtio -net nic,vlan=0,model=e1000 -net user,vlan=0 -append "rw root=/dev/vda3" -device virtio-vga Unfortunately mouse and keyboard doesn't work in the virtual machine. Many thanks for your help! :-) Have a nice weekend! :-) Cheers, Christian
Re: [Qemu-devel] [Qemu-ppc] [PPC64] P5020DS: Booting from img possible (-drive)?
Am Sat, 19 May 2018 16:03:02 +0200 schrieb Christian Zigotzky : > On 19 May 2018 at 08:15AM, Thomas Huth wrote: > > On 19.05.2018 06:58, Christian Zigotzky wrote: > >> Thomas wrote: > >> > >>> No clue, so just a blind guess: Is "CoreNet Generic" the right > >>> machine? What happens if you set "CONFIG_CORENET_GENERIC=n" in > >>> your kernel config? > >> I think it‘s the right machine. > > It's likely the right selection for the real hardware, but it's > > maybe the wrong machine type for the QEMU ppce500 machine. > > > > Thomas > > > Hello Thomas, > > Thanks for your reply. I compiled the RC5 of kernel 4.17 without > corenet generic support today. ubuntu MATE 16.04 LTS PowerPC > boots! Cool! :-) > With the following command I can boot it with a VirtIO graphics cards. > > qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -kernel > /home/christian/Downloads/uImage-4.17-without_corenet -drive > file=/home/christian/Dokumente/ubuntu_MATE_16.04.3_LTS_PowerPC_QEMU/ubuntu_MATE_16.04_PowerPC.img,index=0,if=virtio > > -net nic,vlan=0,model=e1000 -net user,vlan=0 -append "rw > root=/dev/vda3" -device virtio-vga Note that "vlan=0" won't work with the next version (2.13) of QEMU anymore. But since that's the default, you can simply omit that "vlan=0" in both -net options. Or if you are using the latest and greatest QEMU v2.12 already, you can also use "-nic user,model=e1000" instead. > Unfortunately mouse and keyboard doesn't work in the virtual machine. I guess with the ppce500 machine, you've also got to specify them manually, too. You've got two options, virtio and USB. For virtio, try: -device virtio-mouse-pci -device virtio-keyboard-pci And for USB, try something like: -device qemu-xhci -device usb-mouse -device usb-kbd If "qemu-xhci" does not work, you could also try "pci-ohci" instead. HTH, Thomas
[Qemu-devel] [Bug 1772166] Re: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’
2.4.1 is a very old release of QEMU. I would recommend moving to a more recent release. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772166 Title: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’ Status in QEMU: New Bug description: Trying to compile qemu release 2.4.1 Getting compile error user-exec.c: In function ‘cpu_resume_from_signal’: user-exec.c:72:37: error: dereferencing pointer to incomplete type ‘struct ucontext’ sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); ^~ user-exec.c: In function ‘cpu_arm_signal_handler’: user-exec.c:214:41: error: dereferencing pointer to incomplete type ‘struct ucontext’ To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772166/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Thanks. The USB controller for the raspi2/raspi3 boards is not currently modelled, so it's expected that USB devices won't work. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772166] Re: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’
I need this for raspberry pi emulation and the most recent doesn't work as you can see from my other bug post. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772166 Title: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’ Status in QEMU: New Bug description: Trying to compile qemu release 2.4.1 Getting compile error user-exec.c: In function ‘cpu_resume_from_signal’: user-exec.c:72:37: error: dereferencing pointer to incomplete type ‘struct ucontext’ sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); ^~ user-exec.c: In function ‘cpu_arm_signal_handler’: user-exec.c:214:41: error: dereferencing pointer to incomplete type ‘struct ucontext’ To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772166/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
How then should I be able to actually use the vm when there is no input? -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Serial terminal is how I've used the raspi3 board before. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772166] Re: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’
QEMU 2.4 is from 2015, and we didn't add raspi2 support until 2016. We've never supported the USB controller for the raspi boards. Perhaps you're using some other fork of QEMU? If so, better to talk to whoever's responsible for it. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772166 Title: qemu 2.4.1: dereferencing pointer to incomplete type ‘struct ucontext’ Status in QEMU: New Bug description: Trying to compile qemu release 2.4.1 Getting compile error user-exec.c: In function ‘cpu_resume_from_signal’: user-exec.c:72:37: error: dereferencing pointer to incomplete type ‘struct ucontext’ sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); ^~ user-exec.c: In function ‘cpu_arm_signal_handler’: user-exec.c:214:41: error: dereferencing pointer to incomplete type ‘struct ucontext’ To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772166/+subscriptions
[Qemu-devel] [Bug 1772075] Re: Segmentation fault on aarch64 vm at powerdown
This bug is present also on AARCH32, ARMv7 architectures -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772075 Title: Segmentation fault on aarch64 vm at powerdown Status in QEMU: New Bug description: OS Arch Linux x86_64 qemu version: 2.12 cmdline: qemu-system-aarch64 -nographic -cpu cortex-a57 -m 2048 -M virt,gic_version=3 -machine virtualization=true -bios /usr/share/ovmf/AARCH64/QEMU_EFI.fd -drive file=fat:rw:/opt/simonpiemu/kernels/rpi-3,if=none,format=raw,cache=none,id=hd0 -device virtio-blk-device,drive=hd0 -drive file=/home/morfeo/.simonpi/sd-arch-rpi-3-qemu.img,if=none,format=raw,cache=none,id=hd1 -device virtio-blk-device,drive=hd1 -kernel /opt/simonpiemu/kernels/rpi-3/Image -append "root=/dev/vda2 fstab=no rootfstype=ext4 rw console=ttyAMA0" -initrd /home/morfeo/.simonpi/rpi-3/boot/initramfs-linux.img -device virtio-net-device,mac=52:54:26:11:72:9b,netdev=net0 -netdev tap,id=net0,ifname=rasp-tap0,script=no,downscript=no error: qemu-system-aarch64: /build/qemu/src/qemu-2.12.0/block.c:3375: bdrv_close_all: Assertion `QTAILQ_EMPTY(&all_bdrv_states)' failed. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772075/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Serial terminal doesn't work with this options. Would you provide options with which i'll be able to access and login into the terminal. SSH is also a good solution. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
This is for raspi3 but may be a useful reference: https://translatedcode.wordpress.com/2018/04/25/debian-on-qemus-raspberry-pi-3-model/ Probably what you're hitting is that the kernel/dtb default to the second serial terminal, so you can try adding 'console=ttyAMA0' to the -append options, or alternatively maybe using -serial null -serial stdio to drop the 1st serial output and send the second to the terminal. Since the raspi networking sits behind USB, QEMU doesn't support that, so no ssh option, I'm afraid. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
[Qemu-devel] megasas & scsi-disk - interesting I/O errors
Hello. I've an interesting case here with megasas virtual device. TL;DR see summary at the end. Initially I were testing a backport of CVE-2017-9503 fix to qemu 2.8.1 (which is in debian stable), and while testing I found out that the last patch from the fix makes megasas- attached storage device to be malfunctioning in windows10. Copying files from it quite soon makes any I/O operation to return "invalid parameter" error, with a lot of events from "disk" subsystem in windows event log, like this: Found an error at device \Device\Harddisk0\DR0 during page i/o request (translated from ru, might be not exact) Xml события: http://schemas.microsoft.com/win/2004/08/events/event";> 51 3 0 0x80 591 System DESKTOP-KEG4VT4 \Device\Harddisk0\DR0 04008100330004802D010EC0C300010058080001FD200A128201204000103CA0838F88E4B899548F88E4C007298E88E4A8F22A08F2A80800 I enabled megasas tracing but weren't able to trigger the prob when tracing is turned on. So I _guess_ it is timing-related, but who knows. Only the last patch in the CVE-2017-9503 patches triggers the problem. Reverting it makes guest work just fine, with one interesting issue: there are _still_ 2 errors logged like that, followed by 2 warnings from ntfs telling us it can't write journal data and the filesystem might become corrupt (the same ntfs messages are logged with that patch applied, too). The patch in question is this one: commit 87e459a810d7b1ec1638085b5a80ea3d9b43119a Author: Paolo Bonzini Date: Thu Jun 1 17:26:14 2017 +0200 megasas: always store SCSIRequest* into MegasasCmd This ensures that the request is unref'ed properly, and avoids a segmentation fault in the new qtest testcase that is added. This is CVE-2017-9503. Reported-by: Zhangyanyu Signed-off-by: Paolo Bonzini Now the more interesting stuff. I noticed that ubuntu also applied the same CVE-2017-9503 fixes but on top of 2.8.0 version. So I tested their qemu and found out that it works. So there's one change in 2.8.1 which "helps" to trigger the error condition: it is this change: commit 1f8af0d186abf9ef775a74d41bf2852ed8d59b63 Author: Paolo Bonzini Date: Tue Jan 3 18:20:28 2017 +0100 scsi-block: fix direction of BYTCHK test for VERIFY commands The direction is wrong; scsi_block_is_passthrough returns false for commands that *can* use sglists. Reported-by: Zhang Qian Fixes: 8fdc7839e40f43a426bc7e858cf1dbfe315a3804 Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2701,7 +2701,7 @@ static bool scsi_block_is_passthrough(SCSIDiskState *s, uint8_t *buf) * for the number of logical blocks specified in the length * field). For other modes, do not use scatter/gather operation. */ -if ((buf[1] & 6) != 2) { +if ((buf[1] & 6) == 2) { return false; } break; Reverting this one change from 2.8.1 makes the prob to go away (with CVE-2017-9503 fixes applied). Now the more interesting thing: this problem is also present in current 2.12.0 version and in all versions between 2.9 and 2.12... To sum it all up: 2.8.0 + CVE-2017-9503 fix 87e459a810d = one or two i/o error 2.8.0 + CVE-2017-9503 fix 87e459a810d + 1f8af0d186abf9e = hdd unusable up to current 2.12 = hdd unusable but depends on timings up to current 2.12 with tracing = one or two i/o error There's obviously something fishy going on here. I'd love to hear some suggestions/hints about possible ways to debug this. BTW, 2.12 is quite "stally", so to say, in various I/O operations, to the point where working in win10 guest becomes almost impossible - i/o stalls for 20..120 seconds every few minutes (cpu works, I can move windows, spinners are spinning etc, until somethin else hits i/o too). Besides that it is also generally slower. I'll try to bisect that later. Also while trying to find where the prob has been introduced I found out an interesting pair of patches in this CVE-2017-9503 series. See this commit 36c327a69d723571f02a7691631667cdb1865ee1 Author: Paolo Bonzini Date: Thu Jun 1 17:23:13 2017 +0200 megasas: do not read command more than once from frame Avoid TOC-TOU bugs by passing the frame_cmd down, and checking cmd->dcmd_opcode instead of cmd->frame->header.frame_cmd. Signed-off-by: Paolo Bonzini around trace_megasas_handle_scsi call: trace_megasas_handle_scsi(mfi_frame_desc[cmd->frame->header.frame_cmd], - is_logical, cmd->frame->header.target_id, +trace_megasas_handle_scsi(mfi_frame_desc[frame_cmd], is_logical, + cmd->frame->header.target_i
[Qemu-devel] [Bug 1772165] Re: qemu-system-arm: -device usb-host, bus=001, vendorid=0x04f2, productid=0x0111: Bus '001' not found
Whenever I append `console=ttyAMA0` I get kernel panic `Division by zero in kernel` and -serial stdio doen't seem to work. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1772165 Title: qemu-system-arm: -device usb- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found Status in QEMU: New Bug description: Using Qemu 2.12.0 on ArchLinux. Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using ` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 ` # lsusb returns Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 014: ID 13d3:3487 IMC Networks Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp. Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp. Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub # qemu returns qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found Tried with connecting external usb keyboard but that didn't seem to work either. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1772165/+subscriptions
Re: [Qemu-devel] [PATCH v3 0/2] Nios II generic board config and semihosting support
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: cover.1526671191.git.jul...@codesourcery.com Subject: [Qemu-devel] [PATCH v3 0/2] Nios II generic board config and semihosting support === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log --oneline $BASE.. | wc -l) failed=0 git config --local diff.renamelimit 0 git config --local diff.renames True git config --local diff.algorithm histogram commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..." if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then failed=1 echo fi n=$((n+1)) done exit $failed === TEST SCRIPT END === Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test' 659c5a97f6 Add Nios II semihosting support. c917ea3908 Add generic Nios II board. === OUTPUT BEGIN === Checking PATCH 1/2: Add generic Nios II board ERROR: code indent should never use tabs #38: FILE: hw/nios2/boot.c:143: +^Iint kernel_space = 0;$ ERROR: code indent should never use tabs #46: FILE: hw/nios2/boot.c:158: +^Ikernel_space = 1;$ ERROR: code indent should never use tabs #52: FILE: hw/nios2/boot.c:163: +^I+ (entry & 0x07ff);$ WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #57: new file mode 100644 ERROR: do not use C99 // comments #175: FILE: hw/nios2/generic_nommu.c:114: +cpu->reset_addr = 0xd000; //0xd400; ERROR: do not use C99 // comments #177: FILE: hw/nios2/generic_nommu.c:116: +cpu->fast_tlb_miss_addr = 0x7fff400; //0xc100; total: 5 errors, 1 warnings, 150 lines checked Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. Checking PATCH 2/2: Add Nios II semihosting support WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #105: new file mode 100644 ERROR: braces {} are necessary for all arms of this statement #194: FILE: target/nios2/nios2-semi.c:85: +if (flags & GDB_O_WRONLY) [...] +else if (flags & GDB_O_RDWR) [...] +else [...] ERROR: braces {} are necessary for all arms of this statement #196: FILE: target/nios2/nios2-semi.c:87: +else if (flags & GDB_O_RDWR) [...] +else [...] ERROR: trailing statements should be on next line #201: FILE: target/nios2/nios2-semi.c:92: +if (flags & GDB_O_APPEND) hf |= O_APPEND; ERROR: braces {} are necessary for all arms of this statement #201: FILE: target/nios2/nios2-semi.c:92: +if (flags & GDB_O_APPEND) hf |= O_APPEND; [...] ERROR: trailing statements should be on next line #202: FILE: target/nios2/nios2-semi.c:93: +if (flags & GDB_O_CREAT) hf |= O_CREAT; ERROR: braces {} are necessary for all arms of this statement #202: FILE: target/nios2/nios2-semi.c:93: +if (flags & GDB_O_CREAT) hf |= O_CREAT; [...] ERROR: trailing statements should be on next line #203: FILE: target/nios2/nios2-semi.c:94: +if (flags & GDB_O_TRUNC) hf |= O_TRUNC; ERROR: braces {} are necessary for all arms of this statement #203: FILE: target/nios2/nios2-semi.c:94: +if (flags & GDB_O_TRUNC) hf |= O_TRUNC; [...] ERROR: trailing statements should be on next line #204: FILE: target/nios2/nios2-semi.c:95: +if (flags & GDB_O_EXCL) hf |= O_EXCL; ERROR: braces {} are necessary for all arms of this statement #204: FILE: target/nios2/nios2-semi.c:95: +if (flags & GDB_O_EXCL) hf |= O_EXCL; [...] WARNING: line over 80 characters #209: FILE: target/nios2/nios2-semi.c:100: +static void translate_stat(CPUNios2State *env, target_ulong addr, struct stat *s) ERROR: do not use assignment in if condition #213: FILE: target/nios2/nios2-semi.c:104: +if (!(p = lock_user(VERIFY_WRITE, addr, sizeof(struct nios2_gdb_stat), 0))) WARNING: line over 80 characters #238: FILE: target/nios2/nios2-semi.c:129: +static void nios2_semi_return_u32(CPUNios2State *env, uint32_t ret, uint32_t err) WARNING: line over 80 characters #252: FILE: target/nios2/nios2-semi.c:143: +static void nios2_semi_return_u64(CPUNios2State *env, uint64_t ret, uint32_t err) ERROR: do not use assignment in if condition #493: FILE: target/nios2/nios2-semi.c:384: +if (!(p = lock_user(VERIFY_WRITE, ERROR: line over 90 characters #533: FILE: target/nios2/nios2-semi.c:424: +cpu_abort(CPU(nios2_env_get_cpu(env)), "Unsupported semihosting syscall %d\n", nr); total: 13 errors, 4 warnings, 498 lines checked Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. === OUTPUT END === Test command exited with code: 1 --- Email generated automatically by Patchew [http://patchew.org/]. Please send your feedback to patchew-de...@redhat.com
[Qemu-devel] [PATCH] Remove unwanted crlf conversion in serial
Signed-off-by: Patryk Olszewski --- chardev/char-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-serial.c b/chardev/char-serial.c index feb52e5..ae548d2 100644 --- a/chardev/char-serial.c +++ b/chardev/char-serial.c @@ -139,7 +139,7 @@ static void tty_serial_init(int fd, int speed, tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); -tty.c_oflag |= OPOST; +tty.c_oflag &= ~OPOST; tty.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG); tty.c_cflag &= ~(CSIZE | PARENB | PARODD | CRTSCTS | CSTOPB); switch (data_bits) { -- 2.7.4
Re: [Qemu-devel] OpenRISC - SPR_PICMR always 'OR-ing' the values
On Sat, May 19, 2018 at 08:08:47PM -0300, Davidson Francis wrote: > Hello Stafford, > > I'm currently using or1k as a target CPU in an operating system that > I'm working. > It happens that I'm having some issues regarding the PICMR register: I realize > that in the latest Qemu version (2.12) when I write into PICMR, the Qemu is > actually 'OR-ing' the values (as I could note in target/openrisc/sys_helper.c > file), so I can't mask an already enabled interrupt. > > I don't know if this behaviour is expected and if so, I'm sorry, but this does > not occurs in the or1ksim, so I thought this could be might an issue. Hello, thanks for pointing this out. It looks wrong to me too. Have you tested changing it to just `env->picmr = rb;`? -Stafford
[Qemu-devel] [PATCH] qemu-option-trace: -trace enable= is a pattern, not a file
Signed-off-by: Michael Tokarev --- qemu-option-trace.texi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-option-trace.texi b/qemu-option-trace.texi index 4166d5cdc2..7d1b7f05c5 100644 --- a/qemu-option-trace.texi +++ b/qemu-option-trace.texi @@ -2,9 +2,8 @@ Specify tracing options. @table @option @item [enable=]@var{pattern} -Immediately enable events matching @var{pattern}. -The file must contain one event name (as listed in the @file{trace-events-all} -file) per line; globbing patterns are accepted too. This option is only +Immediately enable events matching @var{pattern} +(either event name or a globbing pattern). This option is only available if QEMU has been compiled with the @var{simple}, @var{log} or @var{ftrace} tracing backend. To specify multiple events or patterns, specify the @option{-trace} option multiple times. -- 2.11.0
[Qemu-devel] [PULL 01/22] tcg: fix s/compliment/complement/ typos
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Michael Tokarev --- target/i386/translate.c | 2 +- target/m68k/translate.c | 2 +- tcg/README | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index b0f69838f2..7c21814676 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -113,7 +113,7 @@ typedef struct DisasContext { int rex_x, rex_b; #endif int vex_l; /* vex vector length */ -int vex_v; /* vex register, without 1's compliment. */ +int vex_v; /* vex register, without 1's complement. */ int ss32; /* 32 bit stack segment */ CCOp cc_op; /* current CC operation */ bool cc_op_dirty; diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 44a0ac4e2e..8959e4d0f0 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4002,7 +4002,7 @@ DISAS_INSN(bfext_reg) TCGv shift; /* In general, we're going to rotate the field so that it's at the - top of the word and then right-shift by the compliment of the + top of the word and then right-shift by the complement of the width to extend the field. */ if (ext & 0x20) { /* Variable width. */ diff --git a/tcg/README b/tcg/README index a5237a9edb..d22ee084b8 100644 --- a/tcg/README +++ b/tcg/README @@ -561,7 +561,7 @@ E.g. VECL=1 -> 64 << 1 -> v128, and VECE=2 -> 1 << 2 -> i32. * orc_vec v0, v1, v2 * not_vec v0, v1 - Similarly, logical operations with and without compliment. + Similarly, logical operations with and without complement. Note that VECE is unused. * shli_vec v0, v1, i2 -- 2.11.0
[Qemu-devel] [PULL 02/22] misc, ide: remove use of HWADDR_PRIx in trace events
From: Daniel P. Berrangé The trace events all use a uint64_t data type, so should be using the corresponding PRIx64 format, not HWADDR_PRIx which is intended for use with the 'hwaddr' type. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- hw/ide/trace-events | 4 ++-- hw/misc/trace-events | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/trace-events b/hw/ide/trace-events index 0c39cabe72..5c0e59ec42 100644 --- a/hw/ide/trace-events +++ b/hw/ide/trace-events @@ -108,8 +108,8 @@ ahci_dma_prepare_buf_fail(void *s, int port) "ahci(%p)[%d]: sglist population fa ahci_dma_rw_buf(void *s, int port, int l) "ahci(%p)[%d] len=0x%x" ahci_cmd_done(void *s, int port) "ahci(%p)[%d]: cmd done" ahci_reset(void *s) "ahci(%p): HBA reset" -allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" -allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" +allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d" +allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d" # Warning: Verbose handle_reg_h2d_fis_dump(void *s, int port, const char *fis) "ahci(%p)[%d]: %s" diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 562d9ed005..ec5a9f0da1 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -69,13 +69,13 @@ mps2_fpgaio_reset(void) "MPS2 FPGAIO: reset" mps2_fpgaio_leds(char led1, char led0) "MPS2 FPGAIO LEDs: %c%c" # hw/misc/msf2-sysreg.c -msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" HWADDR_PRIx " data 0x%" PRIx32 " prev 0x%" PRIx32 -msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" HWADDR_PRIx " data 0x%08" PRIx32 +msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" PRIx64 " data 0x%" PRIx32 " prev 0x%" PRIx32 +msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" PRIx64 " data 0x%08" PRIx32 msf2_sysreg_write_pll_status(void) "Invalid write to read only PLL status register" #hw/misc/imx7_gpr.c -imx7_gpr_read(uint64_t offset) "addr 0x%08" HWADDR_PRIx -imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" HWADDR_PRIx "value 0x%08" HWADDR_PRIx +imx7_gpr_read(uint64_t offset) "addr 0x%08" PRIx64 +imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08" PRIx64 # hw/misc/mos6522.c mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d" -- 2.11.0
[Qemu-devel] [PULL 04/22] qemu-option-trace: -trace enable= is a pattern, not a file
Signed-off-by: Michael Tokarev --- qemu-option-trace.texi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-option-trace.texi b/qemu-option-trace.texi index 4166d5cdc2..7d1b7f05c5 100644 --- a/qemu-option-trace.texi +++ b/qemu-option-trace.texi @@ -2,9 +2,8 @@ Specify tracing options. @table @option @item [enable=]@var{pattern} -Immediately enable events matching @var{pattern}. -The file must contain one event name (as listed in the @file{trace-events-all} -file) per line; globbing patterns are accepted too. This option is only +Immediately enable events matching @var{pattern} +(either event name or a globbing pattern). This option is only available if QEMU has been compiled with the @var{simple}, @var{log} or @var{ftrace} tracing backend. To specify multiple events or patterns, specify the @option{-trace} option multiple times. -- 2.11.0
[Qemu-devel] [PULL 13/22] trivial: Do not include pci.h if it is not necessary
From: Thomas Huth There is no need to include pci.h in these files. Signed-off-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- include/hw/ppc/ppc4xx.h| 2 -- include/hw/virtio/virtio-balloon.h | 1 - include/hw/virtio/virtio-gpu.h | 1 - 3 files changed, 4 deletions(-) diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h index cb0bb55cec..3a2a04c8ce 100644 --- a/include/hw/ppc/ppc4xx.h +++ b/include/hw/ppc/ppc4xx.h @@ -25,8 +25,6 @@ #ifndef PPC4XX_H #define PPC4XX_H -#include "hw/pci/pci.h" - /* PowerPC 4xx core initialization */ PowerPCCPU *ppc4xx_init(const char *cpu_model, clk_setup_t *cpu_clk, clk_setup_t *tb_clk, diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index 1ea13bd6a4..e0df3528c8 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -17,7 +17,6 @@ #include "standard-headers/linux/virtio_balloon.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" #define VIRTIO_BALLOON(obj) \ diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 22ac3c2d0e..79bb3fb3dd 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -18,7 +18,6 @@ #include "ui/qemu-pixman.h" #include "ui/console.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #include "qemu/log.h" #include "standard-headers/linux/virtio_gpu.h" -- 2.11.0
[Qemu-devel] [PULL 00/22] Trivial patches for 2018-05-20
Hello! This is a next trivial-patches pull request. It's been a while since the last pull, and quite some changes has been accumulated. Please consider pulling/applying. Thanks, /mjt The following changes since commit 5bcf917ee37a5efbef99f091a96db54a5276becb: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180518' into staging (2018-05-18 18:25:29 +0100) are available in the git repository at: git://git.corpit.ru/qemu.git tags/trivial-patches-fetch for you to fetch changes up to 9a232487aab8a7640ff8853d7d8d7c27106b44f8: acpi: fix a comment about aml_call0() (2018-05-20 08:58:58 +0300) trivial patches for 2018-05-20 Alexey Kardashevskiy (1): slirp/debug: Print IP addresses in human readable form Daniel P. Berrangé (1): misc, ide: remove use of HWADDR_PRIx in trace events Emilio G. Cota (1): tcg: fix s/compliment/complement/ typos John Snow (5): qemu-img-commands.hx: argument ordering fixups qemu-img.texi: fix command ordering qemu-img: remove references to GEN_DOCS qemu-img: Make documentation between .texi and .hx consistent qemu-img-cmds.hx: add passive-aggressive note Laurent Vivier (1): Remove unnecessary variables for function return value Marc-André Lureau (2): tests: fix tpm-crb tpm-tis tests race acpi: fix a comment about aml_call0() Michael Tokarev (1): qemu-option-trace: -trace enable= is a pattern, not a file Michal Privoznik (1): qemu-options: Allow -no-user-config again Murilo Opsfelder Araujo (1): HACKING: document preference for g_new instead of g_malloc Olaf Hering (1): replace functions which are only available in glib-2.24 Peter Maydell (2): gdbstub: Use qemu_set_cloexec() gdbstub: Handle errors in gdb_accept() Philippe Mathieu-Daudé (2): hw/ide/ahci: Keep ALLWINNER_AHCI() macro internal typedefs: Remove PcGuestInfo from qemu/typedefs.h Thomas Huth (3): trivial: Do not include pci.h if it is not necessary hw/timer/mt48t59: Fix bit-rotten NVRAM_PRINTF format strings qapi/net.json: Fix the version number of the "vlan" removal HACKING| 9 +++ accel/tcg/translate-all.c | 5 +- block/quorum.c | 6 +- gdbstub.c | 24 --- hw/acpi/aml-build.c| 2 +- hw/arm/exynos4210.c| 6 +- hw/block/vhost-user-blk.c | 5 +- hw/hppa/dino.c | 5 +- hw/ide/ahci-allwinner.c| 3 + hw/ide/ahci_internal.h | 3 - hw/ide/trace-events| 4 +- hw/misc/mos6522.c | 8 +-- hw/misc/trace-events | 8 +-- hw/net/ftgmac100.c | 5 +- hw/ppc/pnv_lpc.c | 16 ++--- hw/timer/m48t59-internal.h | 9 +-- hw/timer/m48t59.c | 4 +- include/hw/ppc/ppc4xx.h| 2 - include/hw/virtio/virtio-balloon.h | 1 - include/hw/virtio/virtio-gpu.h | 1 - include/qemu/typedefs.h| 1 - io/net-listener.c | 6 +- qapi/net.json | 4 +- qemu-img-cmds.hx | 13 ++-- qemu-img.c | 2 - qemu-img.texi | 78 +++--- qemu-option-trace.texi | 5 +- qemu-options-wrapper.h | 1 - slirp/arp_table.c | 4 +- slirp/socket.c | 8 +-- slirp/udp.c| 4 +- target/i386/hax-darwin.c | 10 +-- target/i386/translate.c| 2 +- target/m68k/translate.c| 2 +- target/mips/dsp_helper.c | 15 + target/xtensa/core-dc232b/xtensa-modules.inc.c | 56 target/xtensa/core-dc233c/xtensa-modules.inc.c | 56 target/xtensa/core-de212/xtensa-modules.inc.c | 48 - target/xtensa/core-fsf/xtensa-modules.inc.c| 32 +++-- .../core-sample_controller/xtensa-modules.inc.c| 24 ++- target/xtensa/translate.c | 7 +- tcg/README | 2 +- tests/m48t59-test.c| 6 +- tests/test-thread-pool.c
[Qemu-devel] [PULL 03/22] slirp/debug: Print IP addresses in human readable form
From: Alexey Kardashevskiy Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Tokarev --- slirp/arp_table.c | 4 ++-- slirp/socket.c| 8 slirp/udp.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slirp/arp_table.c b/slirp/arp_table.c index 3547043555..bac608f97f 100644 --- a/slirp/arp_table.c +++ b/slirp/arp_table.c @@ -33,7 +33,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]) int i; DEBUG_CALL("arp_table_add"); -DEBUG_ARG("ip = 0x%x", ip_addr); +DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n", ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5])); @@ -67,7 +67,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, int i; DEBUG_CALL("arp_table_search"); -DEBUG_ARG("ip = 0x%x", ip_addr); +DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); /* If broadcast address */ if (ip_addr == 0x || ip_addr == broadcast_addr) { diff --git a/slirp/socket.c b/slirp/socket.c index cb7b5b608d..61347d1a0c 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -701,10 +701,10 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr, memset(&addr, 0, addrlen); DEBUG_CALL("tcp_listen"); - DEBUG_ARG("haddr = %x", haddr); - DEBUG_ARG("hport = %d", hport); - DEBUG_ARG("laddr = %x", laddr); - DEBUG_ARG("lport = %d", lport); + DEBUG_ARG("haddr = %s", inet_ntoa(*(struct in_addr *)&haddr)); + DEBUG_ARG("hport = %d", ntohs(hport)); + DEBUG_ARG("laddr = %s", inet_ntoa(*(struct in_addr *)&laddr)); + DEBUG_ARG("lport = %d", ntohs(lport)); DEBUG_ARG("flags = %x", flags); so = socreate(slirp); diff --git a/slirp/udp.c b/slirp/udp.c index 227d779022..e5bf065bf2 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -241,8 +241,8 @@ int udp_output(struct socket *so, struct mbuf *m, DEBUG_CALL("udp_output"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); - DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr); - DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr); + DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr)); + DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr)); /* * Adjust for header -- 2.11.0
[Qemu-devel] [PULL 15/22] hw/timer/mt48t59: Fix bit-rotten NVRAM_PRINTF format strings
From: Thomas Huth When compiling with NVRAM_PRINTF enabled, gcc currently bails out with: CC hw/timer/m48t59.o CC hw/timer/m48t59-isa.o hw/timer/m48t59.c: In function ‘NVRAM_writeb’: hw/timer/m48t59.c:460:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘hwaddr’ [-Werror=format=] NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); ^ hw/timer/m48t59.c:460:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format=] hw/timer/m48t59.c: In function ‘NVRAM_readb’: hw/timer/m48t59.c:492:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘hwaddr’ [-Werror=format=] NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); Fix it by using the correct format strings and while we're at it, also change the definition of NVRAM_PRINTF so that this can not bit-rot so easily again. Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Signed-off-by: Michael Tokarev --- hw/timer/m48t59-internal.h | 9 +++-- hw/timer/m48t59.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/timer/m48t59-internal.h b/hw/timer/m48t59-internal.h index 32ae957805..d0f0caf3c7 100644 --- a/hw/timer/m48t59-internal.h +++ b/hw/timer/m48t59-internal.h @@ -25,13 +25,10 @@ #ifndef HW_M48T59_INTERNAL_H #define HW_M48T59_INTERNAL_H 1 -//#define DEBUG_NVRAM +#define M48T59_DEBUG 0 -#if defined(DEBUG_NVRAM) -#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0) -#else -#define NVRAM_PRINTF(fmt, ...) do { } while (0) -#endif +#define NVRAM_PRINTF(fmt, ...) do { \ +if (M48T59_DEBUG) { printf(fmt , ## __VA_ARGS__); } } while (0) /* * The M48T02, M48T08 and M48T59 chips are very similar. The newer '59 has diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c index 742c576443..f2991762ab 100644 --- a/hw/timer/m48t59.c +++ b/hw/timer/m48t59.c @@ -456,7 +456,7 @@ static void NVRAM_writeb(void *opaque, hwaddr addr, uint64_t val, { M48t59State *NVRAM = opaque; -NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); +NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" => 0x%"PRIx64"\n", __func__, addr, val); switch (addr) { case 0: NVRAM->addr &= ~0x00FF; @@ -488,7 +488,7 @@ static uint64_t NVRAM_readb(void *opaque, hwaddr addr, unsigned size) retval = -1; break; } -NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); +NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" <= 0x%08x\n", __func__, addr, retval); return retval; } -- 2.11.0
[Qemu-devel] [PULL 06/22] qemu-img-commands.hx: argument ordering fixups
From: John Snow The TEXI and string versions are actually identical, except for markup. We can probably automate this... but make the ordering the same until then. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 2fe31893cf..8bcefcafe9 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -23,13 +23,13 @@ STEXI ETEXI DEF("check", img_check, -"check [-q] [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename") +"check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename") STEXI @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} ETEXI DEF("commit", img_commit, -"commit [-q] [--object objectdef] [--image-opts] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") +"commit [--object objectdef] [--image-opts] [-q] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") STEXI @item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} ETEXI @@ -47,7 +47,7 @@ STEXI ETEXI DEF("create", img_create, -"create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") +"create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") STEXI @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] ETEXI -- 2.11.0
[Qemu-devel] [PULL 08/22] qemu-img: remove references to GEN_DOCS
From: John Snow Nothing seemingly uses this. (jcody: commit 77bd1119ba even mentions that it appears unused) Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img.c | 2 -- qemu-options-wrapper.h | 1 - 2 files changed, 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 60e45ec103..2b5a5706b6 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -123,7 +123,6 @@ static void QEMU_NORETURN help(void) " " arg_string "\n" #include "qemu-img-cmds.h" #undef DEF -#undef GEN_DOCS "\n" "Command parameters:\n" " 'filename' is a disk image filename\n" @@ -4716,7 +4715,6 @@ static const img_cmd_t img_cmds[] = { { option, callback }, #include "qemu-img-cmds.h" #undef DEF -#undef GEN_DOCS { NULL, NULL, }, }; diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h index 13bfea0294..6f548e3922 100644 --- a/qemu-options-wrapper.h +++ b/qemu-options-wrapper.h @@ -34,7 +34,6 @@ #undef DEF #undef DEFHEADING #undef ARCHHEADING -#undef GEN_DOCS #undef QEMU_OPTIONS_GENERATE_ENUM #undef QEMU_OPTIONS_GENERATE_HELP -- 2.11.0
[Qemu-devel] [PULL 17/22] typedefs: Remove PcGuestInfo from qemu/typedefs.h
From: Philippe Mathieu-Daudé It is long gone since e4e8ba04c2007 ... Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- include/qemu/typedefs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index a46b0b347b..325c72de33 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -62,7 +62,6 @@ typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; typedef struct NICInfo NICInfo; typedef struct NumaNodeMem NumaNodeMem; -typedef struct PcGuestInfo PcGuestInfo; typedef struct PCIBridge PCIBridge; typedef struct PCIBus PCIBus; typedef struct PCIDevice PCIDevice; -- 2.11.0
[Qemu-devel] [PULL 20/22] gdbstub: Handle errors in gdb_accept()
From: Peter Maydell In gdb_accept(), we both fail to check all errors (notably that from socket_set_nodelay(), as Coverity notes in CID 1005666), and fail to return an error status back to our caller. Correct both of these things, so that errors in accept() result in our stopping with a useful error message rather than ignoring it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- gdbstub.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index b99980d2e2..e4ece2f5bc 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1814,7 +1814,7 @@ void gdb_signalled(CPUArchState *env, int sig) put_packet(s, buf); } -static void gdb_accept(void) +static bool gdb_accept(void) { GDBState *s; struct sockaddr_in sockaddr; @@ -1826,7 +1826,7 @@ static void gdb_accept(void) fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len); if (fd < 0 && errno != EINTR) { perror("accept"); -return; +return false; } else if (fd >= 0) { qemu_set_cloexec(fd); break; @@ -1834,7 +1834,10 @@ static void gdb_accept(void) } /* set short latency */ -socket_set_nodelay(fd); +if (socket_set_nodelay(fd)) { +perror("setsockopt"); +return false; +} s = g_malloc0(sizeof(GDBState)); s->c_cpu = first_cpu; @@ -1843,6 +1846,7 @@ static void gdb_accept(void) gdb_has_xml = false; gdbserver_state = s; +return true; } static int gdbserver_open(int port) @@ -1883,7 +1887,11 @@ int gdbserver_start(int port) if (gdbserver_fd < 0) return -1; /* accept connections */ -gdb_accept(); +if (!gdb_accept()) { +close(gdbserver_fd); +gdbserver_fd = -1; +return -1; +} return 0; } -- 2.11.0
[Qemu-devel] [PULL 07/22] qemu-img.texi: fix command ordering
From: John Snow This should match the summary ordering, which is alphabetical. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img.texi | 58 ++ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/qemu-img.texi b/qemu-img.texi index 8a26400adb..adf5176902 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -193,6 +193,12 @@ sets the number of input blocks to skip Command description: @table @option + +@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} + +Amends the image format specific @var{options} for the image file +@var{filename}. Not all file formats support this operation. + @item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] @var{filename} Run a simple sequential I/O benchmark on the specified image. If @code{-w} is @@ -253,30 +259,6 @@ If @code{-r} is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful @code{-r all} will yield the exit code 0, independently of the image state before. -@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] - -Create the new disk image @var{filename} of size @var{size} and format -@var{fmt}. Depending on the file format, you can add one or more @var{options} -that enable additional features of this format. - -If the option @var{backing_file} is specified, then the image will record -only the differences from @var{backing_file}. No size needs to be specified in -this case. @var{backing_file} will never be modified unless you use the -@code{commit} monitor command (or qemu-img commit). - -If a relative path name is given, the backing file is looked up relative to -the directory containing @var{filename}. - -Note that a given backing file will be opened to check that it is valid. Use -the @code{-u} option to enable unsafe backing file mode, which means that the -image will be created even if the associated backing file cannot be opened. A -matching backing file must be created or additional options be used to make the -backing file specification valid when you want to use an image created this -way. - -The size can also be specified using the @var{size} option with @code{-o}, -it doesn't need to be specified separately in this case. - @item commit [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} Commit the changes recorded in @var{filename} in its base image or backing file. @@ -381,6 +363,30 @@ creating compressed images. @var{num_coroutines} specifies how many coroutines work in parallel during the convert process (defaults to 8). +@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] + +Create the new disk image @var{filename} of size @var{size} and format +@var{fmt}. Depending on the file format, you can add one or more @var{options} +that enable additional features of this format. + +If the option @var{backing_file} is specified, then the image will record +only the differences from @var{backing_file}. No size needs to be specified in +this case. @var{backing_file} will never be modified unless you use the +@code{commit} monitor command (or qemu-img commit). + +If a relative path name is given, the backing file is looked up relative to +the directory containing @var{filename}. + +Note that a given backing file will be opened to check that it is valid. Use +the @code{-u} option to enable unsafe backing file mode, which means that the +image will be created even if the associated backing file cannot be opened. A +matching backing file must be created or additional options be used to make the +backing file specification valid when you want to use an image created this +way. + +The size can also be specified using the @var{size} option with @code{-o}, +it doesn't need to be specified separately in this case. + @item dd [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output} Dd copies from @var{input} file to @var{output} file converting it from @@ -585,10 +591,6 @@ how the additional image area should be allocated on the host. See the format description in the @code{NOTES} section which values are allowed. Using this option may result in slightly more data being allocated than necessary. -@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} - -Amends the image format specific @var{options} for the image file -@var{filename}. Not all file formats support this operation. @end table @c man end -- 2.11.0
[Qemu-devel] [PULL 05/22] HACKING: document preference for g_new instead of g_malloc
From: Murilo Opsfelder Araujo This patch documents the preference for g_new instead of g_malloc. The reasons were adapted from commit b45c03f585ea9bb1af76c73e82195418c294919d. Discussion in QEMU's mailing list: http://lists.nongnu.org/archive/html/qemu-devel/2018-05/msg03238.html Cc: qemu-devel@nongnu.org Cc: David Hildenbrand Cc: Eduardo Habkost Cc: Markus Armbruster Cc: Paolo Bonzini Signed-off-by: Murilo Opsfelder Araujo Reviewed-by: Eric Blake Reviewed-by: Alex Bennée Reviewed-by: David Hildenbrand Signed-off-by: Michael Tokarev --- HACKING | 9 + 1 file changed, 9 insertions(+) diff --git a/HACKING b/HACKING index 4125c97d8d..0fc3e0fc04 100644 --- a/HACKING +++ b/HACKING @@ -118,6 +118,15 @@ Please note that g_malloc will exit on allocation failure, so there is no need to test for failure (as you would have to with malloc). Calling g_malloc with a zero size is valid and will return NULL. +Prefer g_new(T, n) instead of g_malloc(sizeof(T) * n) for the following +reasons: + + a. It catches multiplication overflowing size_t; + b. It returns T * instead of void *, letting compiler catch more type + errors. + +Declarations like T *v = g_malloc(sizeof(*v)) are acceptable, though. + Memory allocated by qemu_memalign or qemu_blockalign must be freed with qemu_vfree, since breaking this will cause problems on Win32. -- 2.11.0
[Qemu-devel] [PULL 09/22] qemu-img: Make documentation between .texi and .hx consistent
From: John Snow These are also different and out of order for whatever reason. I'd like to automate this in the future, but for now let's put on the band-aid. In the case of resize, there were options missing from all three docstrings; the new string is based on the code. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 4 ++-- qemu-img.texi| 24 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 8bcefcafe9..84deb858af 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -89,9 +89,9 @@ STEXI ETEXI DEF("resize", img_resize, -"resize [--object objectdef] [--image-opts] [-q] [--shrink] filename [+ | -]size") +"resize [--object objectdef] [--image-opts] [-f fmt] [--preallocation=prealloc] [-q] [--shrink] filename [+ | -]size") STEXI -@item resize [--object @var{objectdef}] [--image-opts] [-q] [--shrink] @var{filename} [+ | -]@var{size} +@item resize [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--preallocation=@var{prealloc}] [-q] [--shrink] @var{filename} [+ | -]@var{size} ETEXI STEXI diff --git a/qemu-img.texi b/qemu-img.texi index adf5176902..2be8206a05 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -194,12 +194,12 @@ Command description: @table @option -@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} +@item amend [--object @var{objectdef}] [--image-opts] [-p] [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} Amends the image format specific @var{options} for the image file @var{filename}. Not all file formats support this operation. -@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] @var{filename} +@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] [-U] @var{filename} Run a simple sequential I/O benchmark on the specified image. If @code{-w} is specified, a write test is performed, otherwise a read test is performed. @@ -223,7 +223,7 @@ specified as well. For write tests, by default a buffer filled with zeros is written. This can be overridden with a pattern byte specified by @var{pattern}. -@item check [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] @var{filename} +@item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} Perform a consistency check on the disk image @var{filename}. The command can output in the format @var{ofmt} which is either @code{human} or @code{json}. @@ -259,7 +259,7 @@ If @code{-r} is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful @code{-r all} will yield the exit code 0, independently of the image state before. -@item commit [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} +@item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} Commit the changes recorded in @var{filename} in its base image or backing file. If the backing file is smaller than the snapshot, then the backing file will be @@ -281,7 +281,7 @@ all images between @var{base} and the top image will be invalid and may return garbage data when read. For this reason, @code{-b} implies @code{-d} (so that the top image stays valid). -@item compare [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-s] [-q] @var{filename1} @var{filename2} +@item compare [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-q] [-s] [-U] @var{filename1} @var{filename2} Check if two images have the same content. You can compare images with different format or settings. @@ -322,7 +322,7 @@ Error on reading data @end table -@item convert [-c] [-p] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-m @var{num_coroutines}] [-W] [-S @var{sparse_size}] @var{filename} [@var{filename2} [...]] @var{output_filename} +@item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename}
[Qemu-devel] [PULL 10/22] qemu-img-cmds.hx: add passive-aggressive note
From: John Snow I'm kidding. It's very easy to forget there are per-command sections in the texi, and insane that we don't autogenerate those, too. Until then, leave a little post-it note in this .hx file until I find a way to delete it. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 84deb858af..3d2f7b26eb 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -6,6 +6,9 @@ HXCOMM DEF(command, callback, arg_string) is used to construct HXCOMM command structures and help message. HXCOMM HXCOMM can be used for comments, discarded from both texi and C +HXCOMM When amending the TEXI sections, please remember to copy the usage +HXCOMM over to the per-command sections in qemu-img.texi. + STEXI @table @option ETEXI -- 2.11.0
[Qemu-devel] [PULL 21/22] qapi/net.json: Fix the version number of the "vlan" removal
From: Thomas Huth "vlan" will be dropped in 2.13, not in 2.12. And while we're at it, use the better wording "dropped in" instead of "removed with" (also for the "dump" removal). Reported-by: Stefan Hajnoczi Reported-by: Eric Blake Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- qapi/net.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index b4fe4b660b..b8adf1f03f 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -450,7 +450,7 @@ # # Since: 2.7 # -# 'dump' - removed with 2.12 +# 'dump': dropped in 2.12 ## { 'enum': 'NetClientDriver', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', @@ -498,7 +498,7 @@ # # Since: 1.2 # -# 'vlan' - removed with 2.12 +# 'vlan': dropped in 2.13 ## { 'struct': 'NetLegacy', 'data': { -- 2.11.0
[Qemu-devel] [PULL 22/22] acpi: fix a comment about aml_call0()
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- hw/acpi/aml-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 3fa557cea1..1e43cd736d 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -627,7 +627,7 @@ Aml *aml_notify(Aml *arg1, Aml *arg2) return var; } -/* helper to call method with 1 argument */ +/* helper to call method without argument */ Aml *aml_call0(const char *method) { Aml *var = aml_alloc(); -- 2.11.0
[Qemu-devel] [PULL 16/22] qemu-options: Allow -no-user-config again
From: Michal Privoznik After 1217d6ca2bf28c0febe1bd7d5b3fa912bbf6af2a we error out explicitly if an unknown -option was passed on the command line. However, we are doing two pass command line option parsing. In the first pass we just look for -no-user-config or -nodefconfig being present which determines whether we load user config or not. Then in the second pass we finally parse everything else throwing an error if an unsupported -option was found. Problem is that in the second pass -no-user-config and -nodefconfig are not handled explicitly which makes us throw the unsupported option error. Signed-off-by: Michal Privoznik Reviewed-by: Thomas Huth Reviewed-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- vl.c | 4 1 file changed, 4 insertions(+) diff --git a/vl.c b/vl.c index 3b39bbd7a8..d5836c65ae 100644 --- a/vl.c +++ b/vl.c @@ -4011,6 +4011,10 @@ int main(int argc, char **argv, char **envp) exit(1); } break; +case QEMU_OPTION_nodefconfig: +case QEMU_OPTION_nouserconfig: +/* Nothing to be parsed here. Especially, do not error out below. */ +break; default: if (os_parse_cmd_args(popt->index, optarg)) { error_report("Option not supported in this build"); -- 2.11.0
[Qemu-devel] [PULL 12/22] tests: fix tpm-crb tpm-tis tests race
From: Marc-André Lureau No need to close the TPM data socket on the emulator end, qemu will close it after a SHUTDOWN. This avoids a race between close() and read() in the TPM data thread. Reported-by: Peter Maydell Signed-off-by: Marc-André Lureau Signed-off-by: Stefan Berger Reviewed-by: Daniel P. Berrangé Signed-off-by: Michael Tokarev --- tests/tpm-emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tpm-emu.c b/tests/tpm-emu.c index 4dada76834..8c2bd53cad 100644 --- a/tests/tpm-emu.c +++ b/tests/tpm-emu.c @@ -125,7 +125,7 @@ void *tpm_emu_ctrl_thread(void *data) case CMD_SHUTDOWN: { ptm_res res = 0; qio_channel_write(ioc, (char *)&res, sizeof(res), &error_abort); -qio_channel_close(s->tpm_ioc, &error_abort); +/* the tpm data thread is expected to finish now */ g_thread_join(s->emu_tpm_thread); break; } -- 2.11.0
[Qemu-devel] [PULL 11/22] hw/ide/ahci: Keep ALLWINNER_AHCI() macro internal
From: Philippe Mathieu-Daudé The ALLWINNER_AHCI() macro is only used in ahci-allwinner.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Signed-off-by: Michael Tokarev --- hw/ide/ahci-allwinner.c | 3 +++ hw/ide/ahci_internal.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ahci-allwinner.c b/hw/ide/ahci-allwinner.c index 5397483fd8..2fd95078ba 100644 --- a/hw/ide/ahci-allwinner.c +++ b/hw/ide/ahci-allwinner.c @@ -24,6 +24,9 @@ #include "trace.h" +#define ALLWINNER_AHCI(obj) \ +OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI) + #define ALLWINNER_AHCI_BISTAFR((0xa0 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTCR ((0xa4 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTFCTR ((0xa8 - ALLWINNER_AHCI_MMIO_OFF) / 4) diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index 8c755d4ca1..1a25d6c039 100644 --- a/hw/ide/ahci_internal.h +++ b/hw/ide/ahci_internal.h @@ -375,7 +375,4 @@ void ahci_reset(AHCIState *s); #define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) -#define ALLWINNER_AHCI(obj) OBJECT_CHECK(AllwinnerAHCIState, (obj), \ - TYPE_ALLWINNER_AHCI) - #endif /* HW_IDE_AHCI_H */ -- 2.11.0
[Qemu-devel] [PULL 14/22] Remove unnecessary variables for function return value
From: Laurent Vivier Re-run Coccinelle script scripts/coccinelle/return_directly.cocci Signed-off-by: Laurent Vivier ppc part Acked-by: David Gibson Signed-off-by: Michael Tokarev --- accel/tcg/translate-all.c | 5 +- block/quorum.c | 6 +-- hw/arm/exynos4210.c| 6 +-- hw/block/vhost-user-blk.c | 5 +- hw/hppa/dino.c | 5 +- hw/misc/mos6522.c | 8 +--- hw/net/ftgmac100.c | 5 +- hw/ppc/pnv_lpc.c | 16 ++- io/net-listener.c | 6 +-- target/i386/hax-darwin.c | 10 ++-- target/mips/dsp_helper.c | 15 ++ target/xtensa/core-dc232b/xtensa-modules.inc.c | 56 ++ target/xtensa/core-dc233c/xtensa-modules.inc.c | 56 ++ target/xtensa/core-de212/xtensa-modules.inc.c | 48 +-- target/xtensa/core-fsf/xtensa-modules.inc.c| 32 - .../core-sample_controller/xtensa-modules.inc.c| 24 +++--- target/xtensa/translate.c | 7 +-- tests/m48t59-test.c| 6 +-- tests/test-thread-pool.c | 6 +-- util/uri.c | 5 +- 20 files changed, 79 insertions(+), 248 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index f409d42d54..732c919629 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -644,11 +644,8 @@ static inline void *alloc_code_gen_buffer(void) static inline void *alloc_code_gen_buffer(void) { size_t size = tcg_ctx->code_gen_buffer_size; -void *buf; - -buf = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, +return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); -return buf; } #else static inline void *alloc_code_gen_buffer(void) diff --git a/block/quorum.c b/block/quorum.c index e448d7e384..b6476c405a 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -613,7 +613,7 @@ static void read_quorum_children_entry(void *opaque) static int read_quorum_children(QuorumAIOCB *acb) { BDRVQuorumState *s = acb->bs->opaque; -int i, ret; +int i; acb->children_read = s->num_children; for (i = 0; i < s->num_children; i++) { @@ -648,9 +648,7 @@ static int read_quorum_children(QuorumAIOCB *acb) qemu_coroutine_yield(); } -ret = acb->vote_ret; - -return ret; +return acb->vote_ret; } static int read_fifo_child(QuorumAIOCB *acb) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 06f9d1ffa4..b7463a71ec 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -156,12 +156,8 @@ void exynos4210_write_secondary(ARMCPU *cpu, static uint64_t exynos4210_calc_affinity(int cpu) { -uint64_t mp_affinity; - /* Exynos4210 has 0x9 as cluster ID */ -mp_affinity = (0x9 << ARM_AFF1_SHIFT) | cpu; - -return mp_affinity; +return (0x9 << ARM_AFF1_SHIFT) | cpu; } Exynos4210State *exynos4210_init(MemoryRegion *system_mem) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 262baca432..975eae6211 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -196,7 +196,6 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev, Error **errp) { VHostUserBlk *s = VHOST_USER_BLK(vdev); -uint64_t get_features; /* Turn on pre-defined features */ virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX); @@ -215,9 +214,7 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev, virtio_add_feature(&features, VIRTIO_BLK_F_MQ); } -get_features = vhost_get_features(&s->dev, user_feature_bits, features); - -return get_features; +return vhost_get_features(&s->dev, user_feature_bits, features); } static void vhost_user_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 15aefde09c..c5dcf3104d 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -403,13 +403,10 @@ static void dino_set_irq(void *opaque, int irq, int level) static int dino_pci_map_irq(PCIDevice *d, int irq_num) { int slot = d->devfn >> 3; -int local_irq; assert(irq_num >= 0 && irq_num <= 3); -local_irq = slot & 0x03; - -return local_irq; +return slot & 0x03; } static void dino_set_timer_irq(void *opaque, int irq, int level) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 8ad9fc831e..6163cea6ab 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -176,12 +176,8 @@ static void mos6522_set_sr_int(MOS6522State *s) static uint64_t mos6522_get_counter_value(MOS6522State *s, MOS6522T
[Qemu-devel] [PULL 19/22] gdbstub: Use qemu_set_cloexec()
From: Peter Maydell Use the utility routine qemu_set_cloexec() rather than manually calling fcntl(). This lets us drop the #ifndef _WIN32 guards and also means Coverity doesn't complain that we're ignoring the fcntl error return (CID 1005665, CID 1005667). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- gdbstub.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 9682e16ef7..b99980d2e2 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1828,9 +1828,7 @@ static void gdb_accept(void) perror("accept"); return; } else if (fd >= 0) { -#ifndef _WIN32 -fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif +qemu_set_cloexec(fd); break; } } @@ -1857,9 +1855,7 @@ static int gdbserver_open(int port) perror("socket"); return -1; } -#ifndef _WIN32 -fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif +qemu_set_cloexec(fd); socket_set_fast_reuse(fd); -- 2.11.0
[Qemu-devel] [PULL 18/22] replace functions which are only available in glib-2.24
From: Olaf Hering Currently the minimal supported version of glib is 2.22. Since testing is done with a glib that claims to be 2.22, but in fact has APIs from newer version of glib, this bug was not caught during submit of the patch referenced below. Replace g_realloc_n, which is available only since 2.24, with g_renew. Fixes commit 418026ca43 ("util: Introduce vfio helpers") Signed-off-by: Olaf Hering Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Michael Tokarev CC: qemu-sta...@nongnu.org --- util/vfio-helpers.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 006674c916..1d9272efa4 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -522,8 +522,7 @@ static IOVAMapping *qemu_vfio_add_mapping(QEMUVFIOState *s, assert(index >= 0); s->nr_mappings++; -s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), - s->nr_mappings); +s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings); insert = &s->mappings[index]; shift = s->nr_mappings - index - 1; if (shift) { @@ -577,8 +576,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping, memmove(mapping, &s->mappings[index + 1], sizeof(s->mappings[0]) * (s->nr_mappings - index - 1)); s->nr_mappings--; -s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), - s->nr_mappings); +s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings); } /* Check if the mapping list is (ascending) ordered. */ -- 2.11.0