Re: [PATCH v14 16/17] tests/qtest: netdev: test stream and dgram backends

2022-11-03 Thread Laurent Vivier

On 11/3/22 12:07, Philippe Mathieu-Daudé wrote:

On 3/11/22 10:33, Laurent Vivier wrote:

On 10/28/22 07:04, Jason Wang wrote:


在 2022/10/21 17:09, Laurent Vivier 写道:

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---



I got this:

63/63 ERROR:../tests/qtest/netdev-socket.c:139:test_stream_inet_ipv6: assertion failed 
(resp == expect): ("st0: index=0,type=stream,connection error\r\n" == "st0: 
index=0,type=stream,tcp:::1:40389\r\n") ERROR
63/63 qemu:qtest+qtest-x86_64 / qtest-x86_64/netdev-socket  ERROR 5.29s 
killed by signal 6 SIGABRT
 >>> QTEST_QEMU_IMG=./qemu-img QTEST_QEMU_BINARY=./qemu-system-x86_64 
MALLOC_PERTURB_=96 
QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon 
G_TEST_DBUS_DAEMON=/home/devel/git/qemu/tests/dbus-vmstate-daemon.sh 
/home/devel/git/qemu/build/tests/qtest/netdev-socket --tap -k
――― ✀ 
―――

stderr:
**
ERROR:../tests/qtest/netdev-socket.c:139:test_stream_inet_ipv6: assertion failed (resp 
== expect): ("st0: index=0,type=stream,connection error\r\n" == "st0: 
index=0,type=stream,tcp:::1:40389\r\n")


(test program exited with status code -6)


I'm not able to reproduce the problem.

Is this 100% reproducible?
Is IPv6 enabled on your test machine?


If IPv6 is not available, this test should be skipped, not failing.


I agree.
But I'm not sure it's the real cause of the problem (perhaps a firewall 
problem?).

I think I should update my inet_get_free_port_socket() to get a free port from AF_INET6 
and not only from AF_INET.


Thanks,
Laurent




Re: [PATCH v14 16/17] tests/qtest: netdev: test stream and dgram backends

2022-11-03 Thread Laurent Vivier

On 10/28/22 07:04, Jason Wang wrote:


在 2022/10/21 17:09, Laurent Vivier 写道:

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---



I got this:

63/63 ERROR:../tests/qtest/netdev-socket.c:139:test_stream_inet_ipv6: assertion failed 
(resp == expect): ("st0: index=0,type=stream,connection error\r\n" == "st0: 
index=0,type=stream,tcp:::1:40389\r\n") ERROR
63/63 qemu:qtest+qtest-x86_64 / qtest-x86_64/netdev-socket  ERROR 5.29s   
killed by signal 6 SIGABRT
 >>> QTEST_QEMU_IMG=./qemu-img QTEST_QEMU_BINARY=./qemu-system-x86_64 MALLOC_PERTURB_=96 
QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon 
G_TEST_DBUS_DAEMON=/home/devel/git/qemu/tests/dbus-vmstate-daemon.sh 
/home/devel/git/qemu/build/tests/qtest/netdev-socket --tap -k
――― ✀ 
―――

stderr:
**
ERROR:../tests/qtest/netdev-socket.c:139:test_stream_inet_ipv6: assertion failed (resp == 
expect): ("st0: index=0,type=stream,connection error\r\n" == "st0: 
index=0,type=stream,tcp:::1:40389\r\n")


(test program exited with status code -6)


I'm not able to reproduce the problem.

Is this 100% reproducible?
Is IPv6 enabled on your test machine?

Thanks,
Laurent




Re: [PATCH v4 1/2] xen/pt: fix syntax error that causes FTBFS in some configurations

2022-11-02 Thread Laurent Vivier

Le 31/10/2022 à 22:35, Chuck Zmudzinski a écrit :

When Qemu is built with --enable-xen and --disable-xen-pci-passthrough
and the target os is linux, the build fails with:

meson.build:3477:2: ERROR: File xen_pt_stub.c does not exist.

Fixes: 582ea95f5f93 ("meson: convert hw/xen")

Signed-off-by: Chuck Zmudzinski 
---
v2: Remove From:  tag at top of commit message

v3: No change to this patch since v2

v4: Use brchu...@aol.com instead of brchu...@netscape.net for the author's
 email address to match the address used by the same author in commits
 be9c61da and c0e86b76

  hw/xen/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xen/meson.build b/hw/xen/meson.build
index 08dc1f6857..ae0ace3046 100644
--- a/hw/xen/meson.build
+++ b/hw/xen/meson.build
@@ -18,7 +18,7 @@ if have_xen_pci_passthrough
  'xen_pt_msi.c',
))
  else
-  xen_specific_ss.add('xen_pt_stub.c')
+  xen_specific_ss.add(files('xen_pt_stub.c'))
  endif
  
  specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss)


Applied to my trivial-patches branch.

Thanks,
Laurent




Re: [PATCH v14 15/17] net: stream: move to QIO to enable additional parameters

2022-10-21 Thread Laurent Vivier

On 10/21/22 12:35, Markus Armbruster wrote:

Philippe Mathieu-Daudé  writes:


On 21/10/22 11:09, Laurent Vivier wrote:

Use QIOChannel, QIOChannelSocket and QIONetListener.
This allows net/stream to use all the available parameters provided by
SocketAddress.
Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---
   net/stream.c| 492 +---
   qemu-options.hx |   4 +-
   2 files changed, 178 insertions(+), 318 deletions(-)



-static void net_stream_accept(void *opaque)
+static void net_stream_server_listening(QIOTask *task, gpointer opaque)
   {
   NetStreamState *s = opaque;
-struct sockaddr_storage saddr;
-socklen_t len;
-int fd;
-
-for (;;) {
-len = sizeof(saddr);
-fd = qemu_accept(s->listen_fd, (struct sockaddr *), );
-if (fd < 0 && errno != EINTR) {
-return;
-} else if (fd >= 0) {
-qemu_set_fd_handler(s->listen_fd, NULL, NULL, NULL);
-break;
-}
-}
+QIOChannelSocket *listen_sioc = QIO_CHANNEL_SOCKET(s->listen_ioc);
+SocketAddress *addr;
+int ret;
   -s->fd = fd;
-s->nc.link_down = false;
-net_stream_connect(s);
-switch (saddr.ss_family) {
-case AF_INET: {
-struct sockaddr_in *saddr_in = (struct sockaddr_in *)
-
-qemu_set_info_str(>nc, "connection from %s:%d",
-  inet_ntoa(saddr_in->sin_addr),
-  ntohs(saddr_in->sin_port));
-break;
+if (listen_sioc->fd < 0) {
+qemu_set_info_str(>nc, "connection error");
+return;
   }
-case AF_UNIX: {
-struct sockaddr_un saddr_un;
   -len = sizeof(saddr_un);
-getsockname(s->listen_fd, (struct sockaddr *)_un, );
-qemu_set_info_str(>nc, "connect from %s", saddr_un.sun_path);
-break;
-}
-default:
-g_assert_not_reached();
+addr = qio_channel_socket_get_local_address(listen_sioc, NULL);
+g_assert(addr != NULL);


Missing propagating Error* (observed in v12).


*If* this is really a programming error: what about _abort?


assert() informs the compiler that following code will not use addr with a NULL value, I 
don't think _abort does that. This could avoid an error report in code static analyzer.


Thanks,
Laurent




Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-21 Thread Laurent Vivier

On 10/21/22 11:12, Markus Armbruster wrote:

Cc: Stefano Brivio

Laurent Vivier  writes:


On 10/21/22 07:48, Markus Armbruster wrote:

Laurent Vivier  writes:


The netdev reports NETDEV_STREAM_CONNECTED event when the backend
is connected, and NETDEV_STREAM_DISCONNECTED when it is disconnected.


Use cases?


This is asked by Stefano Brivio to allow libvirt to detect if connection to 
passt is lost and to restart passt.


Let's add something like this to the commit message:

 This lets libvirt notice when the connection is lost somehow, and
 restart the peer (such as passt).

Who's working on the libvirt part?


I have also a patch to add a "reconnect=seconds" option, but I didn't want to 
add it to this series.


It's okay to mention future work in commit messages, but not required.


Could similar event signalling be useful for other kinds of netdev
backends?


I was wondering, but it becomes more complicated to be generic.


Making something complicated and generic where a simpler special
solution would do is the worst.

Not quite as bad (but still plenty bad) is making a few special
solutions first, then replace them all with a generic solution.

I believe we should have a good, hard think on possible applications of
a generic solution now.

There is no need to hold back this series for that.

If we conclude a generic solution is called for, we better replace this
special solution before it becomes ABI.  Either by replacing it before
we release it, or by keeping it unstable until we replace it.



I sent the v14 few minutes before this email.

Jason, perhaps we can remove PATCH 17 from the series and only merge PATCH 1 to 
16?

I will resend PATCH 17 in a new series with the reconnect option patch once this series is 
merged.


Thanks,
Laurent




Re: [PATCH v13 00/17] qapi: net: add unix socket type support to netdev backend

2022-10-21 Thread Laurent Vivier

On 10/21/22 08:50, Jason Wang wrote:

On Fri, Oct 21, 2022 at 2:46 PM Markus Armbruster  wrote:


Jason Wang  writes:


I've queued this version and will send pull requests shortly.

Any future comment we can do patches on top.


Please give Laurent and me a few hours to try to improve PATCH 17's
commit message.  Which you could then integrate without a respin.




I'm going to send a new version, only patches 15 and 17 change.
I moved some changes from PATCH 17 to 15 as asked by Markus,
I have updated the commit message for patch 17:

net: stream: add QAPI events to report connection state

The netdev reports NETDEV_STREAM_CONNECTED event when the backend
is connected, and NETDEV_STREAM_DISCONNECTED when it is disconnected.

The NETDEV_STREAM_CONNECTED event includes the destination address.

This allows a system manager like libvirt to detect when the server
fails.

For instance with passt:

{ 'execute': 'qmp_capabilities' }
{ "return": { } }
{ "timestamp": { "seconds": 1666341395, "microseconds": 505347 },
"event": "NETDEV_STREAM_CONNECTED",
"data": { "netdev-id": "netdev0",
"addr": { "path": "/tmp/passt_1.socket", "type": "unix" } } }

[killing passt here]

{ "timestamp": { "seconds": 1666341430, "microseconds": 968694 },
"event": "NETDEV_STREAM_DISCONNECTED",
"data": { "netdev-id": "netdev0" } }

Thanks,
Laurent




Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-21 Thread Laurent Vivier

On 10/21/22 07:48, Markus Armbruster wrote:

Laurent Vivier  writes:


The netdev reports NETDEV_STREAM_CONNECTED event when the backend
is connected, and NETDEV_STREAM_DISCONNECTED when it is disconnected.


Use cases?


This is asked by Stefano Brivio to allow libvirt to detect if connection to passt is lost 
and to restart passt.


I have also a patch to add a "reconnect=seconds" option, but I didn't want to add it to 
this series.




Could similar event signalling be useful for other kinds of netdev
backends?


I was wondering, but it becomes more complicated to be generic.

Thanks,
Laurent




Re: [PATCH v12 15/17] net: stream: move to QIO to enable additional parameters

2022-10-20 Thread Laurent Vivier

On 10/20/22 15:09, Philippe Mathieu-Daudé wrote:

On 20/10/22 11:16, Laurent Vivier wrote:

Use QIOChannel, QIOChannelSocket and QIONetListener.
This allows net/stream to use all the available parameters provided by
SocketAddress.

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---
  meson   |   2 +-
  net/stream.c    | 493 +---
  qemu-options.hx |   4 +-
  3 files changed, 180 insertions(+), 319 deletions(-)



  static int net_stream_server_init(NetClientState *peer,
@@ -283,105 +287,61 @@ static int net_stream_server_init(NetClientState *peer,
  {
  NetClientState *nc;
  NetStreamState *s;
-    int fd, ret;
-
-    switch (addr->type) {
-    case SOCKET_ADDRESS_TYPE_INET: {
-    struct sockaddr_in saddr_in;
-
-    if (convert_host_port(_in, addr->u.inet.host, addr->u.inet.port,
-  errp) < 0) {
-    return -1;
-    }
+    QIOChannelSocket *listen_sioc = qio_channel_socket_new();
-    fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
-    if (fd < 0) {
-    error_setg_errno(errp, errno, "can't create stream socket");
-    return -1;
-    }
-    qemu_socket_set_nonblock(fd);
+    nc = qemu_new_net_client(_stream_info, peer, model, name);
+    s = DO_UPCAST(NetStreamState, nc, nc);
-    socket_set_fast_reuse(fd);
+    s->listen_ioc = QIO_CHANNEL(listen_sioc);
+    qio_channel_socket_listen_async(listen_sioc, addr, 0,
+    net_stream_server_listening, s,
+    NULL, NULL);
-    ret = bind(fd, (struct sockaddr *)_in, sizeof(saddr_in));
-    if (ret < 0) {
-    error_setg_errno(errp, errno, "can't bind ip=%s to socket",
- inet_ntoa(saddr_in.sin_addr));
-    closesocket(fd);
-    return -1;
-    }
-    break;
-    }
-    case SOCKET_ADDRESS_TYPE_UNIX: {
-    struct sockaddr_un saddr_un;
-
-    ret = unlink(addr->u.q_unix.path);
-    if (ret < 0 && errno != ENOENT) {
-    error_setg_errno(errp, errno, "failed to unlink socket %s",
- addr->u.q_unix.path);
-    return -1;
-    }
+    return 0;
+}
-    saddr_un.sun_family = PF_UNIX;
-    ret = snprintf(saddr_un.sun_path, sizeof(saddr_un.sun_path), "%s",
-   addr->u.q_unix.path);
-    if (ret < 0 || ret >= sizeof(saddr_un.sun_path)) {
-    error_setg(errp, "UNIX socket path '%s' is too long",
-   addr->u.q_unix.path);
-    error_append_hint(errp, "Path must be less than %zu bytes\n",
-  sizeof(saddr_un.sun_path));
-    return -1;
-    }
+static void net_stream_client_connected(QIOTask *task, gpointer opaque)
+{
+    NetStreamState *s = opaque;
+    QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(s->ioc);
+    SocketAddress *addr;
+    gchar *uri;
+    int ret;
-    fd = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
-    if (fd < 0) {
-    error_setg_errno(errp, errno, "can't create stream socket");
-    return -1;
-    }
-    qemu_socket_set_nonblock(fd);
-
-    ret = bind(fd, (struct sockaddr *)_un, sizeof(saddr_un));
-    if (ret < 0) {
-    error_setg_errno(errp, errno, "can't create socket with path: %s",
- saddr_un.sun_path);
-    closesocket(fd);
-    return -1;
-    }
-    break;
-    }
-    case SOCKET_ADDRESS_TYPE_FD:
-    fd = monitor_fd_param(monitor_cur(), addr->u.fd.str, errp);
-    if (fd == -1) {
-    return -1;
-    }
-    ret = qemu_socket_try_set_nonblock(fd);
-    if (ret < 0) {
-    error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
- name, fd);
-    return -1;
-    }
-    break;
-    default:
-    error_setg(errp, "only support inet or fd type");
-    return -1;
+    if (sioc->fd < 0) {
+    qemu_set_info_str(>nc, "connection error");
+    goto error;
  }
-    ret = listen(fd, 0);
-    if (ret < 0) {
-    error_setg_errno(errp, errno, "can't listen on socket");
-    closesocket(fd);
-    return -1;
+    addr = qio_channel_socket_get_remote_address(sioc, NULL);
+    g_assert(addr != NULL);


Please use:

    addr = qio_channel_socket_get_remote_address(sioc, _fatal);

Which is more verbose in case of error, i.e.:

   qemu-system-x86_64: socket family 0 unsupported

Instead of:

   ERROR:../../net/stream.c:321:net_stream_client_connected: assertion failed: 
(addr != NULL)



I put an assert() here because I consider to have NULL here is a programming error, not an 
user error.


"It should not happen".

Thanks,
Laurent




Re: [PATCH v12 10/17] net: dgram: make dgram_dst generic

2022-10-20 Thread Laurent Vivier

On 10/20/22 13:17, Philippe Mathieu-Daudé wrote:

On 20/10/22 11:16, Laurent Vivier wrote:

dgram_dst is a sockaddr_in structure. To be able to use it with
unix socket, use a pointer to a generic sockaddr structure.

Rename it dest_addr, and store socket length in dest_len.

Signed-off-by: Laurent Vivier 
Reviewed-by: Stefano Brivio 
Acked-by: Michael S. Tsirkin 
---
  net/dgram.c | 82 ++---
  1 file changed, 53 insertions(+), 29 deletions(-)



  static NetClientInfo net_dgram_socket_info = {
@@ -260,7 +263,7 @@ static NetDgramState *net_dgram_fd_init(NetClientState 
*peer,
  SocketAddress *mcast,
  Error **errp)
  {
-    struct sockaddr_in saddr;
+    struct sockaddr_in *saddr = NULL;


Preferrably g_autofree.


No, because saddr pointer is copied to s->dest_addr.

...

@@ -339,21 +342,24 @@ static int net_dgram_mcast_init(NetClientState *peer,
  {
  NetDgramState *s;
  int fd, ret;
-    struct sockaddr_in saddr;
+    struct sockaddr_in *saddr;


Preferrably:

   g_autofree struct sockaddr_in *saddr = NULL.


The same here.

Thanks,
Laurent




Re: [PATCH v12 16/17] tests/qtest: netdev: test stream and dgram backends

2022-10-20 Thread Laurent Vivier

On 10/20/22 15:26, Philippe Mathieu-Daudé wrote:

On 20/10/22 11:16, Laurent Vivier wrote:

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---
  tests/qtest/meson.build |   1 +
  tests/qtest/netdev-socket.c | 417 
  2 files changed, 418 insertions(+)
  create mode 100644 tests/qtest/netdev-socket.c



+int main(int argc, char **argv)
+{
+    int ret;
+
+    g_test_init(, , NULL);
+
+    qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
+    qtest_add_func("/netdev/stream/inet/ipv6", test_stream_inet_ipv6);
+    qtest_add_func("/netdev/stream/unix", test_stream_unix);
+    qtest_add_func("/netdev/stream/unix/abstract", test_stream_unix_abstract);
+    qtest_add_func("/netdev/stream/fd", test_stream_fd);


The stream tests don't work for me (testing on Darwin).

ERROR:../../tests/qtest/netdev-socket.c:99:test_stream_inet_ipv4:assertion failed (resp == 
"st0: index=0,type=stream,\r\n"): ("st0:index=0,type=stream,connection error\r\n" == "st0: 
index=0,type=stream,\r\n")


My bad: I have changed the default value for "server" but I didn't update the 
test.

Thanks,
Laurent




Re: [PATCH v11 17/17] net: stream: add QAPI events to report connection state

2022-10-20 Thread Laurent Vivier

On 10/20/22 12:22, Markus Armbruster wrote:

Sorry for the slow replay, too many distractions...

Laurent Vivier  writes:


On 10/17/22 15:23, Markus Armbruster wrote:

Laurent Vivier  writes:


The netdev reports NETDEV_STREAM_CONNECTED event when the backend
is connected, and NETDEV_STREAM_EOC when it is disconnected.

The NETDEV_STREAM_CONNECTED event includes the URI of the destination
address.

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 


[...]


diff --git a/qapi/net.json b/qapi/net.json
index 6a1a49749294..69f83bceff3f 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -895,3 +895,49 @@
   ##
   { 'event': 'FAILOVER_NEGOTIATED',
 'data': {'device-id': 'str'} }
+
+##
+# @NETDEV_STREAM_CONNECTED:
+#
+# Emitted when the netdev stream backend is connected
+#
+# @netdev-id: QEMU netdev id that is connected
+# @uri: The Uniform Resource Identifier identifying the destination address


Is an URI the appropriate representation here?  It's not how we specify
such addresses elsewhere in QAPI/QMP...


I put in the event the same information we have in info_str and displayed by 
the HMP command 'info network'. What would be a more appropriate reprensation?


SocketAddress?



I agree SocketAddress looks better.

Thanks,
Laurent




Re: [PATCH v11 17/17] net: stream: add QAPI events to report connection state

2022-10-17 Thread Laurent Vivier

On 10/17/22 15:23, Markus Armbruster wrote:

Laurent Vivier  writes:


The netdev reports NETDEV_STREAM_CONNECTED event when the backend
is connected, and NETDEV_STREAM_EOC when it is disconnected.

The NETDEV_STREAM_CONNECTED event includes the URI of the destination
address.

Signed-off-by: Laurent Vivier 
Acked-by: Michael S. Tsirkin 
---
  net/stream.c  | 11 +--
  qapi/net.json | 46 ++
  2 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/net/stream.c b/net/stream.c
index 0293e38e5b57..821ae3265356 100644
--- a/net/stream.c
+++ b/net/stream.c
@@ -38,6 +38,7 @@
  #include "io/channel.h"
  #include "io/channel-socket.h"
  #include "io/net-listener.h"
+#include "qapi/qapi-events-net.h"
  
  typedef struct NetStreamState {

  NetClientState nc;
@@ -168,6 +169,8 @@ static gboolean net_stream_send(QIOChannel *ioc,
  s->nc.link_down = true;
  qemu_set_info_str(>nc, "");
  
+qapi_event_send_netdev_stream_eoc(s->nc.name);

+
  return G_SOURCE_REMOVE;
  }
  buf = buf1;
@@ -243,9 +246,10 @@ static void net_stream_listen(QIONetListener *listener,
  g_assert(addr != NULL);
  uri = socket_uri(addr);
  qemu_set_info_str(>nc, uri);
-g_free(uri);
  qapi_free_SocketAddress(addr);
  
+qapi_event_send_netdev_stream_connected(s->nc.name, uri);

+g_free(uri);
  }
  
  static void net_stream_server_listening(QIOTask *task, gpointer opaque)

@@ -317,12 +321,12 @@ static void net_stream_client_connected(QIOTask *task, 
gpointer opaque)
  g_assert(addr != NULL);
  uri = socket_uri(addr);
  qemu_set_info_str(>nc, uri);
-g_free(uri);
  
  ret = qemu_socket_try_set_nonblock(sioc->fd);

  if (addr->type == SOCKET_ADDRESS_TYPE_FD && ret < 0) {
  qemu_set_info_str(>nc, "can't use file descriptor %s (errno %d)",
addr->u.fd.str, -ret);
+g_free(uri);
  qapi_free_SocketAddress(addr);
  goto error;
  }
@@ -338,6 +342,9 @@ static void net_stream_client_connected(QIOTask *task, 
gpointer opaque)
  s, NULL);
  s->nc.link_down = false;
  
+qapi_event_send_netdev_stream_connected(s->nc.name, uri);

+g_free(uri);
+
  return;
  error:
  object_unref(OBJECT(s->ioc));
diff --git a/qapi/net.json b/qapi/net.json
index 6a1a49749294..69f83bceff3f 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -895,3 +895,49 @@
  ##
  { 'event': 'FAILOVER_NEGOTIATED',
'data': {'device-id': 'str'} }
+
+##
+# @NETDEV_STREAM_CONNECTED:
+#
+# Emitted when the netdev stream backend is connected
+#
+# @netdev-id: QEMU netdev id that is connected
+# @uri: The Uniform Resource Identifier identifying the destination address


Is an URI the appropriate representation here?  It's not how we specify
such addresses elsewhere in QAPI/QMP...


I put in the event the same information we have in info_str and displayed by the HMP 
command 'info network'. What would be a more appropriate reprensation?





+#
+# Since: 7.2
+#
+# Example:
+#
+# <- { 'event': 'NETDEV_STREAM_CONNECTED',
+#  'data': {'uri': 'tcp:::1:1234', 'netdev-id': 'netdev0'},
+#  'timestamp': {'seconds': 1663330564, 'microseconds': 804317} }
+#
+# or
+#
+# <- { 'event': 'NETDEV_STREAM_CONNECTED',
+#  'data': {'uri': ''unix:/tmp/qemu0', 'netdev-id': 'netdev0'},
+#  'timestamp': {'seconds': 1663330564, 'microseconds': 804317} }
+#
+##
+{ 'event': 'NETDEV_STREAM_CONNECTED',
+  'data': { 'netdev-id': 'str',
+'uri': 'str' } }
+
+##
+# @NETDEV_STREAM_EOC:


What does "EOC" mean?


End-Of-Connection, this is the nomenclature used in the code when the socket is 
disconnected.


Could this be named NETDEV_STREAM_DISCONNECTED, for symmetry with
NETDEV_STREAM_CONNECTED?


Yes, it can. EOC is shorter, it's why I used it, but if you prefer 
"disconnected"...

Thanks,
Laurent




+#
+# Emitted when the netdev stream backend is disconnected
+#
+# @netdev-id: QEMU netdev id that is disconnected
+#
+# Since: 7.2
+#
+# Example:
+#
+# <- { 'event': 'NETDEV_STREAM_EOC',
+#  'data': {'netdev-id': 'netdev0'},
+#  'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
+#
+##
+{ 'event': 'NETDEV_STREAM_EOC',
+  'data': { 'netdev-id': 'str' } }







Re: [PATCH 2/2] hw/i386/xen/xen-hvm: Inline xen_piix_pci_write_config_client() and remove it

2022-06-28 Thread Laurent Vivier

Le 26/06/2022 à 11:46, Bernhard Beschow a écrit :

xen_piix_pci_write_config_client() is implemented in the xen sub tree and
uses PIIX constants internally, thus creating a direct dependency on
PIIX. Now that xen_set_pci_link_route() is stubbable, the logic of
xen_piix_pci_write_config_client() can be moved to PIIX which resolves
the dependency.

Signed-off-by: Bernhard Beschow 
---
  hw/i386/xen/xen-hvm.c | 18 --
  hw/isa/piix3.c| 15 ++-
  include/hw/xen/xen.h  |  1 -
  stubs/xen-hw-stub.c   |  4 
  4 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 204fda7949..e4293d6d66 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -15,7 +15,6 @@
  #include "hw/pci/pci.h"
  #include "hw/pci/pci_host.h"
  #include "hw/i386/pc.h"
-#include "hw/southbridge/piix.h"
  #include "hw/irq.h"
  #include "hw/hw.h"
  #include "hw/i386/apic-msidef.h"
@@ -149,23 +148,6 @@ void xen_piix3_set_irq(void *opaque, int irq_num, int 
level)
 irq_num & 3, level);
  }
  
-void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)

-{
-int i;
-
-/* Scan for updates to PCI link routes (0x60-0x63). */
-for (i = 0; i < len; i++) {
-uint8_t v = (val >> (8 * i)) & 0xff;
-if (v & 0x80) {
-v = 0;
-}
-v &= 0xf;
-if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) {
-xen_set_pci_link_route(address + i - PIIX_PIRQCA, v);
-}
-}
-}
-
  int xen_set_pci_link_route(uint8_t link, uint8_t irq)
  {
  return xendevicemodel_set_pci_link_route(xen_dmod, xen_domid, link, irq);
diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c
index 6388558f92..48f9ab1096 100644
--- a/hw/isa/piix3.c
+++ b/hw/isa/piix3.c
@@ -138,7 +138,20 @@ static void piix3_write_config(PCIDevice *dev,
  static void piix3_write_config_xen(PCIDevice *dev,
 uint32_t address, uint32_t val, int len)
  {
-xen_piix_pci_write_config_client(address, val, len);
+int i;
+
+/* Scan for updates to PCI link routes (0x60-0x63). */
+for (i = 0; i < len; i++) {
+uint8_t v = (val >> (8 * i)) & 0xff;
+if (v & 0x80) {
+v = 0;
+}
+v &= 0xf;
+if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) {
+xen_set_pci_link_route(address + i - PIIX_PIRQCA, v);
+}
+}
+
  piix3_write_config(dev, address, val, len);
  }
  
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h

index 13bffaef53..afdf9c436a 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -23,7 +23,6 @@ extern bool xen_domid_restrict;
  int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
  int xen_set_pci_link_route(uint8_t link, uint8_t irq);
  void xen_piix3_set_irq(void *opaque, int irq_num, int level);
-void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
  void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
  int xen_is_pirq_msi(uint32_t msi_data);
  
diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c

index 743967623f..34a22f2ad7 100644
--- a/stubs/xen-hw-stub.c
+++ b/stubs/xen-hw-stub.c
@@ -19,10 +19,6 @@ void xen_piix3_set_irq(void *opaque, int irq_num, int level)
  {
  }
  
-void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)

-{
-}
-
  int xen_set_pci_link_route(uint8_t link, uint8_t irq)
  {
  return -1;


Applied to my trivial-patches branch.

Thanks,
Laurent




Re: [PATCH 1/2] hw/i386/xen/xen-hvm: Allow for stubbing xen_set_pci_link_route()

2022-06-28 Thread Laurent Vivier

Le 26/06/2022 à 11:46, Bernhard Beschow a écrit :

The only user of xen_set_pci_link_route() is
xen_piix_pci_write_config_client() which implements PIIX-specific logic in
the xen namespace. This makes xen-hvm depend on PIIX which could be
avoided if xen_piix_pci_write_config_client() was implemented in PIIX. In
order to do this, xen_set_pci_link_route() needs to be stubbable which
this patch addresses.

Signed-off-by: Bernhard Beschow 
---
  hw/i386/xen/xen-hvm.c   | 7 ++-
  include/hw/xen/xen.h| 1 +
  include/hw/xen/xen_common.h | 6 --
  stubs/xen-hw-stub.c | 5 +
  4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 0731f70410..204fda7949 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -161,11 +161,16 @@ void xen_piix_pci_write_config_client(uint32_t address, 
uint32_t val, int len)
  }
  v &= 0xf;
  if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) 
{
-xen_set_pci_link_route(xen_domid, address + i - PIIX_PIRQCA, v);
+xen_set_pci_link_route(address + i - PIIX_PIRQCA, v);
  }
  }
  }
  
+int xen_set_pci_link_route(uint8_t link, uint8_t irq)

+{
+return xendevicemodel_set_pci_link_route(xen_dmod, xen_domid, link, irq);
+}
+
  int xen_is_pirq_msi(uint32_t msi_data)
  {
  /* If vector is 0, the msi is remapped into a pirq, passed as
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index 0f9962b1c1..13bffaef53 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -21,6 +21,7 @@ extern enum xen_mode xen_mode;
  extern bool xen_domid_restrict;
  
  int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);

+int xen_set_pci_link_route(uint8_t link, uint8_t irq);
  void xen_piix3_set_irq(void *opaque, int irq_num, int level);
  void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int 
len);
  void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 179741ff79..77ce17d8a4 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -316,12 +316,6 @@ static inline int xen_set_pci_intx_level(domid_t domid, 
uint16_t segment,
   device, intx, level);
  }
  
-static inline int xen_set_pci_link_route(domid_t domid, uint8_t link,

- uint8_t irq)
-{
-return xendevicemodel_set_pci_link_route(xen_dmod, domid, link, irq);
-}
-
  static inline int xen_inject_msi(domid_t domid, uint64_t msi_addr,
   uint32_t msi_data)
  {
diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c
index 15f3921a76..743967623f 100644
--- a/stubs/xen-hw-stub.c
+++ b/stubs/xen-hw-stub.c
@@ -23,6 +23,11 @@ void xen_piix_pci_write_config_client(uint32_t address, 
uint32_t val, int len)
  {
  }
  
+int xen_set_pci_link_route(uint8_t link, uint8_t irq)

+{
+return -1;
+}
+
  void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
  {
  }


Applied to my trivial-patches branch.

Thanks,
Laurent



Re: [PATCH 2/2] sysemu: Let VMChangeStateHandler take boolean 'running' argument

2021-03-09 Thread Laurent Vivier
Le 11/01/2021 à 16:20, Philippe Mathieu-Daudé a écrit :
> The 'running' argument from VMChangeStateHandler does not require
> other value than 0 / 1. Make it a plain boolean.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  include/sysemu/runstate.h   | 10 --
>  target/arm/kvm_arm.h|  2 +-
>  target/ppc/cpu-qom.h|  2 +-
>  accel/xen/xen-all.c |  2 +-
>  audio/audio.c   |  2 +-
>  block/block-backend.c   |  2 +-
>  gdbstub.c   |  2 +-
>  hw/block/pflash_cfi01.c |  2 +-
>  hw/block/virtio-blk.c   |  2 +-
>  hw/display/qxl.c|  2 +-
>  hw/i386/kvm/clock.c |  2 +-
>  hw/i386/kvm/i8254.c |  2 +-
>  hw/i386/kvmvapic.c  |  2 +-
>  hw/i386/xen/xen-hvm.c   |  2 +-
>  hw/ide/core.c   |  2 +-
>  hw/intc/arm_gicv3_its_kvm.c |  2 +-
>  hw/intc/arm_gicv3_kvm.c |  2 +-
>  hw/intc/spapr_xive_kvm.c|  2 +-
>  hw/misc/mac_via.c   |  2 +-
>  hw/net/e1000e_core.c|  2 +-
>  hw/nvram/spapr_nvram.c  |  2 +-
>  hw/ppc/ppc.c|  2 +-
>  hw/ppc/ppc_booke.c  |  2 +-
>  hw/s390x/tod-kvm.c  |  2 +-
>  hw/scsi/scsi-bus.c  |  2 +-
>  hw/usb/hcd-ehci.c   |  2 +-
>  hw/usb/host-libusb.c|  2 +-
>  hw/usb/redirect.c   |  2 +-
>  hw/vfio/migration.c |  2 +-
>  hw/virtio/virtio-rng.c  |  2 +-
>  hw/virtio/virtio.c  |  2 +-
>  net/net.c   |  2 +-
>  softmmu/memory.c|  2 +-
>  softmmu/runstate.c  |  2 +-
>  target/arm/kvm.c|  2 +-
>  target/i386/kvm/kvm.c   |  2 +-
>  target/i386/sev.c   |  2 +-
>  target/i386/whpx/whpx-all.c |  2 +-
>  target/mips/kvm.c   |  4 ++--
>  ui/gtk.c|  2 +-
>  ui/spice-core.c |  2 +-
>  41 files changed, 49 insertions(+), 43 deletions(-)
> 
> diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
> index 3ab35a039a0..a5356915734 100644
> --- a/include/sysemu/runstate.h
> +++ b/include/sysemu/runstate.h
> @@ -10,7 +10,7 @@ bool runstate_is_running(void);
>  bool runstate_needs_reset(void);
>  bool runstate_store(char *str, size_t size);
>  
> -typedef void VMChangeStateHandler(void *opaque, int running, RunState state);
> +typedef void VMChangeStateHandler(void *opaque, bool running, RunState 
> state);
>  
>  VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler 
> *cb,
>   void *opaque);
> @@ -20,7 +20,13 @@ VMChangeStateEntry 
> *qdev_add_vm_change_state_handler(DeviceState *dev,
>   VMChangeStateHandler 
> *cb,
>   void *opaque);
>  void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
> -void vm_state_notify(int running, RunState state);
> +/**
> + * vm_state_notify: Notify the state of the VM
> + *
> + * @running: whether the VM is running or not.
> + * @state: the #RunState of the VM.
> + */
> +void vm_state_notify(bool running, RunState state);
>  
>  static inline bool shutdown_caused_by_guest(ShutdownCause cause)
>  {
> diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
> index eb81b7059eb..68ec970c4f4 100644
> --- a/target/arm/kvm_arm.h
> +++ b/target/arm/kvm_arm.h
> @@ -352,7 +352,7 @@ void kvm_arm_get_virtual_time(CPUState *cs);
>   */
>  void kvm_arm_put_virtual_time(CPUState *cs);
>  
> -void kvm_arm_vm_state_change(void *opaque, int running, RunState state);
> +void kvm_arm_vm_state_change(void *opaque, bool running, RunState state);
>  
>  int kvm_arm_vgic_probe(void);
>  
> diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
> index 63b9e8632ca..118baf8d41f 100644
> --- a/target/ppc/cpu-qom.h
> +++ b/target/ppc/cpu-qom.h
> @@ -218,7 +218,7 @@ extern const VMStateDescription vmstate_ppc_timebase;
>  .offset = vmstate_offset_value(_state, _field, PPCTimebase),  \
>  }
>  
> -void cpu_ppc_clock_vm_state_change(void *opaque, int running,
> +void cpu_ppc_clock_vm_state_change(void *opaque, bool running,
> RunState state);
>  #endif
>  
> diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
> index 878a4089d97..3756aca27be 100644
> --- a/accel/xen/xen-all.c
> +++ b/accel/xen/xen-all.c
> @@ -122,7 +122,7 @@ static void xenstore_record_dm_state(struct xs_handle 
> *xs, const char *state)
>  }
>  
>  
> -static void xen_change_state_handler(void *opaque, int running,
> +static void xen_change_state_handler(void *opaque, bool running,
>   RunState state)
>  {
>  if (running) {
> diff --git a/audio/audio.c b/audio/audio.c
> index b48471bb3f6..f2d56e7e57d 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1549,7 +1549,7 @@ static int audio_driver_init(AudioState *s, struct 
> audio_driver *drv,
>  }
>  }
>  
> -static void audio_vm_change_state_handler (void *opaque, int running,
> 

Re: [PATCH 1/2] sysemu/runstate: Let runstate_is_running() return bool

2021-03-09 Thread Laurent Vivier
Le 11/01/2021 à 16:20, Philippe Mathieu-Daudé a écrit :
> runstate_check() returns a boolean. runstate_is_running()
> returns what runstate_check() returns, also a boolean.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  include/sysemu/runstate.h | 2 +-
>  softmmu/runstate.c| 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
> index e557f470d42..3ab35a039a0 100644
> --- a/include/sysemu/runstate.h
> +++ b/include/sysemu/runstate.h
> @@ -6,7 +6,7 @@
>  
>  bool runstate_check(RunState state);
>  void runstate_set(RunState new_state);
> -int runstate_is_running(void);
> +bool runstate_is_running(void);
>  bool runstate_needs_reset(void);
>  bool runstate_store(char *str, size_t size);
>  
> diff --git a/softmmu/runstate.c b/softmmu/runstate.c
> index 636aab0addb..c7a67147d17 100644
> --- a/softmmu/runstate.c
> +++ b/softmmu/runstate.c
> @@ -217,7 +217,7 @@ void runstate_set(RunState new_state)
>  current_run_state = new_state;
>  }
>  
> -int runstate_is_running(void)
> +bool runstate_is_running(void)
>  {
>  return runstate_check(RUN_STATE_RUNNING);
>  }
> 

Applied to my trivial-patches branch.

Thanks,
Laurent




Re: [PATCH] hw/i386/xen: Remove dead code

2021-02-13 Thread Laurent Vivier
Le 02/02/2021 à 16:56, Philippe Mathieu-Daudé a écrit :
> 'drivers_blacklisted' is never accessed, remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  hw/i386/xen/xen_platform.c | 13 ++---
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 7c4db35debb..01ae1fb1618 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -60,7 +60,6 @@ struct PCIXenPlatformState {
>  MemoryRegion bar;
>  MemoryRegion mmio_bar;
>  uint8_t flags; /* used only for version_id == 2 */
> -int drivers_blacklisted;
>  uint16_t driver_product_version;
>  
>  /* Log from guest drivers */
> @@ -245,18 +244,10 @@ static void platform_fixed_ioport_writeb(void *opaque, 
> uint32_t addr, uint32_t v
>  
>  static uint32_t platform_fixed_ioport_readw(void *opaque, uint32_t addr)
>  {
> -PCIXenPlatformState *s = opaque;
> -
>  switch (addr) {
>  case 0:
> -if (s->drivers_blacklisted) {
> -/* The drivers will recognise this magic number and refuse
> - * to do anything. */
> -return 0xd249;
> -} else {
> -/* Magic value so that you can identify the interface. */
> -return 0x49d2;
> -}
> +/* Magic value so that you can identify the interface. */
> +return 0x49d2;
>  default:
>  return 0x;
>  }
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



Re: [PATCH] hw/xen: Don't use '#' flag of printf format

2020-12-13 Thread Laurent Vivier
Le 04/11/2020 à 14:37, Xinhao Zhang a écrit :
> Fix code style. Don't use '#' flag of printf format ('%#') in
> format strings, use '0x' prefix instead
> 
> Signed-off-by: Xinhao Zhang 
> Signed-off-by: Kai Deng 
> ---
>  hw/xen/xen_pt.c | 10 +-
>  hw/xen/xen_pt_config_init.c |  6 +++---
>  hw/xen/xen_pt_msi.c | 16 
>  3 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 6d359ee486..a5f3dd590c 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -489,7 +489,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState 
> *s, uint16_t *cmd)
>  pci_register_bar(>dev, i, type, >bar[i]);
>  
>  XEN_PT_LOG(>dev, "IO region %i registered (size=0x%08"PRIx64
> -   " base_addr=0x%08"PRIx64" type: %#x)\n",
> +   " base_addr=0x%08"PRIx64" type: 0x%x)\n",
> i, r->size, r->base_addr, type);
>  }
>  
> @@ -578,7 +578,7 @@ static void xen_pt_check_bar_overlap(PCIBus *bus, 
> PCIDevice *d, void *opaque)
>  if (ranges_overlap(arg->addr, arg->size, r->addr, r->size)) {
>  XEN_PT_WARN(>dev,
>  "Overlapped to device [%02x:%02x.%d] Region: %i"
> -" (addr: %#"FMT_PCIBUS", len: %#"FMT_PCIBUS")\n",
> +" (addr: 0x%"FMT_PCIBUS", len: 0x%"FMT_PCIBUS")\n",
>  pci_bus_num(bus), PCI_SLOT(d->devfn),
>  PCI_FUNC(d->devfn), i, r->addr, r->size);
>  arg->rc = true;
> @@ -618,8 +618,8 @@ static void xen_pt_region_update(XenPCIPassthroughState 
> *s,
>  pci_for_each_device(pci_get_bus(d), pci_dev_bus_num(d),
>  xen_pt_check_bar_overlap, );
>  if (args.rc) {
> -XEN_PT_WARN(d, "Region: %d (addr: %#"FMT_PCIBUS
> -", len: %#"FMT_PCIBUS") is overlapped.\n",
> +XEN_PT_WARN(d, "Region: %d (addr: 0x%"FMT_PCIBUS
> +", len: 0x%"FMT_PCIBUS") is overlapped.\n",
>  bar, sec->offset_within_address_space,
>  int128_get64(sec->size));
>  }
> @@ -786,7 +786,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
>  
>  /* register real device */
>  XEN_PT_LOG(d, "Assigning real physical device %02x:%02x.%d"
> -   " to devfn %#x\n",
> +   " to devfn 0x%x\n",
> s->hostaddr.bus, s->hostaddr.slot, s->hostaddr.function,
> s->dev.devfn);
>  
> diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
> index c8724cc7c8..c5c4e943a8 100644
> --- a/hw/xen/xen_pt_config_init.c
> +++ b/hw/xen/xen_pt_config_init.c
> @@ -1622,7 +1622,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughState 
> *s,
>  case PCI_EXP_TYPE_PCIE_BRIDGE:
>  case PCI_EXP_TYPE_RC_EC:
>  default:
> -XEN_PT_ERR(d, "Unsupported device/port type %#x.\n", type);
> +XEN_PT_ERR(d, "Unsupported device/port type 0x%x.\n", type);
>  return -1;
>  }
>  }
> @@ -1645,11 +1645,11 @@ static int 
> xen_pt_pcie_size_init(XenPCIPassthroughState *s,
>  case PCI_EXP_TYPE_PCIE_BRIDGE:
>  case PCI_EXP_TYPE_RC_EC:
>  default:
> -XEN_PT_ERR(d, "Unsupported device/port type %#x.\n", type);
> +XEN_PT_ERR(d, "Unsupported device/port type 0x%x.\n", type);
>  return -1;
>  }
>  } else {
> -XEN_PT_ERR(d, "Unsupported capability version %#x.\n", version);
> +XEN_PT_ERR(d, "Unsupported capability version 0x%x.\n", version);
>  return -1;
>  }
>  
> diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
> index fb4b887b92..b71563f98a 100644
> --- a/hw/xen/xen_pt_msi.c
> +++ b/hw/xen/xen_pt_msi.c
> @@ -123,7 +123,7 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
>  *ppirq = XEN_PT_UNASSIGNED_PIRQ;
>  } else {
>  XEN_PT_LOG(>dev, "requested pirq %d for MSI%s"
> -   " (vec: %#x, entry: %#x)\n",
> +   " (vec: 0x%x, entry: 0x%x)\n",
> *ppirq, is_msix ? "-X" : "", gvec, msix_entry);
>  }
>  }
> @@ -142,7 +142,7 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
>   msix_entry, table_base);
>  if (rc) {
>  XEN_PT_ERR(>dev,
> -   "Mapping of MSI%s (err: %i, vec: %#x, entry %#x)\n",
> +   "Mapping of MSI%s (err: %i, vec: 0x%x, entry 0x%x)\n",
> is_msix ? "-X" : "", errno, gvec, msix_entry);
>  return rc;
>  }
> @@ -165,8 +165,8 @@ static int msi_msix_update(XenPCIPassthroughState *s,
>  int rc = 0;
>  uint64_t table_addr = 0;
>  
> -XEN_PT_LOG(d, "Updating MSI%s with pirq %d gvec %#x gflags %#x"
> -   " (entry: %#x)\n",
> +XEN_PT_LOG(d, 

Re: [PATCH] trivial: Remove trailing whitespaces

2020-07-07 Thread Laurent Vivier
Le 06/07/2020 à 18:23, Christophe de Dinechin a écrit :
> There are a number of unnecessary trailing whitespaces that have
> accumulated over time in the source code. They cause stray changes
> in patches if you use tools that automatically remove them.
> 
> Tested by doing a `git diff -w` after the change.
> 
> This could probably be turned into a pre-commit hook.
> 
> Signed-off-by: Christophe de Dinechin 
> ---
>  block/iscsi.c |   2 +-
>  disas/cris.c  |   2 +-
>  disas/microblaze.c|  80 +++---
>  disas/nios2.c | 256 +-
>  hmp-commands.hx   |   2 +-
>  hw/alpha/typhoon.c|   6 +-
>  hw/arm/gumstix.c  |   6 +-
>  hw/arm/omap1.c|   2 +-
>  hw/arm/stellaris.c|   2 +-
>  hw/char/etraxfs_ser.c |   2 +-
>  hw/core/ptimer.c  |   2 +-
>  hw/cris/axis_dev88.c  |   2 +-
>  hw/cris/boot.c|   2 +-
>  hw/display/qxl.c  |   2 +-
>  hw/dma/etraxfs_dma.c  |  18 +-
>  hw/dma/i82374.c   |   2 +-
>  hw/i2c/bitbang_i2c.c  |   2 +-
>  hw/input/tsc2005.c|   2 +-
>  hw/input/tsc210x.c|   2 +-
>  hw/intc/etraxfs_pic.c |   8 +-
>  hw/intc/sh_intc.c |  10 +-
>  hw/intc/xilinx_intc.c |   2 +-
>  hw/misc/imx25_ccm.c   |   6 +-
>  hw/misc/imx31_ccm.c   |   2 +-
>  hw/net/vmxnet3.h  |   2 +-
>  hw/net/xilinx_ethlite.c   |   2 +-
>  hw/pci/pcie.c |   2 +-
>  hw/sd/omap_mmc.c  |   2 +-
>  hw/sh4/shix.c |   2 +-
>  hw/sparc64/sun4u.c|   2 +-
>  hw/timer/etraxfs_timer.c  |   2 +-
>  hw/timer/xilinx_timer.c   |   4 +-
>  hw/usb/hcd-musb.c |  10 +-
>  hw/usb/hcd-ohci.c |   6 +-
>  hw/usb/hcd-uhci.c |   2 +-
>  hw/virtio/virtio-pci.c|   2 +-
>  include/hw/cris/etraxfs_dma.h |   4 +-
>  include/hw/net/lance.h|   2 +-
>  include/hw/ppc/spapr.h|   2 +-
>  include/hw/xen/interface/io/ring.h|  34 +--
>  include/qemu/log.h|   2 +-
>  include/qom/object.h  |   4 +-
>  linux-user/cris/cpu_loop.c|  16 +-
>  linux-user/microblaze/cpu_loop.c  |  16 +-
>  linux-user/mmap.c |   8 +-
>  linux-user/sparc/signal.c |   4 +-
>  linux-user/syscall.c  |  24 +-
>  linux-user/syscall_defs.h |   2 +-
>  linux-user/uaccess.c  |   2 +-
>  os-posix.c|   2 +-
>  qapi/qapi-util.c  |   2 +-
>  qemu-img.c|   2 +-
>  qemu-options.hx   |  26 +-
>  qom/object.c  |   2 +-
>  target/cris/translate.c   |  28 +-
>  target/cris/translate_v10.inc.c   |   6 +-
>  target/i386/hvf/hvf.c |   4 +-
>  target/i386/hvf/x86.c |   4 +-
>  target/i386/hvf/x86_decode.c  |  20 +-
>  target/i386/hvf/x86_decode.h  |   4 +-
>  target/i386/hvf/x86_descr.c   |   2 +-
>  target/i386/hvf/x86_emu.c |   2 +-
>  target/i386/hvf/x86_mmu.c |   6 +-
>  target/i386/hvf/x86_task.c|   2 +-
>  target/i386/hvf/x86hvf.c  |  42 +--
>  target/i386/translate.c   |   8 +-
>  target/microblaze/mmu.c   |   2 +-
>  target/microblaze/translate.c |   2 +-
>  target/sh4/op_helper.c|   4 +-
>  target/xtensa/core-de212/core-isa.h   |   6 +-
>  .../xtensa/core-sample_controller/core-isa.h  |   6 +-
>  target/xtensa/core-test_kc705_be/core-isa.h   |   2 +-
>  tcg/sparc/tcg-target.inc.c|   2 +-
>  tcg/tcg.c |  32 +--
>  tests/tcg/multiarch/test-mmap.c   |  72 ++---
>  ui/curses.c   |   4 +-
>  ui/curses_keys.h  |   4 +-
>  util/cutils.c |   2 +-
>  78 files changed, 440 

Re: [PATCH v2 8/8] target/i386/cpu: Use the IEC binary prefix definitions

2020-06-09 Thread Laurent Vivier
Le 01/06/2020 à 16:29, Philippe Mathieu-Daudé a écrit :
> IEC binary prefixes ease code review: the unit is explicit.
> 
> Reviewed-by: Peter Maydell 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  target/i386/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 3733d9a279..33ce4861fb 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -6159,7 +6159,7 @@ static void x86_cpu_machine_done(Notifier *n, void 
> *unused)
>  if (smram) {
>  cpu->smram = g_new(MemoryRegion, 1);
>  memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram",
> - smram, 0, 1ull << 32);
> + smram, 0, 4 * GiB);
>  memory_region_set_enabled(cpu->smram, true);
>  memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->smram, 
> 1);
>  }
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



Re: [PATCH v2 7/8] hw/i386/xen/xen-hvm: Use the IEC binary prefix definitions

2020-06-09 Thread Laurent Vivier
Le 01/06/2020 à 16:29, Philippe Mathieu-Daudé a écrit :
> IEC binary prefixes ease code review: the unit is explicit.
> 
> Reviewed-by: Peter Maydell 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  hw/i386/xen/xen-hvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index 82ece6b9e7..94fe5d65e9 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qemu/units.h"
>  
>  #include "cpu.h"
>  #include "hw/pci/pci.h"
> @@ -230,7 +231,7 @@ static void xen_ram_init(PCMachineState *pcms,
>   * Xen does not allocate the memory continuously, it keeps a
>   * hole of the size computed above or passed in.
>   */
> -block_len = (1ULL << 32) + x86ms->above_4g_mem_size;
> +block_len = (4 * GiB) + x86ms->above_4g_mem_size;
>  }
>  memory_region_init_ram(_memory, NULL, "xen.ram", block_len,
> _fatal);
> 

Applied to my trivial-patches branch.

Thanks,
Laurent




Re: [PATCH v2 6/8] hw/hppa/dino: Use the IEC binary prefix definitions

2020-06-09 Thread Laurent Vivier
Le 01/06/2020 à 16:29, Philippe Mathieu-Daudé a écrit :
> IEC binary prefixes ease code review: the unit is explicit.
> 
> Reviewed-by: Peter Maydell 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  hw/hppa/dino.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
> index 2b1b38c58a..7290f23962 100644
> --- a/hw/hppa/dino.c
> +++ b/hw/hppa/dino.c
> @@ -542,7 +542,7 @@ PCIBus *dino_init(MemoryRegion *addr_space,
>  >parent_obj.data_mem);
>  
>  /* Dino PCI bus memory.  */
> -memory_region_init(>pci_mem, OBJECT(s), "pci-memory", 1ull << 32);
> +memory_region_init(>pci_mem, OBJECT(s), "pci-memory", 4 * GiB);
>  
>  b = pci_register_root_bus(dev, "pci", dino_set_irq, dino_pci_map_irq, s,
>>pci_mem, get_system_io(),
> @@ -561,7 +561,7 @@ PCIBus *dino_init(MemoryRegion *addr_space,
>  }
>  
>  /* Set up PCI view of memory: Bus master address space.  */
> -memory_region_init(>bm, OBJECT(s), "bm-dino", 1ull << 32);
> +memory_region_init(>bm, OBJECT(s), "bm-dino", 4 * GiB);
>  memory_region_init_alias(>bm_ram_alias, OBJECT(s),
>   "bm-system", addr_space, 0,
>   0xf000 + DINO_MEM_CHUNK_SIZE);
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



Re: [PATCH v2 1/8] hw/arm/aspeed: Correct DRAM container region size

2020-06-09 Thread Laurent Vivier
Le 01/06/2020 à 16:29, Philippe Mathieu-Daudé a écrit :
> memory_region_set_size() handle the 16 Exabytes limit by
> special-casing the UINT64_MAX value. This is not a problem
> for the 32-bit maximum, 4 GiB.
> By using the UINT32_MAX value, the aspeed-ram-container
> MemoryRegion ends up missing 1 byte:
> 
>  $ qemu-system-arm -M ast2600-evb -S -monitor stdio
>  (qemu) info mtree
> 
>   address-space: aspeed.fmc-ast2600-dma-dram
> 8000-00017ffe (prio 0, i/o): aspeed-ram-container
>   8000-bfff (prio 0, ram): ram
>   c000- (prio 0, i/o): max_ram
> 
> Fix by using the correct value. We now have:
> 
>   address-space: aspeed.fmc-ast2600-dma-dram
> 8000-00017fff (prio 0, i/o): aspeed-ram-container
>   8000-bfff (prio 0, ram): ram
>   c000- (prio 0, i/o): max_ram
> 
> Reviewed-by: Peter Maydell 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  hw/arm/aspeed.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index 2c23297edf..62344ac6a3 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -262,7 +262,7 @@ static void aspeed_machine_init(MachineState *machine)
>  bmc = g_new0(AspeedBoardState, 1);
>  
>  memory_region_init(>ram_container, NULL, "aspeed-ram-container",
> -   UINT32_MAX);
> +   4 * GiB);
>  memory_region_add_subregion(>ram_container, 0, machine->ram);
>  
>  object_initialize_child(OBJECT(machine), "soc", >soc,
> 

Applied to my trivial-patches branch.

Thanks,
Laurent




Re: [Xen-devel] [PATCH 00/20] hw: Clean up hw/i386 headers (and few alpha/hppa)

2020-03-09 Thread Laurent Vivier
Le 27/02/2020 à 14:28, Paolo Bonzini a écrit :
> On 26/10/19 15:32, Laurent Vivier wrote:
>> Le 26/10/2019 à 14:20, Philippe Mathieu-Daudé a écrit :
>>> Hi,
>>>
>>> On 10/14/19 4:22 PM, Philippe Mathieu-Daudé wrote:
>>>> This is a follow-up of Markus's cleanup series:
>>>> Tame a few "touch this, recompile the world"
>>>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg635748.html
>>>>
>>>> This part is mostly restricted to X86, but since some file from the
>>>> Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them
>>>> too.
>>>>
>>>> Eventually I'll succeed at removing hw/i386/ dependency on non-X86
>>>> platforms (Quest I started 2 years ago...).
>>>>
>>>> Regards,
>>>>
>>>> Phil.
>>>>
>>>> Philippe Mathieu-Daudé (20):
>>>>    vl: Add missing "hw/boards.h" include
>>>>    hw/southbridge/ich9: Removed unused headers
>>>>    hw/input/pckbd: Remove unused "hw/i386/pc.h" header
>>>>    hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
>>>>    hw/timer: Remove unused "ui/console.h" header
>>>>    hw/usb/dev-storage: Remove unused "ui/console.h" header
>>>>    hw/i386/intel_iommu: Remove unused includes
>>>>    hw/xen/xen_pt_load_rom: Remove unused includes
>>>>    hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
>>>>    hw/alpha/dp264: Include "net/net.h"
>>>>    hw/hppa/machine: Include "net/net.h"
>>>>    hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
>>>>    hw/timer/hpet: Include "exec/address-spaces.h"
>>>>    hw/pci-host/q35: Include "qemu/range.h"
>>>>    hw/i2c/smbus_ich9: Include "qemu/range.h"
>>>>    hw/pci-host/piix: Include "qemu/range.h"
>>>>    hw/acpi: Include "hw/mem/nvdimm.h"
>>>>    hw/i386: Include "hw/mem/nvdimm.h"
>>>>    hw/pci-host/q35: Remove unused includes
>>>>    hw/i386/pc: Clean up includes
>>> Laurent, since this series is fully reviewed, can it go via
>>> your qemu-trivial tree?
>>
>> I'll try but I'm not sure to have the time to do that before the softfreeze.
> 
> Ping :)

Applied v2 to my trivial-patches branch.

Thanks,
Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v2 1/4] qapi: net: Add query-netdevs command

2020-03-04 Thread Laurent Vivier
On 04/03/2020 14:06, Alexey Kirillov wrote:
> Add a qmp command that provides information about currently attached
> network devices and their configuration.
> 
> Signed-off-by: Alexey Kirillov 
> ---
>  include/net/net.h |   1 +
>  net/hub.c |   8 +++
>  net/l2tpv3.c  |  19 +++
>  net/net.c |  91 +
>  net/netmap.c  |  13 +
>  net/slirp.c   | 126 ++
>  net/socket.c  |  71 ++
>  net/tap-win32.c   |   9 
>  net/tap.c | 103 +++--
>  net/vde.c |  26 ++
>  net/vhost-user.c  |  18 +--
>  qapi/net.json |  89 
>  12 files changed, 566 insertions(+), 8 deletions(-)
> 
...
> diff --git a/net/net.c b/net/net.c
> index 9e93c3f8a1..01e0548295 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -54,6 +54,7 @@
>  #include "sysemu/sysemu.h"
>  #include "net/filter.h"
>  #include "qapi/string-output-visitor.h"
> +#include "qapi/clone-visitor.h"
>  
>  /* Net bridge is currently not supported for W32. */
>  #if !defined(_WIN32)
> @@ -128,6 +129,12 @@ char *qemu_mac_strdup_printf(const uint8_t *macaddr)
>  
>  void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6])
>  {
> +g_assert(nc->stored_config);
> +
> +g_free(nc->stored_config->u.nic.macaddr);
> +nc->stored_config->u.nic.macaddr = g_strdup_printf(MAC_FMT,
> +   MAC_ARG(macaddr));
> +

Why do you use this rather than the qemu_mac_strdup_printf() function
defined above?

qemu_mac_strdup_printf():
  890ee6abb385 ("net: add MAC address string printer")

MAC_FMT/MAC_ARG:
  6d1d4939a647 ("net: Add macros for MAC address tracing")

MAC_FMT/MAC_ARG seems to be reserved for tracing.

Thanks,
Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v2 4/4] net: Remove field info_str of NetClientState

2020-03-04 Thread Laurent Vivier
On 04/03/2020 14:06, Alexey Kirillov wrote:
> Completely remove the info_str field of struct NetClientState because
> it is no longer required due to the addition of the QMP query-netdevs command.
> 
> Signed-off-by: Alexey Kirillov 
> ---
>  hw/net/allwinner_emac.c |  2 +-
>  hw/net/dp8393x.c|  2 +-
>  hw/net/e1000.c  |  4 ++--
>  hw/net/e1000e.c |  2 +-
>  hw/net/e1000e_core.c|  2 +-
>  hw/net/e1000x_common.c  |  2 +-
>  hw/net/eepro100.c   |  5 +++--
>  hw/net/etraxfs_eth.c|  2 +-
>  hw/net/fsl_etsec/etsec.c|  2 +-
>  hw/net/ftgmac100.c  |  2 +-
>  hw/net/i82596.c |  6 +++---
>  hw/net/imx_fec.c|  2 +-
>  hw/net/lan9118.c|  4 ++--
>  hw/net/mcf_fec.c|  2 +-
>  hw/net/milkymist-minimac2.c |  2 +-
>  hw/net/mipsnet.c|  2 +-
>  hw/net/ne2000-isa.c |  2 +-
>  hw/net/ne2000-pci.c |  2 +-
>  hw/net/pcnet.c  |  2 +-
>  hw/net/rocker/rocker_fp.c   |  4 ++--
>  hw/net/rtl8139.c|  6 +++---
>  hw/net/smc91c111.c  |  2 +-
>  hw/net/spapr_llan.c |  6 +++---
>  hw/net/stellaris_enet.c |  2 +-
>  hw/net/sungem.c |  4 ++--
>  hw/net/sunhme.c |  2 +-
>  hw/net/tulip.c  |  2 +-
>  hw/net/virtio-net.c |  8 
>  hw/net/vmxnet3.c|  4 ++--
>  hw/net/xen_nic.c|  4 
>  hw/net/xgmac.c  |  2 +-
>  hw/net/xilinx_axienet.c |  2 +-
>  hw/net/xilinx_ethlite.c |  2 +-
>  hw/usb/dev-network.c|  2 +-
>  include/net/net.h   |  3 +--
>  net/l2tpv3.c|  3 ---
>  net/net.c   |  8 +---
>  net/slirp.c |  4 
>  net/socket.c| 24 
>  net/tap.c   | 12 
>  net/vde.c           |  4 
>  net/vhost-user.c|  2 --
>  42 files changed, 51 insertions(+), 110 deletions(-)
> 

Reviewed-by: Laurent Vivier 
Tested-by: Laurent Vivier 




___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications

2020-02-20 Thread Laurent Vivier
On 20/02/2020 14:05, Philippe Mathieu-Daudé wrote:
> When we use a Coccinelle semantic script to do automatic
> code modifications, it makes sense to look at the semantic
> patch first.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  scripts/git.orderfile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/git.orderfile b/scripts/git.orderfile
> index 1f747b583a..7cf22e0bf5 100644
> --- a/scripts/git.orderfile
> +++ b/scripts/git.orderfile
> @@ -22,6 +22,9 @@ Makefile*
>  qapi/*.json
>  qga/*.json
>  
> +# semantic patches
> +*.cocci
> +
>  # headers
>  *.h
>  
> 

Reviewed-by: Laurent Vivier 


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH-for-5.0 v3 3/6] hw/pci-host/i440fx: Use size_t to iterate over ARRAY_SIZE()

2019-12-18 Thread Laurent Vivier
Le 18/12/2019 à 13:01, Paolo Bonzini a écrit :
> On 18/12/19 12:57, Laurent Vivier wrote:
>> Le 09/12/2019 à 11:05, Thomas Huth a écrit :
>>> On 09/12/2019 10.49, Philippe Mathieu-Daudé wrote:
>>>> We don't enforce the -Wsign-conversion CPPFLAG, but it doesn't hurt
>>>> to avoid this warning:
>>>>
>>>>   warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 
>>>> 'unsigned long') [-Wsign-conversion]
>>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé 
>>>> ---
>>>>  hw/pci-host/i440fx.c | 5 ++---
>>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
>>>> index fbdc563599..0cc80b276d 100644
>>>> --- a/hw/pci-host/i440fx.c
>>>> +++ b/hw/pci-host/i440fx.c
>>>> @@ -419,12 +419,11 @@ out:
>>>>  static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp)
>>>>  {
>>>>  uint32_t val = 0;
>>>> -int i, num;
>>>> +size_t i;
>>>>  int pos, len;
>>>>  Error *local_err = NULL;
>>>>  
>>>> -num = ARRAY_SIZE(igd_host_bridge_infos);
>>>> -for (i = 0; i < num; i++) {
>>>> +for (i = 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) {
>>>>  pos = igd_host_bridge_infos[i].offset;
>>>>  len = igd_host_bridge_infos[i].len;
>>>>  host_pci_config_read(pos, len, , _err);
>>>>
>>>
>>> Reviewed-by: Thomas Huth 
>>>
>>>
>>
>> Applied to my trivial-patches branch.
> 
> No need to, I've already queued the whole series.
> 

ok, I've removed them from my queue.

Thanks,
Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH-for-5.0 v3 3/6] hw/pci-host/i440fx: Use size_t to iterate over ARRAY_SIZE()

2019-12-18 Thread Laurent Vivier
Le 09/12/2019 à 11:05, Thomas Huth a écrit :
> On 09/12/2019 10.49, Philippe Mathieu-Daudé wrote:
>> We don't enforce the -Wsign-conversion CPPFLAG, but it doesn't hurt
>> to avoid this warning:
>>
>>   warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 
>> 'unsigned long') [-Wsign-conversion]
>>
>> Signed-off-by: Philippe Mathieu-Daudé 
>> ---
>>  hw/pci-host/i440fx.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
>> index fbdc563599..0cc80b276d 100644
>> --- a/hw/pci-host/i440fx.c
>> +++ b/hw/pci-host/i440fx.c
>> @@ -419,12 +419,11 @@ out:
>>  static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp)
>>  {
>>  uint32_t val = 0;
>> -int i, num;
>> +size_t i;
>>  int pos, len;
>>  Error *local_err = NULL;
>>  
>> -num = ARRAY_SIZE(igd_host_bridge_infos);
>> -for (i = 0; i < num; i++) {
>> +for (i = 0; i < ARRAY_SIZE(igd_host_bridge_infos); i++) {
>>  pos = igd_host_bridge_infos[i].offset;
>>  len = igd_host_bridge_infos[i].len;
>>  host_pci_config_read(pos, len, , _err);
>>
> 
> Reviewed-by: Thomas Huth 
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH-for-5.0 v3 1/6] hw/pci-host/i440fx: Correct the header description

2019-12-18 Thread Laurent Vivier
Le 09/12/2019 à 11:02, Thomas Huth a écrit :
> On 09/12/2019 10.49, Philippe Mathieu-Daudé wrote:
>> Missed during the refactor in commits 14a026dd58 and 0f25d865a,
>> this file is now only about the i440FX chipset.
>>
>> Signed-off-by: Philippe Mathieu-Daudé 
>> ---
>>  hw/pci-host/i440fx.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
>> index f27131102d..3fc94426ea 100644
>> --- a/hw/pci-host/i440fx.c
>> +++ b/hw/pci-host/i440fx.c
>> @@ -1,5 +1,5 @@
>>  /*
>> - * QEMU i440FX/PIIX3 PCI Bridge Emulation
>> + * QEMU i440FX PCI Bridge Emulation
>>   *
>>   * Copyright (c) 2006 Fabrice Bellard
>>   *
>>
> 
> Reviewed-by: Thomas Huth 
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PULL v2 0/3] Trivial branch patches

2019-11-06 Thread Laurent Vivier
Le 06/11/2019 à 17:05, Peter Maydell a écrit :
> On Tue, 5 Nov 2019 at 20:06, Laurent Vivier  wrote:
>>
>> Le 05/11/2019 à 20:20, no-re...@patchew.org a écrit :
>>> Patchew URL: 
>>> https://patchew.org/QEMU/20191105175010.2591-1-laur...@vivier.eu/
>>>
>>>
>>>
>>> Hi,
>>>
>>> This series seems to have some coding style problems. See output below for
>>> more information:
>>>
>>> Subject: [Xen-devel] [PULL v2 0/3] Trivial branch patches
>>> Type: series
>>> Message-id: 20191105175010.2591-1-laur...@vivier.eu
>>>
>>> === TEST SCRIPT BEGIN ===
>>> #!/bin/bash
>>> git rev-parse base > /dev/null || exit 0
>>> git config --local diff.renamelimit 0
>>> git config --local diff.renames True
>>> git config --local diff.algorithm histogram
>>> ./scripts/checkpatch.pl --mailback base..
>>> === TEST SCRIPT END ===
>>>
>>> Switched to a new branch 'test'
>>> 49a55f7 global: Squash 'the the'
>>> c0b5513 hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses
>>> eb43395 hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
>>>
>>> === OUTPUT BEGIN ===
>>> 1/3 Checking commit eb43395bf8f1 (hw/misc/grlib_ahb_apb_pnp: Avoid crash 
>>> when writing to PnP registers)
>>> 2/3 Checking commit c0b5513f971a (hw/misc/grlib_ahb_apb_pnp: Fix 8-bit 
>>> accesses)
>>> 3/3 Checking commit 49a55f7feb19 (global: Squash 'the the')
>>> ERROR: do not use C99 // comments
>>> #26: FILE: disas/libvixl/vixl/invalset.h:105:
>>> +  // Note that this does not mean the backing storage is empty: it can 
>>> still
>>
>> As reported by David Gilbert, this is a false positive as this file is a
>> C++ file.
> 
> True, but it's also a third-party dependency that we have
> taken a copy of. If we care about fixing its typos in comments
> we should do that by submitting the fixes upstream. We should
> avoid making changes to our local copy of this code because
> it just makes it unnecessarily more difficult to do updates to
> newer versions.
> 
> Could you drop that change, please? (Sorry I didn't notice
> it going by when the patch was originally on list.)

Sure.

Thanks,
Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PULL v2 0/3] Trivial branch patches

2019-11-05 Thread Laurent Vivier
Le 05/11/2019 à 20:20, no-re...@patchew.org a écrit :
> Patchew URL: https://patchew.org/QEMU/20191105175010.2591-1-laur...@vivier.eu/
> 
> 
> 
> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Subject: [Xen-devel] [PULL v2 0/3] Trivial branch patches
> Type: series
> Message-id: 20191105175010.2591-1-laur...@vivier.eu
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> git rev-parse base > /dev/null || exit 0
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> git config --local diff.algorithm histogram
> ./scripts/checkpatch.pl --mailback base..
> === TEST SCRIPT END ===
> 
> Switched to a new branch 'test'
> 49a55f7 global: Squash 'the the'
> c0b5513 hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses
> eb43395 hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
> 
> === OUTPUT BEGIN ===
> 1/3 Checking commit eb43395bf8f1 (hw/misc/grlib_ahb_apb_pnp: Avoid crash when 
> writing to PnP registers)
> 2/3 Checking commit c0b5513f971a (hw/misc/grlib_ahb_apb_pnp: Fix 8-bit 
> accesses)
> 3/3 Checking commit 49a55f7feb19 (global: Squash 'the the')
> ERROR: do not use C99 // comments
> #26: FILE: disas/libvixl/vixl/invalset.h:105:
> +  // Note that this does not mean the backing storage is empty: it can still

As reported by David Gilbert, this is a false positive as this file is a
C++ file.

Thanks,
LAurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 2/3] hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses

2019-11-05 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

The Plug & Play region of the AHB/APB bridge can be accessed
by various word size, however the implementation is clearly
restricted to 32-bit:

  static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
  {
  APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);

  return apb_pnp->regs[offset >> 2];
  }

Set the MemoryRegionOps::impl min/max fields to 32-bit, so
memory.c::access_with_adjusted_size() can adjust when the
access is not 32-bit.

This is required to run RTEMS on leon3, the grlib scanning
functions do byte accesses.

Reported-by: Jiri Gaisler 
Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: KONRAD Frederic 
Message-Id: <20191025110114.27091-3-phi...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 hw/misc/grlib_ahb_apb_pnp.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index f3c015d2c35f..e230e2536361 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -242,6 +242,10 @@ static const MemoryRegionOps grlib_apb_pnp_ops = {
 .read   = grlib_apb_pnp_read,
 .write  = grlib_apb_pnp_write,
 .endianness = DEVICE_BIG_ENDIAN,
+.impl = {
+.min_access_size = 4,
+.max_access_size = 4,
+},
 };
 
 static void grlib_apb_pnp_realize(DeviceState *dev, Error **errp)
-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 3/3] global: Squash 'the the'

2019-11-05 Thread Laurent Vivier
From: "Dr. David Alan Gilbert" 

'the' has a tendency to double up; squash them back down.

Signed-off-by: Dr. David Alan Gilbert 
Reviewed-by: Alex Bennée 
Reviewed-by: Laurent Vivier 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20191104185202.102504-1-dgilb...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 disas/libvixl/vixl/invalset.h   | 2 +-
 docs/interop/pr-helper.rst  | 2 +-
 docs/specs/ppc-spapr-hotplug.txt| 2 +-
 docs/specs/ppc-xive.rst | 2 +-
 docs/specs/tpm.txt  | 2 +-
 include/hw/xen/interface/io/blkif.h | 2 +-
 scripts/dump-guest-memory.py| 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/disas/libvixl/vixl/invalset.h b/disas/libvixl/vixl/invalset.h
index ffdc0237b47c..ef5e49d6feb2 100644
--- a/disas/libvixl/vixl/invalset.h
+++ b/disas/libvixl/vixl/invalset.h
@@ -102,7 +102,7 @@ template class InvalSet {
   size_t size() const;
 
   // Returns true if no elements are stored in the set.
-  // Note that this does not mean the the backing storage is empty: it can 
still
+  // Note that this does not mean the backing storage is empty: it can still
   // contain invalid elements.
   bool empty() const;
 
diff --git a/docs/interop/pr-helper.rst b/docs/interop/pr-helper.rst
index 9f76d5bcf98f..e926f0a6c9cb 100644
--- a/docs/interop/pr-helper.rst
+++ b/docs/interop/pr-helper.rst
@@ -10,7 +10,7 @@ can delegate implementation of persistent reservations to an 
external
 restricting access to block devices to specific initiators in a shared
 storage setup.
 
-For a more detailed reference please refer the the SCSI Primary
+For a more detailed reference please refer to the SCSI Primary
 Commands standard, specifically the section on Reservations and the
 "PERSISTENT RESERVE IN" and "PERSISTENT RESERVE OUT" commands.
 
diff --git a/docs/specs/ppc-spapr-hotplug.txt b/docs/specs/ppc-spapr-hotplug.txt
index cc7833108e12..859d52cce6c8 100644
--- a/docs/specs/ppc-spapr-hotplug.txt
+++ b/docs/specs/ppc-spapr-hotplug.txt
@@ -385,7 +385,7 @@ Each LMB list entry consists of the following elements:
   is used to retrieve the right associativity list to be used for this
   LMB.
 - A 32bit flags word. The bit at bit position 0x0008 defines whether
-  the LMB is assigned to the the partition as of boot time.
+  the LMB is assigned to the partition as of boot time.
 
 ibm,dynamic-memory-v2
 
diff --git a/docs/specs/ppc-xive.rst b/docs/specs/ppc-xive.rst
index 148d57eb6ab2..83d43f658b90 100644
--- a/docs/specs/ppc-xive.rst
+++ b/docs/specs/ppc-xive.rst
@@ -163,7 +163,7 @@ Interrupt Priority Register (PIPR) is also updated using 
the IPB. This
 register represent the priority of the most favored pending
 notification.
 
-The PIPR is then compared to the the Current Processor Priority
+The PIPR is then compared to the Current Processor Priority
 Register (CPPR). If it is more favored (numerically less than), the
 CPU interrupt line is raised and the EO bit of the Notification Source
 Register (NSR) is updated to notify the presence of an exception for
diff --git a/docs/specs/tpm.txt b/docs/specs/tpm.txt
index 5d8c26b1adba..9c8cca042da8 100644
--- a/docs/specs/tpm.txt
+++ b/docs/specs/tpm.txt
@@ -89,7 +89,7 @@ TPM upon reboot. The PPI specification defines the operation 
requests and the
 actions the firmware has to take. The system administrator passes the operation
 request number to the firmware through an ACPI interface which writes this
 number to a memory location that the firmware knows. Upon reboot, the firmware
-finds the number and sends commands to the the TPM. The firmware writes the TPM
+finds the number and sends commands to the TPM. The firmware writes the TPM
 result code and the operation request number to a memory location that ACPI can
 read from and pass the result on to the administrator.
 
diff --git a/include/hw/xen/interface/io/blkif.h 
b/include/hw/xen/interface/io/blkif.h
index 8b1be50ce81e..d07fa1e07822 100644
--- a/include/hw/xen/interface/io/blkif.h
+++ b/include/hw/xen/interface/io/blkif.h
@@ -341,7 +341,7 @@
  *  access (even when it should be read-only). If the frontend hits the
  *  maximum number of allowed persistently mapped grants, it can fallback
  *  to non persistent mode. This will cause a performance degradation,
- *  since the the backend driver will still try to map those grants
+ *  since the backend driver will still try to map those grants
  *  persistently. Since the persistent grants protocol is compatible with
  *  the previous protocol, a frontend driver can choose to work in
  *  persistent mode even when the backend doesn't support it.
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 2c587cbefc57..9371e4581308 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -170,7 +170,7 @@ class ELF(object):
 self.ehdr.e_phnum += 1
 
 def to_file(self, elf_file):
-

[Xen-devel] [PULL v2 1/3] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers

2019-11-05 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Guests can crash QEMU when writting to PnP registers:

  $ echo 'writeb 0x800ff042 69' | qemu-system-sparc -M leon3_generic -S -bios 
/etc/magic -qtest stdio
  [I 1571938309.932255] OPENED
  [R +0.063474] writeb 0x800ff042 69
  Segmentation fault (core dumped)

  (gdb) bt
  #0  0x in  ()
  #1  0x555f4bcdf0bc in memory_region_write_with_attrs_accessor 
(mr=0x555f4d7be8c0, addr=66, value=0x7fff07d00f08, size=1, shift=0, mask=255, 
attrs=...) at memory.c:503
  #2  0x555f4bcdf185 in access_with_adjusted_size (addr=66, 
value=0x7fff07d00f08, size=1, access_size_min=1, access_size_max=4, 
access_fn=0x555f4bcdeff4 , 
mr=0x555f4d7be8c0, attrs=...) at memory.c:539
  #3  0x555f4bce2243 in memory_region_dispatch_write (mr=0x555f4d7be8c0, 
addr=66, data=69, op=MO_8, attrs=...) at memory.c:1489
  #4  0x555f4bc80b20 in flatview_write_continue (fv=0x555f4d92c400, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, addr1=66, l=1, 
mr=0x555f4d7be8c0) at exec.c:3161
  #5  0x555f4bc80c65 in flatview_write (fv=0x555f4d92c400, addr=2148528194, 
attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3201
  #6  0x555f4bc80fb0 in address_space_write (as=0x555f4d7aa460, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3291
  #7  0x555f4bc8101d in address_space_rw (as=0x555f4d7aa460, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, is_write=true) at 
exec.c:3301
  #8  0x555f4bcdb388 in qtest_process_command (chr=0x555f4c2ed7e0 
, words=0x555f4db0c5d0) at qtest.c:432

Instead of crashing, log the access as unimplemented.

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: KONRAD Frederic 
Message-Id: <20191025110114.27091-2-phi...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 hw/misc/grlib_ahb_apb_pnp.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index 7338461694c9..f3c015d2c35f 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/sysbus.h"
 #include "hw/misc/grlib_ahb_apb_pnp.h"
 
@@ -231,8 +232,15 @@ static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr 
offset, unsigned size)
 return apb_pnp->regs[offset >> 2];
 }
 
+static void grlib_apb_pnp_write(void *opaque, hwaddr addr,
+uint64_t val, unsigned size)
+{
+qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+}
+
 static const MemoryRegionOps grlib_apb_pnp_ops = {
 .read   = grlib_apb_pnp_read,
+.write  = grlib_apb_pnp_write,
 .endianness = DEVICE_BIG_ENDIAN,
 };
 
-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 0/3] Trivial branch patches

2019-11-05 Thread Laurent Vivier
The following changes since commit 36609b4fa36f0ac934874371874416f7533a5408:

  Merge remote-tracking branch 'remotes/palmer/tags/palmer-for-master-4.2-sf1' 
into staging (2019-11-02 17:59:03 +)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/trivial-branch-pull-request

for you to fetch changes up to e187e55ec65039ed6bd982debee632450ace3bae:

  global: Squash 'the the' (2019-11-05 18:39:14 +0100)


Trivial fixes (20191105-v2)



Dr. David Alan Gilbert (1):
  global: Squash 'the the'

Philippe Mathieu-Daudé (2):
  hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
  hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses

 disas/libvixl/vixl/invalset.h   |  2 +-
 docs/interop/pr-helper.rst  |  2 +-
 docs/specs/ppc-spapr-hotplug.txt|  2 +-
 docs/specs/ppc-xive.rst |  2 +-
 docs/specs/tpm.txt  |  2 +-
 hw/misc/grlib_ahb_apb_pnp.c | 12 
 include/hw/xen/interface/io/blkif.h |  2 +-
 scripts/dump-guest-memory.py|  2 +-
 8 files changed, 19 insertions(+), 7 deletions(-)

-- 
v2: remove patch from Greg that has lines with more than 80 columns
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PULL 0/4] Trivial branch patches

2019-11-05 Thread Laurent Vivier
Le 05/11/2019 à 17:03, Dr. David Alan Gilbert a écrit :
> * Laurent Vivier (laur...@vivier.eu) wrote:
>> Greg, Dave,
>>
>> could you fix that?
>>
>> Thanks,
>> Laurent
>>
>> Le 05/11/2019 à 16:48, no-re...@patchew.org a écrit :
>>> Patchew URL: 
>>> https://patchew.org/QEMU/20191105144247.10301-1-laur...@vivier.eu/
>>>
>>>
>>>
>>> Hi,
>>>
>>> This series seems to have some coding style problems. See output below for
>>> more information:
>>>
>>> Subject: [PULL 0/4] Trivial branch patches
>>> Type: series
>>> Message-id: 20191105144247.10301-1-laur...@vivier.eu
>>>
>>> === TEST SCRIPT BEGIN ===
>>> #!/bin/bash
>>> git rev-parse base > /dev/null || exit 0
>>> git config --local diff.renamelimit 0
>>> git config --local diff.renames True
>>> git config --local diff.algorithm histogram
>>> ./scripts/checkpatch.pl --mailback base..
>>> === TEST SCRIPT END ===
>>>
>>> Switched to a new branch 'test'
>>> 85ac453 global: Squash 'the the'
>>> 9dd7da4 qom: Fix error message in object_class_property_add()
>>> 2b76b45 hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses
>>> bddcfd9 hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
>>>
>>> === OUTPUT BEGIN ===
>>> 1/4 Checking commit bddcfd9b6b24 (hw/misc/grlib_ahb_apb_pnp: Avoid crash 
>>> when writing to PnP registers)
>>> 2/4 Checking commit 2b76b451f9b7 (hw/misc/grlib_ahb_apb_pnp: Fix 8-bit 
>>> accesses)
>>> 3/4 Checking commit 9dd7da421bfb (qom: Fix error message in 
>>> object_class_property_add())
>>> WARNING: line over 80 characters
>>> #31: FILE: qom/object.c:1109:
>>> +error_setg(errp, "attempt to add duplicate property '%s' to object 
>>> (type '%s')",
>>>
>>> WARNING: line over 80 characters
>>> #43: FILE: qom/object.c:1141:
>>> +error_setg(errp, "attempt to add duplicate property '%s' to class 
>>> (type '%s')",
>>>
>>> total: 0 errors, 2 warnings, 22 lines checked
>>>
>>> Patch 3/4 has style problems, please review.  If any of these errors
>>> are false positives report them to the maintainer, see
>>> CHECKPATCH in MAINTAINERS.
>>> 4/4 Checking commit 85ac453d1520 (global: Squash 'the the')
>>> ERROR: do not use C99 // comments
>>> #26: FILE: disas/libvixl/vixl/invalset.h:105:
>>> +  // Note that this does not mean the backing storage is empty: it can 
>>> still
> 
> That one is a false positive; libvixl is written in C++ !

OK, thank you.

Laurent


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PULL 0/4] Trivial branch patches

2019-11-05 Thread Laurent Vivier
Greg, Dave,

could you fix that?

Thanks,
Laurent

Le 05/11/2019 à 16:48, no-re...@patchew.org a écrit :
> Patchew URL: 
> https://patchew.org/QEMU/20191105144247.10301-1-laur...@vivier.eu/
> 
> 
> 
> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Subject: [PULL 0/4] Trivial branch patches
> Type: series
> Message-id: 20191105144247.10301-1-laur...@vivier.eu
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> git rev-parse base > /dev/null || exit 0
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> git config --local diff.algorithm histogram
> ./scripts/checkpatch.pl --mailback base..
> === TEST SCRIPT END ===
> 
> Switched to a new branch 'test'
> 85ac453 global: Squash 'the the'
> 9dd7da4 qom: Fix error message in object_class_property_add()
> 2b76b45 hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses
> bddcfd9 hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
> 
> === OUTPUT BEGIN ===
> 1/4 Checking commit bddcfd9b6b24 (hw/misc/grlib_ahb_apb_pnp: Avoid crash when 
> writing to PnP registers)
> 2/4 Checking commit 2b76b451f9b7 (hw/misc/grlib_ahb_apb_pnp: Fix 8-bit 
> accesses)
> 3/4 Checking commit 9dd7da421bfb (qom: Fix error message in 
> object_class_property_add())
> WARNING: line over 80 characters
> #31: FILE: qom/object.c:1109:
> +error_setg(errp, "attempt to add duplicate property '%s' to object 
> (type '%s')",
> 
> WARNING: line over 80 characters
> #43: FILE: qom/object.c:1141:
> +error_setg(errp, "attempt to add duplicate property '%s' to class 
> (type '%s')",
> 
> total: 0 errors, 2 warnings, 22 lines checked
> 
> Patch 3/4 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 4/4 Checking commit 85ac453d1520 (global: Squash 'the the')
> ERROR: do not use C99 // comments
> #26: FILE: disas/libvixl/vixl/invalset.h:105:
> +  // Note that this does not mean the backing storage is empty: it can still
> 
> total: 1 errors, 0 warnings, 56 lines checked
> 
> Patch 4/4 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
> 
> 
> The full log is available at
> http://patchew.org/logs/20191105144247.10301-1-laur...@vivier.eu/testing.checkpatch/?type=message.
> ---
> Email generated automatically by Patchew [https://patchew.org/].
> Please send your feedback to patchew-de...@redhat.com
> 


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 0/4] Trivial branch patches

2019-11-05 Thread Laurent Vivier
The following changes since commit 36609b4fa36f0ac934874371874416f7533a5408:

  Merge remote-tracking branch 'remotes/palmer/tags/palmer-for-master-4.2-sf1' 
into staging (2019-11-02 17:59:03 +)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/trivial-branch-pull-request

for you to fetch changes up to a37a36a11b584e083b1c578f1d60e6e0f7878d5f:

  global: Squash 'the the' (2019-11-05 15:06:09 +0100)


Trivial fixes (20191105)



Dr. David Alan Gilbert (1):
  global: Squash 'the the'

Greg Kurz (1):
  qom: Fix error message in object_class_property_add()

Philippe Mathieu-Daudé (2):
  hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers
  hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses

 disas/libvixl/vixl/invalset.h   |  2 +-
 docs/interop/pr-helper.rst  |  2 +-
 docs/specs/ppc-spapr-hotplug.txt|  2 +-
 docs/specs/ppc-xive.rst |  2 +-
 docs/specs/tpm.txt  |  2 +-
 hw/misc/grlib_ahb_apb_pnp.c | 12 
 include/hw/xen/interface/io/blkif.h |  2 +-
 qom/object.c| 10 --
 scripts/dump-guest-memory.py|  2 +-
 9 files changed, 23 insertions(+), 13 deletions(-)

-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 1/4] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to PnP registers

2019-11-05 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Guests can crash QEMU when writting to PnP registers:

  $ echo 'writeb 0x800ff042 69' | qemu-system-sparc -M leon3_generic -S -bios 
/etc/magic -qtest stdio
  [I 1571938309.932255] OPENED
  [R +0.063474] writeb 0x800ff042 69
  Segmentation fault (core dumped)

  (gdb) bt
  #0  0x in  ()
  #1  0x555f4bcdf0bc in memory_region_write_with_attrs_accessor 
(mr=0x555f4d7be8c0, addr=66, value=0x7fff07d00f08, size=1, shift=0, mask=255, 
attrs=...) at memory.c:503
  #2  0x555f4bcdf185 in access_with_adjusted_size (addr=66, 
value=0x7fff07d00f08, size=1, access_size_min=1, access_size_max=4, 
access_fn=0x555f4bcdeff4 , 
mr=0x555f4d7be8c0, attrs=...) at memory.c:539
  #3  0x555f4bce2243 in memory_region_dispatch_write (mr=0x555f4d7be8c0, 
addr=66, data=69, op=MO_8, attrs=...) at memory.c:1489
  #4  0x555f4bc80b20 in flatview_write_continue (fv=0x555f4d92c400, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, addr1=66, l=1, 
mr=0x555f4d7be8c0) at exec.c:3161
  #5  0x555f4bc80c65 in flatview_write (fv=0x555f4d92c400, addr=2148528194, 
attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3201
  #6  0x555f4bc80fb0 in address_space_write (as=0x555f4d7aa460, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1) at exec.c:3291
  #7  0x555f4bc8101d in address_space_rw (as=0x555f4d7aa460, 
addr=2148528194, attrs=..., buf=0x7fff07d01120 "E", len=1, is_write=true) at 
exec.c:3301
  #8  0x555f4bcdb388 in qtest_process_command (chr=0x555f4c2ed7e0 
, words=0x555f4db0c5d0) at qtest.c:432

Instead of crashing, log the access as unimplemented.

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: KONRAD Frederic 
Message-Id: <20191025110114.27091-2-phi...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 hw/misc/grlib_ahb_apb_pnp.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index 7338461694c9..f3c015d2c35f 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "hw/sysbus.h"
 #include "hw/misc/grlib_ahb_apb_pnp.h"
 
@@ -231,8 +232,15 @@ static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr 
offset, unsigned size)
 return apb_pnp->regs[offset >> 2];
 }
 
+static void grlib_apb_pnp_write(void *opaque, hwaddr addr,
+uint64_t val, unsigned size)
+{
+qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+}
+
 static const MemoryRegionOps grlib_apb_pnp_ops = {
 .read   = grlib_apb_pnp_read,
+.write  = grlib_apb_pnp_write,
 .endianness = DEVICE_BIG_ENDIAN,
 };
 
-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 3/4] qom: Fix error message in object_class_property_add()

2019-11-05 Thread Laurent Vivier
From: Greg Kurz 

The error message in object_class_property_add() was copied from
object_property_add() in commit 16bf7f522a2ff. Clarify that it is
about a class, not an object.

While here, have the format string in both functions to fit in a
single line for better grep-ability, despite the checkpatch warning.

Signed-off-by: Greg Kurz 
Reviewed-by: Laurent Vivier 
Message-Id: <157287383591.234942.311840593519058490.st...@bahia.tlslab.ibm.com>
Signed-off-by: Laurent Vivier 
---
 qom/object.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 6fa9c619fac4..d51b57fba11e 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1106,9 +1106,8 @@ object_property_add(Object *obj, const char *name, const 
char *type,
 }
 
 if (object_property_find(obj, name, NULL) != NULL) {
-error_setg(errp, "attempt to add duplicate property '%s'"
-   " to object (type '%s')", name,
-   object_get_typename(obj));
+error_setg(errp, "attempt to add duplicate property '%s' to object 
(type '%s')",
+   name, object_get_typename(obj));
 return NULL;
 }
 
@@ -1139,9 +1138,8 @@ object_class_property_add(ObjectClass *klass,
 ObjectProperty *prop;
 
 if (object_class_property_find(klass, name, NULL) != NULL) {
-error_setg(errp, "attempt to add duplicate property '%s'"
-   " to object (type '%s')", name,
-   object_class_get_name(klass));
+error_setg(errp, "attempt to add duplicate property '%s' to class 
(type '%s')",
+   name, object_class_get_name(klass));
 return NULL;
 }
 
-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 4/4] global: Squash 'the the'

2019-11-05 Thread Laurent Vivier
From: "Dr. David Alan Gilbert" 

'the' has a tendency to double up; squash them back down.

Signed-off-by: Dr. David Alan Gilbert 
Reviewed-by: Alex Bennée 
Reviewed-by: Laurent Vivier 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20191104185202.102504-1-dgilb...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 disas/libvixl/vixl/invalset.h   | 2 +-
 docs/interop/pr-helper.rst  | 2 +-
 docs/specs/ppc-spapr-hotplug.txt| 2 +-
 docs/specs/ppc-xive.rst | 2 +-
 docs/specs/tpm.txt  | 2 +-
 include/hw/xen/interface/io/blkif.h | 2 +-
 scripts/dump-guest-memory.py| 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/disas/libvixl/vixl/invalset.h b/disas/libvixl/vixl/invalset.h
index ffdc0237b47c..ef5e49d6feb2 100644
--- a/disas/libvixl/vixl/invalset.h
+++ b/disas/libvixl/vixl/invalset.h
@@ -102,7 +102,7 @@ template class InvalSet {
   size_t size() const;
 
   // Returns true if no elements are stored in the set.
-  // Note that this does not mean the the backing storage is empty: it can 
still
+  // Note that this does not mean the backing storage is empty: it can still
   // contain invalid elements.
   bool empty() const;
 
diff --git a/docs/interop/pr-helper.rst b/docs/interop/pr-helper.rst
index 9f76d5bcf98f..e926f0a6c9cb 100644
--- a/docs/interop/pr-helper.rst
+++ b/docs/interop/pr-helper.rst
@@ -10,7 +10,7 @@ can delegate implementation of persistent reservations to an 
external
 restricting access to block devices to specific initiators in a shared
 storage setup.
 
-For a more detailed reference please refer the the SCSI Primary
+For a more detailed reference please refer to the SCSI Primary
 Commands standard, specifically the section on Reservations and the
 "PERSISTENT RESERVE IN" and "PERSISTENT RESERVE OUT" commands.
 
diff --git a/docs/specs/ppc-spapr-hotplug.txt b/docs/specs/ppc-spapr-hotplug.txt
index cc7833108e12..859d52cce6c8 100644
--- a/docs/specs/ppc-spapr-hotplug.txt
+++ b/docs/specs/ppc-spapr-hotplug.txt
@@ -385,7 +385,7 @@ Each LMB list entry consists of the following elements:
   is used to retrieve the right associativity list to be used for this
   LMB.
 - A 32bit flags word. The bit at bit position 0x0008 defines whether
-  the LMB is assigned to the the partition as of boot time.
+  the LMB is assigned to the partition as of boot time.
 
 ibm,dynamic-memory-v2
 
diff --git a/docs/specs/ppc-xive.rst b/docs/specs/ppc-xive.rst
index 148d57eb6ab2..83d43f658b90 100644
--- a/docs/specs/ppc-xive.rst
+++ b/docs/specs/ppc-xive.rst
@@ -163,7 +163,7 @@ Interrupt Priority Register (PIPR) is also updated using 
the IPB. This
 register represent the priority of the most favored pending
 notification.
 
-The PIPR is then compared to the the Current Processor Priority
+The PIPR is then compared to the Current Processor Priority
 Register (CPPR). If it is more favored (numerically less than), the
 CPU interrupt line is raised and the EO bit of the Notification Source
 Register (NSR) is updated to notify the presence of an exception for
diff --git a/docs/specs/tpm.txt b/docs/specs/tpm.txt
index 5d8c26b1adba..9c8cca042da8 100644
--- a/docs/specs/tpm.txt
+++ b/docs/specs/tpm.txt
@@ -89,7 +89,7 @@ TPM upon reboot. The PPI specification defines the operation 
requests and the
 actions the firmware has to take. The system administrator passes the operation
 request number to the firmware through an ACPI interface which writes this
 number to a memory location that the firmware knows. Upon reboot, the firmware
-finds the number and sends commands to the the TPM. The firmware writes the TPM
+finds the number and sends commands to the TPM. The firmware writes the TPM
 result code and the operation request number to a memory location that ACPI can
 read from and pass the result on to the administrator.
 
diff --git a/include/hw/xen/interface/io/blkif.h 
b/include/hw/xen/interface/io/blkif.h
index 8b1be50ce81e..d07fa1e07822 100644
--- a/include/hw/xen/interface/io/blkif.h
+++ b/include/hw/xen/interface/io/blkif.h
@@ -341,7 +341,7 @@
  *  access (even when it should be read-only). If the frontend hits the
  *  maximum number of allowed persistently mapped grants, it can fallback
  *  to non persistent mode. This will cause a performance degradation,
- *  since the the backend driver will still try to map those grants
+ *  since the backend driver will still try to map those grants
  *  persistently. Since the persistent grants protocol is compatible with
  *  the previous protocol, a frontend driver can choose to work in
  *  persistent mode even when the backend doesn't support it.
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 2c587cbefc57..9371e4581308 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -170,7 +170,7 @@ class ELF(object):
 self.ehdr.e_phnum += 1
 
 def to_file(self, elf_file):
-

[Xen-devel] [PULL 2/4] hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses

2019-11-05 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

The Plug & Play region of the AHB/APB bridge can be accessed
by various word size, however the implementation is clearly
restricted to 32-bit:

  static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
  {
  APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);

  return apb_pnp->regs[offset >> 2];
  }

Set the MemoryRegionOps::impl min/max fields to 32-bit, so
memory.c::access_with_adjusted_size() can adjust when the
access is not 32-bit.

This is required to run RTEMS on leon3, the grlib scanning
functions do byte accesses.

Reported-by: Jiri Gaisler 
Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: KONRAD Frederic 
Message-Id: <20191025110114.27091-3-phi...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 hw/misc/grlib_ahb_apb_pnp.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index f3c015d2c35f..e230e2536361 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -242,6 +242,10 @@ static const MemoryRegionOps grlib_apb_pnp_ops = {
 .read   = grlib_apb_pnp_read,
 .write  = grlib_apb_pnp_write,
 .endianness = DEVICE_BIG_ENDIAN,
+.impl = {
+.min_access_size = 4,
+.max_access_size = 4,
+},
 };
 
 static void grlib_apb_pnp_realize(DeviceState *dev, Error **errp)
-- 
2.21.0


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 00/20] hw: Clean up hw/i386 headers (and few alpha/hppa)

2019-10-26 Thread Laurent Vivier
Le 26/10/2019 à 14:20, Philippe Mathieu-Daudé a écrit :
> Hi,
> 
> On 10/14/19 4:22 PM, Philippe Mathieu-Daudé wrote:
>> This is a follow-up of Markus's cleanup series:
>> Tame a few "touch this, recompile the world"
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg635748.html
>>
>> This part is mostly restricted to X86, but since some file from the
>> Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them
>> too.
>>
>> Eventually I'll succeed at removing hw/i386/ dependency on non-X86
>> platforms (Quest I started 2 years ago...).
>>
>> Regards,
>>
>> Phil.
>>
>> Philippe Mathieu-Daudé (20):
>>    vl: Add missing "hw/boards.h" include
>>    hw/southbridge/ich9: Removed unused headers
>>    hw/input/pckbd: Remove unused "hw/i386/pc.h" header
>>    hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
>>    hw/timer: Remove unused "ui/console.h" header
>>    hw/usb/dev-storage: Remove unused "ui/console.h" header
>>    hw/i386/intel_iommu: Remove unused includes
>>    hw/xen/xen_pt_load_rom: Remove unused includes
>>    hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
>>    hw/alpha/dp264: Include "net/net.h"
>>    hw/hppa/machine: Include "net/net.h"
>>    hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
>>    hw/timer/hpet: Include "exec/address-spaces.h"
>>    hw/pci-host/q35: Include "qemu/range.h"
>>    hw/i2c/smbus_ich9: Include "qemu/range.h"
>>    hw/pci-host/piix: Include "qemu/range.h"
>>    hw/acpi: Include "hw/mem/nvdimm.h"
>>    hw/i386: Include "hw/mem/nvdimm.h"
>>    hw/pci-host/q35: Remove unused includes
>>    hw/i386/pc: Clean up includes
> Laurent, since this series is fully reviewed, can it go via
> your qemu-trivial tree?

I'll try but I'm not sure to have the time to do that before the softfreeze.

Thanks,
Laurent

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 20/20] milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

qemu_log_mask(GUEST_ERROR) is more appropriate:

  $ qemu -d help
  Log items (comma separated):
  guest_errorslog when the guest OS does something invalid (eg accessing a 
non-existent register)

Signed-off-by: Philippe Mathieu-Daudé 
Acked-by: Michael Walle 
Message-Id: <20181029130034.26750-1-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/net/milkymist-minimac2.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index 3eaa19dfde..664ac34f25 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "net/net.h"
+#include "qemu/log.h"
 #include "qemu/error-report.h"
 
 #include 
@@ -214,7 +215,8 @@ static size_t assemble_frame(uint8_t *buf, size_t size,
 uint32_t crc;
 
 if (size < payload_size + 12) {
-error_report("milkymist_minimac2: received too big ethernet frame");
+qemu_log_mask(LOG_GUEST_ERROR, "milkymist_minimac2: frame too big "
+  "(%zd bytes)\n", payload_size);
 return 0;
 }
 
@@ -347,8 +349,9 @@ minimac2_read(void *opaque, hwaddr addr, unsigned size)
 break;
 
 default:
-error_report("milkymist_minimac2: read access to unknown register 0x"
-TARGET_FMT_plx, addr << 2);
+qemu_log_mask(LOG_GUEST_ERROR,
+  "milkymist_minimac2_rd%d: 0x%" HWADDR_PRIx "\n",
+  size, addr << 2);
 break;
 }
 
@@ -413,8 +416,10 @@ minimac2_write(void *opaque, hwaddr addr, uint64_t value,
 break;
 
 default:
-error_report("milkymist_minimac2: write access to unknown register 0x"
-TARGET_FMT_plx, addr << 2);
+qemu_log_mask(LOG_GUEST_ERROR,
+  "milkymist_minimac2_wr%d: 0x%" HWADDR_PRIx
+  " = 0x%" PRIx64 "\n",
+  size, addr << 2, value);
 break;
 }
 }
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 19/20] ppc: move at24c to its own CONFIG_ symbol

2018-10-30 Thread Laurent Vivier
From: Paolo Bonzini 

AT24c EEPROM is currently gated by CONFIG_I2C, and as such it is
being included in all emulators that use I2C, even if they do not
really need it.  Separate it and, since it was added for the e500
machines, add it to qemu-system-ppc and qemu-system-ppc64.

Signed-off-by: Paolo Bonzini 
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Thomas Huth 
Message-Id: <20180522191743.12872-1-pbonz...@redhat.com>
[lv: rebase]
Signed-off-by: Laurent Vivier 
---
 default-configs/ppc-softmmu.mak | 1 +
 hw/nvram/Makefile.objs  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 3181bbf163..23d871fb3e 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -28,6 +28,7 @@ CONFIG_SM501=y
 CONFIG_DDC=y
 CONFIG_IDE_SII3112=y
 CONFIG_I2C=y
+CONFIG_AT24C=y
 CONFIG_BITBANG_I2C=y
 CONFIG_M41T80=y
 CONFIG_VGA_CIRRUS=y
diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs
index a912d25391..b318e53a43 100644
--- a/hw/nvram/Makefile.objs
+++ b/hw/nvram/Makefile.objs
@@ -1,6 +1,6 @@
 common-obj-$(CONFIG_DS1225Y) += ds1225y.o
 common-obj-y += eeprom93xx.o
-common-obj-$(CONFIG_I2C) += eeprom_at24c.o
+common-obj-$(CONFIG_AT24C) += eeprom_at24c.o
 common-obj-y += fw_cfg.o
 common-obj-y += chrp_nvram.o
 common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 18/20] hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-8-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 include/hw/intc/arm_gicv3_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/intc/arm_gicv3_common.h 
b/include/hw/intc/arm_gicv3_common.h
index b798486ecf..31ec9a1ae4 100644
--- a/include/hw/intc/arm_gicv3_common.h
+++ b/include/hw/intc/arm_gicv3_common.h
@@ -62,7 +62,7 @@
  * avoids bugs where we forget to subtract GIC_INTERNAL from an
  * interrupt number.
  */
-#define GICV3_BMP_SIZE (DIV_ROUND_UP(GICV3_MAXIRQ, 32))
+#define GICV3_BMP_SIZE DIV_ROUND_UP(GICV3_MAXIRQ, 32)
 
 #define GIC_DECLARE_BITMAP(name) \
 uint32_t name[GICV3_BMP_SIZE]
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 07/20] scripts/decodetree.py: remove unused imports

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

Signed-off-by: Cleber Rosa 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-8-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 scripts/decodetree.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 277f9a9bba..457cffea90 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -149,12 +149,10 @@
 #   trans_addl_i(ctx, _opi, insn)
 #
 
-import io
 import os
 import re
 import sys
 import getopt
-import pdb
 
 insnwidth = 32
 insnmask = 0x
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 15/20] xen: Use the PCI_DEVICE macro

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

TYPE_XEN_PT_DEVICE is a subclass of TYPE_PCI_DEVICE, the clean way
to access the PCIDevice pointer is using the PCI_DEVICE() macro.

Suggested-by: Peter Maydell 
Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Anthony PERARD 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-4-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/xen/xen_pt_config_init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index aee31c62bb..47f9010c75 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -358,7 +358,7 @@ static uint64_t xen_pt_get_bar_size(PCIIORegion *r)
 static XenPTBarFlag xen_pt_bar_reg_parse(XenPCIPassthroughState *s,
  int index)
 {
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 XenPTRegion *region = NULL;
 PCIIORegion *r;
 
@@ -469,7 +469,7 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState *s, 
XenPTReg *cfg_entry,
 {
 XenPTRegInfo *reg = cfg_entry->reg;
 XenPTRegion *base = NULL;
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 const PCIIORegion *r;
 uint32_t writable_mask = 0;
 uint32_t bar_emu_mask = 0;
@@ -543,7 +543,7 @@ static int 
xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s,
 {
 XenPTRegInfo *reg = cfg_entry->reg;
 XenPTRegion *base = NULL;
-PCIDevice *d = (PCIDevice *)>dev;
+PCIDevice *d = PCI_DEVICE(s);
 uint32_t writable_mask = 0;
 uint32_t throughable_mask = get_throughable_mask(s, reg, valid_mask);
 pcibus_t r_size = 0;
@@ -1587,7 +1587,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughState 
*s,
  const XenPTRegGroupInfo *grp_reg,
  uint32_t base_offset, uint8_t *size)
 {
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 uint8_t version = get_capability_version(s, base_offset);
 uint8_t type = get_device_type(s, base_offset);
 uint8_t pcie_size = 0;
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 10/20] linux-user: fix comment s/atomic_write/atomic_set/

2018-10-30 Thread Laurent Vivier
From: "Emilio G. Cota" 

Signed-off-by: Emilio G. Cota 
Message-Id: <20180811211011.6277-1-c...@braap.org>
Signed-off-by: Laurent Vivier 
---
 linux-user/qemu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 1beb6a2cfc..dde3f26f5a 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -143,7 +143,7 @@ typedef struct TaskState {
 /* Nonzero if process_pending_signals() needs to do something (either
  * handle a pending signal or unblock signals).
  * This flag is written from a signal handler so should be accessed via
- * the atomic_read() and atomic_write() functions. (It is not accessed
+ * the atomic_read() and atomic_set() functions. (It is not accessed
  * from multiple threads.)
  */
 int signal_pending;
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 06/20] docs/devel/testing.rst: add missing newlines after code block

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

The line immediate following a ".. code::" block is considered
to contains arguments to the "code directive".  The lack of a
new line gives me during at parse time:

   testing.rst:63: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
 make check-unit V=1

   testing.rst:120: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
 make check-qtest V=1

Let's add the missing newlines, both for consistency and to
avoid the parsing errors.

Signed-off-by: Cleber Rosa 
Reviewed-by: John Snow 
Message-Id: <20181004161852.11673-6-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 docs/devel/testing.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index fcfad87614..a227754f86 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -59,6 +59,7 @@ variable (which affects memory reclamation and catches 
invalid pointers better)
 and gtester options. If necessary, you can run
 
 .. code::
+
   make check-unit V=1
 
 and copy the actual command line which executes the unit test, then run
@@ -116,6 +117,7 @@ and using gdb on the test is still simple to do: find out 
the actual command
 from the output of
 
 .. code::
+
   make check-qtest V=1
 
 which you can run manually.
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 00/20] Qemu trivial for 3.1 patches

2018-10-30 Thread Laurent Vivier
The following changes since commit 808ebd66e467f77c0d1f8c6346235f81e9c99cf2:

  Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-sf0' 
into staging (2018-10-25 17:41:03 +0100)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/qemu-trivial-for-3.1-pull-request

for you to fetch changes up to 7b2b797cf0addac789ba858fdbd95c55128d72d5:

  milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report 
(2018-10-30 09:13:31 +0100)


QEMU trivial patches collected between June and October 2018
(Thank you to Thomas Huth)

v2: fix 32bit build with updated patch (v3) from Philippe Mathieu-Daudé
built in a 32bit debian sid chroot



Cleber Rosa (6):
  tests/tcg/README: fix location for lm32 tests
  qemu-iotests: fix filename containing checks
  docs/devel/testing.rst: add missing newlines after code block
  scripts/decodetree.py: remove unused imports
  scripts/qemu.py: remove trailing quotes on docstring
  qemu-iotests: make 218 executable

Emilio G. Cota (1):
  linux-user: fix comment s/atomic_write/atomic_set/

Li Qiang (2):
  memory.h: fix typos in comments
  cpu.h: fix a typo in comment

Paolo Bonzini (1):
  ppc: move at24c to its own CONFIG_ symbol

Philippe Mathieu-Daudé (6):
  qobject: Catch another straggler for use of qdict_put_str()
  xen: Use the PCI_DEVICE macro
  tests/bios-tables-test: Remove an useless cast
  hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro
  hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro
  milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of
error_report

Stefan Weil (2):
  tests: Fix typos in comments and help message (found by codespell)
  configure: Support pkg-config for zlib

Thomas Huth (1):
  configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

yuchenlin (1):
  vga_int: remove unused function protype

 configure | 40 +++
 default-configs/alpha-softmmu.mak |  1 -
 default-configs/ppc-softmmu.mak   |  1 +
 docs/devel/testing.rst|  2 ++
 hw/display/vga_int.h  |  1 -
 hw/net/milkymist-minimac2.c   | 15 ++
 hw/nvram/Makefile.objs|  2 +-
 hw/pci-host/piix.c|  2 +-
 hw/pci-host/q35.c |  2 +-
 hw/xen/xen_pt_config_init.c   |  8 +++---
 include/exec/memory.h |  6 ++--
 include/hw/intc/arm_gicv3_common.h|  2 +-
 include/qom/cpu.h |  2 +-
 linux-user/qemu.h |  2 +-
 qobject/block-qdict.c |  2 +-
 scripts/decodetree.py |  2 --
 scripts/qemu.py   |  2 +-
 tests/bios-tables-test.c  |  4 +--
 tests/docker/Makefile.include |  2 +-
 tests/docker/docker.py|  4 +--
 tests/guest-debug/test-gdbstub.py |  2 +-
 tests/qemu-iotests/218|  0
 tests/qemu-iotests/common.qemu|  2 +-
 tests/qemu-iotests/common.rc  |  4 +--
 tests/tcg/Makefile.include|  2 +-
 tests/tcg/Makefile.probe  |  2 +-
 tests/tcg/README  |  2 +-
 tests/tcg/mips/mips64-dsp/subq_s_pw.c |  2 +-
 28 files changed, 64 insertions(+), 54 deletions(-)
 mode change 100644 => 100755 tests/qemu-iotests/218

-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 08/20] scripts/qemu.py: remove trailing quotes on docstring

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

Signed-off-by: Cleber Rosa 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-11-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 scripts/qemu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index f099ce7278..b0b2f12ce6 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -87,7 +87,7 @@ class QEMUMachine(object):
 @param name: prefix for socket and log file names (default: qemu-PID)
 @param test_dir: where to create socket and log file
 @param monitor_address: address for QMP monitor
-@param socket_scm_helper: helper program, required for send_fd_scm()"
+@param socket_scm_helper: helper program, required for send_fd_scm()
 @note: Qemu process is not started until launch() is used.
 '''
 if args is None:
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 11/20] cpu.h: fix a typo in comment

2018-10-30 Thread Laurent Vivier
From: Li Qiang 

Found by reading the code.

Signed-off-by: Li Qiang 
Message-Id: <1536150548-2797-1-git-send-email-liq...@gmail.com>
Signed-off-by: Laurent Vivier 
---
 include/qom/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 4e238b0d9f..def0c64308 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -852,7 +852,7 @@ extern CPUInterruptHandler cpu_interrupt_handler;
 /**
  * cpu_interrupt:
  * @cpu: The CPU to set an interrupt on.
- * @mask: The interupts to set.
+ * @mask: The interrupts to set.
  *
  * Invokes the interrupt handler.
  */
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 14/20] qobject: Catch another straggler for use of qdict_put_str()

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-2-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 qobject/block-qdict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qobject/block-qdict.c b/qobject/block-qdict.c
index 42054cc274..1487cc5dd8 100644
--- a/qobject/block-qdict.c
+++ b/qobject/block-qdict.c
@@ -577,7 +577,7 @@ static QObject *qdict_crumple_for_keyval_qiv(QDict *src, 
Error **errp)
 if (!tmp) {
 tmp = qdict_clone_shallow(src);
 }
-qdict_put(tmp, ent->key, qstring_from_str(s));
+qdict_put_str(tmp, ent->key, s);
 g_free(buf);
 }
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 17/20] hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-7-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/pci-host/piix.c | 2 +-
 hw/pci-host/q35.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index da73743fa2..47293a3915 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -144,7 +144,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
 memory_region_transaction_begin();
 for (i = 0; i < 13; i++) {
 pam_update(>pam_regions[i], i,
-   pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]);
+   pd->config[I440FX_PAM + DIV_ROUND_UP(i, 2)]);
 }
 memory_region_set_enabled(>smram_region,
   !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN));
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 8ce1e09932..966a7cf92d 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -356,7 +356,7 @@ static void mch_update_pam(MCHPCIState *mch)
 memory_region_transaction_begin();
 for (i = 0; i < 13; i++) {
 pam_update(>pam_regions[i], i,
-   pd->config[MCH_HOST_BRIDGE_PAM0 + (DIV_ROUND_UP(i, 2))]);
+   pd->config[MCH_HOST_BRIDGE_PAM0 + DIV_ROUND_UP(i, 2)]);
 }
 memory_region_transaction_commit();
 }
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 09/20] qemu-iotests: make 218 executable

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

Commit 990dc39c made all tests executable at the time, but 218 came in
later, and missing those permissions.

Signed-off-by: Cleber Rosa 
Message-Id: <20181004161852.11673-4-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/qemu-iotests/218 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tests/qemu-iotests/218

diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218
old mode 100644
new mode 100755
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 04/20] tests/tcg/README: fix location for lm32 tests

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

Point to the right and obvious location for lm32 tests.

Signed-off-by: Cleber Rosa 
Reviewed-by: Thomas Huth 
Acked-by: Alex Bennée 
Message-Id: <20181004161852.11673-3-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/tcg/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tcg/README b/tests/tcg/README
index a5643d33e7..2a58f9a058 100644
--- a/tests/tcg/README
+++ b/tests/tcg/README
@@ -10,6 +10,6 @@ with "make test-cris".
 
 LM32
 
-The testsuite for LM32 is in tests/tcg/cris.  You can run it
+The testsuite for LM32 is in tests/tcg/lm32.  You can run it
 with "make test-lm32".
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 05/20] qemu-iotests: fix filename containing checks

2018-10-30 Thread Laurent Vivier
From: Cleber Rosa 

Commit cce293a2945 moved some functions from common.config to
common.rc, but the error messages still reference the old file
location.

Signed-off-by: Cleber Rosa 
Reviewed-by: Max Reitz 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-5-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/qemu-iotests/common.rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 44bee16a5e..70ca65b49b 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -170,7 +170,7 @@ if [ ! -e "$TEST_DIR" ]; then
 fi
 
 if [ ! -d "$TEST_DIR" ]; then
-echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
+echo "common.rc: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
 exit 1
 fi
 
@@ -179,7 +179,7 @@ if [ -z "$REMOTE_TEST_DIR" ]; then
 fi
 
 if [ ! -d "$SAMPLE_IMG_DIR" ]; then
-echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a 
directory"
+echo "common.rc: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a 
directory"
 exit 1
 fi
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 02/20] vga_int: remove unused function protype

2018-10-30 Thread Laurent Vivier
From: yuchenlin 

Signed-off-by: yuchenlin 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181022080053.9379-1-yuchen...@synology.com>
Signed-off-by: Laurent Vivier 
---
 hw/display/vga_int.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 6e4fa48a79..55c418eab5 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -166,7 +166,6 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
   const MemoryRegionPortio **vbe_ports);
 void vga_common_reset(VGACommonState *s);
 
-void vga_sync_dirty_bitmap(VGACommonState *s);
 void vga_dirty_log_start(VGACommonState *s);
 void vga_dirty_log_stop(VGACommonState *s);
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 16/20] tests/bios-tables-test: Remove an useless cast

2018-10-30 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/typecast.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-5-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index af4b1fb6bd..02e77ec811 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -319,7 +319,7 @@ static bool load_asl(GArray *sdts, AcpiSdtTable *sdt)
 ret = g_spawn_command_line_sync(command_line->str, , _err, NULL, 
);
 g_assert_no_error(error);
 if (ret) {
-ret = g_file_get_contents(sdt->asl_file, (gchar **)>asl,
+ret = g_file_get_contents(sdt->asl_file, >asl,
   >asl_len, );
 g_assert(ret);
 g_assert_no_error(error);
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 13/20] configure: Support pkg-config for zlib

2018-10-30 Thread Laurent Vivier
From: Stefan Weil 

This is needed for builds with the mingw64-* packages from Cygwin,
but also works for Linux.

Move the zlib test also more to the end because users should
get information on the really important missing packages
(which also require zlib) first.

Signed-off-by: Stefan Weil 
Reviewed-by: Stefan Hajnoczi 
Message-Id: <20180712192603.11599-1...@weilnetz.de>
Signed-off-by: Laurent Vivier 
---
 configure | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index 1ee09bd112..a02df30dde 100755
--- a/configure
+++ b/configure
@@ -2151,23 +2151,6 @@ EOF
   fi
 fi
 
-#
-# zlib check
-
-if test "$zlib" != "no" ; then
-cat > $TMPC << EOF
-#include 
-int main(void) { zlibVersion(); return 0; }
-EOF
-if compile_prog "" "-lz" ; then
-:
-else
-error_exit "zlib check failed" \
-"Make sure to have the zlib libs and headers installed."
-fi
-fi
-LIBS="$LIBS -lz"
-
 ##
 # lzo check
 
@@ -3479,6 +3462,29 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; 
then
 fi
 fi
 
+#
+# zlib check
+
+if test "$zlib" != "no" ; then
+if $pkg_config --exists zlib; then
+zlib_cflags=$($pkg_config --cflags zlib)
+zlib_libs=$($pkg_config --libs zlib)
+QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS"
+LIBS="$zlib_libs $LIBS"
+else
+cat > $TMPC << EOF
+#include 
+int main(void) { zlibVersion(); return 0; }
+EOF
+if compile_prog "" "-lz" ; then
+LIBS="$LIBS -lz"
+else
+error_exit "zlib check failed" \
+"Make sure to have the zlib libs and headers installed."
+fi
+fi
+fi
+
 ##
 # SHA command probe for modules
 if test "$modules" = yes; then
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 03/20] memory.h: fix typos in comments

2018-10-30 Thread Laurent Vivier
From: Li Qiang 

Signed-off-by: Li Qiang 
Reviewed-by: Peter Maydell 
Message-Id: <1539080467-2976-1-git-send-email-liq...@gmail.com>
[lv: s/types/typos/]
Signed-off-by: Laurent Vivier 
---
 include/exec/memory.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 667466b8f3..d0c7f0d9e9 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -935,7 +935,7 @@ uint64_t memory_region_size(MemoryRegion *mr);
 /**
  * memory_region_is_ram: check whether a memory region is random access
  *
- * Returns %true is a memory region is random access.
+ * Returns %true if a memory region is random access.
  *
  * @mr: the memory region being queried
  */
@@ -947,7 +947,7 @@ static inline bool memory_region_is_ram(MemoryRegion *mr)
 /**
  * memory_region_is_ram_device: check whether a memory region is a ram device
  *
- * Returns %true is a memory region is a device backed ram region
+ * Returns %true if a memory region is a device backed ram region
  *
  * @mr: the memory region being queried
  */
@@ -1161,7 +1161,7 @@ uint8_t memory_region_get_dirty_log_mask(MemoryRegion 
*mr);
 /**
  * memory_region_is_rom: check whether a memory region is ROM
  *
- * Returns %true is a memory region is read-only memory.
+ * Returns %true if a memory region is read-only memory.
  *
  * @mr: the memory region being queried
  */
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL v2 12/20] tests: Fix typos in comments and help message (found by codespell)

2018-10-30 Thread Laurent Vivier
From: Stefan Weil 

Fix also a grammar issue.

Signed-off-by: Stefan Weil 
Reviewed-by: Alex Bennée 
Message-Id: <20180713054755.23323-1...@weilnetz.de>
Signed-off-by: Laurent Vivier 
---
 tests/bios-tables-test.c  | 2 +-
 tests/docker/Makefile.include | 2 +-
 tests/docker/docker.py| 4 ++--
 tests/guest-debug/test-gdbstub.py | 2 +-
 tests/qemu-iotests/common.qemu| 2 +-
 tests/tcg/Makefile.include| 2 +-
 tests/tcg/Makefile.probe  | 2 +-
 tests/tcg/mips/mips64-dsp/subq_s_pw.c | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 4e24930c4b..af4b1fb6bd 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -390,7 +390,7 @@ try_again:
 if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
 exp_sdt.aml_file = aml_file;
 } else if (*ext != '\0') {
-/* try fallback to generic (extention less) expected file */
+/* try fallback to generic (extension less) expected file */
 ext = "";
 g_free(aml_file);
 goto try_again;
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 6e03235ab9..9467e9d088 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -41,7 +41,7 @@ docker-qemu-src: $(DOCKER_SRC_COPY)
 docker-image: ${DOCKER_TARGETS}
 
 # General rule for building docker images. If we are a sub-make
-# invoked with SKIP_DOCKER_BUILD we still check the image is upto date
+# invoked with SKIP_DOCKER_BUILD we still check the image is up to date
 # though
 ifdef SKIP_DOCKER_BUILD
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 44d5f7493b..02d8a83847 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -97,7 +97,7 @@ def _get_so_libs(executable):
 return libs
 
 def _copy_binary_with_libs(src, dest_dir):
-"""Copy a binary executable and all its dependant libraries.
+"""Copy a binary executable and all its dependent libraries.
 
 This does rely on the host file-system being fairly multi-arch
 aware so the file don't clash with the guests layout."""
@@ -284,7 +284,7 @@ class SubCommand(object):
 name = None # Subcommand name
 def shared_args(self, parser):
 parser.add_argument("--quiet", action="store_true",
-help="Run quietly unless an error occured")
+help="Run quietly unless an error occurred")
 
 def args(self, parser):
 """Setup argument parser"""
diff --git a/tests/guest-debug/test-gdbstub.py 
b/tests/guest-debug/test-gdbstub.py
index 474d2c5c65..0e4ac01426 100644
--- a/tests/guest-debug/test-gdbstub.py
+++ b/tests/guest-debug/test-gdbstub.py
@@ -122,7 +122,7 @@ class CatchBreakpoint(gdb.Breakpoint):
 
 
 def run_test():
-"Run throught the tests one by one"
+"Run through the tests one by one"
 
 print ("Checking we can step the first few instructions")
 step_ok = 0
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index f285484951..dadde2a266 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -257,7 +257,7 @@ function _launch_qemu()
 }
 
 
-# Silenty kills the QEMU process
+# Silently kills the QEMU process
 #
 # If $wait is set to anything other than the empty string, the process will not
 # be killed but only waited for, and any output will be forwarded to stdout. If
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
index 57470b2a2c..c581bd6ffc 100644
--- a/tests/tcg/Makefile.include
+++ b/tests/tcg/Makefile.include
@@ -2,7 +2,7 @@
 #
 # TCG tests (per-target rules)
 #
-# This Makefile fragement is included from the per-target
+# This Makefile fragment is included from the per-target
 # Makefile.target so will be invoked for each linux-user program we
 # build. We have two options for compiling, either using a configured
 # guest compiler or calling one of our docker images to do it for us.
diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe
index 15c0412657..9dc654663d 100644
--- a/tests/tcg/Makefile.probe
+++ b/tests/tcg/Makefile.probe
@@ -2,7 +2,7 @@
 #
 # TCG Compiler Probe
 #
-# This Makefile fragement is included multiple times in the main make
+# This Makefile fragment is included multiple times in the main make
 # script to probe for available compilers. This is used to build up a
 # selection of required docker targets before we invoke a sub-make for
 # each target.
diff --git a/tests/tcg/mips/mips64-dsp/subq_s_pw.c 
b/tests/tcg/mips/mips64-dsp/subq_s_pw.c
index e8e0b0567e..4c080b785a 100644
--- a/tests/tcg/mips/mips64-dsp/subq_s_pw.c
+++ b/tests/tcg/mips/mips64-dsp/su

[Xen-devel] [PULL v2 01/20] configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

2018-10-30 Thread Laurent Vivier
From: Thomas Huth 

We don't use CONFIG_PARALLEL_ISA in any of our Makefiles, so this
is just a dead config option which can be removed.

Fixes: a4cb773928e047b137c6998209cf2eec857fac6b
Signed-off-by: Thomas Huth 
Acked-by: Richard Henderson 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <1540376314-5727-1-git-send-email-th...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 default-configs/alpha-softmmu.mak | 1 -
 1 file changed, 1 deletion(-)

diff --git a/default-configs/alpha-softmmu.mak 
b/default-configs/alpha-softmmu.mak
index eb58b40254..4d654eaa0b 100644
--- a/default-configs/alpha-softmmu.mak
+++ b/default-configs/alpha-softmmu.mak
@@ -8,7 +8,6 @@ CONFIG_I82374=y
 CONFIG_I8254=y
 CONFIG_I8257=y
 CONFIG_PARALLEL=y
-CONFIG_PARALLEL_ISA=y
 CONFIG_FDC=y
 CONFIG_PCKBD=y
 CONFIG_VGA_CIRRUS=y
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 07/20] scripts/decodetree.py: remove unused imports

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

Signed-off-by: Cleber Rosa 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-8-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 scripts/decodetree.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 277f9a9bba..457cffea90 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -149,12 +149,10 @@
 #   trans_addl_i(ctx, _opi, insn)
 #
 
-import io
 import os
 import re
 import sys
 import getopt
-import pdb
 
 insnwidth = 32
 insnmask = 0x
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 18/20] hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-8-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 include/hw/intc/arm_gicv3_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/intc/arm_gicv3_common.h 
b/include/hw/intc/arm_gicv3_common.h
index b798486ecf..31ec9a1ae4 100644
--- a/include/hw/intc/arm_gicv3_common.h
+++ b/include/hw/intc/arm_gicv3_common.h
@@ -62,7 +62,7 @@
  * avoids bugs where we forget to subtract GIC_INTERNAL from an
  * interrupt number.
  */
-#define GICV3_BMP_SIZE (DIV_ROUND_UP(GICV3_MAXIRQ, 32))
+#define GICV3_BMP_SIZE DIV_ROUND_UP(GICV3_MAXIRQ, 32)
 
 #define GIC_DECLARE_BITMAP(name) \
 uint32_t name[GICV3_BMP_SIZE]
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 15/20] xen: Use the PCI_DEVICE macro

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

TYPE_XEN_PT_DEVICE is a subclass of TYPE_PCI_DEVICE, the clean way
to access the PCIDevice pointer is using the PCI_DEVICE() macro.

Suggested-by: Peter Maydell 
Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Anthony PERARD 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-4-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/xen/xen_pt_config_init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index aee31c62bb..47f9010c75 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -358,7 +358,7 @@ static uint64_t xen_pt_get_bar_size(PCIIORegion *r)
 static XenPTBarFlag xen_pt_bar_reg_parse(XenPCIPassthroughState *s,
  int index)
 {
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 XenPTRegion *region = NULL;
 PCIIORegion *r;
 
@@ -469,7 +469,7 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState *s, 
XenPTReg *cfg_entry,
 {
 XenPTRegInfo *reg = cfg_entry->reg;
 XenPTRegion *base = NULL;
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 const PCIIORegion *r;
 uint32_t writable_mask = 0;
 uint32_t bar_emu_mask = 0;
@@ -543,7 +543,7 @@ static int 
xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s,
 {
 XenPTRegInfo *reg = cfg_entry->reg;
 XenPTRegion *base = NULL;
-PCIDevice *d = (PCIDevice *)>dev;
+PCIDevice *d = PCI_DEVICE(s);
 uint32_t writable_mask = 0;
 uint32_t throughable_mask = get_throughable_mask(s, reg, valid_mask);
 pcibus_t r_size = 0;
@@ -1587,7 +1587,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughState 
*s,
  const XenPTRegGroupInfo *grp_reg,
  uint32_t base_offset, uint8_t *size)
 {
-PCIDevice *d = >dev;
+PCIDevice *d = PCI_DEVICE(s);
 uint8_t version = get_capability_version(s, base_offset);
 uint8_t type = get_device_type(s, base_offset);
 uint8_t pcie_size = 0;
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 12/20] tests: Fix typos in comments and help message (found by codespell)

2018-10-26 Thread Laurent Vivier
From: Stefan Weil 

Fix also a grammar issue.

Signed-off-by: Stefan Weil 
Reviewed-by: Alex Bennée 
Message-Id: <20180713054755.23323-1...@weilnetz.de>
Signed-off-by: Laurent Vivier 
---
 tests/bios-tables-test.c  | 2 +-
 tests/docker/Makefile.include | 2 +-
 tests/docker/docker.py| 4 ++--
 tests/guest-debug/test-gdbstub.py | 2 +-
 tests/qemu-iotests/common.qemu| 2 +-
 tests/tcg/Makefile.include| 2 +-
 tests/tcg/Makefile.probe  | 2 +-
 tests/tcg/mips/mips64-dsp/subq_s_pw.c | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 4e24930c4b..af4b1fb6bd 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -390,7 +390,7 @@ try_again:
 if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
 exp_sdt.aml_file = aml_file;
 } else if (*ext != '\0') {
-/* try fallback to generic (extention less) expected file */
+/* try fallback to generic (extension less) expected file */
 ext = "";
 g_free(aml_file);
 goto try_again;
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 6e03235ab9..9467e9d088 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -41,7 +41,7 @@ docker-qemu-src: $(DOCKER_SRC_COPY)
 docker-image: ${DOCKER_TARGETS}
 
 # General rule for building docker images. If we are a sub-make
-# invoked with SKIP_DOCKER_BUILD we still check the image is upto date
+# invoked with SKIP_DOCKER_BUILD we still check the image is up to date
 # though
 ifdef SKIP_DOCKER_BUILD
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 44d5f7493b..02d8a83847 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -97,7 +97,7 @@ def _get_so_libs(executable):
 return libs
 
 def _copy_binary_with_libs(src, dest_dir):
-"""Copy a binary executable and all its dependant libraries.
+"""Copy a binary executable and all its dependent libraries.
 
 This does rely on the host file-system being fairly multi-arch
 aware so the file don't clash with the guests layout."""
@@ -284,7 +284,7 @@ class SubCommand(object):
 name = None # Subcommand name
 def shared_args(self, parser):
 parser.add_argument("--quiet", action="store_true",
-help="Run quietly unless an error occured")
+help="Run quietly unless an error occurred")
 
 def args(self, parser):
 """Setup argument parser"""
diff --git a/tests/guest-debug/test-gdbstub.py 
b/tests/guest-debug/test-gdbstub.py
index 474d2c5c65..0e4ac01426 100644
--- a/tests/guest-debug/test-gdbstub.py
+++ b/tests/guest-debug/test-gdbstub.py
@@ -122,7 +122,7 @@ class CatchBreakpoint(gdb.Breakpoint):
 
 
 def run_test():
-"Run throught the tests one by one"
+"Run through the tests one by one"
 
 print ("Checking we can step the first few instructions")
 step_ok = 0
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index f285484951..dadde2a266 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -257,7 +257,7 @@ function _launch_qemu()
 }
 
 
-# Silenty kills the QEMU process
+# Silently kills the QEMU process
 #
 # If $wait is set to anything other than the empty string, the process will not
 # be killed but only waited for, and any output will be forwarded to stdout. If
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
index 57470b2a2c..c581bd6ffc 100644
--- a/tests/tcg/Makefile.include
+++ b/tests/tcg/Makefile.include
@@ -2,7 +2,7 @@
 #
 # TCG tests (per-target rules)
 #
-# This Makefile fragement is included from the per-target
+# This Makefile fragment is included from the per-target
 # Makefile.target so will be invoked for each linux-user program we
 # build. We have two options for compiling, either using a configured
 # guest compiler or calling one of our docker images to do it for us.
diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe
index 15c0412657..9dc654663d 100644
--- a/tests/tcg/Makefile.probe
+++ b/tests/tcg/Makefile.probe
@@ -2,7 +2,7 @@
 #
 # TCG Compiler Probe
 #
-# This Makefile fragement is included multiple times in the main make
+# This Makefile fragment is included multiple times in the main make
 # script to probe for available compilers. This is used to build up a
 # selection of required docker targets before we invoke a sub-make for
 # each target.
diff --git a/tests/tcg/mips/mips64-dsp/subq_s_pw.c 
b/tests/tcg/mips/mips64-dsp/subq_s_pw.c
index e8e0b0567e..4c080b785a 100644
--- a/tests/tcg/mips/mips64-dsp/subq_s_pw.c
+++ b/tests/tcg/mips/mips64-dsp/su

[Xen-devel] [PULL 20/20] ppc: move at24c to its own CONFIG_ symbol

2018-10-26 Thread Laurent Vivier
From: Paolo Bonzini 

AT24c EEPROM is currently gated by CONFIG_I2C, and as such it is
being included in all emulators that use I2C, even if they do not
really need it.  Separate it and, since it was added for the e500
machines, add it to qemu-system-ppc and qemu-system-ppc64.

Signed-off-by: Paolo Bonzini 
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Thomas Huth 
Message-Id: <20180522191743.12872-1-pbonz...@redhat.com>
[lv: rebase]
Signed-off-by: Laurent Vivier 
---
 default-configs/ppc-softmmu.mak | 1 +
 hw/nvram/Makefile.objs  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 3181bbf163..23d871fb3e 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -28,6 +28,7 @@ CONFIG_SM501=y
 CONFIG_DDC=y
 CONFIG_IDE_SII3112=y
 CONFIG_I2C=y
+CONFIG_AT24C=y
 CONFIG_BITBANG_I2C=y
 CONFIG_M41T80=y
 CONFIG_VGA_CIRRUS=y
diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs
index a912d25391..b318e53a43 100644
--- a/hw/nvram/Makefile.objs
+++ b/hw/nvram/Makefile.objs
@@ -1,6 +1,6 @@
 common-obj-$(CONFIG_DS1225Y) += ds1225y.o
 common-obj-y += eeprom93xx.o
-common-obj-$(CONFIG_I2C) += eeprom_at24c.o
+common-obj-$(CONFIG_AT24C) += eeprom_at24c.o
 common-obj-y += fw_cfg.o
 common-obj-y += chrp_nvram.o
 common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 19/20] milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

qemu_log_mask(GUEST_ERROR) is more appropriate:

  $ qemu -d help
  Log items (comma separated):
  guest_errorslog when the guest OS does something invalid (eg accessing a 
non-existent register)

Signed-off-by: Philippe Mathieu-Daudé 
Acked-by: Michael Walle 
Message-Id: <20180702014022.12395-1-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/net/milkymist-minimac2.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index 3eaa19dfde..322fb77e46 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "net/net.h"
+#include "qemu/log.h"
 #include "qemu/error-report.h"
 
 #include 
@@ -214,7 +215,8 @@ static size_t assemble_frame(uint8_t *buf, size_t size,
 uint32_t crc;
 
 if (size < payload_size + 12) {
-error_report("milkymist_minimac2: received too big ethernet frame");
+qemu_log_mask(LOG_GUEST_ERROR, "milkymist_minimac2: frame too big "
+  "(%zd bytes)\n", payload_size);
 return 0;
 }
 
@@ -347,8 +349,9 @@ minimac2_read(void *opaque, hwaddr addr, unsigned size)
 break;
 
 default:
-error_report("milkymist_minimac2: read access to unknown register 0x"
-TARGET_FMT_plx, addr << 2);
+qemu_log_mask(LOG_GUEST_ERROR,
+  "milkymist_minimac2_rd%d: 0x%" HWADDR_PRIx "\n",
+  size, addr << 2);
 break;
 }
 
@@ -413,8 +416,9 @@ minimac2_write(void *opaque, hwaddr addr, uint64_t value,
 break;
 
 default:
-error_report("milkymist_minimac2: write access to unknown register 0x"
-TARGET_FMT_plx, addr << 2);
+qemu_log_mask(LOG_GUEST_ERROR,
+  "milkymist_minimac2_wr%d: 0x%" HWADDR_PRIx " = 0x%lx\n",
+  size, addr << 2, value);
 break;
 }
 }
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 16/20] tests/bios-tables-test: Remove an useless cast

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/typecast.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-5-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index af4b1fb6bd..02e77ec811 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -319,7 +319,7 @@ static bool load_asl(GArray *sdts, AcpiSdtTable *sdt)
 ret = g_spawn_command_line_sync(command_line->str, , _err, NULL, 
);
 g_assert_no_error(error);
 if (ret) {
-ret = g_file_get_contents(sdt->asl_file, (gchar **)>asl,
+ret = g_file_get_contents(sdt->asl_file, >asl,
   >asl_len, );
 g_assert(ret);
 g_assert_no_error(error);
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 10/20] linux-user: fix comment s/atomic_write/atomic_set/

2018-10-26 Thread Laurent Vivier
From: "Emilio G. Cota" 

Signed-off-by: Emilio G. Cota 
Message-Id: <20180811211011.6277-1-c...@braap.org>
Signed-off-by: Laurent Vivier 
---
 linux-user/qemu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 1beb6a2cfc..dde3f26f5a 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -143,7 +143,7 @@ typedef struct TaskState {
 /* Nonzero if process_pending_signals() needs to do something (either
  * handle a pending signal or unblock signals).
  * This flag is written from a signal handler so should be accessed via
- * the atomic_read() and atomic_write() functions. (It is not accessed
+ * the atomic_read() and atomic_set() functions. (It is not accessed
  * from multiple threads.)
  */
 int signal_pending;
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 14/20] qobject: Catch another straggler for use of qdict_put_str()

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-2-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 qobject/block-qdict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qobject/block-qdict.c b/qobject/block-qdict.c
index 42054cc274..1487cc5dd8 100644
--- a/qobject/block-qdict.c
+++ b/qobject/block-qdict.c
@@ -577,7 +577,7 @@ static QObject *qdict_crumple_for_keyval_qiv(QDict *src, 
Error **errp)
 if (!tmp) {
 tmp = qdict_clone_shallow(src);
 }
-qdict_put(tmp, ent->key, qstring_from_str(s));
+qdict_put_str(tmp, ent->key, s);
 g_free(buf);
 }
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 13/20] configure: Support pkg-config for zlib

2018-10-26 Thread Laurent Vivier
From: Stefan Weil 

This is needed for builds with the mingw64-* packages from Cygwin,
but also works for Linux.

Move the zlib test also more to the end because users should
get information on the really important missing packages
(which also require zlib) first.

Signed-off-by: Stefan Weil 
Reviewed-by: Stefan Hajnoczi 
Message-Id: <20180712192603.11599-1...@weilnetz.de>
Signed-off-by: Laurent Vivier 
---
 configure | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index 1ee09bd112..a02df30dde 100755
--- a/configure
+++ b/configure
@@ -2151,23 +2151,6 @@ EOF
   fi
 fi
 
-#
-# zlib check
-
-if test "$zlib" != "no" ; then
-cat > $TMPC << EOF
-#include 
-int main(void) { zlibVersion(); return 0; }
-EOF
-if compile_prog "" "-lz" ; then
-:
-else
-error_exit "zlib check failed" \
-"Make sure to have the zlib libs and headers installed."
-fi
-fi
-LIBS="$LIBS -lz"
-
 ##
 # lzo check
 
@@ -3479,6 +3462,29 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; 
then
 fi
 fi
 
+#
+# zlib check
+
+if test "$zlib" != "no" ; then
+if $pkg_config --exists zlib; then
+zlib_cflags=$($pkg_config --cflags zlib)
+zlib_libs=$($pkg_config --libs zlib)
+QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS"
+LIBS="$zlib_libs $LIBS"
+else
+cat > $TMPC << EOF
+#include 
+int main(void) { zlibVersion(); return 0; }
+EOF
+if compile_prog "" "-lz" ; then
+LIBS="$LIBS -lz"
+else
+error_exit "zlib check failed" \
+"Make sure to have the zlib libs and headers installed."
+fi
+fi
+fi
+
 ##
 # SHA command probe for modules
 if test "$modules" = yes; then
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 00/20] Trivial patches patches

2018-10-26 Thread Laurent Vivier
The following changes since commit 808ebd66e467f77c0d1f8c6346235f81e9c99cf2:

  Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-sf0' 
into staging (2018-10-25 17:41:03 +0100)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/trivial-patches-pull-request

for you to fetch changes up to 4b03da6e87c34793137a231b558231fd406c05e8:

  ppc: move at24c to its own CONFIG_ symbol (2018-10-26 17:17:32 +0200)


QEMU trivial patches collected between June and October 2018
(Thank you to Thomas Huth)



Cleber Rosa (6):
  tests/tcg/README: fix location for lm32 tests
  qemu-iotests: fix filename containing checks
  docs/devel/testing.rst: add missing newlines after code block
  scripts/decodetree.py: remove unused imports
  scripts/qemu.py: remove trailing quotes on docstring
  qemu-iotests: make 218 executable

Emilio G. Cota (1):
  linux-user: fix comment s/atomic_write/atomic_set/

Li Qiang (2):
  memory.h: fix typos in comments
  cpu.h: fix a typo in comment

Paolo Bonzini (1):
  ppc: move at24c to its own CONFIG_ symbol

Philippe Mathieu-Daudé (6):
  qobject: Catch another straggler for use of qdict_put_str()
  xen: Use the PCI_DEVICE macro
  tests/bios-tables-test: Remove an useless cast
  hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro
  hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro
  milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of
error_report

Stefan Weil (2):
  tests: Fix typos in comments and help message (found by codespell)
  configure: Support pkg-config for zlib

Thomas Huth (1):
  configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

yuchenlin (1):
  vga_int: remove unused function protype

 configure | 40 +++
 default-configs/alpha-softmmu.mak |  1 -
 default-configs/ppc-softmmu.mak   |  1 +
 docs/devel/testing.rst|  2 ++
 hw/display/vga_int.h  |  1 -
 hw/net/milkymist-minimac2.c   | 14 ++
 hw/nvram/Makefile.objs|  2 +-
 hw/pci-host/piix.c|  2 +-
 hw/pci-host/q35.c |  2 +-
 hw/xen/xen_pt_config_init.c   |  8 +++---
 include/exec/memory.h |  6 ++--
 include/hw/intc/arm_gicv3_common.h|  2 +-
 include/qom/cpu.h |  2 +-
 linux-user/qemu.h |  2 +-
 qobject/block-qdict.c |  2 +-
 scripts/decodetree.py |  2 --
 scripts/qemu.py   |  2 +-
 tests/bios-tables-test.c  |  4 +--
 tests/docker/Makefile.include |  2 +-
 tests/docker/docker.py|  4 +--
 tests/guest-debug/test-gdbstub.py |  2 +-
 tests/qemu-iotests/218|  0
 tests/qemu-iotests/common.qemu|  2 +-
 tests/qemu-iotests/common.rc  |  4 +--
 tests/tcg/Makefile.include|  2 +-
 tests/tcg/Makefile.probe  |  2 +-
 tests/tcg/README  |  2 +-
 tests/tcg/mips/mips64-dsp/subq_s_pw.c |  2 +-
 28 files changed, 63 insertions(+), 54 deletions(-)
 mode change 100644 => 100755 tests/qemu-iotests/218

-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 03/20] memory.h: fix typos in comments

2018-10-26 Thread Laurent Vivier
From: Li Qiang 

Signed-off-by: Li Qiang 
Reviewed-by: Peter Maydell 
Message-Id: <1539080467-2976-1-git-send-email-liq...@gmail.com>
[lv: s/types/typos/]
Signed-off-by: Laurent Vivier 
---
 include/exec/memory.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 667466b8f3..d0c7f0d9e9 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -935,7 +935,7 @@ uint64_t memory_region_size(MemoryRegion *mr);
 /**
  * memory_region_is_ram: check whether a memory region is random access
  *
- * Returns %true is a memory region is random access.
+ * Returns %true if a memory region is random access.
  *
  * @mr: the memory region being queried
  */
@@ -947,7 +947,7 @@ static inline bool memory_region_is_ram(MemoryRegion *mr)
 /**
  * memory_region_is_ram_device: check whether a memory region is a ram device
  *
- * Returns %true is a memory region is a device backed ram region
+ * Returns %true if a memory region is a device backed ram region
  *
  * @mr: the memory region being queried
  */
@@ -1161,7 +1161,7 @@ uint8_t memory_region_get_dirty_log_mask(MemoryRegion 
*mr);
 /**
  * memory_region_is_rom: check whether a memory region is ROM
  *
- * Returns %true is a memory region is read-only memory.
+ * Returns %true if a memory region is read-only memory.
  *
  * @mr: the memory region being queried
  */
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 01/20] configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

2018-10-26 Thread Laurent Vivier
From: Thomas Huth 

We don't use CONFIG_PARALLEL_ISA in any of our Makefiles, so this
is just a dead config option which can be removed.

Fixes: a4cb773928e047b137c6998209cf2eec857fac6b
Signed-off-by: Thomas Huth 
Acked-by: Richard Henderson 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <1540376314-5727-1-git-send-email-th...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 default-configs/alpha-softmmu.mak | 1 -
 1 file changed, 1 deletion(-)

diff --git a/default-configs/alpha-softmmu.mak 
b/default-configs/alpha-softmmu.mak
index eb58b40254..4d654eaa0b 100644
--- a/default-configs/alpha-softmmu.mak
+++ b/default-configs/alpha-softmmu.mak
@@ -8,7 +8,6 @@ CONFIG_I82374=y
 CONFIG_I8254=y
 CONFIG_I8257=y
 CONFIG_PARALLEL=y
-CONFIG_PARALLEL_ISA=y
 CONFIG_FDC=y
 CONFIG_PCKBD=y
 CONFIG_VGA_CIRRUS=y
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 02/20] vga_int: remove unused function protype

2018-10-26 Thread Laurent Vivier
From: yuchenlin 

Signed-off-by: yuchenlin 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181022080053.9379-1-yuchen...@synology.com>
Signed-off-by: Laurent Vivier 
---
 hw/display/vga_int.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 6e4fa48a79..55c418eab5 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -166,7 +166,6 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
   const MemoryRegionPortio **vbe_ports);
 void vga_common_reset(VGACommonState *s);
 
-void vga_sync_dirty_bitmap(VGACommonState *s);
 void vga_dirty_log_start(VGACommonState *s);
 void vga_dirty_log_stop(VGACommonState *s);
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 04/20] tests/tcg/README: fix location for lm32 tests

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

Point to the right and obvious location for lm32 tests.

Signed-off-by: Cleber Rosa 
Reviewed-by: Thomas Huth 
Acked-by: Alex Bennée 
Message-Id: <20181004161852.11673-3-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/tcg/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tcg/README b/tests/tcg/README
index a5643d33e7..2a58f9a058 100644
--- a/tests/tcg/README
+++ b/tests/tcg/README
@@ -10,6 +10,6 @@ with "make test-cris".
 
 LM32
 
-The testsuite for LM32 is in tests/tcg/cris.  You can run it
+The testsuite for LM32 is in tests/tcg/lm32.  You can run it
 with "make test-lm32".
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 11/20] cpu.h: fix a typo in comment

2018-10-26 Thread Laurent Vivier
From: Li Qiang 

Found by reading the code.

Signed-off-by: Li Qiang 
Message-Id: <1536150548-2797-1-git-send-email-liq...@gmail.com>
Signed-off-by: Laurent Vivier 
---
 include/qom/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 4e238b0d9f..def0c64308 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -852,7 +852,7 @@ extern CPUInterruptHandler cpu_interrupt_handler;
 /**
  * cpu_interrupt:
  * @cpu: The CPU to set an interrupt on.
- * @mask: The interupts to set.
+ * @mask: The interrupts to set.
  *
  * Invokes the interrupt handler.
  */
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 09/20] qemu-iotests: make 218 executable

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

Commit 990dc39c made all tests executable at the time, but 218 came in
later, and missing those permissions.

Signed-off-by: Cleber Rosa 
Message-Id: <20181004161852.11673-4-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/qemu-iotests/218 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tests/qemu-iotests/218

diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218
old mode 100644
new mode 100755
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 08/20] scripts/qemu.py: remove trailing quotes on docstring

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

Signed-off-by: Cleber Rosa 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-11-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 scripts/qemu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index f099ce7278..b0b2f12ce6 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -87,7 +87,7 @@ class QEMUMachine(object):
 @param name: prefix for socket and log file names (default: qemu-PID)
 @param test_dir: where to create socket and log file
 @param monitor_address: address for QMP monitor
-@param socket_scm_helper: helper program, required for send_fd_scm()"
+@param socket_scm_helper: helper program, required for send_fd_scm()
 @note: Qemu process is not started until launch() is used.
 '''
 if args is None:
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 06/20] docs/devel/testing.rst: add missing newlines after code block

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

The line immediate following a ".. code::" block is considered
to contains arguments to the "code directive".  The lack of a
new line gives me during at parse time:

   testing.rst:63: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
 make check-unit V=1

   testing.rst:120: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
 make check-qtest V=1

Let's add the missing newlines, both for consistency and to
avoid the parsing errors.

Signed-off-by: Cleber Rosa 
Reviewed-by: John Snow 
Message-Id: <20181004161852.11673-6-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 docs/devel/testing.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index fcfad87614..a227754f86 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -59,6 +59,7 @@ variable (which affects memory reclamation and catches 
invalid pointers better)
 and gtester options. If necessary, you can run
 
 .. code::
+
   make check-unit V=1
 
 and copy the actual command line which executes the unit test, then run
@@ -116,6 +117,7 @@ and using gdb on the test is still simple to do: find out 
the actual command
 from the output of
 
 .. code::
+
   make check-qtest V=1
 
 which you can run manually.
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 17/20] hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro

2018-10-26 Thread Laurent Vivier
From: Philippe Mathieu-Daudé 

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
--macro-file scripts/cocci-macro-file.h \
--dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Markus Armbruster 
Acked-by: Michael S. Tsirkin 
Message-Id: <20180705155811.20366-7-f4...@amsat.org>
Signed-off-by: Laurent Vivier 
---
 hw/pci-host/piix.c | 2 +-
 hw/pci-host/q35.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index da73743fa2..47293a3915 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -144,7 +144,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
 memory_region_transaction_begin();
 for (i = 0; i < 13; i++) {
 pam_update(>pam_regions[i], i,
-   pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]);
+   pd->config[I440FX_PAM + DIV_ROUND_UP(i, 2)]);
 }
 memory_region_set_enabled(>smram_region,
   !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN));
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 8ce1e09932..966a7cf92d 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -356,7 +356,7 @@ static void mch_update_pam(MCHPCIState *mch)
 memory_region_transaction_begin();
 for (i = 0; i < 13; i++) {
 pam_update(>pam_regions[i], i,
-   pd->config[MCH_HOST_BRIDGE_PAM0 + (DIV_ROUND_UP(i, 2))]);
+   pd->config[MCH_HOST_BRIDGE_PAM0 + DIV_ROUND_UP(i, 2)]);
 }
 memory_region_transaction_commit();
 }
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PULL 05/20] qemu-iotests: fix filename containing checks

