All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22
@ 2015-09-22 15:05 Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 01/48] nbd: convert to use the QAPI SocketAddress object Paolo Bonzini
                   ` (48 more replies)
  0 siblings, 49 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 9e72681d16792d0ffc42bab634b1753ff299bdfd:

  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-09-21' into staging (2015-09-21 22:33:51 +0100)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 6beb990c835097c402876b04075c6af533d00949:

  ppc: Rename ELF_MACHINE to be PPC specific (2015-09-22 15:55:02 +0200)

----------------------------------------------------------------
* First batch of MAINTAINERS updates
* IOAPIC fixes (to pass kvm-unit-tests with -machine kernel_irqchip=off)
* NBD API upgrades from Daniel
* strtosz fixes from Marc-André
* improved support for readonly=on on scsi-generic devices
* new "info ioapic" and "info lapic" monitor commands
* Peter Crosthwaite's ELF_MACHINE cleanups

----------------------------------------------------------------
Daniel P. Berrange (3):
      nbd: convert to use the QAPI SocketAddress object
      qemu-nbd: convert to use the QAPI SocketAddress object
      Makefile: fix build when VPATH is outside GIT tree

Marc-André Lureau (3):
      utils: rename strtosz to use qemu prefix
      tests: add some qemu_strtosz() tests
      vhost-scsi: include linux/vhost.h

Paolo Bonzini (12):
      checkpatch: do not recommend qemu_strtok over strtok
      scsi-generic: let guests recognize readonly=on on passthrough devices
      get_maintainer.pl: \C is deprecated
      MAINTAINERS: there is no PPC64 TCG backend anymore
      MAINTAINERS: Add disassemblers to the various backends
      MAINTAINERS: Add more s390 files
      MAINTAINERS: add IPack section
      MAINTAINERS: add more devices to the PC section
      MAINTAINERS: add more devices to the PCI section
      MAINTAINERS: add maintainer for character device front-ends
      ioapic: coalesce level interrupts
      ioapic: fix contents of arbitration register

Pavel Butsykin (9):
      apic_internal.h: make some apic_get_* functions externally visible
      apic_internal.h: rename ESR_ILLEGAL_ADDRESS to APIC_ESR_ILLEGAL_ADDRESS
      apic_internal.h: added more constants
      apic_internal.h: fix formatting and drop unused consts
      monitor: make monitor_fprintf and mon_get_cpu externally visible
      hmp: added local apic dump state
      ioapic_internal.h: added more constants
      hmp: added io apic dump state
      hmp: implemented io apic dump state for TCG

Peter Crosthwaite (21):
      linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
      linux-user: elfload: Provide default for elf_check_arch
      elf_ops: Fix coding style for EM alias case statement
      elf: Update EM_MOXIE definition
      arm: Remove ELF_MACHINE from cpu.h
      mb: Remove ELF_MACHINE from cpu.h
      m68k: Remove ELF_MACHINE from cpu.h
      cris: Remove ELF_MACHINE from cpu.h
      moxie: Remove ELF_MACHINE from cpu.h
      unicore: Remove ELF_MACHINE from cpu.h
      lm32: Remove ELF_MACHINE from cpu.h
      or32: Remove ELF_MACHINE from cpu.h
      tricore: Remove ELF_MACHINE from cpu.h
      xtensa: Remove ELF_MACHINE from cpu.h
      sh4: Remove ELF_MACHINE from cpu.h
      s390: Remove ELF_MACHINE from cpu.h
      sparc: Remove ELF_MACHINE from cpu.h
      mips: Remove ELF_MACHINE from cpu.h
      alpha: Remove ELF_MACHINE from cpu.h
      i386: Rename ELF_MACHINE to be x86 specific
      ppc: Rename ELF_MACHINE to be PPC specific

 MAINTAINERS                       |  63 +++++++++++--
 Makefile                          |   3 +-
 block/nbd.c                       |  71 +++++++-------
 disas.c                           |  10 --
 hmp-commands-info.hx              |  32 +++++++
 hw/arm/armv7m.c                   |   2 +-
 hw/cris/boot.c                    |   2 +-
 hw/i386/kvm/ioapic.c              |  10 ++
 hw/i386/multiboot.c               |   2 +-
 hw/intc/apic.c                    |  22 +----
 hw/intc/ioapic.c                  |  20 +++-
 hw/intc/ioapic_common.c           |  55 +++++++++++
 hw/lm32/lm32_boards.c             |   4 +-
 hw/lm32/milkymist.c               |   2 +-
 hw/m68k/an5206.c                  |   2 +-
 hw/m68k/dummy_m68k.c              |   2 +-
 hw/m68k/mcf5208.c                 |   2 +-
 hw/microblaze/boot.c              |   4 +-
 hw/mips/mips_fulong2e.c           |   2 +-
 hw/mips/mips_malta.c              |   2 +-
 hw/mips/mips_mipssim.c            |   2 +-
 hw/mips/mips_r4k.c                |   2 +-
 hw/moxie/moxiesim.c               |   4 +-
 hw/openrisc/openrisc_sim.c        |   2 +-
 hw/ppc/e500.c                     |   2 +-
 hw/ppc/mac_newworld.c             |   4 +-
 hw/ppc/mac_oldworld.c             |   4 +-
 hw/ppc/ppc440_bamboo.c            |   2 +-
 hw/ppc/prep.c                     |   2 +-
 hw/ppc/spapr.c                    |   4 +-
 hw/ppc/virtex_ml507.c             |   2 +-
 hw/s390x/ipl.c                    |   4 +-
 hw/scsi/scsi-generic.c            |  14 +++
 hw/scsi/vhost-scsi.c              |   1 +
 hw/sparc/leon3.c                  |   2 +-
 hw/sparc/sun4m.c                  |   4 +-
 hw/sparc64/sun4u.c                |   4 +-
 hw/tricore/tricore_testboard.c    |   2 +-
 hw/xtensa/sim.c                   |   4 +-
 hw/xtensa/xtfpga.c                |   2 +-
 include/elf.h                     |   3 +
 include/hw/elf_ops.h              |  23 +++--
 include/hw/i386/apic_internal.h   |  96 ++++++++++++++++---
 include/hw/i386/ioapic_internal.h |   7 ++
 include/hw/i386/pc.h              |   5 +
 include/hw/virtio/vhost-scsi.h    |  25 -----
 include/monitor/hmp-target.h      |   3 +
 include/monitor/monitor.h         |   1 +
 include/qemu-common.h             |  27 +++---
 linux-user/elfload.c              |  37 +++-----
 monitor.c                         |   7 +-
 qapi/opts-visitor.c               |   4 +-
 qemu-img.c                        |   5 +-
 qemu-io-cmds.c                    |   2 +-
 qemu-nbd.c                        | 102 ++++++++------------
 scripts/checkpatch.pl             |   4 +-
 scripts/get_maintainer.pl         |  22 ++---
 target-alpha/cpu.h                |   2 -
 target-arm/cpu.h                  |   2 -
 target-cris/cpu.h                 |   2 -
 target-i386/cpu.c                 |   4 +-
 target-i386/cpu.h                 |   7 +-
 target-i386/helper.c              | 191 ++++++++++++++++++++++++++++++++++++++
 target-i386/monitor.c             |  17 ++++
 target-lm32/cpu.h                 |   2 -
 target-m68k/cpu.h                 |   2 -
 target-microblaze/cpu.h           |   2 -
 target-mips/cpu.h                 |   2 -
 target-moxie/cpu.h                |   2 -
 target-openrisc/cpu.h             |   1 -
 target-ppc/cpu.h                  |   4 +-
 target-s390x/cpu.h                |   1 -
 target-sh4/cpu.h                  |   2 -
 target-sparc/cpu.h                |   6 --
 target-tricore/cpu.h              |   2 -
 target-unicore32/cpu.h            |   2 -
 target-xtensa/cpu.h               |   1 -
 tests/test-cutils.c               |  91 ++++++++++++++++++
 util/cutils.c                     |  25 ++---
 79 files changed, 792 insertions(+), 330 deletions(-)
-- 
2.5.0

^ permalink raw reply	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 01/48] nbd: convert to use the QAPI SocketAddress object
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 02/48] qemu-nbd: " Paolo Bonzini
                   ` (47 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

From: "Daniel P. Berrange" <berrange@redhat.com>

The nbd block driver currently uses a QemuOpts object
when setting up sockets. Switch it over to use the
QAPI SocketAddress object instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1442411543-28513-2-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/nbd.c | 71 ++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 37 insertions(+), 34 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index 2176186..c2a87e9 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -43,7 +43,6 @@
 
 typedef struct BDRVNBDState {
     NbdClientSession client;
-    QemuOpts *socket_opts;
 } BDRVNBDState;
 
 static int nbd_parse_uri(const char *filename, QDict *options)
@@ -190,10 +189,10 @@ out:
     g_free(file);
 }
 
-static void nbd_config(BDRVNBDState *s, QDict *options, char **export,
-                       Error **errp)
+static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export,
+                                 Error **errp)
 {
-    Error *local_err = NULL;
+    SocketAddress *saddr;
 
     if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) {
         if (qdict_haskey(options, "path")) {
@@ -201,28 +200,37 @@ static void nbd_config(BDRVNBDState *s, QDict *options, char **export,
         } else {
             error_setg(errp, "one of path and host must be specified.");
         }
-        return;
+        return NULL;
     }
 
-    s->client.is_unix = qdict_haskey(options, "path");
-    s->socket_opts = qemu_opts_create(&socket_optslist, NULL, 0,
-                                      &error_abort);
+    saddr = g_new0(SocketAddress, 1);
 
-    qemu_opts_absorb_qdict(s->socket_opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
-        return;
+    if (qdict_haskey(options, "path")) {
+        saddr->kind = SOCKET_ADDRESS_KIND_UNIX;
+        saddr->q_unix = g_new0(UnixSocketAddress, 1);
+        saddr->q_unix->path = g_strdup(qdict_get_str(options, "path"));
+        qdict_del(options, "path");
+    } else {
+        saddr->kind = SOCKET_ADDRESS_KIND_INET;
+        saddr->inet = g_new0(InetSocketAddress, 1);
+        saddr->inet->host = g_strdup(qdict_get_str(options, "host"));
+        if (!qdict_get_try_str(options, "port")) {
+            saddr->inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
+        } else {
+            saddr->inet->port = g_strdup(qdict_get_str(options, "port"));
+        }
+        qdict_del(options, "host");
+        qdict_del(options, "port");
     }
 
-    if (!qemu_opt_get(s->socket_opts, "port")) {
-        qemu_opt_set_number(s->socket_opts, "port", NBD_DEFAULT_PORT,
-                            &error_abort);
-    }
+    s->client.is_unix = saddr->kind == SOCKET_ADDRESS_KIND_UNIX;
 
     *export = g_strdup(qdict_get_try_str(options, "export"));
     if (*export) {
         qdict_del(options, "export");
     }
+
+    return saddr;
 }
 
 NbdClientSession *nbd_get_client_session(BlockDriverState *bs)
@@ -231,26 +239,24 @@ NbdClientSession *nbd_get_client_session(BlockDriverState *bs)
     return &s->client;
 }
 
-static int nbd_establish_connection(BlockDriverState *bs, Error **errp)
+static int nbd_establish_connection(BlockDriverState *bs,
+                                    SocketAddress *saddr,
+                                    Error **errp)
 {
     BDRVNBDState *s = bs->opaque;
     int sock;
 
-    if (s->client.is_unix) {
-        sock = unix_connect_opts(s->socket_opts, errp, NULL, NULL);
-    } else {
-        sock = inet_connect_opts(s->socket_opts, errp, NULL, NULL);
-        if (sock >= 0) {
-            socket_set_nodelay(sock);
-        }
-    }
+    sock = socket_connect(saddr, errp, NULL, NULL);
 
-    /* Failed to establish connection */
     if (sock < 0) {
         logout("Failed to establish connection to NBD server\n");
         return -EIO;
     }
 
+    if (!s->client.is_unix) {
+        socket_set_nodelay(sock);
+    }
+
     return sock;
 }
 
@@ -260,19 +266,19 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
     BDRVNBDState *s = bs->opaque;
     char *export = NULL;
     int result, sock;
-    Error *local_err = NULL;
+    SocketAddress *saddr;
 
     /* Pop the config into our state object. Exit if invalid. */
-    nbd_config(s, options, &export, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    saddr = nbd_config(s, options, &export, errp);
+    if (!saddr) {
         return -EINVAL;
     }
 
     /* establish TCP connection, return error if it fails
      * TODO: Configurable retry-until-timeout behaviour.
      */
-    sock = nbd_establish_connection(bs, errp);
+    sock = nbd_establish_connection(bs, saddr, errp);
+    qapi_free_SocketAddress(saddr);
     if (sock < 0) {
         g_free(export);
         return sock;
@@ -315,9 +321,6 @@ static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num,
 
 static void nbd_close(BlockDriverState *bs)
 {
-    BDRVNBDState *s = bs->opaque;
-
-    qemu_opts_del(s->socket_opts);
     nbd_client_close(bs);
 }
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 02/48] qemu-nbd: convert to use the QAPI SocketAddress object
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 01/48] nbd: convert to use the QAPI SocketAddress object Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 03/48] utils: rename strtosz to use qemu prefix Paolo Bonzini
                   ` (46 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

From: "Daniel P. Berrange" <berrange@redhat.com>

The qemu-nbd program currently uses a QemuOpts objects
when setting up sockets. Switch it over to use the
QAPI SocketAddress objects instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1442411543-28513-3-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-nbd.c | 102 +++++++++++++++++++++++--------------------------------------
 1 file changed, 38 insertions(+), 64 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 9518b75..6428c15 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -49,7 +49,7 @@
 static NBDExport *exp;
 static int verbose;
 static char *srcpath;
-static char *sockpath;
+static SocketAddress *saddr;
 static int persistent = 0;
 static enum { RUNNING, TERMINATE, TERMINATING, TERMINATED } state;
 static int shared = 1;
@@ -213,52 +213,6 @@ static void termsig_handler(int signum)
     qemu_notify_event();
 }
 
-static void combine_addr(char *buf, size_t len, const char* address,
-                         uint16_t port)
-{
-    /* If the address-part contains a colon, it's an IPv6 IP so needs [] */
-    if (strstr(address, ":")) {
-        snprintf(buf, len, "[%s]:%u", address, port);
-    } else {
-        snprintf(buf, len, "%s:%u", address, port);
-    }
-}
-
-static int tcp_socket_incoming(const char *address, uint16_t port)
-{
-    char address_and_port[128];
-    Error *local_err = NULL;
-
-    combine_addr(address_and_port, 128, address, port);
-    int fd = inet_listen(address_and_port, NULL, 0, SOCK_STREAM, 0, &local_err);
-
-    if (local_err != NULL) {
-        error_report_err(local_err);
-    }
-    return fd;
-}
-
-static int unix_socket_incoming(const char *path)
-{
-    Error *local_err = NULL;
-    int fd = unix_listen(path, NULL, 0, &local_err);
-
-    if (local_err != NULL) {
-        error_report_err(local_err);
-    }
-    return fd;
-}
-
-static int unix_socket_outgoing(const char *path)
-{
-    Error *local_err = NULL;
-    int fd = unix_connect(path, &local_err);
-
-    if (local_err != NULL) {
-        error_report_err(local_err);
-    }
-    return fd;
-}
 
 static void *show_parts(void *arg)
 {
@@ -287,8 +241,10 @@ static void *nbd_client_thread(void *arg)
     pthread_t show_parts_thread;
     Error *local_error = NULL;
 
-    sock = unix_socket_outgoing(sockpath);
+
+    sock = socket_connect(saddr, &local_error, NULL, NULL);
     if (sock < 0) {
+        error_report_err(local_error);
         goto out;
     }
 
@@ -399,6 +355,33 @@ static void nbd_update_server_fd_handler(int fd)
     }
 }
 
+
+static SocketAddress *nbd_build_socket_address(const char *sockpath,
+                                               const char *bindto,
+                                               const char *port)
+{
+    SocketAddress *saddr;
+
+    saddr = g_new0(SocketAddress, 1);
+    if (sockpath) {
+        saddr->kind = SOCKET_ADDRESS_KIND_UNIX;
+        saddr->q_unix = g_new0(UnixSocketAddress, 1);
+        saddr->q_unix->path = g_strdup(sockpath);
+    } else {
+        saddr->kind = SOCKET_ADDRESS_KIND_INET;
+        saddr->inet = g_new0(InetSocketAddress, 1);
+        saddr->inet->host = g_strdup(bindto);
+        if (port) {
+            saddr->inet->port = g_strdup(port);
+        } else  {
+            saddr->inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
+        }
+    }
+
+    return saddr;
+}
+
+
 int main(int argc, char **argv)
 {
     BlockBackend *blk;
@@ -407,8 +390,9 @@ int main(int argc, char **argv)
     uint32_t nbdflags = 0;
     bool disconnect = false;
     const char *bindto = "0.0.0.0";
+    const char *port = NULL;
+    char *sockpath = NULL;
     char *device = NULL;
-    int port = NBD_DEFAULT_PORT;
     off_t fd_size;
     QemuOpts *sn_opts = NULL;
     const char *sn_id_or_name = NULL;
@@ -441,7 +425,6 @@ int main(int argc, char **argv)
     };
     int ch;
     int opt_ind = 0;
-    int li;
     char *end;
     int flags = BDRV_O_RDWR;
     int partition = -1;
@@ -529,14 +512,7 @@ int main(int argc, char **argv)
             bindto = optarg;
             break;
         case 'p':
-            li = strtol(optarg, &end, 0);
-            if (*end) {
-                errx(EXIT_FAILURE, "Invalid port `%s'", optarg);
-            }
-            if (li < 1 || li > 65535) {
-                errx(EXIT_FAILURE, "Port out of range `%s'", optarg);
-            }
-            port = (uint16_t)li;
+            port = optarg;
             break;
         case 'o':
                 dev_offset = strtoll (optarg, &end, 0);
