Skip to content
  1. Jun 07, 2019
  2. Jun 06, 2019
    • Jason Wang's avatar
      vhost: access vq metadata through kernel virtual address · 7f466032
      Jason Wang authored
      
      
      It was noticed that the copy_to/from_user() friends that was used to
      access virtqueue metdata tends to be very expensive for dataplane
      implementation like vhost since it involves lots of software checks,
      speculation barriers, hardware feature toggling (e.g SMAP). The
      extra cost will be more obvious when transferring small packets since
      the time spent on metadata accessing become more significant.
      
      This patch tries to eliminate those overheads by accessing them
      through direct mapping of those pages. Invalidation callbacks is
      implemented for co-operation with general VM management (swap, KSM,
      THP or NUMA balancing). We will try to get the direct mapping of vq
      metadata before each round of packet processing if it doesn't
      exist. If we fail, we will simplely fallback to copy_to/from_user()
      friends.
      
      This invalidation and direct mapping access are synchronized through
      spinlock and RCU. All matedata accessing through direct map is
      protected by RCU, and the setup or invalidation are done under
      spinlock.
      
      This method might does not work for high mem page which requires
      temporary mapping so we just fallback to normal
      copy_to/from_user() and may not for arch that has virtual tagged cache
      since extra cache flushing is needed to eliminate the alias. This will
      result complex logic and bad performance. For those archs, this patch
      simply go for copy_to/from_user() friends. This is done by ruling out
      kernel mapping codes through ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE.
      
      Note that this is only done when device IOTLB is not enabled. We
      could use similar method to optimize IOTLB in the future.
      
      Tests shows at most about 23% improvement on TX PPS when using
      virtio-user + vhost_net + xdp1 + TAP on 2.6GHz Broadwell:
      
              SMAP on | SMAP off
      Before: 5.2Mpps | 7.1Mpps
      After:  6.4Mpps | 8.2Mpps
      
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: linux-mm@kvack.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-parisc@vger.kernel.org
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      7f466032
    • Jason Wang's avatar
      vhost: factor out setting vring addr and num · feebcaea
      Jason Wang authored
      
      
      Factoring vring address and num setting which needs special care for
      accelerating vq metadata accessing.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      feebcaea
    • Jason Wang's avatar
      vhost: introduce helpers to get the size of metadata area · 4942e825
      Jason Wang authored
      
      
      To avoid code duplication since it will be used by kernel VA prefetching.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      4942e825
    • Jason Wang's avatar
      vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() · 9b5e830b
      Jason Wang authored
      
      
      Rename the function to be more accurate since it actually tries to
      prefetch vq metadata address in IOTLB. And this will be used by
      following patch to prefetch metadata virtual addresses.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      9b5e830b
    • Jason Wang's avatar
      vhost: fine grain userspace memory accessors · 7b5d753e
      Jason Wang authored
      
      
      This is used to hide the metadata address from virtqueue helpers. This
      will allow to implement a vmap based fast accessing to metadata.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      7b5d753e
    • Jason Wang's avatar
      vhost: generalize adding used elem · 1ab5d138
      Jason Wang authored
      
      
      Use one generic vhost_copy_to_user() instead of two dedicated
      accessor. This will simplify the conversion to fine grain
      accessors. About 2% improvement of PPS were seen during vitio-user
      txonly test.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      1ab5d138
  3. May 27, 2019
    • Jason Wang's avatar
      vhost: scsi: add weight support · c1ea02f1
      Jason Wang authored
      This patch will check the weight and exit the loop if we exceeds the
      weight. This is useful for preventing scsi kthread from hogging cpu
      which is guest triggerable.
      
      This addresses CVE-2019-3900.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Fixes: 057cbf49
      
       ("tcm_vhost: Initial merge for vhost level target fabric driver")
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      c1ea02f1
    • Jason Wang's avatar
      vhost: vsock: add weight support · e79b431f
      Jason Wang authored
      This patch will check the weight and exit the loop if we exceeds the
      weight. This is useful for preventing vsock kthread from hogging cpu
      which is guest triggerable. The weight can help to avoid starving the
      request from on direction while another direction is being processed.
      
      The value of weight is picked from vhost-net.
      
      This addresses CVE-2019-3900.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Fixes: 433fc58e
      
       ("VSOCK: Introduce vhost_vsock.ko")
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e79b431f
    • Jason Wang's avatar
      vhost_net: fix possible infinite loop · e2412c07
      Jason Wang authored
      When the rx buffer is too small for a packet, we will discard the vq
      descriptor and retry it for the next packet:
      
      while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk,
      					      &busyloop_intr))) {
      ...
      	/* On overrun, truncate and discard */
      	if (unlikely(headcount > UIO_MAXIOV)) {
      		iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
      		err = sock->ops->recvmsg(sock, &msg,
      					 1, MSG_DONTWAIT | MSG_TRUNC);
      		pr_debug("Discarded rx packet: len %zd\n", sock_len);
      		continue;
      	}
      ...
      }
      
      This makes it possible to trigger a infinite while..continue loop
      through the co-opreation of two VMs like:
      
      1) Malicious VM1 allocate 1 byte rx buffer and try to slow down the
         vhost process as much as possible e.g using indirect descriptors or
         other.
      2) Malicious VM2 generate packets to VM1 as fast as possible
      
      Fixing this by checking against weight at the end of RX and TX
      loop. This also eliminate other similar cases when:
      
      - userspace is consuming the packets in the meanwhile
      - theoretical TOCTOU attack if guest moving avail index back and forth
        to hit the continue after vhost find guest just add new buffers
      
      This addresses CVE-2019-3900.
      
      Fixes: d8316f39 ("vhost: fix total length when packets are too short")
      Fixes: 3a4d5c94
      
       ("vhost_net: a kernel-level virtio server")
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e2412c07
    • Jason Wang's avatar
      vhost: introduce vhost_exceeds_weight() · e82b9b07
      Jason Wang authored
      
      
      We used to have vhost_exceeds_weight() for vhost-net to:
      
      - prevent vhost kthread from hogging the cpu
      - balance the time spent between TX and RX
      
      This function could be useful for vsock and scsi as well. So move it
      to vhost.c. Device must specify a weight which counts the number of
      requests, or it can also specific a byte_weight which counts the
      number of bytes that has been processed.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e82b9b07
    • Fabrizio Castro's avatar
      virtio: Fix indentation of VIRTIO_MMIO · 6166e533
      Fabrizio Castro authored
      
      
      VIRTIO_MMIO config option block starts with a space, fix that.
      
      Signed-off-by: default avatarFabrizio Castro <fabrizio.castro@bp.renesas.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      6166e533
    • Igor Stoppa's avatar
      virtio: add unlikely() to WARN_ON_ONCE() · 3d840e06
      Igor Stoppa authored
      
      
      The condition to test is unlikely() to be true. Add the hint.
      
      Signed-off-by: default avatarIgor Stoppa <igor.stoppa@huawei.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Virtualization@lists.linux-foundation.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      3d840e06
    • Linus Torvalds's avatar
      Linux 5.2-rc2 · cd6c84d8
      Linus Torvalds authored
      v5.2-rc2
      cd6c84d8
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · c5b44095
      Linus Torvalds authored
      Pull tracing warning fix from Steven Rostedt:
       "Make the GCC 9 warning for sub struct memset go away.
      
        GCC 9 now warns about calling memset() on partial structures when it
        goes across multiple fields. This adds a helper for the place in
        tracing that does this type of clearing of a structure"
      
      * tag 'trace-v5.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Silence GCC 9 array bounds warning
      c5b44095
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 862f0a32
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "The usual smattering of fixes and tunings that came in too late for
        the merge window, but should not wait four months before they appear
        in a release.
      
        I also travelled a bit more than usual in the first part of May, which
        didn't help with picking up patches and reports promptly"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (33 commits)
        KVM: x86: fix return value for reserved EFER
        tools/kvm_stat: fix fields filter for child events
        KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard
        kvm: selftests: aarch64: compile with warnings on
        kvm: selftests: aarch64: fix default vm mode
        kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size
        KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION
        KVM: x86/pmu: do not mask the value that is written to fixed PMUs
        KVM: x86/pmu: mask the result of rdpmc according to the width of the counters
        x86/kvm/pmu: Set AMD's virt PMU version to 1
        KVM: x86: do not spam dmesg with VMCS/VMCB dumps
        kvm: Check irqchip mode before assign irqfd
        kvm: svm/avic: fix off-by-one in checking host APIC ID
        KVM: selftests: do not blindly clobber registers in guest asm
        KVM: selftests: Remove duplicated TEST_ASSERT in hyperv_cpuid.c
        KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace
        KVM: LAPIC: Fix lapic_timer_advance_ns parameter overflow
        kvm: vmx: Fix -Wmissing-prototypes warnings
        KVM: nVMX: Fix using __this_cpu_read() in preemptible context
        kvm: fix compilation on s390
        ...
      862f0a32
  4. May 26, 2019
  5. May 25, 2019
    • Gabriel Krisman Bertazi's avatar
      ext4: fix dcache lookup of !casefolded directories · 66883da1
      Gabriel Krisman Bertazi authored
      Found by visual inspection, this wasn't caught by my xfstest, since it's
      effect is ignoring positive dentries in the cache the fallback just goes
      to the disk.  it was introduced in the last iteration of the
      case-insensitive patch.
      
      d_compare should return 0 when the entries match, so make sure we are
      correctly comparing the entire string if the encoding feature is set and
      we are on a case-INsensitive directory.
      
      Fixes: b886ee3e
      
       ("ext4: Support case-insensitive file name lookups")
      Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@collabora.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      66883da1
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 2409207a
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is the same set of patches sent in the merge window as the final
        pull except that Martin's read only rework is replaced with a simple
        revert of the original change that caused the regression.
      
        Everything else is an obvious fix or small cleanup"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        Revert "scsi: sd: Keep disk read-only when re-reading partition"
        scsi: bnx2fc: fix incorrect cast to u64 on shift operation
        scsi: smartpqi: Reporting unhandled SCSI errors
        scsi: myrs: Fix uninitialized variable
        scsi: lpfc: Update lpfc version to 12.2.0.2
        scsi: lpfc: add check for loss of ndlp when sending RRQ
        scsi: lpfc: correct rcu unlock issue in lpfc_nvme_info_show
        scsi: lpfc: resolve lockdep warnings
        scsi: qedi: remove set but not used variables 'cdev' and 'udev'
        scsi: qedi: remove memset/memcpy to nfunc and use func instead
        scsi: qla2xxx: Add cleanup for PCI EEH recovery
      2409207a
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block · 7fbc78e3
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Keith, with fixes from a few folks.
      
       - bio and sbitmap before atomic barrier fixes (Andrea)
      
       - Hang fix for blk-mq freeze and unfreeze (Bob)
      
       - Single segment count regression fix (Christoph)
      
       - AoE now has a new maintainer
      
       - tools/io_uring/ Makefile fix, and sync with liburing (me)
      
      * tag 'for-linus-20190524' of git://git.kernel.dk/linux-block: (23 commits)
        tools/io_uring: sync with liburing
        tools/io_uring: fix Makefile for pthread library link
        blk-mq: fix hang caused by freeze/unfreeze sequence
        block: remove the bi_seg_{front,back}_size fields in struct bio
        block: remove the segment size check in bio_will_gap
        block: force an unlimited segment size on queues with a virt boundary
        block: don't decrement nr_phys_segments for physically contigous segments
        sbitmap: fix improper use of smp_mb__before_atomic()
        bio: fix improper use of smp_mb__before_atomic()
        aoe: list new maintainer for aoe driver
        nvme-pci: use blk-mq mapping for unmanaged irqs
        nvme: update MAINTAINERS
        nvme: copy MTFA field from identify controller
        nvme: fix memory leak for power latency tolerance
        nvme: release namespace SRCU protection before performing controller ioctls
        nvme: merge nvme_ns_ioctl into nvme_ioctl
        nvme: remove the ifdef around nvme_nvm_ioctl
        nvme: fix srcu locking on error return in nvme_get_ns_from_disk
        nvme: Fix known effects
        nvme-pci: Sync queues on reset
        ...
      7fbc78e3
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-5.2-rc2' of... · 7f8b40e3
      Linus Torvalds authored
      Merge tag 'linux-kselftest-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fixes from Shuah Khan:
      
       - Two fixes to regressions introduced in kselftest Makefile test run
         output refactoring work (Kees Cook)
      
       - Adding Atom support to syscall_arg_fault test (Tong Bo)
      
      * tag 'linux-kselftest-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/timers: Add missing fflush(stdout) calls
        selftests: Remove forced unbuffering for test running
        selftests/x86: Support Atom for syscall_arg_fault test
      7f8b40e3
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · e7bd3e24
      Linus Torvalds authored
      Pull Devicetree fixes from Rob Herring:
      
       - Update checkpatch.pl to use DT vendor-prefixes.yaml
      
       - Fix DT binding references to files converted to DT schema
      
       - Clean-up Arm CPU binding examples to match schema
      
       - Add Sifive block versioning scheme documentation
      
       - Pass binding directory base to validation tools for reference lookups
      
      * tag 'devicetree-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        checkpatch.pl: Update DT vendor prefix check
        dt: bindings: mtd: replace references to nand.txt with nand-controller.yaml
        dt-bindings: interrupt-controller: arm,gic: Fix schema errors in example
        dt-bindings: arm: Clean up CPU binding examples
        dt: fix refs that were renamed to json with the same file name
        dt-bindings: Pass binding directory to validation tools
        dt-bindings: sifive: describe sifive-blocks versioning
      e7bd3e24
    • Linus Torvalds's avatar
      Merge tag 'spdx-5.2-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 86c2f5d6
      Linus Torvalds authored
      Pule more SPDX updates from Greg KH:
       "Here is another set of reviewed patches that adds SPDX tags to
        different kernel files, based on a set of rules that are being used to
        parse the comments to try to determine that the license of the file is
        "GPL-2.0-or-later".
      
        Only the "obvious" versions of these matches are included here, a
        number of "non-obvious" variants of text have been found but those
        have been postponed for later review and analysis.
      
        These patches have been out for review on the linux-spdx@vger mailing
        list, and while they were created by automatic tools, they were
        hand-verified by a bunch of different people, all whom names are on
        the patches are reviewers"
      
      * tag 'spdx-5.2-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (85 commits)
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 125
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 123
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 122
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 121
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 120
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 119
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 116
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 113
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 112
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 111
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 110
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 106
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 105
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 104
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 103
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 102
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 101
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 98
        ...
      86c2f5d6
    • Waiman Long's avatar
      locking/lock_events: Use this_cpu_add() when necessary · 51816e9e
      Waiman Long authored
      The kernel test robot has reported that the use of __this_cpu_add()
      causes bug messages like:
      
        BUG: using __this_cpu_add() in preemptible [00000000] code: ...
      
      Given the imprecise nature of the count and the possibility of resetting
      the count and doing the measurement again, this is not really a big
      problem to use the unprotected __this_cpu_*() functions.
      
      To make the preemption checking code happy, the this_cpu_*() functions
      will be used if CONFIG_DEBUG_PREEMPT is defined.
      
      The imprecise nature of the locking counts are also documented with
      the suggestion that we should run the measurement a few times with the
      counts reset in between to get a better picture of what is going on
      under the hood.
      
      Fixes: a8654596
      
       ("locking/rwsem: Enable lock event counting")
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      51816e9e
    • Paolo Bonzini's avatar
      KVM: x86: fix return value for reserved EFER · 66f61c92
      Paolo Bonzini authored
      Commit 11988499
      
       ("KVM: x86: Skip EFER vs. guest CPUID checks for
      host-initiated writes", 2019-04-02) introduced a "return false" in a
      function returning int, and anyway set_efer has a "nonzero on error"
      conventon so it should be returning 1.
      
      Reported-by: default avatarPavel Machek <pavel@denx.de>
      Fixes: 11988499
      
       ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      66f61c92
    • Stefan Raspl's avatar
      tools/kvm_stat: fix fields filter for child events · 883d25e7
      Stefan Raspl authored
      
      
      The fields filter would not work with child fields, as the respective
      parents would not be included. No parents displayed == no childs displayed.
      To reproduce, run on s390 (would work on other platforms, too, but would
      require a different filter name):
      - Run 'kvm_stat -d'
      - Press 'f'
      - Enter 'instruct'
      Notice that events like instruction_diag_44 or instruction_diag_500 are not
      displayed - the output remains empty.
      With this patch, we will filter by matching events and their parents.
      However, consider the following example where we filter by
      instruction_diag_44:
      
        kvm statistics - summary
                         regex filter: instruction_diag_44
         Event                                         Total %Total CurAvg/s
         exit_instruction                                276  100.0       12
           instruction_diag_44                           256   92.8       11
         Total                                           276              12
      
      Note that the parent ('exit_instruction') displays the total events, but
      the childs listed do not match its total (256 instead of 276). This is
      intended (since we're filtering all but one child), but might be confusing
      on first sight.
      
      Signed-off-by: default avatarStefan Raspl <raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      883d25e7
    • Thomas Huth's avatar
      KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard · c7957206
      Thomas Huth authored
      
      
      struct kvm_nested_state is only available on x86 so far. To be able
      to compile the code on other architectures as well, we need to wrap
      the related code with #ifdefs.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c7957206
    • Andrew Jones's avatar
      kvm: selftests: aarch64: compile with warnings on · 98e68344
      Andrew Jones authored
      
      
      aarch64 fixups needed to compile with warnings as errors.
      
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      98e68344
    • Andrew Jones's avatar
      kvm: selftests: aarch64: fix default vm mode · 55eda003
      Andrew Jones authored
      
      
      VM_MODE_P52V48_4K is not a valid mode for AArch64. Replace its
      use in vm_create_default() with a mode that works and represents
      a good AArch64 default. (We didn't ever see a problem with this
      because we don't have any unit tests using vm_create_default(),
      but it's good to get it fixed in advance.)
      
      Reported-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      55eda003