Skip to content
Snippets Groups Projects
  1. Feb 18, 2021
  2. Feb 17, 2021
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20210216' into staging · 1af56296
      Peter Maydell authored
      
      virtiofsd pull 2021-02-16
      
      Vivek's support for new FUSE KILLPRIV_V2
      and some smaller cleanups.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      
      # gpg: Signature made Tue 16 Feb 2021 18:34:32 GMT
      # gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
      # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
      # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7
      
      * remotes/dgilbert-gitlab/tags/pull-virtiofs-20210216:
        virtiofsd: Do not use a thread pool by default
        viriofsd: Add support for FUSE_HANDLE_KILLPRIV_V2
        virtiofsd: Save error code early at the failure callsite
        tools/virtiofsd: Replace the word 'whitelist'
        virtiofsd: vu_dispatch locking should never fail
        virtiofsd: Allow to build it without the tools
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1af56296
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging · f0f75dc1
      Peter Maydell authored
      
      * HVF fixes
      * Extra qos-test debugging output (Christian)
      * SEV secret address autodetection (James)
      * SEV-ES support (Thomas)
      * Relocatable paths bugfix (Stefan)
      * RR fix (Pavel)
      * EventNotifier fix (Greg)
      
      # gpg: Signature made Tue 16 Feb 2021 16:15:59 GMT
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini-gitlab/tags/for-upstream: (21 commits)
        replay: fix icount request when replaying clock access
        event_notifier: Set ->initialized earlier in event_notifier_init()
        hvf: Fetch cr4 before evaluating CPUID(1)
        target/i386/hvf: add rdmsr 35H MSR_CORE_THREAD_COUNT
        hvf: x86: Remove unused definitions
        target/i386/hvf: add vmware-cpuid-freq cpu feature
        hvf: Guard xgetbv call
        util/cutils: Skip "." when looking for next directory component
        tests/qtest/qos-test: dump QEMU command if verbose
        tests/qtest/qos-test: dump environment variables if verbose
        tests/qtest/qos-test: dump qos graph if verbose
        libqos/qgraph_internal: add qos_printf() and qos_printf_literal()
        libqos/qgraph: add qos_node_create_driver_named()
        sev/i386: Enable an SEV-ES guest based on SEV policy
        kvm/i386: Use a per-VM check for SMM capability
        sev/i386: Don't allow a system reset under an SEV-ES guest
        sev/i386: Allow AP booting under SEV-ES
        sev/i386: Require in-kernel irqchip support for SEV-ES guests
        sev/i386: Add initial support for SEV-ES
        sev: update sev-inject-launch-secret to make gpa optional
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f0f75dc1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210217' into staging · 65d6ae49
      Peter Maydell authored
      
      target-arm queue:
       * Support ARMv8.5-MemTag for linux-user
       * ncpm7xx: Support SMBus
       * MAINTAINERS: add section for Clock framework
      
      # gpg: Signature made Wed 17 Feb 2021 11:01:45 GMT
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20210217: (37 commits)
        MAINTAINERS: add myself maintainer for the clock framework
        hw/i2c: Implement NPCM7XX SMBus Module FIFO Mode
        hw/i2c: Add a QTest for NPCM7XX SMBus Device
        hw/arm: Add I2C sensors and EEPROM for GSJ machine
        hw/arm: Add I2C sensors for NPCM750 eval board
        hw/i2c: Implement NPCM7XX SMBus Module Single Mode
        tests/tcg/aarch64: Add mte smoke tests
        target/arm: Enable MTE for user-only
        target/arm: Add allocation tag storage for user mode
        linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error
        linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault
        linux-user/aarch64: Pass syndrome to EXC_*_ABORT
        target/arm: Split out syndrome.h from internals.h
        linux-user/aarch64: Implement PROT_MTE
        linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG
        target/arm: Use the proper TBI settings for linux-user
        target/arm: Improve gen_top_byte_ignore
        linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE
        linux-user: Handle tags in lock_user/unlock_user
        linux-user: Fix types in uaccess.c
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      65d6ae49
  3. Feb 16, 2021
    • Vivek Goyal's avatar
      virtiofsd: Do not use a thread pool by default · 26ec1909
      Vivek Goyal authored
      
      Currently we created a thread pool (With 64 max threads per pool) for
      each virtqueue. We hoped that this will provide us with better scalability
      and performance.
      
      But in practice, we are getting better numbers in most of the cases
      when we don't create a thread pool at all and a single thread per
      virtqueue receives the request and processes it.
      
      Hence, I am proposing that we switch to no thread pool by default
      (equivalent of --thread-pool-size=0). This will provide out of
      box better performance to most of the users. In fact other users
      have confirmed that not using a thread pool gives them better
      numbers. So why not use this as default. It can be changed when
      somebody can fix the issues with thread pool performance.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Message-Id: <20210210182744.27324-2-vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      26ec1909
    • Vivek Goyal's avatar
      viriofsd: Add support for FUSE_HANDLE_KILLPRIV_V2 · d64907ac
      Vivek Goyal authored
      
      This patch adds basic support for FUSE_HANDLE_KILLPRIV_V2. virtiofsd
      can enable/disable this by specifying option "-o killpriv_v2/no_killpriv_v2".
      By default this is enabled as long as client supports it
      
      Enabling this option helps with performance in write path. Without this
      option, currently every write is first preceeded with a getxattr() operation
      to find out if security.capability is set. (Write is supposed to clear
      security.capability). With this option enabled, server is signing up for
      clearing security.capability on every WRITE and also clearing suid/sgid
      subject to certain rules. This gets rid of extra getxattr() call for every
      WRITE and improves performance. This is true when virtiofsd is run with
      option -o xattr.
      
      What does enabling FUSE_HANDLE_KILLPRIV_V2 mean for file server implementation.
      It needs to adhere to following rules. Thanks to Miklos for this summary.
      
      - clear "security.capability" on write, truncate and chown unconditionally
      - clear suid/sgid in case of following. Note, sgid is cleared only if
        group executable bit is set.
          o setattr has FATTR_SIZE and FATTR_KILL_SUIDGID set.
          o setattr has FATTR_UID or FATTR_GID
          o open has O_TRUNC and FUSE_OPEN_KILL_SUIDGID
          o create has O_TRUNC and FUSE_OPEN_KILL_SUIDGID flag set.
          o write has FUSE_WRITE_KILL_SUIDGID
      
      >From Linux VFS client perspective, here are the requirements.
      
      - caps are always cleared on chown/write/truncate
      - suid is always cleared on chown, while for truncate/write it is cleared
        only if caller does not have CAP_FSETID.
      - sgid is always cleared on chown, while for truncate/write it is cleared
        only if caller does not have CAP_FSETID as well as file has group execute
        permission.
      
      virtiofsd implementation has not changed much to adhere to above ruls. And
      reason being that current assumption is that we are running on Linux
      and on top of filesystems like ext4/xfs which already follow above rules.
      On write, truncate, chown, seucurity.capability is cleared. And virtiofsd
      drops CAP_FSETID if need be and that will lead to clearing of suid/sgid.
      
      But if virtiofsd is running on top a filesystem which breaks above assumptions,
      then it will have to take extra actions to emulate above. That's a TODO
      for later when need arises.
      
      Note: create normally is supposed to be called only when file does not
            exist. So generally there should not be any question of clearing
            setuid/setgid. But it is possible that after client checks that
            file is not present, some other client creates file on server
            and this race can trigger sending FUSE_CREATE. In that case, if
            O_TRUNC is set, we should clear suid/sgid if FUSE_OPEN_KILL_SUIDGID
            is also set.
      
      v3:
        - Resolved conflicts due to lo_inode_open() changes.
        - Moved capability code in lo_do_open() so that both lo_open() and
          lo_create() can benefit from common code.
        - Dropped changes to kernel headers as these are part of qemu already.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20210208224024.43555-3-vgoyal@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      d64907ac
    • Vivek Goyal's avatar
      virtiofsd: Save error code early at the failure callsite · 1e08f164
      Vivek Goyal authored
      
      Change error code handling slightly in lo_setattr(). Right now we seem
      to jump to out_err and assume that "errno" is valid and use that to
      send reply.
      
      But if caller has to do some other operations before jumping to out_err,
      then it does the dance of first saving errno to saverr and the restore
      errno before jumping to out_err. This makes it more confusing.
      
      I am about to make more changes where caller will have to do some
      work after error before jumping to out_err. I found it easier to
      change the convention a bit. That is caller saves error in "saverr"
      before jumping to out_err. And out_err uses "saverr" to send error
      back and does not rely on "errno" having actual error.
      
      v3: Resolved conflicts in lo_setattr() due to lo_inode_open() changes.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20210208224024.43555-2-vgoyal@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      1e08f164
    • Philippe Mathieu-Daudé's avatar
      tools/virtiofsd: Replace the word 'whitelist' · a65963ef
      Philippe Mathieu-Daudé authored
      Follow the inclusive terminology from the "Conscious Language in your
      Open Source Projects" guidelines [*] and replace the words "whitelist"
      appropriately.
      
      [*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md
      
      
      
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20210205171817.2108907-3-philmd@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      a65963ef
Loading