1. 15 6月, 2019 3 次提交
  2. 14 6月, 2019 3 次提交
    • N
      powerpc/pseries: Fix oops in hotplug memory notifier · 0aa82c48
      Nathan Lynch 提交于
      During post-migration device tree updates, we can oops in
      pseries_update_drconf_memory() if the source device tree has an
      ibm,dynamic-memory-v2 property and the destination has a
      ibm,dynamic_memory (v1) property. The notifier processes an "update"
      for the ibm,dynamic-memory property but it's really an add in this
      scenario. So make sure the old property object is there before
      dereferencing it.
      
      Fixes: 2b31e3ae ("powerpc/drmem: Add support for ibm, dynamic-memory-v2 property")
      Cc: stable@vger.kernel.org # v4.16+
      Signed-off-by: NNathan Lynch <nathanl@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      0aa82c48
    • D
      powerpc/pseries/hvconsole: Fix stack overread via udbg · 934bda59
      Daniel Axtens 提交于
      While developing KASAN for 64-bit book3s, I hit the following stack
      over-read.
      
      It occurs because the hypercall to put characters onto the terminal
      takes 2 longs (128 bits/16 bytes) of characters at a time, and so
      hvc_put_chars() would unconditionally copy 16 bytes from the argument
      buffer, regardless of supplied length. However, udbg_hvc_putc() can
      call hvc_put_chars() with a single-byte buffer, leading to the error.
      
        ==================================================================
        BUG: KASAN: stack-out-of-bounds in hvc_put_chars+0xdc/0x110
        Read of size 8 at addr c0000000023e7a90 by task swapper/0
      
        CPU: 0 PID: 0 Comm: swapper Not tainted 5.2.0-rc2-next-20190528-02824-g048a6ab4835b #113
        Call Trace:
          dump_stack+0x104/0x154 (unreliable)
          print_address_description+0xa0/0x30c
          __kasan_report+0x20c/0x224
          kasan_report+0x18/0x30
          __asan_report_load8_noabort+0x24/0x40
          hvc_put_chars+0xdc/0x110
          hvterm_raw_put_chars+0x9c/0x110
          udbg_hvc_putc+0x154/0x200
          udbg_write+0xf0/0x240
          console_unlock+0x868/0xd30
          register_console+0x970/0xe90
          register_early_udbg_console+0xf8/0x114
          setup_arch+0x108/0x790
          start_kernel+0x104/0x784
          start_here_common+0x1c/0x534
      
        Memory state around the buggy address:
         c0000000023e7980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
         c0000000023e7a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
        >c0000000023e7a80: f1 f1 01 f2 f2 f2 00 00 00 00 00 00 00 00 00 00
                                 ^
         c0000000023e7b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
         c0000000023e7b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        ==================================================================
      
      Document that a 16-byte buffer is requred, and provide it in udbg.
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      934bda59
    • M
      ocxl: do not use C++ style comments in uapi header · 2305ff22
      Masahiro Yamada 提交于
      Linux kernel tolerates C++ style comments these days. Actually, the
      SPDX License tags for .c files start with //.
      
      On the other hand, uapi headers are written in more strict C, where
      the C++ comment style is forbidden.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NFrederic Barrat <fbarrat@linux.ibm.com>
      Acked-by: NAndrew Donnellan <ajd@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2305ff22
  3. 02 6月, 2019 6 次提交
    • G
      powerpc/pseries: Fix xive=off command line · a3bf9fbd
      Greg Kurz 提交于
      On POWER9, if the hypervisor supports XIVE exploitation mode, the
      guest OS will unconditionally requests for the XIVE interrupt mode
      even if XIVE was deactivated with the kernel command line xive=off.
      Later on, when the spapr XIVE init code handles xive=off, it disables
      XIVE and tries to fall back on the legacy mode XICS.
      
      This discrepency causes a kernel panic because the hypervisor is
      configured to provide the XIVE interrupt mode to the guest :
      
        kernel BUG at arch/powerpc/sysdev/xics/xics-common.c:135!
        ...
        NIP xics_smp_probe+0x38/0x98
        LR  xics_smp_probe+0x2c/0x98
        Call Trace:
          xics_smp_probe+0x2c/0x98 (unreliable)
          pSeries_smp_probe+0x40/0xa0
          smp_prepare_cpus+0x62c/0x6ec
          kernel_init_freeable+0x148/0x448
          kernel_init+0x2c/0x148
          ret_from_kernel_thread+0x5c/0x68
      
      Look for xive=off during prom_init and don't ask for XIVE in this
      case. One exception though: if the host only supports XIVE, we still
      want to boot so we ignore xive=off.
      
      Similarly, have the spapr XIVE init code to looking at the interrupt
      mode negotiated during CAS, and ignore xive=off if the hypervisor only
      supports XIVE.
      
      Fixes: eac1e731 ("powerpc/xive: guest exploitation of the XIVE interrupt controller")
      Cc: stable@vger.kernel.org # v4.20
      Reported-by: NPavithra R. Prakash <pavrampu@in.ibm.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a3bf9fbd
    • G
      powerpc/powernv/npu: Fix reference leak · 02c5f539
      Greg Kurz 提交于
      Since 902bdc57, get_pci_dev() calls pci_get_domain_bus_and_slot(). This
      has the effect of incrementing the reference count of the PCI device, as
      explained in drivers/pci/search.c:
      
       * Given a PCI domain, bus, and slot/function number, the desired PCI
       * device is located in the list of PCI devices. If the device is
       * found, its reference count is increased and this function returns a
       * pointer to its data structure.  The caller must decrement the
       * reference count by calling pci_dev_put().  If no device is found,
       * %NULL is returned.
      
      Nothing was done to call pci_dev_put() and the reference count of GPU and
      NPU PCI devices rockets up.
      
      A natural way to fix this would be to teach the callers about the change,
      so that they call pci_dev_put() when done with the pointer. This turns
      out to be quite intrusive, as it affects many paths in npu-dma.c,
      pci-ioda.c and vfio_pci_nvlink2.c. Also, the issue appeared in 4.16 and
      some affected code got moved around since then: it would be problematic
      to backport the fix to stable releases.
      
      All that code never cared for reference counting anyway. Call pci_dev_put()
      from get_pci_dev() to revert to the previous behavior.
      
      Fixes: 902bdc57 ("powerpc/powernv/idoa: Remove unnecessary pcidev from pci_dn")
      Cc: stable@vger.kernel.org # v4.16
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      02c5f539
    • M
      powerpc: Remove variable ‘path’ since not used · c806a6fd
      Mathieu Malaterre 提交于
      In commit eab00a20 ("powerpc: Move `path` variable inside
      DEBUG_PROM") DEBUG_PROM sentinels were added to silence a warning
      (treated as error with W=1):
      
        arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]
      
      Rework the original patch and simplify the code, by removing the
      variable ‘path’ completely. Fix line over 90 characters.
      Suggested-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NMathieu Malaterre <malat@debian.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c806a6fd
    • F
      powerpc/powernv: Show checkstop reason for NPU2 HMIs · 89d87bcb
      Frederic Barrat 提交于
      If the kernel is notified of an HMI caused by the NPU2, it's currently
      not being recognized and it logs the default message:
      
          Unknown Malfunction Alert of type 3
      
      The NPU on Power 9 has 3 Fault Isolation Registers, so that's a lot of
      possible causes, but we should at least log that it's an NPU problem
      and report which FIR and which bit were raised if opal gave us the
      information.
      Signed-off-by: NFrederic Barrat <fbarrat@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      89d87bcb
    • S
      powerpc/powernv: Update firmware archaeology around OPAL_HANDLE_HMI · 1549c42d
      Stewart Smith 提交于
      The first machines to ship with OPAL firmware all got firmware updates
      that have the new call, but just in case someone is foolish enough to
      believe the first 4 months of firmware is the best, we keep this code
      around.
      
      Comment is updated to not refer to late 2014 as recent or the future.
      Signed-off-by: NStewart Smith <stewart@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1549c42d
    • G
      powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() · efa9ace6
      Gen Zhang 提交于
      In dlpar_parse_cc_property(), 'prop->name' is allocated by kstrdup().
      kstrdup() may return NULL, so it should be checked and handle error.
      And prop should be freed if 'prop->name' is NULL.
      Signed-off-by: NGen Zhang <blackgod016574@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      efa9ace6
  4. 28 5月, 2019 4 次提交
  5. 27 5月, 2019 3 次提交
    • L
      Linux 5.2-rc2 · cd6c84d8
      Linus Torvalds 提交于
      cd6c84d8
    • L
      Merge tag 'trace-v5.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · c5b44095
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 862f0a32
      Linus Torvalds 提交于
      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
  6. 26 5月, 2019 6 次提交
  7. 25 5月, 2019 15 次提交
    • G
      ext4: fix dcache lookup of !casefolded directories · 66883da1
      Gabriel Krisman Bertazi 提交于
      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: NGabriel Krisman Bertazi <krisman@collabora.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      66883da1
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 2409207a
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block · 7fbc78e3
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'linux-kselftest-5.2-rc2' of... · 7f8b40e3
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'devicetree-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · e7bd3e24
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'spdx-5.2-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 86c2f5d6
      Linus Torvalds 提交于
      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
    • W
      locking/lock_events: Use this_cpu_add() when necessary · 51816e9e
      Waiman Long 提交于
      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: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NWaiman Long <longman@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      51816e9e
    • P
      KVM: x86: fix return value for reserved EFER · 66f61c92
      Paolo Bonzini 提交于
      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: NPavel 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: NPaolo Bonzini <pbonzini@redhat.com>
      66f61c92
    • S
      tools/kvm_stat: fix fields filter for child events · 883d25e7
      Stefan Raspl 提交于
      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: NStefan Raspl <raspl@linux.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      883d25e7
    • T
      KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard · c7957206
      Thomas Huth 提交于
      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: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c7957206
    • A
      kvm: selftests: aarch64: compile with warnings on · 98e68344
      Andrew Jones 提交于
      aarch64 fixups needed to compile with warnings as errors.
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      98e68344
    • A
      kvm: selftests: aarch64: fix default vm mode · 55eda003
      Andrew Jones 提交于
      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: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      55eda003
    • A
      kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size · bffed38d
      Andrew Jones 提交于
      The memory slot size must be aligned to the host's page size. When
      testing a guest with a 4k page size on a host with a 64k page size,
      then 3 guest pages are not host page size aligned. Since we just need
      a nearly arbitrary number of extra pages to ensure the memslot is not
      aligned to a 64 host-page boundary for this test, then we can use
      16, as that's 64k aligned, but not 64 * 64k aligned.
      
      Fixes: 76d58e0f ("KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size", 2019-04-17)
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      bffed38d
    • C
      KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION · 19ec166c
      Christian Borntraeger 提交于
      kselftests exposed a problem in the s390 handling for memory slots.
      Right now we only do proper memory slot handling for creation of new
      memory slots. Neither MOVE, nor DELETION are handled properly. Let us
      implement those.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      19ec166c
    • P
      KVM: x86/pmu: do not mask the value that is written to fixed PMUs · 2924b521
      Paolo Bonzini 提交于
      According to the SDM, for MSR_IA32_PERFCTR0/1 "the lower-order 32 bits of
      each MSR may be written with any value, and the high-order 8 bits are
      sign-extended according to the value of bit 31", but the fixed counters
      in real hardware are limited to the width of the fixed counters ("bits
      beyond the width of the fixed-function counter are reserved and must be
      written as zeros").  Fix KVM to do the same.
      Reported-by: NNadav Amit <nadav.amit@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2924b521