@@ -695,6 +671,8 @@ int main(int argc, char **argv)
         snprintf(sockpath, 128, SOCKET_PATH, basename(device));
     }
 
+    saddr = nbd_build_socket_address(sockpath, bindto, port);
+
     if (qemu_init_main_loop(&local_err)) {
         error_report_err(local_err);
         exit(EXIT_FAILURE);
@@ -752,13 +730,9 @@ int main(int argc, char **argv)
         errx(EXIT_FAILURE, "%s", error_get_pretty(local_err));
     }
 
-    if (sockpath) {
-        fd = unix_socket_incoming(sockpath);
-    } else {
-        fd = tcp_socket_incoming(bindto, port);
-    }
-
+    fd = socket_listen(saddr, &local_err);
     if (fd < 0) {
+        error_report_err(local_err);
         return 1;
     }
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 03/48] utils: rename strtosz to use qemu prefix
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 01/48] nbd: convert to use the QAPI SocketAddress object Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 02/48] qemu-nbd: " Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 04/48] tests: add some qemu_strtosz() tests Paolo Bonzini
                   ` (45 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Not only it makes sense, but it gets rid of checkpatch warning:
WARNING: consider using qemu_strtosz in preference to strtosz

Also remove get rid of tabs to please checkpatch.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1442419377-9309-1-git-send-email-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qemu-common.h | 27 ++++++++++++++-------------
 monitor.c             |  2 +-
 qapi/opts-visitor.c   |  4 ++--
 qemu-img.c            |  5 +++--
 qemu-io-cmds.c        |  2 +-
 target-i386/cpu.c     |  4 ++--
 util/cutils.c         | 25 +++++++++++++------------
 7 files changed, 36 insertions(+), 33 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index 01d29dd..0bd212b 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -217,22 +217,23 @@ int parse_uint(const char *s, unsigned long long *value, char **endptr,
 int parse_uint_full(const char *s, unsigned long long *value, int base);
 
 /*
- * strtosz() suffixes used to specify the default treatment of an
- * argument passed to strtosz() without an explicit suffix.
+ * qemu_strtosz() suffixes used to specify the default treatment of an
+ * argument passed to qemu_strtosz() without an explicit suffix.
  * These should be defined using upper case characters in the range
- * A-Z, as strtosz() will use qemu_toupper() on the given argument
+ * A-Z, as qemu_strtosz() will use qemu_toupper() on the given argument
  * prior to comparison.
  */
-#define STRTOSZ_DEFSUFFIX_EB	'E'
-#define STRTOSZ_DEFSUFFIX_PB	'P'
-#define STRTOSZ_DEFSUFFIX_TB	'T'
-#define STRTOSZ_DEFSUFFIX_GB	'G'
-#define STRTOSZ_DEFSUFFIX_MB	'M'
-#define STRTOSZ_DEFSUFFIX_KB	'K'
-#define STRTOSZ_DEFSUFFIX_B	'B'
-int64_t strtosz(const char *nptr, char **end);
-int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix);
-int64_t strtosz_suffix_unit(const char *nptr, char **end,
+#define QEMU_STRTOSZ_DEFSUFFIX_EB 'E'
+#define QEMU_STRTOSZ_DEFSUFFIX_PB 'P'
+#define QEMU_STRTOSZ_DEFSUFFIX_TB 'T'
+#define QEMU_STRTOSZ_DEFSUFFIX_GB 'G'
+#define QEMU_STRTOSZ_DEFSUFFIX_MB 'M'
+#define QEMU_STRTOSZ_DEFSUFFIX_KB 'K'
+#define QEMU_STRTOSZ_DEFSUFFIX_B 'B'
+int64_t qemu_strtosz(const char *nptr, char **end);
+int64_t qemu_strtosz_suffix(const char *nptr, char **end,
+                            const char default_suffix);
+int64_t qemu_strtosz_suffix_unit(const char *nptr, char **end,
                             const char default_suffix, int64_t unit);
 #define K_BYTE     (1ULL << 10)
 #define M_BYTE     (1ULL << 20)
diff --git a/monitor.c b/monitor.c
index d0edb3b..476872c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2697,7 +2697,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
                         break;
                     }
                 }
-                val = strtosz(p, &end);
+                val = qemu_strtosz(p, &end);
                 if (val < 0) {
                     monitor_printf(mon, "invalid size\n");
                     goto fail;
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 7ae33b3..cd10392 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -474,8 +474,8 @@ opts_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp)
         return;
     }
 
-    val = strtosz_suffix(opt->str ? opt->str : "", &endptr,
-                         STRTOSZ_DEFSUFFIX_B);
+    val = qemu_strtosz_suffix(opt->str ? opt->str : "", &endptr,
+                         QEMU_STRTOSZ_DEFSUFFIX_B);
     if (val < 0 || *endptr) {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE, opt->name,
                    "a size value representible as a non-negative int64");
diff --git a/qemu-img.c b/qemu-img.c
index 6ff4e85..7d65c0a 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -338,7 +338,8 @@ static int img_create(int argc, char **argv)
     if (optind < argc) {
         int64_t sval;
         char *end;
-        sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
+        sval = qemu_strtosz_suffix(argv[optind++], &end,
+                                   QEMU_STRTOSZ_DEFSUFFIX_B);
         if (sval < 0 || *end) {
             if (sval == -ERANGE) {
                 error_report("Image size must be less than 8 EiB!");
@@ -1607,7 +1608,7 @@ static int img_convert(int argc, char **argv)
         {
             int64_t sval;
             char *end;
-            sval = strtosz_suffix(optarg, &end, STRTOSZ_DEFSUFFIX_B);
+            sval = qemu_strtosz_suffix(optarg, &end, QEMU_STRTOSZ_DEFSUFFIX_B);
             if (sval < 0 || *end) {
                 error_report("Invalid minimum zero buffer size for sparse output specified");
                 ret = -1;
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index d6572a8..6e5d1e4 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -136,7 +136,7 @@ static char **breakline(char *input, int *count)
 static int64_t cvtnum(const char *s)
 {
     char *end;
-    return strtosz_suffix(s, &end, STRTOSZ_DEFSUFFIX_B);
+    return qemu_strtosz_suffix(s, &end, QEMU_STRTOSZ_DEFSUFFIX_B);
 }
 
 #define EXABYTES(x)     ((long long)(x) << 60)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7c52714..d2b6bc5 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1893,8 +1893,8 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features,
                 char *err;
                 char num[32];
 
-                tsc_freq = strtosz_suffix_unit(val, &err,
-                                               STRTOSZ_DEFSUFFIX_B, 1000);
+                tsc_freq = qemu_strtosz_suffix_unit(val, &err,
+                                               QEMU_STRTOSZ_DEFSUFFIX_B, 1000);
                 if (tsc_freq < 0 || *err) {
                     error_setg(errp, "bad numerical value %s", val);
                     return;
diff --git a/util/cutils.c b/util/cutils.c
index ae35198..cfeb848 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -276,19 +276,19 @@ int fcntl_setfl(int fd, int flag)
 static int64_t suffix_mul(char suffix, int64_t unit)
 {
     switch (qemu_toupper(suffix)) {
-    case STRTOSZ_DEFSUFFIX_B:
+    case QEMU_STRTOSZ_DEFSUFFIX_B:
         return 1;
-    case STRTOSZ_DEFSUFFIX_KB:
+    case QEMU_STRTOSZ_DEFSUFFIX_KB:
         return unit;
-    case STRTOSZ_DEFSUFFIX_MB:
+    case QEMU_STRTOSZ_DEFSUFFIX_MB:
         return unit * unit;
-    case STRTOSZ_DEFSUFFIX_GB:
+    case QEMU_STRTOSZ_DEFSUFFIX_GB:
         return unit * unit * unit;
-    case STRTOSZ_DEFSUFFIX_TB:
+    case QEMU_STRTOSZ_DEFSUFFIX_TB:
         return unit * unit * unit * unit;
-    case STRTOSZ_DEFSUFFIX_PB:
+    case QEMU_STRTOSZ_DEFSUFFIX_PB:
         return unit * unit * unit * unit * unit;
-    case STRTOSZ_DEFSUFFIX_EB:
+    case QEMU_STRTOSZ_DEFSUFFIX_EB:
         return unit * unit * unit * unit * unit * unit;
     }
     return -1;
@@ -300,7 +300,7 @@ static int64_t suffix_mul(char suffix, int64_t unit)
  * in *end, if not NULL. Return -ERANGE on overflow, Return -EINVAL on
  * other error.
  */
-int64_t strtosz_suffix_unit(const char *nptr, char **end,
+int64_t qemu_strtosz_suffix_unit(const char *nptr, char **end,
                             const char default_suffix, int64_t unit)
 {
     int64_t retval = -EINVAL;
@@ -343,14 +343,15 @@ fail:
     return retval;
 }
 
-int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix)
+int64_t qemu_strtosz_suffix(const char *nptr, char **end,
+                            const char default_suffix)
 {
-    return strtosz_suffix_unit(nptr, end, default_suffix, 1024);
+    return qemu_strtosz_suffix_unit(nptr, end, default_suffix, 1024);
 }
 
-int64_t strtosz(const char *nptr, char **end)
+int64_t qemu_strtosz(const char *nptr, char **end)
 {
-    return strtosz_suffix(nptr, end, STRTOSZ_DEFSUFFIX_MB);
+    return qemu_strtosz_suffix(nptr, end, QEMU_STRTOSZ_DEFSUFFIX_MB);
 }
 
 /**
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 04/48] tests: add some qemu_strtosz() tests
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 03/48] utils: rename strtosz to use qemu prefix Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 05/48] checkpatch: do not recommend qemu_strtok over strtok Paolo Bonzini
                   ` (44 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

While reading the function I decided to write some tests.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1442419377-9309-2-git-send-email-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/test-cutils.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/tests/test-cutils.c b/tests/test-cutils.c
index 0046c61..a3de6ab 100644
--- a/tests/test-cutils.c
+++ b/tests/test-cutils.c
@@ -1352,6 +1352,86 @@ static void test_qemu_strtoull_full_max(void)
     g_assert_cmpint(res, ==, ULLONG_MAX);
 }
 
+static void test_qemu_strtosz_simple(void)
+{
+    const char *str = "12345M";
+    char *endptr = NULL;
+    int64_t res;
+
+    res = qemu_strtosz(str, &endptr);
+    g_assert_cmpint(res, ==, 12345 * M_BYTE);
+    g_assert(endptr == str + 6);
+
+    res = qemu_strtosz(str, NULL);
+    g_assert_cmpint(res, ==, 12345 * M_BYTE);
+}
+
+static void test_qemu_strtosz_units(void)
+{
+    const char *none = "1";
+    const char *b = "1B";
+    const char *k = "1K";
+    const char *m = "1M";
+    const char *g = "1G";
+    const char *t = "1T";
+    const char *p = "1P";
+    const char *e = "1E";
+    int64_t res;
+
+    /* default is M */
+    res = qemu_strtosz(none, NULL);
+    g_assert_cmpint(res, ==, M_BYTE);
+
+    res = qemu_strtosz(b, NULL);
+    g_assert_cmpint(res, ==, 1);
+
+    res = qemu_strtosz(k, NULL);
+    g_assert_cmpint(res, ==, K_BYTE);
+
+    res = qemu_strtosz(m, NULL);
+    g_assert_cmpint(res, ==, M_BYTE);
+
+    res = qemu_strtosz(g, NULL);
+    g_assert_cmpint(res, ==, G_BYTE);
+
+    res = qemu_strtosz(t, NULL);
+    g_assert_cmpint(res, ==, T_BYTE);
+
+    res = qemu_strtosz(p, NULL);
+    g_assert_cmpint(res, ==, P_BYTE);
+
+    res = qemu_strtosz(e, NULL);
+    g_assert_cmpint(res, ==, E_BYTE);
+}
+
+static void test_qemu_strtosz_float(void)
+{
+    const char *str = "12.345M";
+    int64_t res;
+
+    res = qemu_strtosz(str, NULL);
+    g_assert_cmpint(res, ==, 12.345 * M_BYTE);
+}
+
+static void test_qemu_strtosz_erange(void)
+{
+    const char *str = "10E";
+    int64_t res;
+
+    res = qemu_strtosz(str, NULL);
+    g_assert_cmpint(res, ==, -ERANGE);
+}
+
+static void test_qemu_strtosz_suffix_unit(void)
+{
+    const char *str = "12345";
+    int64_t res;
+
+    res = qemu_strtosz_suffix_unit(str, NULL,
+                                   QEMU_STRTOSZ_DEFSUFFIX_KB, 1000);
+    g_assert_cmpint(res, ==, 12345000);
+}
+
 int main(int argc, char **argv)
 {
     g_test_init(&argc, &argv, NULL);
@@ -1502,5 +1582,16 @@ int main(int argc, char **argv)
     g_test_add_func("/cutils/qemu_strtoull_full/max",
                     test_qemu_strtoull_full_max);
 
+    g_test_add_func("/cutils/strtosz/simple",
+                    test_qemu_strtosz_simple);
+    g_test_add_func("/cutils/strtosz/units",
+                    test_qemu_strtosz_units);
+    g_test_add_func("/cutils/strtosz/float",
+                    test_qemu_strtosz_float);
+    g_test_add_func("/cutils/strtosz/erange",
+                    test_qemu_strtosz_erange);
+    g_test_add_func("/cutils/strtosz/suffix-unit",
+                    test_qemu_strtosz_suffix_unit);
+
     return g_test_run();
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 05/48] checkpatch: do not recommend qemu_strtok over strtok
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 04/48] tests: add some qemu_strtosz() tests Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 06/48] scsi-generic: let guests recognize readonly=on on passthrough devices Paolo Bonzini
                   ` (43 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

If anything it should recommend strtok_r!

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 574334b..b6d71ea 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2463,8 +2463,8 @@ sub process {
 			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
 		}
 
-# recommend qemu_strto* over strto*
-		if ($line =~ /\b(strto.*?)\s*\(/) {
+# recommend qemu_strto* over strto* for numeric conversions
+		if ($line =~ /\b(strto[^k].*?)\s*\(/) {
 			WARN("consider using qemu_$1 in preference to $1\n" . $herecurr);
 		}
 # check for module_init(), use category-specific init macros explicitly please
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 06/48] scsi-generic: let guests recognize readonly=on on passthrough devices
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 05/48] checkpatch: do not recommend qemu_strtok over strtok Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 07/48] Makefile: fix build when VPATH is outside GIT tree Paolo Bonzini
                   ` (42 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

Passed-through SCSI devices can be opened with the readonly=on option.
When this happens, Linux filters away write commands so that the guest
cannot overwrite the contents of the device.

However, the guest does not know that the device is read-only, and
accepts writes.  The writes only fail later when the page cache is
flushed.

This patch modifies scsi-generic to modify the MODE SENSE data and
set the read-only bit in the device-specific parameters, so that
the guest OS treats the disk as write protected.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/scsi-generic.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 1b6350b..a4626f7 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -210,6 +210,20 @@ static void scsi_read_complete(void * opaque, int ret)
     }
     blk_set_guest_block_size(s->conf.blk, s->blocksize);
 
