Skip to content
Snippets Groups Projects
  1. Jul 29, 2022
  2. Jul 20, 2022
  3. Jul 12, 2022
  4. Jun 24, 2022
  5. Jun 16, 2022
    • Zhenwei Pi's avatar
      crypto: Introduce RSA algorithm · 0e660a6f
      Zhenwei Pi authored
      
      There are two parts in this patch:
      1, support akcipher service by cryptodev-builtin driver
      2, virtio-crypto driver supports akcipher service
      
      In principle, we should separate this into two patches, to avoid
      compiling error, merge them into one.
      
      Then virtio-crypto gets request from guest side, and forwards the
      request to builtin driver to handle it.
      
      Test with a guest linux:
      1, The self-test framework of crypto layer works fine in guest kernel
      2, Test with Linux guest(with asym support), the following script
      test(note that pkey_XXX is supported only in a newer version of keyutils):
        - both public key & private key
        - create/close session
        - encrypt/decrypt/sign/verify basic driver operation
        - also test with kernel crypto layer(pkey add/query)
      
      All the cases work fine.
      
      Run script in guest:
      rm -rf *.der *.pem *.pfx
      modprobe pkcs8_key_parser # if CONFIG_PKCS8_PRIVATE_KEY_PARSER=m
      rm -rf /tmp/data
      dd if=/dev/random of=/tmp/data count=1 bs=20
      
      openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/ST=BJ/L=HD/O=qemu/OU=dev/CN=qemu/emailAddress=qemu@qemu.org"
      openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER -out key.der
      openssl x509 -in cert.pem -inform PEM -outform DER -out cert.der
      
      PRIV_KEY_ID=`cat key.der | keyctl padd asymmetric test_priv_key @s`
      echo "priv key id = "$PRIV_KEY_ID
      PUB_KEY_ID=`cat cert.der | keyctl padd asymmetric test_pub_key @s`
      echo "pub key id = "$PUB_KEY_ID
      
      keyctl pkey_query $PRIV_KEY_ID 0
      keyctl pkey_query $PUB_KEY_ID 0
      
      echo "Enc with priv key..."
      keyctl pkey_encrypt $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.priv
      echo "Dec with pub key..."
      keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.priv enc=pkcs1 >/tmp/dec
      cmp /tmp/data /tmp/dec
      
      echo "Sign with priv key..."
      keyctl pkey_sign $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 hash=sha1 > /tmp/sig
      echo "Verify with pub key..."
      keyctl pkey_verify $PRIV_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1
      
      echo "Enc with pub key..."
      keyctl pkey_encrypt $PUB_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.pub
      echo "Dec with priv key..."
      keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec
      cmp /tmp/data /tmp/dec
      
      echo "Verify with pub key..."
      keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1
      
      Reviewed-by: default avatarGonglei <arei.gonglei@huawei.com>
      Signed-off-by: default avatarlei he <helei.sig11@bytedance.com>
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      Message-Id: <20220611064243.24535-2-pizhenwei@bytedance.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      0e660a6f
  6. Jun 06, 2022
  7. Jun 03, 2022
    • Thomas Huth's avatar
      ui: Switch "-display sdl" to use the QAPI parser · 9eafdeea
      Thomas Huth authored
      
      The "-display sdl" option still uses a hand-crafted parser for its
      parameters since we didn't want to drag an interface we considered
      somewhat flawed into the QAPI schema. Since the flaws are gone now,
      it's time to QAPIfy.
      
      This introduces the new "DisplaySDL" QAPI struct that is used to hold
      the parameters that are unique to the SDL display. The only specific
      parameter is currently "grab-mod" that is used to specify the required
      modifier keys to escape from the mouse grabbing mode.
      
      Message-Id: <20220519155625.1414365-3-thuth@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      9eafdeea
  8. May 12, 2022
  9. May 11, 2022
  10. May 09, 2022
    • Nicolas Saenz Julienne's avatar
      util/event-loop-base: Introduce options to set the thread pool size · 71ad4713
      Nicolas Saenz Julienne authored
      
      The thread pool regulates itself: when idle, it kills threads until
      empty, when in demand, it creates new threads until full. This behaviour
      doesn't play well with latency sensitive workloads where the price of
      creating a new thread is too high. For example, when paired with qemu's
      '-mlock', or using safety features like SafeStack, creating a new thread
      has been measured take multiple milliseconds.
      
      In order to mitigate this let's introduce a new 'EventLoopBase'
      property to set the thread pool size. The threads will be created during
      the pool's initialization or upon updating the property's value, remain
      available during its lifetime regardless of demand, and destroyed upon
      freeing it. A properly characterized workload will then be able to
      configure the pool to avoid any latency spikes.
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-4-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      71ad4713
    • Nicolas Saenz Julienne's avatar
      util/main-loop: Introduce the main loop into QOM · 70ac26b9
      Nicolas Saenz Julienne authored
      
      'event-loop-base' provides basic property handling for all 'AioContext'
      based event loops. So let's define a new 'MainLoopClass' that inherits
      from it. This will permit tweaking the main loop's properties through
      qapi as well as through the command line using the '-object' keyword[1].
      Only one instance of 'MainLoopClass' might be created at any time.
      
      'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to
      mark 'MainLoop' as non-deletable.
      
      [1] For example:
            -object main-loop,id=main-loop,aio-max-batch=<value>
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-3-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      70ac26b9
    • Nicolas Saenz Julienne's avatar
      Introduce event-loop-base abstract class · 7d5983e3
      Nicolas Saenz Julienne authored
      
      Introduce the 'event-loop-base' abstract class, it'll hold the
      properties common to all event loops and provide the necessary hooks for
      their creation and maintenance. Then have iothread inherit from it.
      
      EventLoopBaseClass is defined as user creatable and provides a hook for
      its children to attach themselves to the user creatable class 'complete'
      function. It also provides an update_params() callback to propagate
      property changes onto its children.
      
      The new 'event-loop-base' class will live in the root directory. It is
      built on its own using the 'link_whole' option (there are no direct
      function dependencies between the class and its children, it all happens
      trough 'constructor' magic). And also imposes new compilation
      dependencies:
      
          qom <- event-loop-base <- blockdev (iothread.c)
      
      And in subsequent patches:
      
          qom <- event-loop-base <- qemuutil (util/main-loop.c)
      
      All this forced some amount of reordering in meson.build:
      
       - Moved qom build definition before qemuutil. Doing it the other way
         around (i.e. moving qemuutil after qom) isn't possible as a lot of
         core libraries that live in between the two depend on it.
      
       - Process the 'hw' subdir earlier, as it introduces files into the
         'qom' source set.
      
      No functional changes intended.
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-2-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      7d5983e3
    • Gautam Agrawal's avatar
      Warn user if the vga flag is passed but no vga device is created · f9bcb2d6
      Gautam Agrawal authored
      
      A global boolean variable "vga_interface_created"(declared in softmmu/globals.c)
      has been used to track the creation of vga interface. If the vga flag is passed
      in the command line "default_vga"(declared in softmmu/vl.c) variable is set to 0.
      To warn user, the condition checks if vga_interface_created is false
      and default_vga is equal to 0. If "-vga none" is passed, this patch will not warn the
      user regarding the creation of VGA device.
      
      The warning "A -vga option was passed but this
      machine type does not use that option; no VGA device has been created"
      is logged if vga flag is passed but no vga device is created.
      
      This patch has been tested for x86_64, i386, sparc, sparc64 and arm boards.
      
      Signed-off-by: default avatarGautam Agrawal <gautamnagrawal@gmail.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/581
      
      
      Message-Id: <20220501122505.29202-1-gautamnagrawal@gmail.com>
      [thuth: Fix wrong warning with "-device" in some cases as reported by Paolo]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      f9bcb2d6
  11. May 06, 2022
  12. May 03, 2022
  13. Apr 22, 2022
  14. Apr 20, 2022
  15. Apr 06, 2022
    • Ivan Shcherbakov's avatar
      whpx: Added support for breakpoints and stepping · d7482ffe
      Ivan Shcherbakov authored
      
      Below is the updated version of the patch adding debugging support to WHPX.
      It incorporates feedback from Alex Bennée and Peter Maydell regarding not
      changing the emulation logic depending on the gdb connection status.
      
      Instead of checking for an active gdb connection to determine whether QEMU
      should intercept the INT1 exceptions, it now checks whether any breakpoints
      have been set, or whether gdb has explicitly requested one or more CPUs to
      do single-stepping. Having none of these condition present now has the same
      effect as not using gdb at all.
      
      Message-Id: <0e7f01d82e9e$00e9c360$02bd4a20$@sysprogs.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d7482ffe
Loading