2018-10-26 Thread Laurent Vivier
From: Cleber Rosa 

Commit cce293a2945 moved some functions from common.config to
common.rc, but the error messages still reference the old file
location.

Signed-off-by: Cleber Rosa 
Reviewed-by: Max Reitz 
Reviewed-by: Philippe Mathieu-Daudé 
Message-Id: <20181004161852.11673-5-cr...@redhat.com>
Signed-off-by: Laurent Vivier 
---
 tests/qemu-iotests/common.rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 44bee16a5e..70ca65b49b 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -170,7 +170,7 @@ if [ ! -e "$TEST_DIR" ]; then
 fi
 
 if [ ! -d "$TEST_DIR" ]; then
-echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
+echo "common.rc: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
 exit 1
 fi
 
@@ -179,7 +179,7 @@ if [ -z "$REMOTE_TEST_DIR" ]; then
 fi
 
 if [ ! -d "$SAMPLE_IMG_DIR" ]; then
-echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a 
directory"
+echo "common.rc: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a 
directory"
 exit 1
 fi
 
-- 
2.17.2


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] qemu: include generated files with <> and not ""

2018-03-20 Thread Laurent Vivier
Le 20/03/2018 à 02:54, Michael S. Tsirkin a écrit :
> QEMU coding style at the moment asks for all non-system
> include files to be used with #include "foo.h".
> However this rule actually does not make sense and
> creates issues for when the included file is generated.

