21 Nov, 2020

1 commit

  • If there is only one keyslot, then blk_ksm_init() computes
    slot_hashtable_size=1 and log_slot_ht_size=0. This causes
    blk_ksm_find_keyslot() to crash later because it uses
    hash_ptr(key, log_slot_ht_size) to find the hash bucket containing the
    key, and hash_ptr() doesn't support the bits == 0 case.

    Fix this by making the hash table always have at least 2 buckets.

    Tested by running:

    kvm-xfstests -c ext4 -g encrypt -m inlinecrypt \
    -o blk-crypto-fallback.num_keyslots=1

    Fixes: 1b2628397058 ("block: Keyslot Manager for Inline Encryption")
    Signed-off-by: Eric Biggers
    Signed-off-by: Jens Axboe

    Eric Biggers
     

20 Nov, 2020

1 commit


16 Nov, 2020

1 commit

  • When requeueing all requests on the device request queue to the blocklayer
    we might get to an ERP (error recovery) request that is a copy of an
    original CQR.

    Those requests do not have blocklayer request information or a pointer to
    the dasd_queue set. When trying to access those data it will lead to a
    null pointer dereference in dasd_requeue_all_requests().

    Fix by checking if the request is an ERP request that can simply be
    ignored. The blocklayer request will be requeued by the original CQR that
    is on the device queue right behind the ERP request.

    Fixes: 9487cfd3430d ("s390/dasd: fix handling of internal requests")
    Cc: #4.16
    Signed-off-by: Stefan Haberland
    Reviewed-by: Jan Hoeppner
    Signed-off-by: Jens Axboe

    Stefan Haberland
     

15 Nov, 2020

1 commit


14 Nov, 2020

4 commits

  • xa_destroy() frees only internal data. The caller is responsible for
    freeing the exteranl objects referenced by an xarray.

    Fixes: 1cf7a12e09aa4 ("nvme: use an xarray to lookup the Commands Supported and Effects log")
    Signed-off-by: Keith Busch
    Signed-off-by: Christoph Hellwig

    Keith Busch
     
  • Remove the struct used for tracking known command effects logs in a
    list. This is now saved in an xarray that doesn't use these elements.
    Instead, store the log directly instead of the wrapper struct.

    Signed-off-by: Keith Busch
    Signed-off-by: Christoph Hellwig

    Keith Busch
     
  • If Doorbell Buffer Config command fails even 'dev->dbbuf_dbs != NULL'
    which means OACS indicates that NVME_CTRL_OACS_DBBUF_SUPP is set,
    nvme_dbbuf_update_and_check_event() will check event even it's not been
    successfully set.

    This patch fixes mismatch among dbbuf for sq/cqs in case that dbbuf
    command fails.

    Signed-off-by: Minwoo Im
    Signed-off-by: Christoph Hellwig

    Minwoo Im
     
  • For avoiding use-after-free on flush request, we call its .end_io() from
    both timeout code path and __blk_mq_end_request().

    When flush request's ref doesn't drop to zero, it is still used, we
    can't mark it as IDLE, so fix it by marking IDLE when its refcount drops
    to zero really.

    Fixes: 65ff5cd04551 ("blk-mq: mark flush request as IDLE in flush_end_io()")
    Signed-off-by: Ming Lei
    Cc: Yi Zhang
    Signed-off-by: Jens Axboe

    Ming Lei
     

13 Nov, 2020

