mirror_qemu/hw
Laszlo Ersek 50de920b37 hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg
Introduce the following fw_cfg files:

- "etc/smi/supported-features": a little endian uint64_t feature bitmap,
  presenting the features known by the host to the guest. Read-only for
  the guest.

  The content of this file will be determined via bit-granularity ICH9-LPC
  device properties, to be introduced later. For now, the bitmask is left
  zeroed. The bits will be set from machine type compat properties and on
  the QEMU command line, hence this file is not migrated.

- "etc/smi/requested-features": a little endian uint64_t feature bitmap,
  representing the features the guest would like to request. Read-write
  for the guest.

  The guest can freely (re)write this file, it has no direct consequence.
  Initial value is zero. A nonzero value causes the SMI-related fw_cfg
  files and fields that are under guest influence to be migrated.

- "etc/smi/features-ok": contains a uint8_t value, and it is read-only for
  the guest. When the guest selects the associated fw_cfg key, the guest
  features are validated against the host features. In case of error, the
  negotiation doesn't proceed, and the "features-ok" file remains zero. In
  case of success, the "features-ok" file becomes (uint8_t)1, and the
  negotiated features are locked down internally (to which no further
  changes are possible until reset).

  The initial value is zero.  A nonzero value causes the SMI-related
  fw_cfg files and fields that are under guest influence to be migrated.

The C-language fields backing the "supported-features" and
"requested-features" files are uint8_t arrays. This is because they carry
guest-side representation (our choice is little endian), while
VMSTATE_UINT64() assumes / implies host-side endianness for any uint64_t
fields. If we migrate a guest between hosts with different endiannesses
(which is possible with TCG), then the host-side value is preserved, and
the host-side representation is translated. This would be visible to the
guest through fw_cfg, unless we used plain byte arrays. So we do.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20170126014416.11211-2-lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-01-27 18:07:31 +01:00
..
9pfs This pull request fixes a 2.9 regression and a long standing bug that can 2017-01-25 17:54:14 +00:00
acpi machine: Make possible_cpu_arch_ids() return const pointer 2017-01-23 21:25:37 -02:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
arm virtio, vhost, pc: fixes, features 2017-01-20 14:05:44 +00:00
audio es1370: wire up reset via DeviceClass 2017-01-11 09:19:03 +01:00
block hw/block/m25p80: Fix typo in local macro name 2017-01-24 23:26:52 +03:00
bt char: replace avail_connections 2016-10-24 15:46:10 +02:00
char serial: fix memory leak in serial exit 2017-01-16 17:52:35 +01:00
core hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
cpu cpu: Abstract CPU core type 2016-06-17 16:33:48 +10:00
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
dma hw/dma/pl080: Fix bad bit mask (PL080_CONF_M1 | PL080_CONF_M1) 2016-10-17 19:22:17 +01:00
gpio i2c: Allow I2C devices to NAK start events 2017-01-09 11:40:20 +00:00
i2c arm: Uniquely name imx25 I2C buses. 2017-01-20 11:15:06 +00:00
i386 icount: update instruction counter on apic patching 2017-01-27 18:07:30 +01:00
ide atapi: classify read_cd as conditionally returning data 2016-11-14 11:15:54 -05:00
input gtk,vnc: misc bugfixes. 2017-01-10 14:52:34 +00:00
intc apic: save apic_delivered flag 2017-01-27 18:07:30 +01:00
ipack ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
ipmi ipmi: fix qemu crash while migrating with ipmi 2016-11-18 17:50:09 +02:00
isa hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg 2017-01-27 18:07:31 +01:00
lm32 fw-cfg: support writeable blobs 2017-01-18 22:59:53 +02:00
m68k m68k: QOMify the MCF Fast Ethernet Controller device 2017-01-20 10:36:38 +08:00
mem pc: memhp: enable nvdimm device hotplug 2016-11-01 19:21:09 +02:00
microblaze clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
mips clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
misc migration: disallow migrate_add_blocker during migration 2017-01-24 18:00:30 +00:00
moxie hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
net trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
nios2 nios2: Add Altera 10M50 GHRD emulation 2017-01-24 13:10:35 -08:00
nvram migration: extend VMStateInfo 2017-01-24 17:54:47 +00:00
openrisc hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
pci trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
pci-bridge PCI/migration merge vmstate_pci_device and vmstate_pcie_device 2017-01-24 18:00:31 +00:00
pci-host ppc: Make uninorth interrupt swizzling identical to Grackle 2016-11-23 12:00:48 +11:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
s390x hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
scsi trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
sd vmstateify ssi-sd 2016-09-22 18:13:08 +01:00
sh4 cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
smbios stubs: move smbios stubs to hw/smbios 2017-01-16 17:52:35 +01:00
sparc fw_cfg: move FW_CFG_NB_CPUS out of fw_cfg_init1() 2016-11-16 12:09:58 -02:00
sparc64 target-sparc: fix up niagara machine 2017-01-18 22:03:44 +01:00
ssi aspeed/smc: handle SPI flash Command mode 2017-01-20 11:15:08 +00:00
timer replay: don't use rtc clock on loadvm phase 2017-01-27 18:07:30 +01:00
tpm clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
tricore tricore: remove useless cast 2016-09-15 15:32:22 +03:00
unicore32 clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
usb trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
vfio vfio: remove a duplicated word in comments 2017-01-24 23:26:53 +03:00
virtio trivial patches for 2017-01-24 2017-01-25 10:42:26 +00:00
watchdog watchdog: 6300esb: add exit function 2016-12-22 16:00:23 +01:00
xen xen: create qdev for each backend device 2016-11-22 10:29:39 -08:00
xenpv xenpv: Fix qemu_uuid compiling error 2016-09-29 11:43:17 +08:00
xtensa target/xtensa: refactor CCOUNT/CCOMPARE 2017-01-15 13:01:55 -08:00
Makefile.objs acpi: filter based on CONFIG_ACPI_X86 rather than TARGET 2017-01-16 17:52:35 +01:00