+    /* Patch MODE SENSE device specific parameters if the BDS is opened
+     * readonly.
+     */
+    if ((s->type == TYPE_DISK || s->type == TYPE_TAPE) &&
+        blk_is_read_only(s->conf.blk) &&
+        (r->req.cmd.buf[0] == MODE_SENSE ||
+         r->req.cmd.buf[0] == MODE_SENSE_10) &&
+        (r->req.cmd.buf[1] & 0x8) == 0) {
+        if (r->req.cmd.buf[0] == MODE_SENSE) {
+            r->buf[2] |= 0x80;
+        } else  {
+            r->buf[3] |= 0x80;
+        }
+    }
     scsi_req_data(&r->req, len);
     scsi_req_unref(&r->req);
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 07/48] Makefile: fix build when VPATH is outside GIT tree
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 06/48] scsi-generic: let guests recognize readonly=on on passthrough devices Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 08/48] vhost-scsi: include linux/vhost.h Paolo Bonzini
                   ` (41 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

From: "Daniel P. Berrange" <berrange@redhat.com>

Steve Ellcey / Leon Alrae reported that QEMU fails to build when
the VPATH directory is outside of the GIT tree, and the system
emulators & tools build is disabled. eg

   cd ..
   mkdir build
   cd build
   ../qemu/configure --disable-system --disable-tools
   make
   (...)
   make[1]: *** No rule to make target `../qom/object.o', needed by `qemu-aarch64'. Stop.
   make: *** [subdir-aarch64-linux-user] Error 2

