Skip to content
Snippets Groups Projects
  1. Jan 20, 2016
  2. Jan 19, 2016
  3. Jan 18, 2016
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging · 3db34bf6
      Peter Maydell authored
      
      QOM infrastructure fixes and device conversions
      
      * Dynamic class properties
      * Property iterator cleanup
      * Device hot-unplug ID race fix
      
      # gpg: Signature made Mon 18 Jan 2016 17:27:01 GMT using RSA key ID 3E7E013F
      # gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
      # gpg:                 aka "Andreas Färber <afaerber@suse.com>"
      
      * remotes/afaerber/tags/qom-devices-for-peter:
        MAINTAINERS: Fix sPAPR entry heading
        qdev: Free QemuOpts when the QOM path goes away
        qom: Change object property iterator API contract
        qom: Allow properties to be registered against classes
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3db34bf6
    • Andreas Färber's avatar
      MAINTAINERS: Fix sPAPR entry heading · 300b115c
      Andreas Färber authored
      
      get_maintainers.pl does not handle parenthesis in maintenance areas well
      in connection with list emails (here: qemu-ppc@nongnu.org).
      
      Resolve a recurring CC issue breaking git-send-email by reverting part
      of commit 085eb217 ("Add David Gibson
      for sPAPR in MAINTAINERS file").
      
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      300b115c
    • Paolo Bonzini's avatar
      qdev: Free QemuOpts when the QOM path goes away · abed886e
      Paolo Bonzini authored
      
      Otherwise there is a race where the DEVICE_DELETED event has been sent but
      attempts to reuse the ID will fail.
      
      Note that similar races exist for other QemuOpts, which this patch
      does not attempt to fix.
      
      For example, if the device is a block device, then unplugging it also
      deletes its backend.  However, this backend's get deleted in
      drive_info_del(), which is only called when properties are
      destroyed.  Just like device_finalize(), drive_info_del() is called
      some time after DEVICE_DELETED is sent.  A separate patch series has
      been sent to plug this other bug.  Character devices also have yet to
      be fixed.
      
      Reported-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      abed886e
    • Daniel P. Berrangé's avatar
      qom: Change object property iterator API contract · 7746abd8
      Daniel P. Berrangé authored
      
      Currently the ObjectProperty iterator API works as follows:
      
        ObjectPropertyIterator *iter;
      
        iter = object_property_iter_init(obj);
        while ((prop = object_property_iter_next(iter))) {
           ...
        }
        object_property_iter_free(iter);
      
      This has the benefit that the ObjectPropertyIterator struct
      can be opaque, but has the downside that callers need to
      explicitly call a free function. It is also not in keeping
      with iterator style used elsewhere in QEMU/GLib2.
      
      This patch changes the API to use stack allocation instead:
      
        ObjectPropertyIterator iter;
      
        object_property_iter_init(&iter, obj);
        while ((prop = object_property_iter_next(&iter))) {
           ...
        }
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      [AF: Fused ObjectPropertyIterator struct with typedef]
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      7746abd8
    • Daniel P. Berrangé's avatar
      qom: Allow properties to be registered against classes · 16bf7f52
      Daniel P. Berrangé authored
      
      When there are many instances of a given class, registering
      properties against the instance is wasteful of resources. The
      majority of objects have a statically defined list of possible
      properties, so most of the properties are easily registerable
      against the class. Only those properties which are conditionally
      registered at runtime need be recorded against the klass.
      
      Registering properties against classes also makes it possible
      to provide static introspection of QOM - currently introspection
      is only possible after creating an instance of a class, which
      severely limits its usefulness.
      
      This impl only supports simple scalar properties. It does not
      attempt to allow child object / link object properties against
      the class. There are ways to support those too, but it would
      make this patch more complicated, so it is left as an exercise
      for the future.
      
      There is no equivalent to object_property_del() provided, since
      classes must be immutable once they are defined.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      16bf7f52
    • Peter Maydell's avatar
      hw/arm: Clean up includes · 12b16722
      Peter Maydell authored
      
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1449505425-32022-4-git-send-email-peter.maydell@linaro.org
      12b16722
    • Peter Maydell's avatar
      target-arm: Clean up includes · 74c21bd0
      Peter Maydell authored
      
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1449505425-32022-3-git-send-email-peter.maydell@linaro.org
      74c21bd0
    • Peter Maydell's avatar
      scripts: Add new clean-includes script to fix C include directives · 85071702
      Peter Maydell authored
      
      Add a new scripts/clean-includes, which can be used to automatically
      ensure that a C source file includes qemu/osdep.h first and doesn't
      then include any headers which osdep.h provides already.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1449505425-32022-2-git-send-email-peter.maydell@linaro.org
      85071702
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160118-1' into staging · 46188349
      Peter Maydell authored
      
      ui: misc small gtk/spice/vnc patches.
      
      # gpg: Signature made Mon 18 Jan 2016 15:52:13 GMT using RSA key ID D3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      
      * remotes/kraxel/tags/pull-ui-20160118-1:
        vnc: fix tls-creds error message
        Fix corner-case when using VNC+SASL+SPICE
        vnc: clear vs->tlscreds after unparenting it
        gtk: implement set_echo
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      46188349
    • Wolfgang Bumiller's avatar
      vnc: fix tls-creds error message · c62e90af
      Wolfgang Bumiller authored
      
      The parameter is called 'tls-creds', 'credid' is just the
      variable name in the code.
      
      Signed-off-by: default avatarWolfgang Bumiller <w.bumiller@proxmox.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1452681360-29239-1-git-send-email-w.bumiller@proxmox.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      c62e90af
    • Christophe Fergeau's avatar
      Fix corner-case when using VNC+SASL+SPICE · 06bb8814
      Christophe Fergeau authored
      
      Similarly to the commit 764eb39d fixing VNC+SASL+QXL, when starting
      QEMU with SPICE but no SASL, and at the same time VNC with SASL, then
      spice_server_init() will get called without a previous call to
      spice_server_set_sasl_appname(), which will cause cyrus-sasl to
      try to use /etc/sasl2/spice.conf (spice-server uses "spice" as its
      default appname) rather than the expected /etc/sasl2/qemu.conf.
      
      This commit unconditionally calls spice_server_set_sasl_appname()
      before calling spice_server_init() in order to use the correct appname
      even if SPICE without SASL was requested on qemu command line.
      
      Signed-off-by: default avatarChristophe Fergeau <cfergeau@redhat.com>
      Message-id: 1452607738-1521-1-git-send-email-cfergeau@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      06bb8814
    • Wolfgang Bumiller's avatar
      vnc: clear vs->tlscreds after unparenting it · 67c4c2bd
      Wolfgang Bumiller authored
      
      This pointer should be cleared in vnc_display_close()
      otherwise a use-after-free can happen when when using the
      old style 'x509' and 'tls' options rather than a persistent
      tls-creds -object, by issuing monitor commands to change
      the vnc server like so:
      
      Start with: -vnc unix:test.socket,x509,tls
      Then use the following monitor command:
        change vnc unix:test.socket
      
      After this the pointer is still set but invalid and a crash
      can be triggered for instance by issuing the same command a
      second time which will try to object_unparent() the same
      pointer again.
      
      Signed-off-by: default avatarWolfgang Bumiller <w.bumiller@proxmox.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      67c4c2bd
    • Paolo Bonzini's avatar
      gtk: implement set_echo · fba958c6
      Paolo Bonzini authored
      
      Even without line editing, this makes -qmp vc more pleasant with the
      GTK+ backend.  The only issue is that set_echo is invoked very early,
      long before a vc is actually associated with a VirtualConsole.  To work
      around this, create a temporary VirtualConsole until then.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1450356422-31710-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      fba958c6
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging · 4aaddc29
      Peter Maydell authored
      
      qemu-sparc update
      
      # gpg: Signature made Sat 16 Jan 2016 12:32:06 GMT using RSA key ID AE0F321F
      # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
      
      * remotes/mcayland/tags/qemu-sparc-signed:
        target-sparc: Migrate CWP and PIL for SPARC64
        target-sparc: Use VMState arrays for SPARC64 TLB/MMU state
        target-sparc: Convert to VMStateDescription
        target-sparc: Don't flush TLB in cpu_load function
        target-sparc: Split cpu_put_psr into side-effect and no-side-effect parts
        vmstate: define vmstate_info_uinttl
        vmstate: Introduce VMSTATE_VARRAY_MULTPLY
        vmstate: introduce CPU_DoubleU arrays
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4aaddc29
  4. Jan 16, 2016
  5. Jan 15, 2016
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 19b6d843
      Peter Maydell authored
      
      * qemu-char logfile facility
      * NBD coroutine based negotiation
      * bugfixes
      
      # gpg: Signature made Fri 15 Jan 2016 17:58:28 GMT using RSA key ID 78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      
      * remotes/bonzini/tags/for-upstream:
        qemu-char: do not leak QemuMutex when freeing a character device
        qemu-char: add logfile facility to all chardev backends
        nbd-server: do not exit on failed memory allocation
        nbd-server: do not check request length except for reads and writes
        nbd-server: Coroutine based negotiation
        nbd: Split nbd.c
        nbd: Always call "close_fn" in nbd_client_new
        SCSI device: fix to incomplete QOMify
        iscsi: send readcapacity10 when readcapacity16 failed
        qemu-char: delete send_all/recv_all helper methods
        vmw_pvscsi: x-disable-pcie, x-old-pci-configuration back-compat props are 2.5 specific
        scsi: initialise info object with appropriate size
        i386: avoid null pointer dereference
        target-i386: do not duplicate page protection checks
        scsi: revert change to scsi_req_cancel_async and add assertions
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      19b6d843
    • Paolo Bonzini's avatar
      qemu-char: do not leak QemuMutex when freeing a character device · fefd749c
      Paolo Bonzini authored
      
      The leak is only apparent on Win32.  On POSIX platforms destroying a
      mutex is not necessary.
      
      Reported-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fefd749c
    • Daniel P. Berrangé's avatar
      qemu-char: add logfile facility to all chardev backends · d0d7708b
      Daniel P. Berrangé authored
      
      Typically a UNIX guest OS will log boot messages to a serial
      port in addition to any graphical console. An admin user
      may also wish to use the serial port for an interactive
      console. A virtualization management system may wish to
      collect system boot messages by logging the serial port,
      but also wish to allow admins interactive access.
      
      Currently providing such a feature forces the mgmt app
      to either provide 2 separate serial ports, one for
      logging boot messages and one for interactive console
      login, or to proxy all output via a separate service
      that can multiplex the two needs onto one serial port.
      While both are valid approaches, they each have their
      own downsides. The former causes confusion and extra
      setup work for VM admins creating disk images. The latter
      places an extra burden to re-implement much of the QEMU
      chardev backends logic in libvirt or even higher level
      mgmt apps and adds extra hops in the data transfer path.
      
      A simpler approach that is satisfactory for many use
      cases is to allow the QEMU chardev backends to have a
      "logfile" property associated with them.
      
       $QEMU -chardev socket,host=localhost,port=9000,\
                      server=on,nowait,id-charserial0,\
      		logfile=/var/log/libvirt/qemu/test-serial0.log
             -device isa-serial,chardev=charserial0,id=serial0
      
      This patch introduces a 'ChardevCommon' struct which
      is setup as a base for all the ChardevBackend types.
      Ideally this would be registered directly as a base
      against ChardevBackend, rather than each type, but
      the QAPI generator doesn't allow that since the
      ChardevBackend is a non-discriminated union. The
      ChardevCommon struct provides the optional 'logfile'
      parameter, as well as 'logappend' which controls
      whether QEMU truncates or appends (default truncate).
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1452516281-27519-1-git-send-email-berrange@redhat.com>
      [Call qemu_chr_parse_common if cd->parse is NULL. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d0d7708b
    • Paolo Bonzini's avatar
      nbd-server: do not exit on failed memory allocation · f1c17521
      Paolo Bonzini authored
      
      The amount of memory allocated in nbd_co_receive_request is driven by the
      NBD client (possibly a virtual machine).  Parallel I/O can cause the
      server to allocate a large amount of memory; check for failures and
      return ENOMEM in that case.
      
      Cc: qemu-block@nongnu.org
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f1c17521
    • Paolo Bonzini's avatar
      nbd-server: do not check request length except for reads and writes · eb38c3b6
      Paolo Bonzini authored
      
      Only reads and writes need to allocate memory correspondent to the
      request length.  Other requests can be sent to the storage without
      allocating any memory, and thus any request length is acceptable.
      
      Reported-by: default avatarSitsofe Wheeler <sitsofe@yahoo.com>
      Cc: qemu-block@nongnu.org
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      eb38c3b6
    • Fam Zheng's avatar
      nbd-server: Coroutine based negotiation · 1a6245a5
      Fam Zheng authored
      
      Create a coroutine in nbd_client_new, so that nbd_send_negotiate doesn't
      need qemu_set_block().
      
      Handlers need to be set temporarily for csock fd in case the coroutine
      yields during I/O.
      
      With this, if the other end disappears in the middle of the negotiation,
      we don't block the whole event loop.
      
      To make the code clearer, unify all function names that belong to
      negotiate, so they are less likely to be misused. This is important
      because we rely on negotiation staying in main loop, as commented in
      nbd_negotiate_read/write().
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-4-git-send-email-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1a6245a5
    • Fam Zheng's avatar
      nbd: Split nbd.c · 798bfe00
      Fam Zheng authored
      
      We have NBD server code and client code, all mixed in a file. Now split
      them into separate files under nbd/, and update MAINTAINERS.
      
      filter_nbd for iotest 083 is updated to keep the log filtered out.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-3-git-send-email-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      798bfe00
    • Fam Zheng's avatar
      nbd: Always call "close_fn" in nbd_client_new · ee7d7aab
      Fam Zheng authored
      
      Rename the parameter "close" to "close_fn" to disambiguous with
      close(2).
      
      This unifies error handling paths of NBDClient allocation:
      nbd_client_new will shutdown the socket and call the "close_fn" callback
      if negotiation failed, so the caller don't need a different path than
      the normal close.
      
      The returned pointer is never used, make it void in preparation for the
      next patch.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-2-git-send-email-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ee7d7aab
    • Cao jin's avatar
      SCSI device: fix to incomplete QOMify · e1dc6815
      Cao jin authored
      
      Signed-off-by: default avatarCao jin <caoj.fnst@cn.fujitsu.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <1452073066-28319-1-git-send-email-caoj.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e1dc6815
    • Zhu Lingshan's avatar
      iscsi: send readcapacity10 when readcapacity16 failed · 1cb6d137
      Zhu Lingshan authored
      
      When play with Dell MD3000 target, for sure it
      is a TYPE_DISK, but readcapacity16 would fail.
      Then we find that readcapacity10 succeeded. It
      looks like the target just support readcapacity10
      even through it is a TYPE_DISK or have some
      TYPE_ROM characteristics.
      
      This patch can give a chance to send
      readcapacity16 when readcapacity10 failed.
      This patch is not harmful to original pathes
      
      Signed-off-by: default avatarZhu Lingshan <lszhu@suse.com>
      Message-Id: <1451359934-9236-1-git-send-email-lszhu@suse.com>
      [Don't fall through on UNIT ATTENTION. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1cb6d137
    • Daniel P. Berrangé's avatar
      qemu-char: delete send_all/recv_all helper methods · 46f296cd
      Daniel P. Berrangé authored
      
      The qemu-char.c contains two helper methods send_all
      and recv_all. These are in fact declared in sockets.h
      so ought to have been in util/qemu-sockets.c. For added
      fun the impl of recv_all is completely missing on Win32.
      
      Fortunately there is only a single caller of these
      methods, the TPM passthrough code, which is only
      ever compiled on Linux. With only a single caller
      these helpers are not compelling enough to keep so
      inline them in the TPM code, avoiding the need to
      fix the missing recv_all on Win32.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1450879144-17111-1-git-send-email-berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      46f296cd
    • Shmulik Ladkani's avatar
      vmw_pvscsi: x-disable-pcie, x-old-pci-configuration back-compat props are 2.5 specific · fca10318
      Shmulik Ladkani authored
      
      pvscsi's x-disable-pcie and x-old-pci-configuration backward compat
      properties were introduced in 952970ba and d5da3ef2:
      
        vmw_pvscsi: Introduce 'x-old-pci-configuration' backword compatability property
        vmw_pvscsi: Introduce 'x-disable-pcie' backword compatability property
      
      and were placed into HW_COMPAT_2_4.
      
      However since these commits were pulled post v2.5, move them to
      HW_COMPAT_2_5.
      
      Signed-off-by: default avatarShmulik Ladkani <shmulik.ladkani@ravellosystems.com>
      Message-Id: <1450900558-20113-1-git-send-email-shmulik.ladkani@ravellosystems.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fca10318
    • Prasad J Pandit's avatar
      scsi: initialise info object with appropriate size · 36fef36b
      Prasad J Pandit authored
      
      While processing controller 'CTRL_GET_INFO' command, the routine
      'megasas_ctrl_get_info' overflows the '&info' object size. Use its
      appropriate size to null initialise it.
      
      Reported-by: default avatarQinghao Tang <luodalongde@gmail.com>
      Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
      Message-Id: <alpine.LFD.2.20.1512211501420.22471@wniryva>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarP J P <ppandit@redhat.com>
      36fef36b
    • Prasad J Pandit's avatar
      i386: avoid null pointer dereference · 4c1396cb
      Prasad J Pandit authored
      
          Hello,
      
      A null pointer dereference issue was reported by Mr Ling Liu, CC'd here. It
      occurs while doing I/O port write operations via hmp interface. In that,
      'current_cpu' remains null as it is not called from cpu_exec loop, which
      results in the said issue.
      
      Below is a proposed (tested)patch to fix this issue; Does it look okay?
      
      ===
      From ae88a4947fab9a148cd794f8ad2d812e7f5a1d0f Mon Sep 17 00:00:00 2001
      From: Prasad J Pandit <pjp@fedoraproject.org>
      Date: Fri, 18 Dec 2015 11:16:07 +0530
      Subject: [PATCH] i386: avoid null pointer dereference
      
      When I/O port write operation is called from hmp interface,
      'current_cpu' remains null, as it is not called from cpu_exec()
      loop. This leads to a null pointer dereference in vapic_write
      routine. Add check to avoid it.
      
      Reported-by: default avatarLing Liu <liuling-it@360.cn>
      Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
      Message-Id: <alpine.LFD.2.20.1512181129320.9805@wniryva>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarP J P <ppandit@redhat.com>
      4c1396cb
    • Paolo Bonzini's avatar
      target-i386: do not duplicate page protection checks · 76c64d33
      Paolo Bonzini authored
      
      x86_cpu_handle_mmu_fault is currently checking twice for writability
      and executability of pages; the first time to decide whether to
      trigger a page fault, the second time to compute the "prot" argument
      to tlb_set_page_with_attrs.
      
      Reorganize code so that first "prot" is computed, then it is used
      to check whether to raise a page fault, then finally PROT_WRITE is
      removed if the D bit will have to be set.
      
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      76c64d33
Loading