qemu-e2k/hw/pci-host
Igor Mammedov f404220e27 q35: implement 128K SMRAM at default SMBASE address
It's not what real HW does, implementing which would be overkill [**]
and would require complex cross stack changes (QEMU+firmware) to make
it work.
So considering that SMRAM is owned by MCH, for simplicity (ab)use
reserved Q35 register, which allows QEMU and firmware easily init
and make RAM at SMBASE available only from SMM context.

Patch uses commit (2f295167e0 q35/mch: implement extended TSEG sizes)
for inspiration and uses reserved register in config space at 0x9c
offset [*] to extend q35 pci-host with ability to use 128K at
0x30000 as SMRAM and hide it (like TSEG) from non-SMM context.

Usage:
  1: write 0xff in the register
  2: if the feature is supported, follow up read from the register
     should return 0x01. At this point RAM at 0x30000 is still
     available for SMI handler configuration from non-SMM context
  3: writing 0x02 in the register, locks SMBASE area, making its contents
     available only from SMM context. In non-SMM context, reads return
     0xff and writes are ignored. Further writes into the register are
     ignored until the system reset.

*) https://www.mail-archive.com/qemu-devel@nongnu.org/msg455991.html
**) https://www.mail-archive.com/qemu-devel@nongnu.org/msg646965.html

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1575896942-331151-3-git-send-email-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2020-01-22 00:23:07 -05:00
..
Kconfig hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge 2019-12-18 02:34:12 +01:00
Makefile.objs hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge 2019-12-18 02:34:12 +01:00
bonito.c hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
designware.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
gpex.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
grackle.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
i440fx.c hw/pci-host/i440fx: Extract the IGD passthrough host bridge device 2019-12-18 02:34:12 +01:00
pam.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
ppce500.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
prep.c hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
q35.c q35: implement 128K SMRAM at default SMBASE address 2020-01-22 00:23:07 -05:00
sabre.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
uninorth.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
versatile.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
xen_igd_pt.c hw/pci-host/i440fx: Extract the IGD passthrough host bridge device 2019-12-18 02:34:12 +01:00
xilinx-pcie.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00