The problem is due to the fact that some sub directory deps
were listed against SOFTMMU_SUBDIR_RULES instead of SUBDIR_RULES,
so were only processed for system emulators, not user emalutors.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1442570495-22029-1-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8ec9b69..5c0809f 100644
--- a/Makefile
+++ b/Makefile
@@ -179,7 +179,6 @@ SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
 
 $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
 $(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
-$(SOFTMMU_SUBDIR_RULES): $(qom-obj-y)
 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
 
 subdir-%:
@@ -204,7 +203,7 @@ subdir-dtc:dtc/libfdt dtc/tests
 dtc/%:
 	mkdir -p $@
 
-$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
+$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 romsubdir-%:
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 08/48] vhost-scsi: include linux/vhost.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 07/48] Makefile: fix build when VPATH is outside GIT tree Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 09/48] get_maintainer.pl: \C is deprecated Paolo Bonzini
                   ` (40 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Replace ad-hoc declarations with the linux header.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1442585920-28373-1-git-send-email-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/vhost-scsi.c           |  1 +
 include/hw/virtio/vhost-scsi.h | 25 -------------------------
 2 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index bac9ddb..fb7983d 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/fw-path-provider.h"
+#include "linux/vhost.h"
 
 /* Features supported by host kernel. */
 static const int kernel_feature_bits[] = {
diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h
index 701bfee..9fd63df 100644
--- a/include/hw/virtio/vhost-scsi.h
+++ b/include/hw/virtio/vhost-scsi.h
@@ -19,37 +19,12 @@
 #include "hw/virtio/virtio-scsi.h"
 #include "hw/virtio/vhost.h"
 
-/*
- * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
- *
- * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
- *            RFC-v2 vhost-scsi userspace.  Add GET_ABI_VERSION ioctl usage
- * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
- * 	      All the targets under vhost_wwpn can be seen and used by guest.
- */
-
-#define VHOST_SCSI_ABI_VERSION 1
-
-/* TODO #include <linux/vhost.h> properly */
-/* For VHOST_SCSI_SET_ENDPOINT/VHOST_SCSI_CLEAR_ENDPOINT ioctl */
-struct vhost_scsi_target {
-    int abi_version;
-    char vhost_wwpn[224];
-    unsigned short vhost_tpgt;
-    unsigned short reserved;
-};
-
 enum vhost_scsi_vq_list {
     VHOST_SCSI_VQ_CONTROL = 0,
     VHOST_SCSI_VQ_EVENT = 1,
     VHOST_SCSI_VQ_NUM_FIXED = 2,
 };
 
-#define VHOST_VIRTIO 0xAF
-#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
-#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
-#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
-
 #define TYPE_VHOST_SCSI "vhost-scsi"
 #define VHOST_SCSI(obj) \
         OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 09/48] get_maintainer.pl: \C is deprecated
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 08/48] vhost-scsi: include linux/vhost.h Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 10/48] MAINTAINERS: there is no PPC64 TCG backend anymore Paolo Bonzini
                   ` (39 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

"Match a single C-language char (octet) even if that is part of a larger
UTF-8 character.  Thus it breaks up characters into their UTF-8 bytes,
so you may end up with malformed pieces of UTF-8."

Just use a period instead.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/get_maintainer.pl | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index f39630e..7dacf32 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -258,7 +258,7 @@ open (my $maint, '<', "${lk_path}MAINTAINERS")
 while (<$maint>) {
     my $line = $_;
 
-    if ($line =~ m/^(\C):\s*(.*)/) {
+    if ($line =~ m/^(.):\s*(.*)/) {
 	my $type = $1;
 	my $value = $2;
 
@@ -493,7 +493,7 @@ sub range_is_maintained {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^(.):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'S') {
@@ -511,7 +511,7 @@ sub range_has_maintainer {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^(.):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'M') {
@@ -560,7 +560,7 @@ sub get_maintainers {
 
 	    for ($i = $start; $i < $end; $i++) {
 		my $line = $typevalue[$i];
-		if ($line =~ m/^(\C):\s*(.*)/) {
+		if ($line =~ m/^(.):\s*(.*)/) {
 		    my $type = $1;
 		    my $value = $2;
 		    if ($type eq 'X') {
@@ -575,7 +575,7 @@ sub get_maintainers {
 	    if (!$exclude) {
 		for ($i = $start; $i < $end; $i++) {
 		    my $line = $typevalue[$i];
-		    if ($line =~ m/^(\C):\s*(.*)/) {
+		    if ($line =~ m/^(.):\s*(.*)/) {
 			my $type = $1;
 			my $value = $2;
 			if ($type eq 'F') {
@@ -855,7 +855,7 @@ sub find_first_section {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (($tv =~ m/^(\C):\s*(.*)/)) {
+	if (($tv =~ m/^(.):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -869,7 +869,7 @@ sub find_starting_index {
 
     while ($index > 0) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^(.):\s*(.*)/)) {
 	    last;
 	}
 	$index--;
@@ -883,7 +883,7 @@ sub find_ending_index {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^(.):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -909,7 +909,7 @@ sub get_maintainer_role {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^(.):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "S") {
@@ -968,7 +968,7 @@ sub add_categories {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^(.):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "L") {
@@ -1010,7 +1010,7 @@ sub add_categories {
 		if ($name eq "") {
 		    if ($i > 0) {
 			my $tv = $typevalue[$i - 1];
-			if ($tv =~ m/^(\C):\s*(.*)/) {
+			if ($tv =~ m/^(.):\s*(.*)/) {
 			    if ($1 eq "P") {
 				$name = $2;
 				$pvalue = format_email($name, $address, $email_usename);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 10/48] MAINTAINERS: there is no PPC64 TCG backend anymore
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 09/48] get_maintainer.pl: \C is deprecated Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 11/48] MAINTAINERS: Add disassemblers to the various backends Paolo Bonzini
                   ` (38 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

PPC32 and PPC64 were unified.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 71c652b..7c81848 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1142,11 +1142,6 @@ M: Vassili Karpov (malc) <av1474@comtv.ru>
 S: Maintained
 F: tcg/ppc/
 
-PPC64 target
-M: Vassili Karpov (malc) <av1474@comtv.ru>
-S: Maintained
-F: tcg/ppc64/
-
 S390 target
 M: Alexander Graf <agraf@suse.de>
 M: Richard Henderson <rth@twiddle.net>
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 11/48] MAINTAINERS: Add disassemblers to the various backends
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 10/48] MAINTAINERS: there is no PPC64 TCG backend anymore Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 12/48] MAINTAINERS: Add more s390 files Paolo Bonzini
                   ` (37 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c81848..af4952c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -77,6 +77,7 @@ S: Maintained
 F: target-alpha/
 F: hw/alpha/
 F: tests/tcg/alpha/
+F: disas/alpha.c
 
 ARM
 M: Peter Maydell <peter.maydell@linaro.org>
@@ -84,6 +85,9 @@ S: Maintained
 F: target-arm/
 F: hw/arm/
 F: hw/cpu/a*mpcore.c
+F: disas/arm.c
+F: disas/arm-a64.cc
+F: disas/libvixl/
 
 CRIS
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
@@ -91,6 +95,7 @@ S: Maintained
 F: target-cris/
 F: hw/cris/
 F: tests/tcg/cris/
+F: disas/cris.c
 
 LM32
 M: Michael Walle <michael@walle.cc>
@@ -114,6 +119,7 @@ M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
 S: Maintained
 F: target-microblaze/
 F: hw/microblaze/
+F: disas/microblaze.c
 
 MIPS
 M: Aurelien Jarno <aurelien@aurel32.net>
@@ -122,11 +128,13 @@ S: Maintained
 F: target-mips/
 F: hw/mips/
 F: tests/tcg/mips/
+F: disas/mips.c
 
 Moxie
 M: Anthony Green <green@moxielogic.com>
 S: Maintained
 F: target-moxie/
+F: disas/moxie.c
 
 OpenRISC
 M: Jia Liu <proljc@gmail.com>
@@ -141,6 +149,7 @@ L: qemu-ppc@nongnu.org
 S: Maintained
 F: target-ppc/
 F: hw/ppc/
+F: disas/ppc.c
 
 S390
 M: Richard Henderson <rth@twiddle.net>
@@ -148,12 +157,14 @@ M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: target-s390x/
 F: hw/s390x/
+F: disas/s390.c
 
 SH4
 M: Aurelien Jarno <aurelien@aurel32.net>
 S: Odd Fixes
 F: target-sh4/
 F: hw/sh4/
+F: disas/sh4.c
 
 SPARC
 M: Blue Swirl <blauwirbel@gmail.com>
@@ -162,6 +173,7 @@ S: Maintained
 F: target-sparc/
 F: hw/sparc/
 F: hw/sparc64/
+F: disas/sparc.c
 
 UniCore32
 M: Guan Xuetao <gxt@mprc.pku.edu.cn>
@@ -176,6 +188,7 @@ M: Eduardo Habkost <ehabkost@redhat.com>
 S: Maintained
 F: target-i386/
 F: hw/i386/
+F: disas/i386.c
 
 Xtensa
 M: Max Filippov <jcmvbkbc@gmail.com>
@@ -1116,48 +1129,58 @@ M: Claudio Fontana <claudio.fontana@huawei.com>
 M: Claudio Fontana <claudio.fontana@gmail.com>
 S: Maintained
 F: tcg/aarch64/
+F: disas/arm-a64.cc
+F: disas/libvixl/
 
 ARM target
 M: Andrzej Zaborowski <balrogg@gmail.com>
 S: Maintained
 F: tcg/arm/
+F: disas/arm.c
 
 i386 target
 L: qemu-devel@nongnu.org
 S: Maintained
 F: tcg/i386/
+F: disas/i386.c
 
 IA64 target
 M: Aurelien Jarno <aurelien@aurel32.net>
 S: Maintained
 F: tcg/ia64/
+F: disas/ia64.c
 
 MIPS target
 M: Aurelien Jarno <aurelien@aurel32.net>
 S: Maintained
 F: tcg/mips/
+F: disas/mips.c
 
 PPC
 M: Vassili Karpov (malc) <av1474@comtv.ru>
 S: Maintained
 F: tcg/ppc/
+F: disas/ppc.c
 
 S390 target
 M: Alexander Graf <agraf@suse.de>
 M: Richard Henderson <rth@twiddle.net>
 S: Maintained
 F: tcg/s390/
+F: disas/s390.c
 
 SPARC target
 M: Blue Swirl <blauwirbel@gmail.com>
 S: Maintained
 F: tcg/sparc/
+F: disas/sparc.c
 
 TCI target
 M: Stefan Weil <sw@weilnetz.de>
 S: Maintained
 F: tcg/tci/
 F: tci.c
+F: disas/tci.c
 
 Stable branches
 ---------------
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 12/48] MAINTAINERS: Add more s390 files
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 11/48] MAINTAINERS: Add disassemblers to the various backends Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 13/48] MAINTAINERS: add IPack section Paolo Bonzini
                   ` (36 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf

Cc: Alexander Graf <agraf@suse.de>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index af4952c..599f7a7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -577,6 +577,7 @@ M: Cornelia Huck <cornelia.huck@de.ibm.com>
 M: Christian Borntraeger <borntraeger@de.ibm.com>
 M: Alexander Graf <agraf@suse.de>
 S: Supported
+F: hw/char/sclp*.[hc]
 F: hw/s390x/s390-virtio-ccw.c
 F: hw/s390x/css.[hc]
 F: hw/s390x/sclp*.[hc]
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 13/48] MAINTAINERS: add IPack section
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 12/48] MAINTAINERS: Add more s390 files Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 14/48] MAINTAINERS: add more devices to the PC section Paolo Bonzini
                   ` (35 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 599f7a7..b39e714 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -663,6 +663,12 @@ M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/*/omap*
 
+IPack
+M: Alberto Garcia <berto@igalia.com>
+S: Odd Fixes
+F: hw/char/ipoctal232.c
+F: hw/ipack/
+
 PCI
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 14/48] MAINTAINERS: add more devices to the PC section
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (12 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 13/48] MAINTAINERS: add IPack section Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 15/48] MAINTAINERS: add more devices to the PCI section Paolo Bonzini
                   ` (34 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

For chipset devices, I can co-maintain it with Michael.

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b39e714..c042f59 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -615,6 +615,25 @@ F: hw/acpi/piix4.c
 F: hw/acpi/ich9.c
 F: include/hw/acpi/ich9.h
 F: include/hw/acpi/piix.h
+F: hw/misc/sga.c
+
+PC Chipset
+M: Michael S. Tsirkin <mst@redhat.com>
+M: Paolo Bonzini <pbonzini@redhat.com>
+S: Support
+F: hw/char/debugcon.c
+F: hw/char/parallel.c
+F: hw/char/serial*
+F: hw/dma/i8257*
+F: hw/i2c/pm_smbus.c
+F: hw/intc/apic*
+F: hw/intc/ioapic*
+F: hw/intc/i8259*
+F: hw/misc/debugexit.c
+F: hw/misc/pc-testdev.c
+F: hw/timer/hpet*
+F: hw/timer/i8254*
+F: hw/timer/mc146818rtc*
 
 
 Xtensa Machines
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 15/48] MAINTAINERS: add more devices to the PCI section
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (13 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 14/48] MAINTAINERS: add more devices to the PC section Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 16/48] MAINTAINERS: add maintainer for character device front-ends Paolo Bonzini
                   ` (33 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index c042f59..5317ce1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -692,7 +692,9 @@ PCI
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: include/hw/pci/*
+F: hw/misc/pci-testdev.c
 F: hw/pci/*
+F: hw/pci-bridge/*
 
 ACPI/SMBIOS
 M: Michael S. Tsirkin <mst@redhat.com>
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 16/48] MAINTAINERS: add maintainer for character device front-ends
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (14 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 15/48] MAINTAINERS: add more devices to the PCI section Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 17/48] ioapic: coalesce level interrupts Paolo Bonzini
                   ` (32 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

Only "Odd Fixes" status, but let's add a point of contact.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5317ce1..14c0374 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -724,6 +724,11 @@ L: qemu-ppc@nongnu.org
 S: Supported
 F: hw/ppc/e500*
 
+Character devices
+M: Paolo Bonzini <pbonzini@redhat.com>
+S: Odd Fixes
+F: hw/char/
+
 SCSI
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Supported
@@ -908,7 +913,7 @@ F: block/qapi.c
 F: qapi/block*.json
 T: git git://repo.or.cz/qemu/armbru.git block-next
 
-Character Devices
+Character device backends
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: qemu-char.c
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 17/48] ioapic: coalesce level interrupts
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (15 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 16/48] MAINTAINERS: add maintainer for character device front-ends Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 18/48] ioapic: fix contents of arbitration register Paolo Bonzini
                   ` (31 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

If a level-triggered interrupt goes down and back up before the
corresponding EOI, it should be coalesced.  This fixes one testcase
in kvm-unit-tests' ioapic.flat.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/intc/ioapic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index b527932..6ad3c66 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -98,7 +98,9 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
             /* level triggered */
             if (level) {
                 s->irr |= mask;
-                ioapic_service(s);
+                if (!(entry & IOAPIC_LVT_REMOTE_IRR)) {
+                    ioapic_service(s);
+                }
             } else {
                 s->irr &= ~mask;
             }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 18/48] ioapic: fix contents of arbitration register
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (16 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 17/48] ioapic: coalesce level interrupts Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 19/48] apic_internal.h: make some apic_get_* functions externally visible Paolo Bonzini
                   ` (30 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel

The arbitration register should read to the same value as the
IOAPIC id register.  Fixes kvm-unit-tests ioapic.flat.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/intc/ioapic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 6ad3c66..bde52e8 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -156,15 +156,13 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
         }
         switch (s->ioregsel) {
         case IOAPIC_REG_ID:
+        case IOAPIC_REG_ARB:
             val = s->id << IOAPIC_ID_SHIFT;
             break;
         case IOAPIC_REG_VER:
             val = IOAPIC_VERSION |
                 ((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT);
             break;
-        case IOAPIC_REG_ARB:
-            val = 0;
-            break;
         default:
             index = (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1;
             if (index >= 0 && index < IOAPIC_NUM_PINS) {
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 19/48] apic_internal.h: make some apic_get_* functions externally visible
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (17 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 18/48] ioapic: fix contents of arbitration register Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 20/48] apic_internal.h: rename ESR_ILLEGAL_ADDRESS to APIC_ESR_ILLEGAL_ADDRESS Paolo Bonzini
                   ` (29 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Move apic_get_bit(), apic_set_bit() to apic_internal.h, make the apic_get_ppr
symbol external. It's necessary to work with isr, tmr, irr and ppr outside
hw/intc/apic.c

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-2-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/intc/apic.c                  | 18 +-----------------
 include/hw/i386/apic_internal.h | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 77b639c..52ac8b2 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -51,14 +51,6 @@ static int apic_ffs_bit(uint32_t value)
     return ctz32(value);
 }
 
-static inline void apic_set_bit(uint32_t *tab, int index)
-{
-    int i, mask;
-    i = index >> 5;
-    mask = 1 << (index & 0x1f);
-    tab[i] |= mask;
-}
-
 static inline void apic_reset_bit(uint32_t *tab, int index)
 {
     int i, mask;
@@ -67,14 +59,6 @@ static inline void apic_reset_bit(uint32_t *tab, int index)
     tab[i] &= ~mask;
 }
 
-static inline int apic_get_bit(uint32_t *tab, int index)
-{
-    int i, mask;
-    i = index >> 5;
-    mask = 1 << (index & 0x1f);
-    return !!(tab[i] & mask);
-}
-
 /* return -1 if no bit is set */
 static int get_highest_priority_int(uint32_t *tab)
 {
@@ -318,7 +302,7 @@ static uint8_t apic_get_tpr(APICCommonState *s)
     return s->tpr >> 4;
 }
 
-static int apic_get_ppr(APICCommonState *s)
+int apic_get_ppr(APICCommonState *s)
 {
     int tpr, isrv, ppr;
 
diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 26632ac..5a213bc 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -147,4 +147,22 @@ void apic_enable_vapic(DeviceState *d, hwaddr paddr);
 void vapic_report_tpr_access(DeviceState *dev, CPUState *cpu, target_ulong ip,
                              TPRAccess access);
 
+int apic_get_ppr(APICCommonState *s);
+
+static inline void apic_set_bit(uint32_t *tab, int index)
+{
+    int i, mask;
+    i = index >> 5;
+    mask = 1 << (index & 0x1f);
+    tab[i] |= mask;
+}
+
+static inline int apic_get_bit(uint32_t *tab, int index)
+{
+    int i, mask;
+    i = index >> 5;
+    mask = 1 << (index & 0x1f);
+    return !!(tab[i] & mask);
+}
+
 #endif /* !QEMU_APIC_INTERNAL_H */
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 20/48] apic_internal.h: rename ESR_ILLEGAL_ADDRESS to APIC_ESR_ILLEGAL_ADDRESS
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (18 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 19/48] apic_internal.h: make some apic_get_* functions externally visible Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 21/48] apic_internal.h: added more constants Paolo Bonzini
                   ` (28 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Added prefix APIC_ for determining the constant of a particular subsystem,
improve the overall readability and match other constant names.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-3-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/intc/apic.c                  | 4 ++--
 include/hw/i386/apic_internal.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 52ac8b2..0a840b8 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -723,7 +723,7 @@ static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
         val = s->divide_conf;
         break;
     default:
-        s->esr |= ESR_ILLEGAL_ADDRESS;
+        s->esr |= APIC_ESR_ILLEGAL_ADDRESS;
         val = 0;
         break;
     }
@@ -836,7 +836,7 @@ static void apic_mem_writel(void *opaque, hwaddr addr, uint32_t val)
         }
         break;
     default:
-        s->esr |= ESR_ILLEGAL_ADDRESS;
+        s->esr |= APIC_ESR_ILLEGAL_ADDRESS;
         break;
     }
 }
diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 5a213bc..188131c 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -57,7 +57,7 @@
 #define APIC_INPUT_POLARITY             (1<<13)
 #define APIC_SEND_PENDING               (1<<12)
 
-#define ESR_ILLEGAL_ADDRESS (1 << 7)
+#define APIC_ESR_ILLEGAL_ADDRESS        (1 << 7)
 
 #define APIC_SV_DIRECTED_IO             (1<<12)
 #define APIC_SV_ENABLE                  (1<<8)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 21/48] apic_internal.h: added more constants
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (19 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 20/48] apic_internal.h: rename ESR_ILLEGAL_ADDRESS to APIC_ESR_ILLEGAL_ADDRESS Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 22/48] apic_internal.h: fix formatting and drop unused consts Paolo Bonzini
                   ` (27 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

These constants are needed for optimal access to
bit fields local apic registers without magic numbers.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-4-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/i386/apic_internal.h | 58 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 188131c..a1db16e 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -50,14 +50,72 @@
 #define APIC_TRIGGER_EDGE               0
 #define APIC_TRIGGER_LEVEL              1
 
+#define APIC_VECTOR_MASK                0xff
+#define APIC_DCR_MASK                   0xf
+
+#define APIC_LVT_TIMER_SHIFT            17
+#define APIC_LVT_MASKED_SHIFT           16
+#define APIC_LVT_LEVEL_TRIGGER_SHIFT    15
+#define APIC_LVT_REMOTE_IRR_SHIFT       14
+#define APIC_LVT_INT_POLARITY_SHIFT     13
+#define APIC_LVT_DELIV_STS_SHIFT        12
+#define APIC_LVT_DELIV_MOD_SHIFT        8
+
+#define APIC_LVT_TIMER_TSCDEADLINE      (2 << APIC_LVT_TIMER_SHIFT)
 #define APIC_LVT_TIMER_PERIODIC         (1<<17)
 #define APIC_LVT_MASKED                 (1<<16)
 #define APIC_LVT_LEVEL_TRIGGER          (1<<15)
 #define APIC_LVT_REMOTE_IRR             (1<<14)
 #define APIC_INPUT_POLARITY             (1<<13)
 #define APIC_SEND_PENDING               (1<<12)
+#define APIC_LVT_INT_POLARITY           (1 << APIC_LVT_INT_POLARITY_SHIFT)
+#define APIC_LVT_DELIV_STS              (1 << APIC_LVT_DELIV_STS_SHIFT)
+#define APIC_LVT_DELIV_MOD              (7 << APIC_LVT_DELIV_MOD_SHIFT)
+
+#define APIC_ESR_ILL_ADDRESS_SHIFT      7
+#define APIC_ESR_RECV_ILL_VECT_SHIFT    6
+#define APIC_ESR_SEND_ILL_VECT_SHIFT    5
+#define APIC_ESR_RECV_ACCEPT_SHIFT      3
+#define APIC_ESR_SEND_ACCEPT_SHIFT      2
+#define APIC_ESR_RECV_CHECK_SUM_SHIFT   1
 
 #define APIC_ESR_ILLEGAL_ADDRESS        (1 << 7)
+#define APIC_ESR_RECV_ILLEGAL_VECT      (1 << APIC_ESR_RECV_ILL_VECT_SHIFT)
+#define APIC_ESR_SEND_ILLEGAL_VECT      (1 << APIC_ESR_SEND_ILL_VECT_SHIFT)
+#define APIC_ESR_RECV_ACCEPT            (1 << APIC_ESR_RECV_ACCEPT_SHIFT)
+#define APIC_ESR_SEND_ACCEPT            (1 << APIC_ESR_SEND_ACCEPT_SHIFT)
+#define APIC_ESR_RECV_CHECK_SUM         (1 << APIC_ESR_RECV_CHECK_SUM_SHIFT)
+#define APIC_ESR_SEND_CHECK_SUM         1
+
+#define APIC_ICR_DEST_SHIFT             24
+#define APIC_ICR_DEST_SHORT_SHIFT       18
+#define APIC_ICR_TRIGGER_MOD_SHIFT      15
+#define APIC_ICR_LEVEL_SHIFT            14
+#define APIC_ICR_DELIV_STS_SHIFT        12
+#define APIC_ICR_DEST_MOD_SHIFT         11
+#define APIC_ICR_DELIV_MOD_SHIFT        8
+
+#define APIC_ICR_DEST_SHORT             (3 << APIC_ICR_DEST_SHORT_SHIFT)
+#define APIC_ICR_TRIGGER_MOD            (1 << APIC_ICR_TRIGGER_MOD_SHIFT)
+#define APIC_ICR_LEVEL                  (1 << APIC_ICR_LEVEL_SHIFT)
+#define APIC_ICR_DELIV_STS              (1 << APIC_ICR_DELIV_STS_SHIFT)
+#define APIC_ICR_DEST_MOD               (1 << APIC_ICR_DEST_MOD_SHIFT)
+#define APIC_ICR_DELIV_MOD              (7 << APIC_ICR_DELIV_MOD_SHIFT)
+
+#define APIC_PR_CLASS_SHIFT             4
+#define APIC_PR_SUB_CLASS               0xf
+
+#define APIC_LOGDEST_XAPIC_SHIFT        4
+#define APIC_LOGDEST_XAPIC_ID           0xf
+
+#define APIC_LOGDEST_X2APIC_SHIFT       16
+#define APIC_LOGDEST_X2APIC_ID          0xffff
+
+#define APIC_SPURIO_FOCUS_SHIFT         9
+#define APIC_SPURIO_ENABLED_SHIFT       8
+
+#define APIC_SPURIO_FOCUS               (1 << APIC_SPURIO_FOCUS_SHIFT)
+#define APIC_SPURIO_ENABLED             (1 << APIC_SPURIO_ENABLED_SHIFT)
 
 #define APIC_SV_DIRECTED_IO             (1<<12)
 #define APIC_SV_ENABLE                  (1<<8)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 22/48] apic_internal.h: fix formatting and drop unused consts
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (20 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 21/48] apic_internal.h: added more constants Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 23/48] monitor: make monitor_fprintf and mon_get_cpu externally visible Paolo Bonzini
                   ` (26 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Fix formatting of local apic definitions and drop unused constant
APIC_INPUT_POLARITY, APIC_SEND_PENDING. Magic numbers in shifts are
replaced with constants defined just above.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-5-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/i386/apic_internal.h | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index a1db16e..7813396 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -62,12 +62,10 @@
 #define APIC_LVT_DELIV_MOD_SHIFT        8
 
 #define APIC_LVT_TIMER_TSCDEADLINE      (2 << APIC_LVT_TIMER_SHIFT)
-#define APIC_LVT_TIMER_PERIODIC         (1<<17)
-#define APIC_LVT_MASKED                 (1<<16)
-#define APIC_LVT_LEVEL_TRIGGER          (1<<15)
-#define APIC_LVT_REMOTE_IRR             (1<<14)
-#define APIC_INPUT_POLARITY             (1<<13)
-#define APIC_SEND_PENDING               (1<<12)
+#define APIC_LVT_TIMER_PERIODIC         (1 << APIC_LVT_TIMER_SHIFT)
+#define APIC_LVT_MASKED                 (1 << APIC_LVT_MASKED_SHIFT)
+#define APIC_LVT_LEVEL_TRIGGER          (1 << APIC_LVT_LEVEL_TRIGGER_SHIFT)
+#define APIC_LVT_REMOTE_IRR             (1 << APIC_LVT_REMOTE_IRR_SHIFT)
 #define APIC_LVT_INT_POLARITY           (1 << APIC_LVT_INT_POLARITY_SHIFT)
 #define APIC_LVT_DELIV_STS              (1 << APIC_LVT_DELIV_STS_SHIFT)
 #define APIC_LVT_DELIV_MOD              (7 << APIC_LVT_DELIV_MOD_SHIFT)
@@ -79,7 +77,7 @@
 #define APIC_ESR_SEND_ACCEPT_SHIFT      2
 #define APIC_ESR_RECV_CHECK_SUM_SHIFT   1
 
-#define APIC_ESR_ILLEGAL_ADDRESS        (1 << 7)
+#define APIC_ESR_ILLEGAL_ADDRESS        (1 << APIC_ESR_ILL_ADDRESS_SHIFT)
 #define APIC_ESR_RECV_ILLEGAL_VECT      (1 << APIC_ESR_RECV_ILL_VECT_SHIFT)
 #define APIC_ESR_SEND_ILLEGAL_VECT      (1 << APIC_ESR_SEND_ILL_VECT_SHIFT)
 #define APIC_ESR_RECV_ACCEPT            (1 << APIC_ESR_RECV_ACCEPT_SHIFT)
@@ -117,8 +115,8 @@
 #define APIC_SPURIO_FOCUS               (1 << APIC_SPURIO_FOCUS_SHIFT)
 #define APIC_SPURIO_ENABLED             (1 << APIC_SPURIO_ENABLED_SHIFT)
 
-#define APIC_SV_DIRECTED_IO             (1<<12)
-#define APIC_SV_ENABLE                  (1<<8)
+#define APIC_SV_DIRECTED_IO             (1 << 12)
+#define APIC_SV_ENABLE                  (1 << 8)
 
 #define VAPIC_ENABLE_BIT                0
 #define VAPIC_ENABLE_MASK               (1 << VAPIC_ENABLE_BIT)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 23/48] monitor: make monitor_fprintf and mon_get_cpu externally visible
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (21 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 22/48] apic_internal.h: fix formatting and drop unused consts Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 24/48] hmp: added local apic dump state Paolo Bonzini
                   ` (25 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

monitor_fprintf and mon_get_cpu will be used in the target-specific monitor,
so it is advisable to make it external.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-6-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 disas.c                      | 10 ----------
 include/monitor/hmp-target.h |  1 +
 include/monitor/monitor.h    |  1 +
 monitor.c                    |  5 ++---
 4 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/disas.c b/disas.c
index 0ae70c2..45878fa 100644
--- a/disas.c
+++ b/disas.c
@@ -392,16 +392,6 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,
     return 0;
 }
 
-static int GCC_FMT_ATTR(2, 3)
-monitor_fprintf(FILE *stream, const char *fmt, ...)
-{
-    va_list ap;
-    va_start(ap, fmt);
-    monitor_vprintf((Monitor *)stream, fmt, ap);
-    va_end(ap);
-    return 0;
-}
-
 /* Disassembler for the monitor.
    See target_disas for a description of flags. */
 void monitor_disas(Monitor *mon, CPUState *cpu,
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index 611541d..c64f523 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -37,6 +37,7 @@ struct MonitorDef {
 const MonitorDef *target_monitor_defs(void);
 
 CPUArchState *mon_get_cpu_env(void);
+CPUState *mon_get_cpu(void);
 
 void hmp_info_mem(Monitor *mon, const QDict *qdict);
 void hmp_info_tlb(Monitor *mon, const QDict *qdict);
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index bc6cb6d..91b95ae 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -34,6 +34,7 @@ int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp);
 void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
     GCC_FMT_ATTR(2, 0);
 void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
 void monitor_flush(Monitor *mon);
 int monitor_set_cpu(int cpu_index);
 int monitor_get_cpu_index(void);
diff --git a/monitor.c b/monitor.c
index 476872c..4f1ba2f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -372,8 +372,7 @@ void monitor_printf(Monitor *mon, const char *fmt, ...)
     va_end(ap);
 }
 
-static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream,
-                                              const char *fmt, ...)
+int monitor_fprintf(FILE *stream, const char *fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
@@ -957,7 +956,7 @@ int monitor_set_cpu(int cpu_index)
     return 0;
 }
 
-static CPUState *mon_get_cpu(void)
+CPUState *mon_get_cpu(void)
 {
     if (!cur_mon->mon_cpu) {
         monitor_set_cpu(0);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 24/48] hmp: added local apic dump state
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (22 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 23/48] monitor: make monitor_fprintf and mon_get_cpu externally visible Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 25/48] ioapic_internal.h: added more constants Paolo Bonzini
                   ` (24 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Added the hmp command to query local apic registers state, may be
usefull after guest crashes to understand IRQ routing in guest.

(qemu) info lapic
dumping local APIC state for CPU 0

LVT0    0x00010700 active-hi edge  masked                      ExtINT (vec 0)
LVT1    0x00000400 active-hi edge                              NMI
LVTPC   0x00010000 active-hi edge  masked                      Fixed  (vec 0)
LVTERR  0x000000fe active-hi edge                              Fixed  (vec 254)
LVTTHMR 0x00010000 active-hi edge  masked                      Fixed  (vec 0)
LVTT    0x000000ef active-hi edge                 one-shot     Fixed  (vec 239)
Timer   DCR=0x3 (divide by 16) initial_count = 61360
SPIV    0x000001ff APIC enabled, focus=off, spurious vec 255
ICR     0x000000fd physical edge de-assert no-shorthand
ICR2    0x00000001 cpu 1 (X2APIC ID)
ESR     0x00000000
ISR     (none)
IRR     239

APR 0x00 TPR 0x00 DFR 0x0f LDR 0x00 PPR 0x00

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-7-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hmp-commands-info.hx         |  16 ++++
 include/monitor/hmp-target.h |   1 +
 target-i386/cpu.h            |   3 +
 target-i386/helper.c         | 191 +++++++++++++++++++++++++++++++++++++++++++
 target-i386/monitor.c        |   6 ++
 5 files changed, 217 insertions(+)

diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 9f5a158..dba7839 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -112,6 +112,22 @@ STEXI
 Show the cpu registers.
 ETEXI
 
+#if defined(TARGET_I386)
+    {
+        .name       = "lapic",
+        .args_type  = "",
+        .params     = "",
+        .help       = "show local apic state",
+        .mhandler.cmd = hmp_info_local_apic,
+    },
+#endif
+
+STEXI
+@item info lapic
+@findex lapic
+Show local APIC state
+ETEXI
+
     {
         .name       = "cpus",
         .args_type  = "",
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index c64f523..be50577 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -42,5 +42,6 @@ CPUState *mon_get_cpu(void);
 void hmp_info_mem(Monitor *mon, const QDict *qdict);
 void hmp_info_tlb(Monitor *mon, const QDict *qdict);
 void hmp_mce(Monitor *mon, const QDict *qdict);
+void hmp_info_local_apic(Monitor *mon, const QDict *qdict);
 
 #endif /* MONITOR_COMMON */
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 5231e8c..527eb99 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -1353,4 +1353,7 @@ void enable_compat_apic_id_mode(void);
 #define APIC_DEFAULT_ADDRESS 0xfee00000
 #define APIC_SPACE_SIZE      0x100000
 
+void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
+                                   fprintf_function cpu_fprintf, int flags);
+
 #endif /* CPU_I386_H */
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 5480a96..9364d96 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -23,6 +23,7 @@
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/sysemu.h"
 #include "monitor/monitor.h"
+#include "hw/i386/apic_internal.h"
 #endif
 
 static void cpu_x86_version(CPUX86State *env, int *family, int *model)
@@ -177,6 +178,196 @@ done:
     cpu_fprintf(f, "\n");
 }
 
+#ifndef CONFIG_USER_ONLY
+
+/* ARRAY_SIZE check is not required because
+ * DeliveryMode(dm) has a size of 3 bit.
+ */
+static inline const char *dm2str(uint32_t dm)
+{
+    static const char *str[] = {
+        "Fixed",
+        "...",
+        "SMI",
+        "...",
+        "NMI",
+        "INIT",
+        "...",
+        "ExtINT"
+    };
+    return str[dm];
+}
+
+static void dump_apic_lvt(FILE *f, fprintf_function cpu_fprintf,
+                          const char *name, uint32_t lvt, bool is_timer)
+{
+    uint32_t dm = (lvt & APIC_LVT_DELIV_MOD) >> APIC_LVT_DELIV_MOD_SHIFT;
+    cpu_fprintf(f,
+                "%s\t 0x%08x %s %-5s %-6s %-7s %-12s %-6s",
+                name, lvt,
+                lvt & APIC_LVT_INT_POLARITY ? "active-lo" : "active-hi",
+                lvt & APIC_LVT_LEVEL_TRIGGER ? "level" : "edge",
+                lvt & APIC_LVT_MASKED ? "masked" : "",
+                lvt & APIC_LVT_DELIV_STS ? "pending" : "",
+                !is_timer ?
+                    "" : lvt & APIC_LVT_TIMER_PERIODIC ?
+                            "periodic" : lvt & APIC_LVT_TIMER_TSCDEADLINE ?
+                                            "tsc-deadline" : "one-shot",
+                dm2str(dm));
+    if (dm != APIC_DM_NMI) {
+        cpu_fprintf(f, " (vec %u)\n", lvt & APIC_VECTOR_MASK);
+    } else {
+        cpu_fprintf(f, "\n");
+    }
+}
+
+/* ARRAY_SIZE check is not required because
+ * destination shorthand has a size of 2 bit.
+ */
+static inline const char *shorthand2str(uint32_t shorthand)
+{
+    const char *str[] = {
+        "no-shorthand", "self", "all-self", "all"
+    };
+    return str[shorthand];
+}
+
+static inline uint8_t divider_conf(uint32_t divide_conf)
+{
+    uint8_t divide_val = ((divide_conf & 0x8) >> 1) | (divide_conf & 0x3);
+
+    return divide_val == 7 ? 1 : 2 << divide_val;
+}
+
+static inline void mask2str(char *str, uint32_t val, uint8_t size)
+{
+    while (size--) {
+        *str++ = (val >> size) & 1 ? '1' : '0';
+    }
+    *str = 0;
+}
+
+#define MAX_LOGICAL_APIC_ID_MASK_SIZE 16
+
+static void dump_apic_icr(FILE *f, fprintf_function cpu_fprintf,
+                          APICCommonState *s, CPUX86State *env)
+{
+    uint32_t icr = s->icr[0], icr2 = s->icr[1];
+    uint8_t dest_shorthand = \
+        (icr & APIC_ICR_DEST_SHORT) >> APIC_ICR_DEST_SHORT_SHIFT;
+    bool logical_mod = icr & APIC_ICR_DEST_MOD;
+    char apic_id_str[MAX_LOGICAL_APIC_ID_MASK_SIZE + 1];
+    uint32_t dest_field;
+    bool x2apic;
+
+    cpu_fprintf(f, "ICR\t 0x%08x %s %s %s %s\n",
+                icr,
+                logical_mod ? "logical" : "physical",
+                icr & APIC_ICR_TRIGGER_MOD ? "level" : "edge",
+                icr & APIC_ICR_LEVEL ? "assert" : "de-assert",
+                shorthand2str(dest_shorthand));
+
+    cpu_fprintf(f, "ICR2\t 0x%08x", icr2);
+    if (dest_shorthand != 0) {
+        cpu_fprintf(f, "\n");
+        return;
+    }
+    x2apic = env->features[FEAT_1_ECX] & CPUID_EXT_X2APIC;
+    dest_field = x2apic ? icr2 : icr2 >> APIC_ICR_DEST_SHIFT;
+
+    if (!logical_mod) {
+        if (x2apic) {
+            cpu_fprintf(f, " cpu %u (X2APIC ID)\n", dest_field);
+        } else {
+            cpu_fprintf(f, " cpu %u (APIC ID)\n",
+                        dest_field & APIC_LOGDEST_XAPIC_ID);
+        }
+        return;
+    }
+
+    if (s->dest_mode == 0xf) { /* flat mode */
+        mask2str(apic_id_str, icr2 >> APIC_ICR_DEST_SHIFT, 8);
+        cpu_fprintf(f, " mask %s (APIC ID)\n", apic_id_str);
+    } else if (s->dest_mode == 0) { /* cluster mode */
+        if (x2apic) {
+            mask2str(apic_id_str, dest_field & APIC_LOGDEST_X2APIC_ID, 16);
+            cpu_fprintf(f, " cluster %u mask %s (X2APIC ID)\n",
+                        dest_field >> APIC_LOGDEST_X2APIC_SHIFT, apic_id_str);
+        } else {
+            mask2str(apic_id_str, dest_field & APIC_LOGDEST_XAPIC_ID, 4);
+            cpu_fprintf(f, " cluster %u mask %s (APIC ID)\n",
+                        dest_field >> APIC_LOGDEST_XAPIC_SHIFT, apic_id_str);
+        }
+    }
+}
+
+static void dump_apic_interrupt(FILE *f, fprintf_function cpu_fprintf,
+                                const char *name, uint32_t *ireg_tab,
+                                uint32_t *tmr_tab)
+{
+    int i, empty = true;
+
+    cpu_fprintf(f, "%s\t ", name);
+    for (i = 0; i < 256; i++) {
+        if (apic_get_bit(ireg_tab, i)) {
+            cpu_fprintf(f, "%u%s ", i,
+                        apic_get_bit(tmr_tab, i) ? "(level)" : "");
+            empty = false;
+        }
+    }
+    cpu_fprintf(f, "%s\n", empty ? "(none)" : "");
+}
+
+void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
+                                   fprintf_function cpu_fprintf, int flags)
+{
+    X86CPU *cpu = X86_CPU(cs);
+    APICCommonState *s = APIC_COMMON(cpu->apic_state);
+    uint32_t *lvt = s->lvt;
+
+    cpu_fprintf(f, "dumping local APIC state for CPU %-2u\n\n",
+                CPU(cpu)->cpu_index);
+    dump_apic_lvt(f, cpu_fprintf, "LVT0", lvt[APIC_LVT_LINT0], false);
+    dump_apic_lvt(f, cpu_fprintf, "LVT1", lvt[APIC_LVT_LINT1], false);
+    dump_apic_lvt(f, cpu_fprintf, "LVTPC", lvt[APIC_LVT_PERFORM], false);
+    dump_apic_lvt(f, cpu_fprintf, "LVTERR", lvt[APIC_LVT_ERROR], false);
+    dump_apic_lvt(f, cpu_fprintf, "LVTTHMR", lvt[APIC_LVT_THERMAL], false);
+    dump_apic_lvt(f, cpu_fprintf, "LVTT", lvt[APIC_LVT_TIMER], true);
+
+    cpu_fprintf(f, "Timer\t DCR=0x%x (divide by %u) initial_count = %u\n",
+                s->divide_conf & APIC_DCR_MASK,
+                divider_conf(s->divide_conf),
+                s->initial_count);
+
+    cpu_fprintf(f, "SPIV\t 0x%08x APIC %s, focus=%s, spurious vec %u\n",
+                s->spurious_vec,
+                s->spurious_vec & APIC_SPURIO_ENABLED ? "enabled" : "disabled",
+                s->spurious_vec & APIC_SPURIO_FOCUS ? "on" : "off",
+                s->spurious_vec & APIC_VECTOR_MASK);
+
+    dump_apic_icr(f, cpu_fprintf, s, &cpu->env);
+
+    cpu_fprintf(f, "ESR\t 0x%08x\n", s->esr);
+
+    dump_apic_interrupt(f, cpu_fprintf, "ISR", s->isr, s->tmr);
+    dump_apic_interrupt(f, cpu_fprintf, "IRR", s->irr, s->tmr);
+
+    cpu_fprintf(f, "\nAPR 0x%02x TPR 0x%02x DFR 0x%02x LDR 0x%02x",
+                s->arb_id, s->tpr, s->dest_mode, s->log_dest);
+    if (s->dest_mode == 0) {
+        cpu_fprintf(f, "(cluster %u: id %u)",
+                    s->log_dest >> APIC_LOGDEST_XAPIC_SHIFT,
+                    s->log_dest & APIC_LOGDEST_XAPIC_ID);
+    }
+    cpu_fprintf(f, " PPR 0x%02x\n", apic_get_ppr(s));
+}
+#else
+void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
+                                   fprintf_function cpu_fprintf, int flags)
+{
+}
+#endif /* !CONFIG_USER_ONLY */
+
 #define DUMP_CODE_BYTES_TOTAL    50
 #define DUMP_CODE_BYTES_BACKWARD 20
 
diff --git a/target-i386/monitor.c b/target-i386/monitor.c
index 6ac8636..9479a77 100644
--- a/target-i386/monitor.c
+++ b/target-i386/monitor.c
@@ -492,3 +492,9 @@ const MonitorDef *target_monitor_defs(void)
 {
     return monitor_defs;
 }
+
+void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
+{
+    x86_cpu_dump_local_apic_state(mon_get_cpu(), (FILE *)mon, monitor_fprintf,
+                                  CPU_DUMP_FPU);
+}
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 25/48] ioapic_internal.h: added more constants
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (23 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 24/48] hmp: added local apic dump state Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 26/48] hmp: added io apic dump state Paolo Bonzini
                   ` (23 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Added the masks for easy  access to fields of the redirection table entry

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-8-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/i386/ioapic_internal.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h
index 3be3352..4f7764e 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -40,7 +40,12 @@
 #define IOAPIC_LVT_DELIV_MODE_SHIFT     8
 
 #define IOAPIC_LVT_MASKED               (1 << IOAPIC_LVT_MASKED_SHIFT)
+#define IOAPIC_LVT_TRIGGER_MODE         (1 << IOAPIC_LVT_TRIGGER_MODE_SHIFT)
 #define IOAPIC_LVT_REMOTE_IRR           (1 << IOAPIC_LVT_REMOTE_IRR_SHIFT)
+#define IOAPIC_LVT_POLARITY             (1 << IOAPIC_LVT_POLARITY_SHIFT)
+#define IOAPIC_LVT_DELIV_STATUS         (1 << IOAPIC_LVT_DELIV_STATUS_SHIFT)
+#define IOAPIC_LVT_DEST_MODE            (1 << IOAPIC_LVT_DEST_MODE_SHIFT)
+#define IOAPIC_LVT_DELIV_MODE           (7 << IOAPIC_LVT_DELIV_MODE_SHIFT)
 
 #define IOAPIC_TRIGGER_EDGE             0
 #define IOAPIC_TRIGGER_LEVEL            1
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 26/48] hmp: added io apic dump state
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (24 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 25/48] ioapic_internal.h: added more constants Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 27/48] hmp: implemented io apic dump state for TCG Paolo Bonzini
                   ` (22 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Added the hmp command to query io apic state, may be usefull after guest
crashes to understand IRQ routing in guest.

Implementation is only for kvm here. The dump will look like
(qemu) info ioapic
ioapic id=0x00 sel=0x26 (redir[11])
pin 0  0x0000000000010000 dest=0 vec=0   active-hi edge  masked fixed  physical
pin 1  0x0000000000000031 dest=0 vec=49  active-hi edge         fixed  physical
...
pin 23 0x0000000000010000 dest=0 vec=0   active-hi edge  masked fixed  physical
IRR        (none)
Remote IRR (none)

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-9-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hmp-commands-info.hx              | 16 ++++++++++++
 hw/i386/kvm/ioapic.c              | 10 +++++++
 hw/intc/ioapic_common.c           | 55 +++++++++++++++++++++++++++++++++++++++
 include/hw/i386/ioapic_internal.h |  2 ++
 include/hw/i386/pc.h              |  4 +++
 include/monitor/hmp-target.h      |  1 +
 target-i386/monitor.c             |  9 +++++++
 7 files changed, 97 insertions(+)

diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index dba7839..b346fd1 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -128,6 +128,22 @@ STEXI
 Show local APIC state
 ETEXI
 
+#if defined(TARGET_I386)
+    {
+        .name       = "ioapic",
+        .args_type  = "",
+        .params     = "",
+        .help       = "show io apic state",
+        .mhandler.cmd = hmp_info_io_apic,
+    },
+#endif
+
+STEXI
+@item info ioapic
+@findex ioapic
+Show io APIC state
+ETEXI
+
     {
         .name       = "cpus",
         .args_type  = "",
diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index d2a6c4c..b7390ca 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "monitor/monitor.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/ioapic_internal.h"
 #include "hw/i386/apic_internal.h"
@@ -110,6 +111,15 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
     }
 }
 
+void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict)
+{
+    IOAPICCommonState s;
+
+    kvm_ioapic_get(&s);
+
+    ioapic_print_redtbl(mon, &s);
+}
+
 static void kvm_ioapic_reset(DeviceState *dev)
 {
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index 8b7d118..d78181e 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -19,6 +19,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "monitor/monitor.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
 #include "hw/sysbus.h"
@@ -31,6 +32,60 @@
  */
 int ioapic_no;
 
+static void ioapic_irr_dump(Monitor *mon, const char *name, uint32_t bitmap)
+{
+    int i;
+
+    monitor_printf(mon, "%-10s ", name);
+    if (bitmap == 0) {
+        monitor_printf(mon, "(none)\n");
+        return;
+    }
+    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
+        if (bitmap & (1 << i)) {
+            monitor_printf(mon, "%-2u ", i);
+        }
+    }
+    monitor_printf(mon, "\n");
+}
+
+void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s)
+{
+    static const char *delm_str[] = {
+        "fixed", "lowest", "SMI", "...", "NMI", "INIT", "...", "extINT"};
+    uint32_t remote_irr = 0;
+    int i;
+
+    monitor_printf(mon, "ioapic id=0x%02x sel=0x%02x", s->id, s->ioregsel);
+    if (s->ioregsel) {
+        monitor_printf(mon, " (redir[%u])\n",
+                       (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1);
+    } else {
+        monitor_printf(mon, "\n");
+    }
+    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
+        uint64_t entry = s->ioredtbl[i];
+        uint32_t delm = (uint32_t)((entry & IOAPIC_LVT_DELIV_MODE) >>
+                                   IOAPIC_LVT_DELIV_MODE_SHIFT);
+        monitor_printf(mon, "pin %-2u 0x%016jx dest=%jx vec=%-3lu "
+                       "%s %-5s %-6s %-6s %s\n",
+                       i, entry,
+                       (entry >> IOAPIC_LVT_DEST_SHIFT) &
+                            (entry & IOAPIC_LVT_DEST_MODE ? 0xff : 0xf),
+                       entry & IOAPIC_VECTOR_MASK,
+                       entry & IOAPIC_LVT_POLARITY ? "active-lo" : "active-hi",
+                       entry & IOAPIC_LVT_TRIGGER_MODE ? "level" : "edge",
+                       entry & IOAPIC_LVT_MASKED ? "masked" : "",
+                       delm_str[delm],
+                       entry & IOAPIC_LVT_DEST_MODE ? "logical" : "physical");
+
+        remote_irr |= entry & IOAPIC_LVT_TRIGGER_MODE ?
+                        (entry & IOAPIC_LVT_REMOTE_IRR ? (1 << i) : 0) : 0;
+    }
+    ioapic_irr_dump(mon, "IRR", s->irr);
+    ioapic_irr_dump(mon, "Remote IRR", remote_irr);
+}
+
 void ioapic_reset_common(DeviceState *dev)
 {
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h
index 4f7764e..797ed47 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -105,4 +105,6 @@ struct IOAPICCommonState {
 
 void ioapic_reset_common(DeviceState *dev);
 
+void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s);
+
 #endif /* !QEMU_IOAPIC_INTERNAL_H */
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 3e002c9..539cf64 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -123,6 +123,10 @@ int pic_get_output(DeviceState *d);
 void hmp_info_pic(Monitor *mon, const QDict *qdict);
 void hmp_info_irq(Monitor *mon, const QDict *qdict);
 
+/* ioapic.c */
+
+void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict);
+
 /* Global System Interrupts */
 
 #define GSI_NUM_PINS IOAPIC_NUM_PINS
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index be50577..213566c 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -43,5 +43,6 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict);
 void hmp_info_tlb(Monitor *mon, const QDict *qdict);
 void hmp_mce(Monitor *mon, const QDict *qdict);
 void hmp_info_local_apic(Monitor *mon, const QDict *qdict);
+void hmp_info_io_apic(Monitor *mon, const QDict *qdict);
 
 #endif /* MONITOR_COMMON */
diff --git a/target-i386/monitor.c b/target-i386/monitor.c
index 9479a77..829fff9 100644
--- a/target-i386/monitor.c
+++ b/target-i386/monitor.c
@@ -24,6 +24,8 @@
 #include "cpu.h"
 #include "monitor/monitor.h"
 #include "monitor/hmp-target.h"
+#include "hw/i386/pc.h"
+#include "sysemu/kvm.h"
 #include "hmp.h"
 
 
@@ -498,3 +500,10 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
     x86_cpu_dump_local_apic_state(mon_get_cpu(), (FILE *)mon, monitor_fprintf,
                                   CPU_DUMP_FPU);
 }
+
+void hmp_info_io_apic(Monitor *mon, const QDict *qdict)
+{
+    if (kvm_irqchip_in_kernel()) {
+        kvm_ioapic_dump_state(mon, qdict);
+    }
+}
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 27/48] hmp: implemented io apic dump state for TCG
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (25 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 26/48] hmp: added io apic dump state Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 28/48] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Paolo Bonzini
                   ` (21 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Andreas Färber, Pavel Butsykin

From: Pavel Butsykin <pbutsykin@virtuozzo.com>

Added support emulator for the hmp command "info ioapic"

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
Message-Id: <1442927901-1084-10-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/intc/ioapic.c      | 12 ++++++++++++
 include/hw/i386/pc.h  |  1 +
 target-i386/monitor.c |  2 ++
 3 files changed, 15 insertions(+)

diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index bde52e8..de2dd4b 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -20,6 +20,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "monitor/monitor.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/ioapic.h"
@@ -139,6 +140,17 @@ void ioapic_eoi_broadcast(int vector)
     }
 }
 
+void ioapic_dump_state(Monitor *mon, const QDict *qdict)
+{
+    int i;
+
+    for (i = 0; i < MAX_IOAPICS; i++) {
+        if (ioapics[i] != 0) {
+            ioapic_print_redtbl(mon, ioapics[i]);
+        }
+    }
+}
+
 static uint64_t
 ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
 {
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 539cf64..7c9f3a5 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -126,6 +126,7 @@ void hmp_info_irq(Monitor *mon, const QDict *qdict);
 /* ioapic.c */
 
 void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict);
+void ioapic_dump_state(Monitor *mon, const QDict *qdict);
 
 /* Global System Interrupts */
 
diff --git a/target-i386/monitor.c b/target-i386/monitor.c
index 829fff9..aac6b1b 100644
--- a/target-i386/monitor.c
+++ b/target-i386/monitor.c
@@ -505,5 +505,7 @@ void hmp_info_io_apic(Monitor *mon, const QDict *qdict)
 {
     if (kvm_irqchip_in_kernel()) {
         kvm_ioapic_dump_state(mon, qdict);
+    } else {
+        ioapic_dump_state(mon, qdict);
     }
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 28/48] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (26 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 27/48] hmp: implemented io apic dump state for TCG Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 29/48] linux-user: elfload: Provide default for elf_check_arch Paolo Bonzini
                   ` (20 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite

From: Peter Crosthwaite <crosthwaite.peter@gmail.com>

In most (but not all) cases, ELF_MACHINE and ELF_ARCH are safely the
same. Default ELF_MACHINE to ELF_ARCH. This makes defining ELF_MACHINE
optional for target-*/cpu.h when they are known to match.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 linux-user/elfload.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 39f3282..4ed8c5e 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1245,6 +1245,10 @@ static inline void init_thread(struct target_pt_regs *regs,
 #define ELF_PLATFORM (NULL)
 #endif
 
+#ifndef ELF_MACHINE
+#define ELF_MACHINE ELF_ARCH
+#endif
+
 #ifndef ELF_HWCAP
 #define ELF_HWCAP 0
 #endif
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 29/48] linux-user: elfload: Provide default for elf_check_arch
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (27 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 28/48] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement Paolo Bonzini
                   ` (19 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite

From: Peter Crosthwaite <crosthwaite.peter@gmail.com>

For many arch's this macro is defined as the predicatable behaviour
of checking the argument for eqaulity against ELF_ARCH. Provide a
default define as such, so only archs with special handling (usually
allowing multiple EM values) need to provide a def.

Arches that do any of:

1: provide this def exactly the same way as the new default
        (alpha, x86_64)
2: check against ELF_MACHINE while defining ELF_ARCH == ELF_MACHINE
        (arm, aarch64)
3: check against EM_FOO directly while defining ELF_ARCH == EM_FOO
        (unicore32, sparc32, ppc32, mips, openrisc, sh4, cris, m86k)

have their elf_check_arch removed as the default will provide the
correct behaviour.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 linux-user/elfload.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 4ed8c5e..0ecc1b2 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -145,7 +145,6 @@ static uint32_t get_elf_hwcap(void)
 
 #ifdef TARGET_X86_64
 #define ELF_START_MMAP 0x2aaaaab000ULL
-#define elf_check_arch(x) ( ((x) == ELF_ARCH) )
 
 #define ELF_CLASS      ELFCLASS64
 #define ELF_ARCH       EM_X86_64
@@ -273,8 +272,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ((x) == ELF_MACHINE)
-
 #define ELF_ARCH        ELF_MACHINE
 #define ELF_CLASS       ELFCLASS32
 
@@ -481,8 +478,6 @@ static uint32_t get_elf_hwcap2(void)
 /* 64 bit ARM definitions */
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ((x) == ELF_MACHINE)
-
 #define ELF_ARCH        ELF_MACHINE
 #define ELF_CLASS       ELFCLASS64
 #define ELF_PLATFORM    "aarch64"
@@ -556,8 +551,6 @@ static uint32_t get_elf_hwcap(void)
 
 #define ELF_START_MMAP          0x80000000
 
-#define elf_check_arch(x)       ((x) == EM_UNICORE32)
-
 #define ELF_CLASS               ELFCLASS32
 #define ELF_DATA                ELFDATA2LSB
 #define ELF_ARCH                EM_UNICORE32
@@ -666,7 +659,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 #define ELF_START_MMAP 0x80000000
 #define ELF_HWCAP  (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \
                     | HWCAP_SPARC_MULDIV)
-#define elf_check_arch(x) ( (x) == EM_SPARC )
 
 #define ELF_CLASS   ELFCLASS32
 #define ELF_ARCH    EM_SPARC
@@ -696,8 +688,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #else
 
-#define elf_check_arch(x) ( (x) == EM_PPC )
-
 #define ELF_CLASS       ELFCLASS32
 
 #endif
@@ -875,8 +865,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_MIPS )
-
 #ifdef TARGET_MIPS64
 #define ELF_CLASS   ELFCLASS64
 #else
@@ -985,8 +973,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env
 
 #define ELF_START_MMAP 0x08000000
 
-#define elf_check_arch(x) ((x) == EM_OPENRISC)
-
 #define ELF_ARCH EM_OPENRISC
 #define ELF_CLASS ELFCLASS32
 #define ELF_DATA  ELFDATA2MSB
@@ -1026,8 +1012,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_SH )
-
 #define ELF_CLASS ELFCLASS32
 #define ELF_ARCH  EM_SH
 
@@ -1110,8 +1094,6 @@ static uint32_t get_elf_hwcap(void)
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_CRIS )
-
 #define ELF_CLASS ELFCLASS32
 #define ELF_ARCH  EM_CRIS
 
@@ -1129,8 +1111,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #define ELF_START_MMAP 0x80000000
 
-#define elf_check_arch(x) ( (x) == EM_68K )
-
 #define ELF_CLASS       ELFCLASS32
 #define ELF_ARCH        EM_68K
 
@@ -1182,8 +1162,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *e
 
 #define ELF_START_MMAP (0x30000000000ULL)
 
-#define elf_check_arch(x) ( (x) == ELF_ARCH )
-
 #define ELF_CLASS      ELFCLASS64
 #define ELF_ARCH       EM_ALPHA
 
@@ -1203,8 +1181,6 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #define ELF_START_MMAP (0x20000000000ULL)
 
-#define elf_check_arch(x) ( (x) == ELF_ARCH )
-
 #define ELF_CLASS	ELFCLASS64
 #define ELF_DATA	ELFDATA2MSB
 #define ELF_ARCH	EM_S390
@@ -1249,6 +1225,10 @@ static inline void init_thread(struct target_pt_regs *regs,
 #define ELF_MACHINE ELF_ARCH
 #endif
 
+#ifndef elf_check_arch
+#define elf_check_arch(x) ((x) == ELF_ARCH)
+#endif
+
 #ifndef ELF_HWCAP
 #define ELF_HWCAP 0
 #endif
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (28 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 29/48] linux-user: elfload: Provide default for elf_check_arch Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 31/48] elf: Update EM_MOXIE definition Paolo Bonzini
                   ` (18 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite

From: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Fix the coding style for these cases as per CODING_STYLE. Reverse the
Yoda conditions and add missing if braces.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/elf_ops.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index bd71968..0d41f24 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -282,25 +282,28 @@ static int glue(load_elf, SZ)(const char *name, int fd,
 
     switch (elf_machine) {
         case EM_PPC64:
-            if (EM_PPC64 != ehdr.e_machine)
-                if (EM_PPC != ehdr.e_machine) {
+            if (ehdr.e_machine != EM_PPC64) {
+                if (ehdr.e_machine != EM_PPC) {
                     ret = ELF_LOAD_WRONG_ARCH;
                     goto fail;
                 }
+            }
             break;
         case EM_X86_64:
-            if (EM_X86_64 != ehdr.e_machine)
-                if (EM_386 != ehdr.e_machine) {
+            if (ehdr.e_machine != EM_X86_64) {
+                if (ehdr.e_machine != EM_386) {
                     ret = ELF_LOAD_WRONG_ARCH;
                     goto fail;
                 }
+            }
             break;
         case EM_MICROBLAZE:
-            if (EM_MICROBLAZE != ehdr.e_machine)
-                if (EM_MICROBLAZE_OLD != ehdr.e_machine) {
+            if (ehdr.e_machine != EM_MICROBLAZE) {
+                if (ehdr.e_machine != EM_MICROBLAZE_OLD) {
                     ret = ELF_LOAD_WRONG_ARCH;
                     goto fail;
                 }
+            }
             break;
         default:
             if (elf_machine != ehdr.e_machine) {
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 31/48] elf: Update EM_MOXIE definition
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (29 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h Paolo Bonzini
                   ` (17 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Green, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaite.peter@gmail.com>

EM_MOXIE now has a proper assigned elf code. Use it. Register the old
interim value as EM_MOXIE_OLD and accept either in elf loading.

Cc: Anthony Green <green@moxielogic.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/moxie/moxiesim.c  | 1 +
 include/elf.h        | 3 +++
 include/hw/elf_ops.h | 8 ++++++++
 target-moxie/cpu.h   | 2 +-
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c
index a3d1a1b..4e98c20 100644
--- a/hw/moxie/moxiesim.c
+++ b/hw/moxie/moxiesim.c
@@ -34,6 +34,7 @@
 #include "hw/loader.h"
 #include "hw/char/serial.h"
 #include "exec/address-spaces.h"
+#include "elf.h"
 
 #define PHYS_MEM_BASE 0x80000000
 
diff --git a/include/elf.h b/include/elf.h
index 79859f0..66add81 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -135,6 +135,9 @@ typedef int64_t  Elf64_Sxword;
 
 #define EM_TILEGX   191 /* TILE-Gx */
 
+#define EM_MOXIE           223     /* Moxie processor family */
+#define EM_MOXIE_OLD       0xFEED
+
 /* This is the info that is needed to parse the dynamic section of the file */
 #define DT_NULL		0
 #define DT_NEEDED	1
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index 0d41f24..0010c44 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -305,6 +305,14 @@ static int glue(load_elf, SZ)(const char *name, int fd,
                 }
             }
             break;
+        case EM_MOXIE:
+            if (ehdr.e_machine != EM_MOXIE) {
+                if (ehdr.e_machine != EM_MOXIE_OLD) {
+                    ret = ELF_LOAD_WRONG_ARCH;
+                    goto fail;
+                }
+            }
+            break;
         default:
             if (elf_machine != ehdr.e_machine) {
                 ret = ELF_LOAD_WRONG_ARCH;
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index 15ca15b..7d47e0d 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -26,7 +26,7 @@
 
 #define CPUArchState struct CPUMoxieState
 
-#define ELF_MACHINE     0xFEED /* EM_MOXIE */
+#define ELF_MACHINE     EM_MOXIE
 
 #define MOXIE_EX_DIV0        0
 #define MOXIE_EX_BAD         1
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (30 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 31/48] elf: Update EM_MOXIE definition Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 33/48] mb: " Paolo Bonzini
                   ` (16 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Peter Crosthwaite, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user. Linux user
already has a lot of #ifdef TARGET_ customisation so instead, define
ELF_ARCH as either EM_ARM or EM_AARCH64 appropriately.

The armv7m bootloader can just pass EM_ARM directly, as that
is architecture specific code. Note that arm_boot already has its own
logic selecting an arm specific elf machine so this makes V7M more
consistent with arm_boot.

This removes another architecture specific definition from the global
namespace.

Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/arm/armv7m.c      | 2 +-
 linux-user/elfload.c | 4 ++--
 target-arm/cpu.h     | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 40334d7..eb214db 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -215,7 +215,7 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
 
     if (kernel_filename) {
         image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
-                              NULL, big_endian, ELF_MACHINE, 1);
+                              NULL, big_endian, EM_ARM, 1);
         if (image_size < 0) {
             image_size = load_image_targphys(kernel_filename, 0, mem_size);
             lowaddr = 0;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0ecc1b2..506b1ee 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -272,7 +272,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #define ELF_START_MMAP 0x80000000
 
-#define ELF_ARCH        ELF_MACHINE
+#define ELF_ARCH        EM_ARM
 #define ELF_CLASS       ELFCLASS32
 
 static inline void init_thread(struct target_pt_regs *regs,
@@ -478,7 +478,7 @@ static uint32_t get_elf_hwcap2(void)
 /* 64 bit ARM definitions */
 #define ELF_START_MMAP 0x80000000
 
-#define ELF_ARCH        ELF_MACHINE
+#define ELF_ARCH        EM_AARCH64
 #define ELF_CLASS       ELFCLASS64
 #define ELF_PLATFORM    "aarch64"
 
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 1b80516..cc1578c 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -26,10 +26,8 @@
 #if defined(TARGET_AARCH64)
   /* AArch64 definitions */
 #  define TARGET_LONG_BITS 64
-#  define ELF_MACHINE EM_AARCH64
 #else
 #  define TARGET_LONG_BITS 32
-#  define ELF_MACHINE EM_ARM
 #endif
 
 #define TARGET_IS_BIENDIAN 1
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 33/48] mb: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (31 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 34/48] m68k: " Paolo Bonzini
                   ` (15 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias, Peter Crosthwaite, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux-users'
default behaviour or setting ELF_MACHINE to ELF_ARCH will handle this.

The microblaze bootloader can just pass EM_MICROBLAZE directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/microblaze/boot.c    | 4 ++--
 target-microblaze/cpu.h | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 3e8820f..d7eaa1f 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -141,12 +141,12 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL,
                                &entry, &low, &high,
-                               big_endian, ELF_MACHINE, 0);
+                               big_endian, EM_MICROBLAZE, 0);
         base32 = entry;
         if (base32 == 0xc0000000) {
             kernel_size = load_elf(kernel_filename, translate_kernel_address,
                                    NULL, &entry, NULL, NULL,
-                                   big_endian, ELF_MACHINE, 0);
+                                   big_endian, EM_MICROBLAZE, 0);
         }
         /* Always boot into physical ram.  */
         boot_info.bootstrap_pc = (uint32_t)entry;
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 402124a..b707c71 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -34,8 +34,6 @@ typedef struct CPUMBState CPUMBState;
 #include "mmu.h"
 #endif
 
-#define ELF_MACHINE	EM_MICROBLAZE
-
 #define EXCP_MMU        1
 #define EXCP_IRQ        2
 #define EXCP_BREAK      3
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 34/48] m68k: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (32 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 33/48] mb: " Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 35/48] cris: " Paolo Bonzini
                   ` (14 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, Peter Crosthwaite, Laurent Vivier, Greg Ungerer

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The machine model bootloaders can just pass EM_68K directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Greg Ungerer <gerg@uclinux.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Greg Ungerer <gerg@uclinux.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/m68k/an5206.c     | 2 +-
 hw/m68k/dummy_m68k.c | 2 +-
 hw/m68k/mcf5208.c    | 2 +-
 target-m68k/cpu.h    | 2 --
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index aa49cd5..c1dea17 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -70,7 +70,7 @@ static void an5206_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, ELF_MACHINE, 0);
+                           NULL, NULL, 1, EM_68K, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
index d4f2073..8b3b775 100644
--- a/hw/m68k/dummy_m68k.c
+++ b/hw/m68k/dummy_m68k.c
@@ -49,7 +49,7 @@ static void dummy_m68k_init(MachineState *machine)
     /* Load kernel.  */
     if (kernel_filename) {
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               NULL, NULL, 1, ELF_MACHINE, 0);
+                               NULL, NULL, 1, EM_68K, 0);
         entry = elf_entry;
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index c3365eb..ddeccc5 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -275,7 +275,7 @@ static void mcf5208evb_init(MachineState *machine)
     }
 
     kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                           NULL, NULL, 1, ELF_MACHINE, 0);
+                           NULL, NULL, 1, EM_68K, 0);
     entry = elf_entry;
     if (kernel_size < 0) {
         kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 43a9a1c..d195706 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -32,8 +32,6 @@
 
 #define MAX_QREGS 32
 
-#define ELF_MACHINE	EM_68K
-
 #define EXCP_ACCESS         2   /* Access (MMU) error.  */
 #define EXCP_ADDRESS        3   /* Address error.  */
 #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 35/48] cris: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (33 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 34/48] m68k: " Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:05 ` [Qemu-devel] [PULL 36/48] moxie: " Paolo Bonzini
                   ` (13 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias, Peter Crosthwaite, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloader can just pass EM_CRIS directly, as that is architecture
specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/cris/boot.c    | 2 +-
 target-cris/cpu.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/cris/boot.c b/hw/cris/boot.c
index 622f353..1cfa339 100644
--- a/hw/cris/boot.c
+++ b/hw/cris/boot.c
@@ -72,7 +72,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
     /* Boots a kernel elf binary, os/linux-2.6/vmlinux from the axis 
        devboard SDK.  */
     image_size = load_elf(li->image_filename, translate_kernel_address, NULL,
-                          &entry, NULL, &high, 0, ELF_MACHINE, 0);
+                          &entry, NULL, &high, 0, EM_CRIS, 0);
     li->entry = entry;
     if (image_size < 0) {
         /* Takes a kimage from the axis devboard SDK.  */
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 8ae7708..d47fad4 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -29,8 +29,6 @@
 
 #include "exec/cpu-defs.h"
 
-#define ELF_MACHINE	EM_CRIS
-
 #define EXCP_NMI        1
 #define EXCP_GURU       2
 #define EXCP_BUSFAULT   3
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 36/48] moxie: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (34 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 35/48] cris: " Paolo Bonzini
@ 2015-09-22 15:05 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 37/48] unicore: " Paolo Bonzini
                   ` (12 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Anthony Green, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_MOXIE directly, as that is architecture
specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Anthony Green <green@moxielogic.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/moxie/moxiesim.c | 3 +--
 target-moxie/cpu.h  | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c
index 4e98c20..ada3d58 100644
--- a/hw/moxie/moxiesim.c
+++ b/hw/moxie/moxiesim.c
@@ -53,8 +53,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
     ram_addr_t initrd_offset;
 
     kernel_size = load_elf(loader_params->kernel_filename,  NULL, NULL,
-                           &entry, &kernel_low, &kernel_high, 1,
-                           ELF_MACHINE, 0);
+                           &entry, &kernel_low, &kernel_high, 1, EM_MOXIE, 0);
 
     if (kernel_size <= 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index 7d47e0d..2bac15b 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -26,8 +26,6 @@
 
 #define CPUArchState struct CPUMoxieState
 
-#define ELF_MACHINE     EM_MOXIE
-
 #define MOXIE_EX_DIV0        0
 #define MOXIE_EX_BAD         1
 #define MOXIE_EX_IRQ         2
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 37/48] unicore: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (35 preceding siblings ...)
  2015-09-22 15:05 ` [Qemu-devel] [PULL 36/48] moxie: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 38/48] lm32: " Paolo Bonzini
                   ` (11 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Guan Xuetao, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

This removes another architecture specific definition from the global
namespace.

Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-unicore32/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 121e528..01c370c 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -17,8 +17,6 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS     32
 #define TARGET_VIRT_ADDR_SPACE_BITS     32
 
-#define ELF_MACHINE             EM_UNICORE32
-
 #define CPUArchState                struct CPUUniCore32State
 
 #include "config.h"
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 38/48] lm32: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (36 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 37/48] unicore: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 39/48] or32: " Paolo Bonzini
                   ` (10 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Michael Walle, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloaders can just pass EM_LATTICEMICO32 directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Michael Walle <michael@walle.cc>
Acked-By: Michael Walle <michael@walle.cc>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/lm32/lm32_boards.c | 4 ++--
 hw/lm32/milkymist.c   | 2 +-
 target-lm32/cpu.h     | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index 8e17a82..eb553a1 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -142,7 +142,7 @@ static void lm32_evr_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
-                               1, ELF_MACHINE, 0);
+                               1, EM_LATTICEMICO32, 0);
         reset_info->bootstrap_pc = entry;
 
         if (kernel_size < 0) {
@@ -244,7 +244,7 @@ static void lm32_uclinux_init(MachineState *machine)
         int kernel_size;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
-                               1, ELF_MACHINE, 0);
+                               1, EM_LATTICEMICO32, 0);
         reset_info->bootstrap_pc = entry;
 
         if (kernel_size < 0) {
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index cb30850..13976b3 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -176,7 +176,7 @@ milkymist_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
-                               1, ELF_MACHINE, 0);
+                               1, EM_LATTICEMICO32, 0);
         reset_info->bootstrap_pc = entry;
 
         if (kernel_size < 0) {
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h
index cc77263..3f874d5 100644
--- a/target-lm32/cpu.h
+++ b/target-lm32/cpu.h
@@ -30,8 +30,6 @@
 struct CPULM32State;
 typedef struct CPULM32State CPULM32State;
 
-#define ELF_MACHINE EM_LATTICEMICO32
-
 #define NB_MMU_MODES 1
 #define TARGET_PAGE_BITS 12
 static inline int cpu_mmu_index(CPULM32State *env, bool ifetch)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 39/48] or32: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (37 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 38/48] lm32: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 40/48] tricore: " Paolo Bonzini
                   ` (9 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Jia Liu, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloader can just pass EM_OPENRISC directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Jia Liu <proljc@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/openrisc/openrisc_sim.c | 2 +-
 target-openrisc/cpu.h      | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
index 5f26785..be6c9b5 100644
--- a/hw/openrisc/openrisc_sim.c
+++ b/hw/openrisc/openrisc_sim.c
@@ -68,7 +68,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size,
 
     if (kernel_filename && !qtest_enabled()) {
         kernel_size = load_elf(kernel_filename, NULL, NULL,
-                               &elf_entry, NULL, NULL, 1, ELF_MACHINE, 1);
+                               &elf_entry, NULL, NULL, 1, EM_OPENRISC, 1);
         entry = elf_entry;
         if (kernel_size < 0) {
             kernel_size = load_uimage(kernel_filename,
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index 560210d9..1ff1c9e 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -21,7 +21,6 @@
 #define CPU_OPENRISC_H
 
 #define TARGET_LONG_BITS 32
-#define ELF_MACHINE    EM_OPENRISC
 
 #define CPUArchState struct CPUOpenRISCState
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 40/48] tricore: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (38 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 39/48] or32: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 41/48] xtensa: " Paolo Bonzini
                   ` (8 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Bastian Koppelmann, Peter Crosthwaite, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_TRICORE directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Acked-By: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/tricore/tricore_testboard.c | 2 +-
 target-tricore/cpu.h           | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 8532410..4ff5e7b 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -44,7 +44,7 @@ static void tricore_load_kernel(CPUTriCoreState *env)
     kernel_size = load_elf(tricoretb_binfo.kernel_filename, NULL,
                            NULL, (uint64_t *)&entry, NULL,
                            NULL, 0,
-                           ELF_MACHINE, 1);
+                           EM_TRICORE, 1);
     if (kernel_size <= 0) {
         error_report("qemu: no kernel file '%s'",
                 tricoretb_binfo.kernel_filename);
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index 42751e8..20a12f3 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -25,8 +25,6 @@
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
-#define ELF_MACHINE     EM_TRICORE
-
 #define CPUArchState struct CPUTriCoreState
 
 struct CPUTriCoreState;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 41/48] xtensa: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (39 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 40/48] tricore: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 42/48] sh4: " Paolo Bonzini
                   ` (7 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov, Peter Crosthwaite, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloaders can just pass EM_XTENSA directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/xtensa/sim.c     | 4 ++--
 hw/xtensa/xtfpga.c  | 2 +-
 target-xtensa/cpu.h | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index aa1cd10..6266b8d 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -93,10 +93,10 @@ static void xtensa_sim_init(MachineState *machine)
         uint64_t elf_lowaddr;
 #ifdef TARGET_WORDS_BIGENDIAN
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, 1, EM_XTENSA, 0);
 #else
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, 0, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, 0, EM_XTENSA, 0);
 #endif
         if (success > 0) {
             env->pc = elf_entry;
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 7aca1cf..72350f1 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -341,7 +341,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
         uint64_t elf_entry;
         uint64_t elf_lowaddr;
         int success = load_elf(kernel_filename, translate_phys_addr, cpu,
-                &elf_entry, &elf_lowaddr, NULL, be, ELF_MACHINE, 0);
+                &elf_entry, &elf_lowaddr, NULL, be, EM_XTENSA, 0);
         if (success > 0) {
             entry_point = elf_entry;
         } else {
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index dbd2c9c..148a0f8 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -30,7 +30,6 @@
 
 #define ALIGNED_ONLY
 #define TARGET_LONG_BITS 32
-#define ELF_MACHINE EM_XTENSA
 
 #define CPUArchState struct CPUXtensaState
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 42/48] sh4: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (40 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 41/48] xtensa: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 43/48] s390: " Paolo Bonzini
                   ` (6 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Aurelien Jarno, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

This removes another architecture specific definition from the global
namespace.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-sh4/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index 1f68b27..6fb6321 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -24,8 +24,6 @@
 
 #define TARGET_LONG_BITS 32
 
-#define ELF_MACHINE	EM_SH
-
 /* CPU Subtypes */
 #define SH_CPU_SH7750  (1 << 0)
 #define SH_CPU_SH7750S (1 << 1)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 43/48] s390: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (41 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 42/48] sh4: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 44/48] sparc: " Paolo Bonzini
                   ` (5 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, Peter Crosthwaite, Alexander Graf, Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloader can just pass EM_S390 directly, as that
is architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/s390x/ipl.c     | 4 ++--
 target-s390x/cpu.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 2e0a8b6..31473e7 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -132,7 +132,7 @@ static int s390_ipl_init(SysBusDevice *dev)
 
         bios_size = load_elf(bios_filename, bios_translate_addr, &fwbase,
                              &ipl->bios_start_addr, NULL, NULL, 1,
-                             ELF_MACHINE, 0);
+                             EM_S390, 0);
         if (bios_size > 0) {
             /* Adjust ELF start address to final location */
             ipl->bios_start_addr += fwbase;
@@ -154,7 +154,7 @@ static int s390_ipl_init(SysBusDevice *dev)
 
     if (ipl->kernel) {
         kernel_size = load_elf(ipl->kernel, NULL, NULL, &pentry, NULL,
-                               NULL, 1, ELF_MACHINE, 0);
+                               NULL, 1, EM_S390, 0);
         if (kernel_size < 0) {
             kernel_size = load_image_targphys(ipl->kernel, 0, ram_size);
         }
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 9aeb024..5acd54c 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -27,7 +27,6 @@
 
 #define TARGET_LONG_BITS 64
 
-#define ELF_MACHINE	EM_S390
 #define ELF_MACHINE_UNAME "S390X"
 
 #define CPUArchState struct CPUS390XState
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 44/48] sparc: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (42 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 43/48] s390: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 45/48] mips: " Paolo Bonzini
                   ` (4 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Mark Cave-Ayland, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The bootloaders can just pass EM_SPARC or EM_SPARCV9 directly, as
they are architecture specific code (to one or the other).

This removes another architecture specific definition from the global
namespace.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/sparc/leon3.c   | 2 +-
 hw/sparc/sun4m.c   | 4 ++--
 hw/sparc64/sun4u.c | 4 ++--
 target-sparc/cpu.h | 6 ------
 4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index ee73fea..22d1e7e 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -193,7 +193,7 @@ static void leon3_generic_hw_init(MachineState *machine)
         uint64_t entry;
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
-                               1 /* big endian */, ELF_MACHINE, 0);
+                               1 /* big endian */, EM_SPARC, 0);
         if (kernel_size < 0) {
             fprintf(stderr, "qemu: could not load kernel '%s'\n",
                     kernel_filename);
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 9f1917f..230dac9 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -300,7 +300,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, NULL, NULL, 1, ELF_MACHINE, 0);
+                               NULL, NULL, NULL, 1, EM_SPARC, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, KERNEL_LOAD_ADDR,
                                     RAM_size - KERNEL_LOAD_ADDR, bswap_needed,
@@ -744,7 +744,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
         ret = load_elf(filename, translate_prom_address, &addr, NULL,
-                       NULL, NULL, 1, ELF_MACHINE, 0);
+                       NULL, NULL, 1, EM_SPARC, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index a6b5957..d6b929c 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -208,7 +208,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename,
         bswap_needed = 0;
 #endif
         kernel_size = load_elf(kernel_filename, NULL, NULL, kernel_entry,
-                               kernel_addr, &kernel_top, 1, ELF_MACHINE, 0);
+                               kernel_addr, &kernel_top, 1, EM_SPARCV9, 0);
         if (kernel_size < 0) {
             *kernel_addr = KERNEL_LOAD_ADDR;
             *kernel_entry = KERNEL_LOAD_ADDR;
@@ -671,7 +671,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
         ret = load_elf(filename, translate_prom_address, &addr,
-                       NULL, NULL, NULL, 1, ELF_MACHINE, 0);
+                       NULL, NULL, NULL, 1, EM_SPARCV9, 0);
         if (ret < 0 || ret > PROM_SIZE_MAX) {
             ret = load_image_targphys(filename, addr, PROM_SIZE_MAX);
         }
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 72ea171..053edd5 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -31,12 +31,6 @@
 
 #include "fpu/softfloat.h"
 
-#if !defined(TARGET_SPARC64)
-#define ELF_MACHINE     EM_SPARC
-#else
-#define ELF_MACHINE     EM_SPARCV9
-#endif
-
 /*#define EXCP_INTERRUPT 0x100*/
 
 /* trap definitions */
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 45/48] mips: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (43 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 44/48] sparc: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 46/48] alpha: " Paolo Bonzini
                   ` (3 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, Leon Alrae, Aurelien Jarno, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloaders can just pass EM_MIPS directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/mips/mips_fulong2e.c | 2 +-
 hw/mips/mips_malta.c    | 2 +-
 hw/mips/mips_mipssim.c  | 2 +-
 hw/mips/mips_r4k.c      | 2 +-
 target-mips/cpu.h       | 2 --
 5 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index e44521f..5988a88 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -116,7 +116,7 @@ static int64_t load_kernel (CPUMIPSState *env)
 
     if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
                  (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
-                 (uint64_t *)&kernel_high, 0, ELF_MACHINE, 1) < 0) {
+                 (uint64_t *)&kernel_high, 0, EM_MIPS, 1) < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
                 loaderparams.kernel_filename);
         exit(1);
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index bb864fe..c1f570a 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -795,7 +795,7 @@ static int64_t load_kernel (void)
 
     if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
                  (uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high,
-                 big_endian, ELF_MACHINE, 1) < 0) {
+                 big_endian, EM_MIPS, 1) < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n",
                 loaderparams.kernel_filename);
         exit(1);
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index e651312..23b35be 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -69,7 +69,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
                            NULL, (uint64_t *)&entry, NULL,
                            (uint64_t *)&kernel_high, big_endian,
-                           ELF_MACHINE, 1);
+                           EM_MIPS, 1);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000)
             entry = (int32_t)entry;
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 97628fc..af10da1 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -87,7 +87,7 @@ static int64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
                            NULL, (uint64_t *)&entry, NULL,
                            (uint64_t *)&kernel_high, big_endian,
-                           ELF_MACHINE, 1);
+                           EM_MIPS, 1);
     if (kernel_size >= 0) {
         if ((entry & ~0x7fffffffULL) == 0x80000000)
             entry = (int32_t)entry;
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index ed7d86d..ec5f991 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -5,8 +5,6 @@
 
 #define ALIGNED_ONLY
 
-#define ELF_MACHINE	EM_MIPS
-
 #define CPUArchState struct CPUMIPSState
 
 #include "config.h"
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 46/48] alpha: Remove ELF_MACHINE from cpu.h
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (44 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 45/48] mips: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 47/48] i386: Rename ELF_MACHINE to be x86 specific Paolo Bonzini
                   ` (2 subsequent siblings)
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, Peter Crosthwaite, Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

ELF_MACHINE is unused by target alpha.

Cc: Richard Henderson <rth@twiddle.net>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-alpha/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index ef88ffb..097637e 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -32,8 +32,6 @@
 
 #include "fpu/softfloat.h"
 
-#define ELF_MACHINE     EM_ALPHA
-
 #define ICACHE_LINE_SIZE 32
 #define DCACHE_LINE_SIZE 32
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 47/48] i386: Rename ELF_MACHINE to be x86 specific
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (45 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 46/48] alpha: " Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 15:06 ` [Qemu-devel] [PULL 48/48] ppc: Rename ELF_MACHINE to be PPC specific Paolo Bonzini
  2015-09-22 19:41 ` [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Peter Maydell
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Crosthwaite, Peter Crosthwaite, Eduardo Habkost, Richard Henderson

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Rename ELF_MACHINE to be I386 specific. This is used as-is by the
multiboot loader.

Linux-user previously used this definition but will not anymore,
falling back to the default bahaviour of using ELF_ARCH as ELF_MACHINE.

This removes another architecture specific definition from the global
namespace.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/multiboot.c | 2 +-
 target-i386/cpu.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 1adbe9e..6774a19 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -195,7 +195,7 @@ int load_multiboot(FWCfgState *fw_cfg,
         }
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               &elf_low, &elf_high, 0, ELF_MACHINE, 0);
+                               &elf_low, &elf_high, 0, I386_ELF_MACHINE, 0);
         if (kernel_size < 0) {
             fprintf(stderr, "Error while loading elf kernel\n");
             exit(1);
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 527eb99..034fab6 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -37,10 +37,10 @@
 #define TARGET_HAS_PRECISE_SMC
 
 #ifdef TARGET_X86_64
-#define ELF_MACHINE     EM_X86_64
+#define I386_ELF_MACHINE  EM_X86_64
 #define ELF_MACHINE_UNAME "x86_64"
 #else
-#define ELF_MACHINE     EM_386
+#define I386_ELF_MACHINE  EM_386
 #define ELF_MACHINE_UNAME "i686"
 #endif
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [Qemu-devel] [PULL 48/48] ppc: Rename ELF_MACHINE to be PPC specific
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (46 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 47/48] i386: Rename ELF_MACHINE to be x86 specific Paolo Bonzini
@ 2015-09-22 15:06 ` Paolo Bonzini
  2015-09-22 19:41 ` [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Peter Maydell
  48 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Crosthwaite, qemu-ppc, Alexander Graf, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Rename ELF_MACHINE to be PPC specific. This is used as-is by the
various PPC bootloaders and is locally defined to ELF_MACHINE in linux
user in PPC specific ifdeffery.

This removes another architecture specific definition from the global
namespace (as desired by multi-arch).

Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-By: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ppc/e500.c          | 2 +-
 hw/ppc/mac_newworld.c  | 4 ++--
 hw/ppc/mac_oldworld.c  | 4 ++--
 hw/ppc/ppc440_bamboo.c | 2 +-
 hw/ppc/prep.c          | 2 +-
 hw/ppc/spapr.c         | 4 ++--
 hw/ppc/virtex_ml507.c  | 2 +-
 linux-user/elfload.c   | 1 +
 target-ppc/cpu.h       | 4 ++--
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index e968386..b3418db 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1017,7 +1017,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
 
     bios_size = load_elf(filename, NULL, NULL, &bios_entry, &loadaddr, NULL,
-                         1, ELF_MACHINE, 0);
+                         1, PPC_ELF_MACHINE, 0);
     if (bios_size < 0) {
         /*
          * Hrm. No ELF image? Try a uImage, maybe someone is giving us an
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index e1c5ed7..66d016c 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -219,7 +219,7 @@ static void ppc_core99_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, NULL, NULL, NULL,
-                             NULL, NULL, 1, ELF_MACHINE, 0);
+                             NULL, NULL, 1, PPC_ELF_MACHINE, 0);
 
         g_free(filename);
     } else {
@@ -242,7 +242,7 @@ static void ppc_core99_init(MachineState *machine)
         kernel_base = KERNEL_LOAD_ADDR;
 
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
                                     ram_size - kernel_base, bswap_needed,
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 5cba2cb..21eaf0e 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -147,7 +147,7 @@ static void ppc_heathrow_init(MachineState *machine)
     /* Load OpenBIOS (ELF) */
     if (filename) {
         bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
-                             1, ELF_MACHINE, 0);
+                             1, PPC_ELF_MACHINE, 0);
         g_free(filename);
     } else {
         bios_size = -1;
@@ -168,7 +168,7 @@ static void ppc_heathrow_init(MachineState *machine)
 #endif
         kernel_base = KERNEL_LOAD_ADDR;
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size < 0)
             kernel_size = load_aout(kernel_filename, kernel_base,
                                     ram_size - kernel_base, bswap_needed,
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index ada676c..b66c113 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -256,7 +256,7 @@ static void bamboo_init(MachineState *machine)
                               NULL, NULL);
         if (success < 0) {
             success = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               &elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               &elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
             entry = elf_entry;
             loadaddr = elf_lowaddr;
         }
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 9d6d70a..d95222b 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -601,7 +601,7 @@ static void ppc_prep_init(MachineState *machine)
         bios_name = BIOS_FILENAME;
     }
     qdev_prop_set_string(dev, "bios-name", bios_name);
-    qdev_prop_set_uint32(dev, "elf-machine", ELF_MACHINE);
+    qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
     pcihost = PCI_HOST_BRIDGE(dev);
     object_property_add_child(qdev_get_machine(), "raven", OBJECT(dev), NULL);
     qdev_init_nofail(dev);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 05926a3..942d0dc 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1636,11 +1636,11 @@ static void ppc_spapr_init(MachineState *machine)
         uint64_t lowaddr = 0;
 
         kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
-                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
+                               NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE, 0);
         if (kernel_size == ELF_LOAD_WRONG_ENDIAN) {
             kernel_size = load_elf(kernel_filename,
                                    translate_kernel_address, NULL,
-                                   NULL, &lowaddr, NULL, 0, ELF_MACHINE, 0);
+                                   NULL, &lowaddr, NULL, 0, PPC_ELF_MACHINE, 0);
             kernel_le = kernel_size > 0;
         }
         if (kernel_size < 0) {
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 457d762..c2b5e44 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -257,7 +257,7 @@ static void virtex_init(MachineState *machine)
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL,
-                               &entry, &low, &high, 1, ELF_MACHINE, 0);
+                               &entry, &low, &high, 1, PPC_ELF_MACHINE, 0);
         boot_info.bootstrap_pc = entry & 0x00ffffff;
 
         if (kernel_size < 0) {
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 506b1ee..a7ff58c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -678,6 +678,7 @@ static inline void init_thread(struct target_pt_regs *regs,
 
 #ifdef TARGET_PPC
 
+#define ELF_MACHINE    PPC_ELF_MACHINE
 #define ELF_START_MMAP 0x80000000
 
 #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 406d308..c6dbb38 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -81,9 +81,9 @@
 #include "fpu/softfloat.h"
 
 #if defined (TARGET_PPC64)
-#define ELF_MACHINE     EM_PPC64
+#define PPC_ELF_MACHINE     EM_PPC64
 #else
-#define ELF_MACHINE     EM_PPC
+#define PPC_ELF_MACHINE     EM_PPC
 #endif
 
 /*****************************************************************************/
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* Re: [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22
  2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
                   ` (47 preceding siblings ...)
  2015-09-22 15:06 ` [Qemu-devel] [PULL 48/48] ppc: Rename ELF_MACHINE to be PPC specific Paolo Bonzini
@ 2015-09-22 19:41 ` Peter Maydell
  2015-09-22 20:12   ` Paolo Bonzini
  48 siblings, 1 reply; 51+ messages in thread
From: Peter Maydell @ 2015-09-22 19:41 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 22 September 2015 at 08:05, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 9e72681d16792d0ffc42bab634b1753ff299bdfd:
>
>   Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-09-21' into staging (2015-09-21 22:33:51 +0100)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 6beb990c835097c402876b04075c6af533d00949:
>
>   ppc: Rename ELF_MACHINE to be PPC specific (2015-09-22 15:55:02 +0200)
>
> ----------------------------------------------------------------
> * First batch of MAINTAINERS updates
> * IOAPIC fixes (to pass kvm-unit-tests with -machine kernel_irqchip=off)
> * NBD API upgrades from Daniel
> * strtosz fixes from Marc-André
> * improved support for readonly=on on scsi-generic devices
> * new "info ioapic" and "info lapic" monitor commands
> * Peter Crosthwaite's ELF_MACHINE cleanups

I'm afraid this doesn't build on 32-bit:

/root/qemu/hw/intc/ioapic_common.c: In function ‘ioapic_print_redtbl’:
/root/qemu/hw/intc/ioapic_common.c:80:24: error: format ‘%lu’ expects
argument of type ‘long unsigned int’, but argument 6 has type
‘uint64_t’ [-Werror=format]

thanks
-- PMM

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22
  2015-09-22 19:41 ` [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Peter Maydell
@ 2015-09-22 20:12   ` Paolo Bonzini
  0 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-09-22 20:12 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers



On 22/09/2015 21:41, Peter Maydell wrote:
> I'm afraid this doesn't build on 32-bit:
> 
> /root/qemu/hw/intc/ioapic_common.c: In function ‘ioapic_print_redtbl’:
> /root/qemu/hw/intc/ioapic_common.c:80:24: error: format ‘%lu’ expects
> argument of type ‘long unsigned int’, but argument 6 has type
> ‘uint64_t’ [-Werror=format]

I really have to add ARM to my build tests... Win32 doesn't cut it since
it's -Wno-error.  Will respin tomorrow.

Paolo

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2015-09-22 20:12 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 15:05 [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 01/48] nbd: convert to use the QAPI SocketAddress object Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 02/48] qemu-nbd: " Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 03/48] utils: rename strtosz to use qemu prefix Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 04/48] tests: add some qemu_strtosz() tests Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 05/48] checkpatch: do not recommend qemu_strtok over strtok Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 06/48] scsi-generic: let guests recognize readonly=on on passthrough devices Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 07/48] Makefile: fix build when VPATH is outside GIT tree Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 08/48] vhost-scsi: include linux/vhost.h Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 09/48] get_maintainer.pl: \C is deprecated Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 10/48] MAINTAINERS: there is no PPC64 TCG backend anymore Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 11/48] MAINTAINERS: Add disassemblers to the various backends Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 12/48] MAINTAINERS: Add more s390 files Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 13/48] MAINTAINERS: add IPack section Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 14/48] MAINTAINERS: add more devices to the PC section Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 15/48] MAINTAINERS: add more devices to the PCI section Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 16/48] MAINTAINERS: add maintainer for character device front-ends Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 17/48] ioapic: coalesce level interrupts Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 18/48] ioapic: fix contents of arbitration register Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 19/48] apic_internal.h: make some apic_get_* functions externally visible Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 20/48] apic_internal.h: rename ESR_ILLEGAL_ADDRESS to APIC_ESR_ILLEGAL_ADDRESS Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 21/48] apic_internal.h: added more constants Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 22/48] apic_internal.h: fix formatting and drop unused consts Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 23/48] monitor: make monitor_fprintf and mon_get_cpu externally visible Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 24/48] hmp: added local apic dump state Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 25/48] ioapic_internal.h: added more constants Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 26/48] hmp: added io apic dump state Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 27/48] hmp: implemented io apic dump state for TCG Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 28/48] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 29/48] linux-user: elfload: Provide default for elf_check_arch Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 31/48] elf: Update EM_MOXIE definition Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 33/48] mb: " Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 34/48] m68k: " Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 35/48] cris: " Paolo Bonzini
2015-09-22 15:05 ` [Qemu-devel] [PULL 36/48] moxie: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 37/48] unicore: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 38/48] lm32: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 39/48] or32: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 40/48] tricore: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 41/48] xtensa: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 42/48] sh4: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 43/48] s390: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 44/48] sparc: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 45/48] mips: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 46/48] alpha: " Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 47/48] i386: Rename ELF_MACHINE to be x86 specific Paolo Bonzini
2015-09-22 15:06 ` [Qemu-devel] [PULL 48/48] ppc: Rename ELF_MACHINE to be PPC specific Paolo Bonzini
2015-09-22 19:41 ` [Qemu-devel] [PULL 00/48] Misc patches for 2015-09-22 Peter Maydell
2015-09-22 20:12   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.