2 commits

  • Commit 716ad0986cbd ("loop: Switch to set_capacity_revalidate_and_notify")
    causes an occasional drop of loop device uevent, which are no longer
    triggered in loop_set_size() but in a different part of code.

    Bug is reproducible with LTP test uevent01 [1]:

    i=0; while true; do
    i=$((i+1)); echo "== $i =="
    lsmod |grep -q loop && rmmod -f loop
    ./uevent01 || break
    done

    Put back triggering through code called in loop_set_size().

    Fix required to add yet another parameter to
    set_capacity_revalidate_and_notify().

    [1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/uevents/uevent01.c

    [hch: rebased on a different change to the prototype of
    set_capacity_revalidate_and_notify]

    Cc: stable@vger.kernel.org # v5.9
    Fixes: 716ad0986cbd ("loop: Switch to set_capacity_revalidate_and_notify")
    Reported-by:
    Signed-off-by: Petr Vorel
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Petr Vorel
     
  • Return if the function ended up sending an uevent or not.

    Cc: stable@vger.kernel.org # v5.9
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Petr Vorel
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

10 Nov, 2020

3 commits


07 Nov, 2020

1 commit

  • Commit aa1c09cb65e2 ("null_blk: Fix locking in zoned mode") changed
    zone locking to using the potentially sleeping wait_on_bit_io()
    function. This is acceptable when memory backing is enabled as the
    device queue is in that case marked as blocking, but this triggers a
    scheduling while in atomic context with memory backing disabled.

    Fix this by relying solely on the device zone spinlock for zone
    information protection without temporarily releasing this lock around
    null_process_cmd() execution in null_zone_write(). This is OK to do
    since when memory backing is disabled, command processing does not
    block and the memory backing lock nullb->lock is unused. This solution
    avoids the overhead of having to mark a zoned null_blk device queue as
    blocking when memory backing is unused.

    This patch also adds comments to the zone locking code to explain the
    unusual locking scheme.

    Fixes: aa1c09cb65e2 ("null_blk: Fix locking in zoned mode")
    Reported-by: kernel test robot
    Signed-off-by: Damien Le Moal
    Reviewed-by: Christoph Hellwig
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Damien Le Moal
     

05 Nov, 2020

1 commit

  • Pull NVMe fixes from Christoph:

    "nvme fixes for 5.10:

    - revert a nvme_queue size optimization (Keith Bush)
    - fabrics timeout races fixes (Chao Leng and Sagi Grimberg)"

    * tag 'nvme-5.10-2020-11-05' of git://git.infradead.org/nvme:
    nvme-tcp: avoid repeated request completion
    nvme-rdma: avoid repeated request completion
    nvme-tcp: avoid race between time out and tear down
    nvme-rdma: avoid race between time out and tear down
    nvme: introduce nvme_sync_io_queues
    Revert "nvme-pci: remove last_sq_tail"

    Jens Axboe
     

03 Nov, 2020

6 commits

  • The request may be executed asynchronously, and rq->state may be
    changed to IDLE. To avoid repeated request completion, only
    MQ_RQ_COMPLETE of rq->state is checked in nvme_tcp_complete_timed_out.
    It is not safe, so need adding check IDLE for rq->state.

    Signed-off-by: Sagi Grimberg
    Signed-off-by: Chao Leng
    Signed-off-by: Christoph Hellwig

    Sagi Grimberg
     
  • The request may be executed asynchronously, and rq->state may be
    changed to IDLE. To avoid repeated request completion, only
    MQ_RQ_COMPLETE of rq->state is checked in nvme_rdma_complete_timed_out.
    It is not safe, so need adding check IDLE for rq->state.

    Signed-off-by: Sagi Grimberg
    Signed-off-by: Chao Leng
    Signed-off-by: Christoph Hellwig

    Sagi Grimberg
     
  • Now use teardown_lock to serialize for time out and tear down. This may
    cause abnormal: first cancel all request in tear down, then time out may
    complete the request again, but the request may already be freed or
    restarted.

    To avoid race between time out and tear down, in tear down process,
    first we quiesce the queue, and then delete the timer and cancel
    the time out work for the queue. At the same time we need to delete
    teardown_lock.

    Signed-off-by: Chao Leng
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Christoph Hellwig

    Chao Leng
     
  • Now use teardown_lock to serialize for time out and tear down. This may
    cause abnormal: first cancel all request in tear down, then time out may
    complete the request again, but the request may already be freed or
    restarted.

    To avoid race between time out and tear down, in tear down process,
    first we quiesce the queue, and then delete the timer and cancel
    the time out work for the queue. At the same time we need to delete
    teardown_lock.

    Signed-off-by: Chao Leng
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Christoph Hellwig

    Chao Leng
     
  • Introduce sync io queues for some scenarios which just only need sync
    io queues not sync all queues.

    Signed-off-by: Chao Leng
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Christoph Hellwig

    Chao Leng
     
  • Multiple CPUs may be mapped to the same hctx, allowing mulitple
    submission contexts to attempt commit_rqs(). We need to verify we're
    not writing the same doorbell value multiple times since that's a spec
    violation.

    Revert commit 54b2fcee1db041a83b52b51752dade6090cf952f.

    Link: https://bugzilla.redhat.com/show_bug.cgi?id=1878596
    Reported-by: "B.L. Jones"
    Signed-off-by: Keith Busch

    Keith Busch
     

02 Nov, 2020

11 commits

  • Linus Torvalds
     
  • Pull x86 fixes from Thomas Gleixner:
    "Three fixes all related to #DB:

    - Handle the BTF bit correctly so it doesn't get lost due to a kernel
    #DB

    - Only clear and set the virtual DR6 value used by ptrace on user
    space triggered #DB. A kernel #DB must leave it alone to ensure
    data consistency for ptrace.

    - Make the bitmasking of the virtual DR6 storage correct so it does
    not lose DR_STEP"

    * tag 'x86-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/debug: Fix DR_STEP vs ptrace_get_debugreg(6)
    x86/debug: Only clear/set ->virtual_dr6 for userspace #DB
    x86/debug: Fix BTF handling

    Linus Torvalds
     
  • Pull timer fixes from Thomas Gleixner:
    "A few fixes for timers/timekeeping:

    - Prevent undefined behaviour in the timespec64_to_ns() conversion
    which is used for converting user supplied time input to
    nanoseconds. It lacked overflow protection.

    - Mark sched_clock_read_begin/retry() to prevent recursion in the
    tracer

    - Remove unused debug functions in the hrtimer and timerlist code"

    * tag 'timers-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    time: Prevent undefined behaviour in timespec64_to_ns()
    timers: Remove unused inline funtion debug_timer_free()
    hrtimer: Remove unused inline function debug_hrtimer_free()
    time/sched_clock: Mark sched_clock_read_begin/retry() as notrace

    Linus Torvalds
     
  • Pull smp fix from Thomas Gleixner:
    "A single fix for stop machine.

    Mark functions no trace to prevent a crash caused by recursion when
    enabling or disabling a tracer on RISC-V (probably all architectures
    which patch through stop machine)"

    * tag 'smp-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    stop_machine, rcu: Mark functions as notrace

    Linus Torvalds
     
  • Pull locking fixes from Thomas Gleixner:
    "A couple of locking fixes:

    - Fix incorrect failure injection handling in the fuxtex code

    - Prevent a preemption warning in lockdep when tracking
    local_irq_enable() and interrupts are already enabled

    - Remove more raw_cpu_read() usage from lockdep which causes state
    corruption on !X86 architectures.

    - Make the nr_unused_locks accounting in lockdep correct again"

    * tag 'locking-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    lockdep: Fix nr_unused_locks accounting
    locking/lockdep: Remove more raw_cpu_read() usage
    futex: Fix incorrect should_fail_futex() handling
    lockdep: Fix preemption WARN for spurious IRQ-enable

    Linus Torvalds
     
  • Pull char/misc fixes/removals from Greg KH:
    "Here's some small fixes for 5.10-rc2 and a big driver removal.

    The fixes are for some reported issues in the interconnect and
    coresight drivers, nothing major.

    The "big" driver removal is the MIC drivers have been asked to be
    removed as the hardware never shipped and Intel no longer wants to
    maintain something that no one can use. This is welcomed by many as
    the DMA usage of these drivers was "interesting" and the security
    people were starting to question some issues that were starting to be
    found in the codebase.

    Note, one of the subsystems for this driver, the "VOP" code, will
    probably come back in future kernel versions as it was looking to
    potentially solve some PCIe virtualization issues that a number of
    other vendors were wanting to solve. But as-is, this codebase didn't
    work for anyone else so no actual functionality is being removed.

    All of these have been in linux-next with no reported issues"

    * tag 'char-misc-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    coresight: cti: Initialize dynamic sysfs attributes
    coresight: Fix uninitialised pointer bug in etm_setup_aux()
    coresight: add module license
    misc: mic: remove the MIC drivers
    interconnect: qcom: use icc_sync state for sm8[12]50
    interconnect: qcom: Ensure that the floor bandwidth value is enforced
    interconnect: qcom: sc7180: Init BCMs before creating the nodes
    interconnect: qcom: sdm845: Init BCMs before creating the nodes
    interconnect: Aggregate before setting initial bandwidth
    interconnect: qcom: sdm845: Enable keepalive for the MM1 BCM

    Linus Torvalds
     
  • Pull driver core and documentation fixes from Greg KH:
    "Here is one tiny debugfs change to fix up an API where the last user
    was successfully fixed up in 5.10-rc1 (so it couldn't be merged
    earlier), and a much larger Documentation/ABI/ update to the files so
    they can be automatically parsed by our tools.

    The Documentation/ABI/ updates are just formatting issues, small ones
    to bring the files into parsable format, and have been acked by
    numerous subsystem maintainers and the documentation maintainer. I
    figured it was good to get this into 5.10-rc2 to help wih the merge
    issues that would arise if these were to stick in linux-next until
    5.11-rc1.

    The debugfs change has been in linux-next for a long time, and the
    Documentation updates only for the last linux-next release"

    * tag 'driver-core-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (40 commits)
    scripts: get_abi.pl: assume ReST format by default
    docs: ABI: sysfs-class-led-trigger-pattern: remove hw_pattern duplication
    docs: ABI: sysfs-class-backlight: unify ABI documentation
    docs: ABI: sysfs-c2port: remove a duplicated entry
    docs: ABI: sysfs-class-power: unify duplicated properties
    docs: ABI: unify /sys/class/leds//brightness documentation
    docs: ABI: stable: remove a duplicated documentation
    docs: ABI: change read/write attributes
    docs: ABI: cleanup several ABI documents
    docs: ABI: sysfs-bus-nvdimm: use the right format for ABI
    docs: ABI: vdso: use the right format for ABI
    docs: ABI: fix syntax to be parsed using ReST notation
    docs: ABI: convert testing/configfs-acpi to ReST
    docs: Kconfig/Makefile: add a check for broken ABI files
    docs: abi-testing.rst: enable --rst-sources when building docs
    docs: ABI: don't escape ReST-incompatible chars from obsolete and removed
    docs: ABI: create a 2-depth index for ABI
    docs: ABI: make it parse ABI/stable as ReST-compatible files
    docs: ABI: sysfs-uevent: make it compatible with ReST output
    docs: ABI: testing: make the files compatible with ReST output
    ...

    Linus Torvalds
     
  • Pull staging driver fixes from Greg KH:
    "Here are some small staging driver fixes for issues that have been
    reported in 5.10-rc1:

    - octeon driver fixes

    - wfx driver fixes

    - memory leak fix in vchiq driver

    - fieldbus driver bugfix

    - comedi driver bugfix

    All of these have been in linux-next with no reported issues"

    * tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    staging: fieldbus: anybuss: jump to correct label in an error path
    staging: wfx: fix test on return value of gpiod_get_value()
    staging: wfx: fix use of uninitialized pointer
    staging: mmal-vchiq: Fix memory leak for vchiq_instance
    staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
    staging: octeon: Drop on uncorrectable alignment or FCS error
    staging: octeon: repair "fixed-link" support

    Linus Torvalds
     
  • Pull tty/serial fixes from Greg KH:
    "Here are some small TTY and Serial driver fixes for reported issues
    for 5.10-rc2. They include:

    - vt ioctl bugfix for reported problems

    - fsl_lpuart serial driver fix

    - 21285 serial driver bugfix

    All have been in linux-next with no reported issues"

    * tag 'tty-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    vt_ioctl: fix GIO_UNIMAP regression
    vt: keyboard, extend func_buf_lock to readers
    vt: keyboard, simplify vt_kdgkbsent
    tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A
    tty: serial: 21285: fix lockup on open

    Linus Torvalds
     
  • Pull USB driver fixes from Greg KH:
    "Here are a number of small bugfixes for reported issues in some USB
    drivers. They include:

    - typec bugfixes

    - xhci bugfixes and lockdep warning fixes

    - cdc-acm driver regression fix

    - kernel doc fixes

    - cdns3 driver bugfixes for a bunch of reported issues

    - other tiny USB driver fixes

    All have been in linux-next with no reported issues"

    * tag 'usb-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    usb: cdns3: gadget: own the lock wrongly at the suspend routine
    usb: cdns3: Fix on-chip memory overflow issue
    usb: cdns3: gadget: suspicious implicit sign extension
    xhci: Don't create stream debugfs files with spinlock held.
    usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
    xhci: Fix sizeof() mismatch
    usb: typec: stusb160x: fix signedness comparison issue with enum variables
    usb: typec: add missing MODULE_DEVICE_TABLE() to stusb160x
    USB: apple-mfi-fastcharge: don't probe unhandled devices
    usbcore: Check both id_table and match() when both available
    usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
    usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
    usb: typec: tcpm: reset hard_reset_count for any disconnect
    usb: cdc-acm: fix cooldown mechanism
    usb: host: fsl-mph-dr-of: check return of dma_set_mask()
    usb: fix kernel-doc markups
    usb: typec: stusb160x: fix some signedness bugs
    usb: cdns3: Variable 'length' set but not used

    Linus Torvalds
     
  • Pull kvm fixes from Paolo Bonzini:
    "ARM:
    - selftest fix
    - force PTE mapping on device pages provided via VFIO
    - fix detection of cacheable mapping at S2
    - fallback to PMD/PTE mappings for composite huge pages
    - fix accounting of Stage-2 PGD allocation
    - fix AArch32 handling of some of the debug registers
    - simplify host HYP entry
    - fix stray pointer conversion on nVHE TLB invalidation
    - fix initialization of the nVHE code
    - simplify handling of capabilities exposed to HYP
    - nuke VCPUs caught using a forbidden AArch32 EL0

    x86:
    - new nested virtualization selftest
    - miscellaneous fixes
    - make W=1 fixes
    - reserve new CPUID bit in the KVM leaves"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: vmx: remove unused variable
    KVM: selftests: Don't require THP to run tests
    KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again
    KVM: selftests: test behavior of unmapped L2 APIC-access address
    KVM: x86: Fix NULL dereference at kvm_msr_ignored_check()
    KVM: x86: replace static const variables with macros
    KVM: arm64: Handle Asymmetric AArch32 systems
    arm64: cpufeature: upgrade hyp caps to final
    arm64: cpufeature: reorder cpus_have_{const, final}_cap()
    KVM: arm64: Factor out is_{vhe,nvhe}_hyp_code()
    KVM: arm64: Force PTE mapping on fault resulting in a device mapping
    KVM: arm64: Use fallback mapping sizes for contiguous huge page sizes
    KVM: arm64: Fix masks in stage2_pte_cacheable()
    KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
    KVM: arm64: Allocate stage-2 pgd pages with GFP_KERNEL_ACCOUNT
    KVM: arm64: Drop useless PAN setting on host EL1 to EL2 transition
    KVM: arm64: Remove leftover kern_hyp_va() in nVHE TLB invalidation
    KVM: arm64: Don't corrupt tpidr_el2 on failed HVC call
    x86/kvm: Reserve KVM_FEATURE_MSI_EXT_DEST_ID

    Linus Torvalds
     

01 Nov, 2020

4 commits

  • Pull vhost fixes from Michael Tsirkin:
    "Fixes all over the place.

    A new UAPI is borderline: can also be considered a new feature but
    also seems to be the only way we could come up with to fix addressing
    for userspace - and it seems important to switch to it now before
    userspace making assumptions about addressing ability of devices is
    set in stone"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    vdpasim: allow to assign a MAC address
    vdpasim: fix MAC address configuration
    vdpa: handle irq bypass register failure case
    vdpa_sim: Fix DMA mask
    Revert "vhost-vdpa: fix page pinning leakage in error path"
    vdpa/mlx5: Fix error return in map_direct_mr()
    vhost_vdpa: Return -EFAULT if copy_from_user() fails
    vdpa_sim: implement get_iova_range()
    vhost: vdpa: report iova range
    vdpa: introduce config op to get valid iova range

    Linus Torvalds
     
  • …linux/kernel/git/gustavoars/linux

    Pull more flexible-array member conversions from Gustavo A. R. Silva:
    "Replace zero-length arrays with flexible-array members"

    * tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
    printk: ringbuffer: Replace zero-length array with flexible-array member
    net/smc: Replace zero-length array with flexible-array member
    net/mlx5: Replace zero-length array with flexible-array member
    mei: hw: Replace zero-length array with flexible-array member
    gve: Replace zero-length array with flexible-array member
    Bluetooth: btintel: Replace zero-length array with flexible-array member
    scsi: target: tcmu: Replace zero-length array with flexible-array member
    ima: Replace zero-length array with flexible-array member
    enetc: Replace zero-length array with flexible-array member
    fs: Replace zero-length array with flexible-array member
    Bluetooth: Replace zero-length array with flexible-array member
    params: Replace zero-length array with flexible-array member
    tracepoint: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_proto: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_commands: Replace zero-length array with flexible-array member
    mailbox: zynqmp-ipi-message: Replace zero-length array with flexible-array member
    dmaengine: ti-cppi5: Replace zero-length array with flexible-array member

    Linus Torvalds
     
  • Pull dma-mapping fix from Christoph Hellwig:
    "Fix an integer overflow on 32-bit platforms in the new DMA range code
    (Geert Uytterhoeven)"

    * tag 'dma-mapping-5.10-2' of git://git.infradead.org/users/hch/dma-mapping:
    dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "Four driver fixes and one core fix.

    The core fix closes a race window where we could kick off a second
    asynchronous scan because the test and set of the variable preventing
    it isn't atomic"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: hisi_sas: Stop using queue #0 always for v2 hw
    scsi: ibmvscsi: Fix potential race after loss of transport
    scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
    scsi: qla2xxx: Return EBUSY on fcport deletion
    scsi: core: Don't start concurrent async scan on same host

    Linus Torvalds
     

31 Oct, 2020

4 commits

  • Reported-by: kernel test robot
    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     
  • Unless we want to test with THP, then we shouldn't require it to be
    configured by the host kernel. Unfortunately, even advising with
    MADV_NOHUGEPAGE does require it, so check for THP first in order
    to avoid madvise failing with EINVAL.

    Signed-off-by: Andrew Jones
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Andrew Jones
     
  • It was noticed that evmcs_sanitize_exec_ctrls() is not being executed
    nowadays despite the code checking 'enable_evmcs' static key looking
    correct. Turns out, static key magic doesn't work in '__init' section
    (and it is unclear when things changed) but setup_vmcs_config() is called
    only once per CPU so we don't really need it to. Switch to checking
    'enlightened_vmcs' instead, it is supposed to be in sync with
    'enable_evmcs'.

    Opportunistically make evmcs_sanitize_exec_ctrls '__init' and drop unneeded
    extra newline from it.

    Reported-by: Yang Weijiang
    Signed-off-by: Vitaly Kuznetsov
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Vitaly Kuznetsov
     
  • Add a regression test for commit 671ddc700fd0 ("KVM: nVMX: Don't leak
    L1 MMIO regions to L2").

    First, check to see that an L2 guest can be launched with a valid
    APIC-access address that is backed by a page of L1 physical memory.

    Next, set the APIC-access address to a (valid) L1 physical address
    that is not backed by memory. KVM can't handle this situation, so
    resuming L2 should result in a KVM exit for internal error
    (emulation).

    Signed-off-by: Jim Mattson
    Reviewed-by: Ricardo Koller
    Reviewed-by: Peter Shier
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Jim Mattson