qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 2654ac: kvm/i386: Set proper nested state for


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 2654ac: kvm/i386: Set proper nested state format for SVM
Date: Tue, 17 Nov 2020 03:09:12 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 2654ace151c07bd6519a7b71ab98d763137302eb
      
https://github.com/qemu/qemu/commit/2654ace151c07bd6519a7b71ab98d763137302eb
  Author: Tom Lendacky <thomas.lendacky@amd.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  -----------
  kvm/i386: Set proper nested state format for SVM

Currently, the nested state format is hardcoded to VMX. This will result
in kvm_put_nested_state() returning an error because the KVM SVM support
checks for the nested state to be KVM_STATE_NESTED_FORMAT_SVM. As a
result, kvm_arch_put_registers() errors out early.

Update the setting of the format based on the virtualization feature:
  VMX - KVM_STATE_NESTED_FORMAT_VMX
  SVM - KVM_STATE_NESTED_FORMAT_SVM

Also, fix the code formatting while at it.

Fixes: b16c0e20c7 ("KVM: add support for AMD nested live migration")
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: 
<fe53d00fe0d884e812960781284cd48ae9206acc.1605546140.git.thomas.lendacky@amd.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b430b51395650137a80e78ee7395165b80fe1752
      
https://github.com/qemu/qemu/commit/b430b51395650137a80e78ee7395165b80fe1752
  Author: David Hildenbrand <david@redhat.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M stubs/ram-block.c
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers.c: Use ram_block_discard_disable() in qemu_vfio_open_pci()

Currently, when using "nvme://" for a block device, like
    -drive file=nvme://0000:01:00.0/1,if=none,id=drive0 \
    -device virtio-blk,drive=drive0 \

VFIO may pin all guest memory, and discarding of RAM no longer works as
expected. I was able to reproduce this easily with my
    01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd
            NVMe SSD Controller SM981/PM981/PM983

Similar to common VFIO, we have to disable it, making sure that:
a) virtio-balloon won't discard any memory ("silently disabled")
b) virtio-mem and nvme:// run mutually exclusive

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20201116105947.9194-1-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 3b12a7fd39307017c8968b8d05986a63b33752b5
      
https://github.com/qemu/qemu/commit/3b12a7fd39307017c8968b8d05986a63b33752b5
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M hw/scsi/scsi-disk.c

  Log Message:
  -----------
  scsi-disk: convert more errno values back to SCSI statuses

Linux has some OS-specific (and sometimes weird) mappings for various SCSI
statuses and sense codes.  The most important is probably RESERVATION
CONFLICT.  Add them so that they can be reported back to the guest
kernel.

Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 42ccce19818e4e8fb55026f50b20d533cccc48f6
      
https://github.com/qemu/qemu/commit/42ccce19818e4e8fb55026f50b20d533cccc48f6
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M target/i386/helper.c

  Log Message:
  -----------
  target/i386: avoid theoretical leak on MCE injection

g_strdup_printf is used twice to write to the same variable, which
can theoretically cause a leak.  In practice, it is extremely
unlikely that a guest is seeing a recursive MCE and has disabled
CR4.MCE between the first and the second error, but we can fix it
and we can also make a slight improvement on the logic: CR4.MCE=0
causes a triple fault even for a non-recursive machine check, so
let's place its test first.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 1370d61ae3c9934861d2349349447605202f04e9
      
https://github.com/qemu/qemu/commit/1370d61ae3c9934861d2349349447605202f04e9
  Author: Zenghui Yu <yuzenghui@huawei.com>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M softmmu/memory.c

  Log Message:
  -----------
  memory: Skip dirty tracking for un-migratable memory regions

It makes no sense to track dirty pages for those un-migratable memory
regions (e.g., Memory BAR region of the VFIO PCI device) and doing so
will potentially lead to some unpleasant issues during migration [1].

Skip dirty tracking for those regions by evaluating if the region is
migratable before setting dirty_log_mask (DIRTY_MEMORY_MIGRATION).

[1] https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg03757.html

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Message-Id: <20201116132210.1730-1-yuzenghui@huawei.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: bce36c6c5436c0c2679b42c6de54de5393dfcf59
      
https://github.com/qemu/qemu/commit/bce36c6c5436c0c2679b42c6de54de5393dfcf59
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M hw/scsi/scsi-disk.c
    M softmmu/memory.c
    M stubs/ram-block.c
    M target/i386/helper.c
    M target/i386/kvm.c
    M util/vfio-helpers.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into 
staging

Bug fixes

# gpg: Signature made Mon 16 Nov 2020 18:22:51 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:
  memory: Skip dirty tracking for un-migratable memory regions
  target/i386: avoid theoretical leak on MCE injection
  scsi-disk: convert more errno values back to SCSI statuses
  util/vfio-helpers.c: Use ram_block_discard_disable() in qemu_vfio_open_pci()
  kvm/i386: Set proper nested state format for SVM

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/b17d3b7b77f0...bce36c6c5436



reply via email to

[Prev in Thread] Current Thread [Next in Thread]