If you change that, we can have issue when a system include has the same
name as our local include. With "", system header are taken first.

> In C, include "file" means look in current directory,
> then on include search path. Current directory here
> means the source file directory.
> By comparison include  means look on include search path.

Not exactly, there is the notion of "system header" too.

https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html

#include 
This variant is used for system header files. It searches for a file
named file in a standard list of system directories. You can prepend
directories to this list with the -I option (see Invocation).

#include "file"
This variant is used for header files of your own program. It searches
for a file named file first in the directory containing the current
file, then in the quote directories and then the same directories used
for . You can prepend directories to the list of quote directories
with the -iquote option.

> As generated files are not in the search directory (unless the build
> directory happens to match the source directory), it does not make sense
> to include them with "" - doing so is merely more work for preprocessor
> and a source or errors if a stale file happens to exist in the source
> directory.

I agree there is a problem with stale files. But linux, for instance,
asks for a "make mrproper" to avoid this.

> This changes include directives for all generated files, across the
> tree. The idea is to avoid sending a huge amount of email.  But when
> merging, the changes will be split with one commit per file, e.g. for
> ease of bisect in case of build failures, and to ease merging.
> 
> Note that should some generated files be missed by this tree-wide
> refactoring, it isn't a big deal - this merely maintains the status quo,
> and this can be addressed by a separate patch on top.
> 
> Signed-off-by: Michael S. Tsirkin 

I think your idea conflicts with what Markus has started to do:

commit d8e39b70625d4ba1e998439d1a077b4b978930e7
Author: Markus Armbruster 
Date:   Thu Feb 1 12:18:28 2018 +0100

Use #include "..." for our own headers, <...> for others

System headers should be included with <...>, our own headers with
"...".  Offenders tracked down with an ugly, brittle and probably
buggy Perl script.  Previous iteration was commit a9c94277f0.

Delete inclusions of "string.h" and "strings.h" instead of fixing them
to  and , because we always include these via
osdep.h.

Put the cleaned up system header includes first.

While there, separate #include from file comment with exactly one
blank line.

commit a9c94277f07d19d3eb14f199c3e93491aa3eae0e
Author: Markus Armbruster 
Date:   Wed Jun 22 19:11:19 2016 +0200

Use #include "..." for our own headers, <...> for others

Tracked down with an ugly, brittle and probably buggy Perl script.

Also move includes converted to <...> up so they get included before
ours where that's obviously okay.

Thanks,
Laurent

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel