Skip to contentSkip to conversation

KVM patches (SMM implementation) for 2015-07-06

GIT PULL Paolo Bonzini 2 participants 4 messages Jul 6, 2015

lore
Share & tools
lore
#0 lore raw

The following changes since commit 7edd8e4660beb301d527257f8e04ebec0f841cb0:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-06 14:03:44 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream-smm

for you to fetch changes up to b90c5c82b7e723d7509b5dae8be9b74a4195a64a:

pc: add SMM property (2015-07-06 17:59:44 +0200)

----------------------------------------------------------------
This series implements KVM support for SMM, and lets you enable/disable it through the "smm" property of x86 machine types.

Achievement unlocked: send two pull requests the same day with a conflict between them.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
linux-headers: Update to 4.2-rc1

Andrew Jones (1):
kvm-all: put kvm_mem_flags to more work

Paolo Bonzini (11):
piix4/ich9: do not raise SMI on ACPI enable/disable commands
target-i386: add support for SMBASE MSR and SMIs
kvm-all: remove useless typedef
kvm-all: move internal types to kvm_int.h
kvm-all: make KVM's memory listener more generic
kvm-all: add support for multiple address spaces
kvm-all: kvm_irqchip_create is not expected to fail
target-i386: register a separate KVM address space including SMRAM regions
pc_piix: rename kvm_enabled to smm_enabled
ich9: add smm_enabled field and arguments
pc: add SMM property

 hw/acpi/ich9.c                                  |   5 +-
 hw/acpi/piix4.c                                 |  13 +-
 hw/i386/pc.c                                    |  51 +++++
 hw/i386/pc_piix.c                               |   7 +-
 hw/i386/pc_q35.c                                |   6 +-
 hw/isa/lpc_ich9.c                               |   9 +-
 include/hw/acpi/ich9.h                          |   3 +-
 include/hw/i386/ich9.h                          |   2 +-
 include/hw/i386/pc.h                            |   5 +-
 include/standard-headers/linux/input.h          |  10 +-
 include/standard-headers/linux/virtio_balloon.h |   1 +
 include/standard-headers/linux/virtio_gpu.h     |   2 +
 include/sysemu/kvm_int.h                        |  39 ++++
 kvm-all.c                                       | 243 ++++++++++++------------
 linux-headers/asm-x86/hyperv.h                  |  11 ++
 linux-headers/linux/kvm.h                       |   2 +-
 linux-headers/linux/vfio.h                      | 102 +++++++++-
 linux-headers/linux/virtio_pci.h                | 192 -------------------
 target-i386/cpu.h                               |   1 +
 target-i386/kvm.c                               | 146 ++++++++++++--
 20 files changed, 506 insertions(+), 344 deletions(-)
 create mode 100644 include/sysemu/kvm_int.h
 delete mode 100644 linux-headers/linux/virtio_pci.h
Signature · 1 line
1.8.3.1
#1 lore raw

[Qemu-devel] [PULL 03/13] target-i386: add support for SMBASE MSR and SMIs

Apart from the MSR, the smi field of struct kvm_vcpu_events has to be translated into the corresponding CPUX86State fields. Also, memory transaction flags depend on SMM state, so pull it from struct kvm_run on every exit from KVM to userspace.

---
 target-i386/cpu.h |   1 +
 target-i386/kvm.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 94 insertions(+), 12 deletions(-)
target-i386/cpu.h +1 -0
index 603aaf0..ac39291 100644
@@ -314,6 +314,7 @@
 
 #define MSR_P6_PERFCTR0                 0xc1
 
+#define MSR_IA32_SMBASE                 0x9e
 #define MSR_MTRRcap                     0xfe
 #define MSR_MTRRcap_VCNT                8
 #define MSR_MTRRcap_FIXRANGE_SUPPORT    (1 << 8)
target-i386/kvm.c +93 -12

183 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#2 lore raw
In reply to Paolo Bonzini
Quoted 11 lines · Paolo Bonzini

The following changes since commit 7edd8e4660beb301d527257f8e04ebec0f841cb0:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-07-06 14:03:44 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream-smm

for you to fetch changes up to b90c5c82b7e723d7509b5dae8be9b74a4195a64a:

Quoted 8 lines

pc: add SMM property (2015-07-06 17:59:44 +0200)

----------------------------------------------------------------
This series implements KVM support for SMM, and lets you enable/disable it through the "smm" property of x86 machine types.

Achievement unlocked: send two pull requests the same day with a conflict between them.

:-)

Quoted 1 line

----------------------------------------------------------------

I'm afraid this doesn't build on OSX or on ARM Linux (or likely any build host where x86 isn't a CONFIG_KVM build):

CC i386-softmmu/hw/i386/pc_piix.o
/Users/pm215/src/qemu/hw/i386/pc.c:1782:56: error: use of undeclared identifier

      'KVM_CAP_X86_SMM'
        smm_available = kvm_check_extension(kvm_state, KVM_CAP_X86_SMM);
                                                       ^

1 error generated.

Putting #ifdef CONFIG_KVM around the offending line fixes this; there may be a cleaner approach.

-- PMM

#3 lore raw
Quoted 5 lines · Peter Maydell

I'm afraid this doesn't build on OSX or on ARM Linux (or likely any build host where x86 isn't a CONFIG_KVM build):

CC i386-softmmu/hw/i386/pc_piix.o
/Users/pm215/src/qemu/hw/i386/pc.c:1782:56: error: use of undeclared identifier

Quoted 7 lines
      'KVM_CAP_X86_SMM'
        smm_available = kvm_check_extension(kvm_state, KVM_CAP_X86_SMM);
                                                       ^

1 error generated.

Putting #ifdef CONFIG_KVM around the offending line fixes this; there may be a cleaner approach.

Indeed the same file already does something cleaner for kvm_allows_irq0_override().

Paolo