Re: [RFC] virt/acpi: set PSCI flag even when psci_conduit is disabled

2020-07-03 Thread Heyi Guo
在 2020/7/3 下午6:37, Peter Maydell 写道: On Fri, 3 Jul 2020 at 10:44, Heyi Guo wrote: vms->psci_conduit being disabled only means PSCI is not implemented by qemu; it doesn't mean PSCI is not supported on this virtual machine. Actually vms->psci_conduit is set to disabled when vms-&

[RFC] virt/acpi: set PSCI flag even when psci_conduit is disabled

2020-07-03 Thread Heyi Guo
re, which will definitely provide PSCI. The issue can be reproduced when running qemu in TCG mode with secure enabled, while using ARM trusted firmware + qemu virt UEFI as firmware binaries, and we can see secondary cores will not be waken up. Signed-off-by: Heyi Guo --- Cc: Shannon Zhao Cc: "Mich

Re: [PATCH v4 0/2] add new options to set smbios type 4 fields

2020-03-19 Thread Heyi Guo
On 2020/3/19 22:46, Igor Mammedov wrote: On Wed, 18 Mar 2020 14:48:18 +0800 Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU speed to their users. Normally these information can be fetched from host smbios. it's

[PATCH v4 0/2] add new options to set smbios type 4 fields

2020-03-18 Thread Heyi Guo
be 0 instead of 2000 in previous versions - Use uint64_t type to check value overflow - Add test case to check smbios type 4 CPU speed Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Philippe Mathieu-Daudé Cc: Thomas Huth Cc: Laurent Vivier Cc: Paolo Bonzini Heyi Guo (2): hw/smbios:

[PATCH v4 1/2] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-18 Thread Heyi Guo
ly for the max speed and current speed of processor, for "max speed" identifies a capability of the system, and "current speed" identifies the processor's speed at boot (see smbios spec), but some applications do not tell the differences. Signed-off-by: Heyi Guo --- Cc: "Michael

[PATCH v4 2/2] tests/bios-tables-test: add smbios cpu speed test

2020-03-18 Thread Heyi Guo
t doesn't really run on aarch64 platform for smbios test can't run on uefi only platform yet. Signed-off-by: Heyi Guo --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Thomas Huth Cc: Laurent Vivier Cc: Paolo Bonzini --- tests/qtest/bios-tables-test.c | 42

Re: [PATCH v3] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-03 Thread Heyi Guo
On 2020/3/3 16:33, Igor Mammedov wrote: On Tue, 3 Mar 2020 11:18:56 +0800 Heyi Guo wrote: One comment from myself after going through the code... On 2020/3/3 9:01, Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU

Re: [PATCH v3] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-02 Thread Heyi Guo
One comment from myself after going through the code... On 2020/3/3 9:01, Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU speed to their users. Normally these information can be fetched from host smbios. Strictly

Re: [PATCH v2] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-02 Thread Heyi Guo
On 2020/3/2 21:52, Igor Mammedov wrote: On Mon, 2 Mar 2020 17:29:10 +0800 Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU speed to their users. Normally these information can be fetched from host smbios. Strictly

[PATCH v3] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-02 Thread Heyi Guo
ly for the max speed and current speed of processor, for "max speed" identifies a capability of the system, and "current speed" identifies the processor's speed at boot (see smbios spec), but some applications do not tell the differences. Signed-off-by: Heyi Guo Reviewed-by: Igor Mam

[PATCH v2] hw/smbios: add options for type 4 max-speed and current-speed

2020-03-02 Thread Heyi Guo
ly for the max speed and current speed of processor, for "max speed" identifies a capability of the system, and "current speed" identifies the processor's speed at boot (see smbios spec), but some applications do not tell the differences. Signed-off-by: Heyi Guo --- Cc: "Michael

Re: [PATCH] hw/smbios: add options for type 4 max_speed and current_speed

2020-03-02 Thread Heyi Guo
On 2020/3/2 16:20, Igor Mammedov wrote: On Sat, 29 Feb 2020 08:17:48 +0800 Heyi Guo wrote: Hi Igor, On 2020/2/28 17:39, Igor Mammedov wrote: On Thu, 27 Feb 2020 17:12:21 +0800 Heyi Guo wrote: On 2020/2/25 17:24, Philippe Mathieu-Daudé wrote: On 2/25/20 8:50 AM, Heyi Guo wrote

Re: [PATCH] hw/smbios: add options for type 4 max_speed and current_speed

2020-02-28 Thread Heyi Guo
Hi Igor, On 2020/2/28 17:39, Igor Mammedov wrote: On Thu, 27 Feb 2020 17:12:21 +0800 Heyi Guo wrote: On 2020/2/25 17:24, Philippe Mathieu-Daudé wrote: On 2/25/20 8:50 AM, Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors

Re: [PATCH] hw/smbios: add options for type 4 max_speed and current_speed

2020-02-27 Thread Heyi Guo
On 2020/2/25 17:24, Philippe Mathieu-Daudé wrote: On 2/25/20 8:50 AM, Heyi Guo wrote: Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU speed to their users. Normally these information can be fetched from host smbios. Strictly

[PATCH] hw/smbios: add options for type 4 max_speed and current_speed

2020-02-24 Thread Heyi Guo
ly for the max speed and current speed of processor, for "max speed" identifies a capability of the system, and "current speed" identifies the processor's speed at boot (see smbios spec), but some applications do not tell the differences. Signed-off-by: Heyi Guo --- Cc: "Michael S

Re: [PATCH v3 0/7] Some cleanup in arm/virt/acpi

2020-02-09 Thread Heyi Guo
Hi Peter, Do you have any other comments? If not, could you help to merge into your tree? Thanks, Heyi On 2020/2/4 9:43, Heyi Guo wrote: Remove conflict _ADR objects, and fix and refine PCI device definition in ACPI/DSDT. History: v3 -> v2: - update commit message for patch 4/7. - rem

Re: [RFC v2 00/14] Add SDEI support for arm64

2020-02-07 Thread Heyi Guo
On 2020/2/7 18:52, James Morse wrote: Hi guys, On 06/02/2020 17:30, Marc Zyngier wrote: On 2020-02-06 01:20, Heyi Guo wrote: On 2020/2/5 21:15, Marc Zyngier wrote: My concern is that SDEI implies having EL3. EL3 not being virtualizable with KVM, you end-up baking SDEI in *hardware

Re: [RFC v2 00/14] Add SDEI support for arm64

2020-02-07 Thread Heyi Guo
On 2020/2/7 1:30, Marc Zyngier wrote: On 2020-02-06 01:20, Heyi Guo wrote: Hi Marc, On 2020/2/5 21:15, Marc Zyngier wrote: Hi Heyi, On 2020-02-04 08:26, Heyi Guo wrote: Update Marc's email address. +cc Gavin as he is posting a RFC for ARM NMI. Hi Marc, Really sorry for missing

Re: [RFC v2 00/14] Add SDEI support for arm64

2020-02-05 Thread Heyi Guo
Hi Marc, On 2020/2/5 21:15, Marc Zyngier wrote: Hi Heyi, On 2020-02-04 08:26, Heyi Guo wrote: Update Marc's email address. +cc Gavin as he is posting a RFC for ARM NMI. Hi Marc, Really sorry for missing to update your email address, for the initial topic was raised long time ago and I

Re: [RFC v2 00/14] Add SDEI support for arm64

2020-02-04 Thread Heyi Guo
e existing firmware directly, but how can we achieve that? Either I don't think it is good to modify the firmware code too much, for firmware should be kept simple and reliable. Does James or Marc have any idea? Thanks, Heyi 在 2019/12/20 21:44, Peter Maydell 写道: On Tue, 5 Nov 2019 at 09:12, Heyi

[PATCH v3 1/7] bios-tables-test: prepare to change ARM virt ACPI DSDT

2020-02-03 Thread Heyi Guo
We are going to change ARM virt ACPI DSDT table, which will cause make check to fail, so temporarily add related golden masters to ignore list. Signed-off-by: Heyi Guo Reviewed-by: Michael S. Tsirkin --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao

[PATCH v3 2/7] arm/virt/acpi: remove meaningless sub device "RP0" from PCI0

2020-02-03 Thread Heyi Guo
The sub device "RP0" under PCI0 in ACPI/DSDT does not contain any method or property other than "_ADR", so it is safe to remove it. Signed-off-by: Heyi Guo Acked-by: "Michael S. Tsirkin" --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: I

[PATCH v3 3/7] arm/virt/acpi: remove _ADR from devices identified by _HID

2020-02-03 Thread Heyi Guo
343: A device object must contain either an _HID object or an _ADR object, but should not contain both. (https://uefi.org/sites/default/files/resources/ACPI_6_3_May16.pdf) Signed-off-by: Heyi Guo Acked-by: Igor Mammedov Acked-by: Michael S. Tsirkin --- Cc: Shannon Zhao Cc: Peter Maydell Cc

[PATCH v3 6/7] arm/acpi: simplify the description of PCI _CRS

2020-02-03 Thread Heyi Guo
Signed-off-by: Heyi Guo Reviewed-by: Michael S. Tsirkin --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt-acpi-build.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/virt-a

[PATCH v3 4/7] arm/acpi: fix PCI _PRT definition

2020-02-03 Thread Heyi Guo
) instead. Signed-off-by: Heyi Guo Reviewed-by: Michael S. Tsirkin --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt-acpi-build.c | 10 +- 1 file changed, 5 insertions(+), 5 deletion

[PATCH v3 7/7] virt/acpi: update golden masters for DSDT update

2020-02-03 Thread Heyi Guo
uot;, "DSDT", 2, "BOCHS ", "BXPCDSDT", 0x0001) Device (PWRB) { Name (_HID, "PNP0C0C" /* Power Button Device */) // _HID: Hardware ID -Name (_ADR, Zero) // _ADR: Address Name (_UID, Zero) // _UID: Un

[PATCH v3 5/7] arm/acpi: fix duplicated _UID of PCI interrupt link devices

2020-02-03 Thread Heyi Guo
Using _UID of 0 for all PCI interrupt link devices absolutely violates the spec. Simply increase one by one. Signed-off-by: Heyi Guo Reviewed-by: Michael S. Tsirkin --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc:

[PATCH v3 0/7] Some cleanup in arm/virt/acpi

2020-02-03 Thread Heyi Guo
test.c to post ACPI related patches. - update commit messages for removing "RP0" and "_ADR". - add 3 more cleanup patches. Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org Heyi

Re: [PATCH v2 0/7] Some cleanup in arm/virt/acpi

2020-02-03 Thread Heyi Guo
在 2020/2/3 22:03, Peter Maydell 写道: On Mon, 3 Feb 2020 at 13:33, Heyi Guo wrote: 在 2020/2/3 14:43, Michael S. Tsirkin 写道: On Mon, Feb 03, 2020 at 08:14:58AM +0800, Heyi Guo wrote: Remove conflict _ADR objects, and fix and refine PCI device definition in ACPI/DSDT. Cc: Peter Maydell Cc

Re: [PATCH v2 0/7] Some cleanup in arm/virt/acpi

2020-02-03 Thread Heyi Guo
在 2020/2/3 14:43, Michael S. Tsirkin 写道: On Mon, Feb 03, 2020 at 08:14:58AM +0800, Heyi Guo wrote: Remove conflict _ADR objects, and fix and refine PCI device definition in ACPI/DSDT. Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@non

[PATCH v2 7/7] virt/acpi: update golden masters for DSDT update

2020-02-02 Thread Heyi Guo
quot; /* PNP Motherboard Resources */) // _HID: Hardware ID @@ -9131,7 +1925,6 @@ DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPCDSDT", 0x0001) Device (PWRB) { Name (_HID, "PNP0C0C" /* Power Button Device */)

[PATCH v2 3/7] arm/virt/acpi: remove _ADR from devices identified by _HID

2020-02-02 Thread Heyi Guo
343: A device object must contain either an _HID object or an _ADR object, but should not contain both. (https://uefi.org/sites/default/files/resources/ACPI_6_3_May16.pdf) Signed-off-by: Heyi Guo Acked-by: Igor Mammedov --- Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin"

[PATCH v2 5/7] arm/acpi: fix duplicated _UID of PCI interrupt link devices

2020-02-02 Thread Heyi Guo
Using _UID of 0 for all PCI interrupt link devices absolutely violates the spec. Simply increase one by one. Signed-off-by: Heyi Guo --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm

[PATCH v2 2/7] arm/virt/acpi: remove meaningless sub device "RP0" from PCI0

2020-02-02 Thread Heyi Guo
The sub device "RP0" under PCI0 in ACPI/DSDT does not contain any method or property other than "_ADR", so it is safe to remove it. Signed-off-by: Heyi Guo Acked-by: "Michael S. Tsirkin" --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: I

[PATCH v2 1/7] bios-tables-test: prepare to change ARM virt ACPI DSDT

2020-02-02 Thread Heyi Guo
We are going to change ARM virt ACPI DSDT table, which will cause make check to fail, so temporarily add related golden masters to ignore list. Signed-off-by: Heyi Guo --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc:

[PATCH v2 6/7] arm/acpi: simplify the description of PCI _CRS

2020-02-02 Thread Heyi Guo
Signed-off-by: Heyi Guo --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt-acpi-build.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/vir

[PATCH v2 4/7] arm/acpi: fix PCI _PRT definition

2020-02-02 Thread Heyi Guo
The address field in each _PRT mapping package should be constructed with high word for device# and low word for function#, so it is wrong to use bus_no as the high word. Enumerate all possible slots (i.e. PCI_SLOT_MAX) instead. Signed-off-by: Heyi Guo --- Cc: Peter Maydell Cc: "Mich

[PATCH v2 0/7] Some cleanup in arm/virt/acpi

2020-02-02 Thread Heyi Guo
to post ACPI related patches. - update commit messages for removing "RP0" and "_ADR". - add 3 more cleanup patches. Heyi Guo (7): bios-tables-test: prepare to change ARM virt ACPI DSDT arm/virt/acpi: remove meaningless sub device "PR0" from PCI0 arm/virt/acpi:

[PATCH] tests/qtest: update comments about bios-tables-test-allowed-diff.h

2020-02-02 Thread Heyi Guo
Update comments in tests/qtest/bios-tables-test.c to reflect the current path of bios-tables-test-allowed-diff.h, which is now under tests/qtest/ as well. Signed-off-by: Heyi Guo --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Thomas Huth Cc: Laurent Vivier Cc: Paolo Bonzini

[PATCH 2/2] arm/virt/acpi: remove _ADR from devices identified by _HID

2019-12-18 Thread Heyi Guo
According to ACPI spec, _ADR should be used for device which is on a bus that has a standard enumeration algorithm. It does not make sense to have a _ADR object for devices which already have _HID and will be enumerated by OSPM. Signed-off-by: Heyi Guo --- Cc: Shannon Zhao Cc: Peter Maydell

[PATCH 0/2] Some cleanup in arm/virt/acpi

2019-12-18 Thread Heyi Guo
Remove useless device node and conflict _ADR objects in ACPI/DSDT. Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org Heyi Guo (2): arm/virt/acpi: remove meaningless sub device "PR0" from

[PATCH 1/2] arm/virt/acpi: remove meaningless sub device "PR0" from PCI0

2019-12-18 Thread Heyi Guo
The sub device "PR0" under PCI0 in ACPI/DSDT does not make any sense, so simply remote it. Signed-off-by: Heyi Guo --- Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Shannon Zhao Cc: qemu-...@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt-acpi-bu

[PATCH v6 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-12-08 Thread Heyi Guo
Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 16 tests/data/acpi/virt/DSDT | Bin 18470 -> 18462 bytes tests/data/acpi/

[PATCH v6 0/2] arm/acpi: simplify aml code and enable SHPC

2019-12-08 Thread Heyi Guo
: - Fix "make check" errors by updating tests/data/acpi/virt/DSDT*. v5: - Refine commit message of patch 1/2 v4: - Improve the code indention. Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Heyi Guo (2): hw/arm/acpi: simplify AML bit and/o

[PATCH v6 2/2] hw/arm/acpi: enable SHPC native hot plug

2019-12-08 Thread Heyi Guo
; Cc: Igor Mammedov Reviewed-by: Michael S. Tsirkin Reviewed-by: Igor Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 7 ++- tests/data/acpi/virt/DSDT | Bin 18462 -> 18462 bytes tests/data/acpi/virt/DSDT.memhp | Bin 19799 -> 19799 bytes tests/data/ac

[RFC v2 03/14] arm/sdei: add virtual device framework

2019-11-05 Thread Heyi Guo
index as lower bit for each allocated event number, so that we can get property easily from valid input event number, as well as the QemuSDE instance. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse

[RFC v2 12/14] arm/sdei: add stub to fix build failure when SDEI is not enabled

2019-11-05 Thread Heyi Guo
Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/Makefile.objs | 2 ++ target/arm/sdei-stub.c | 49 2 files changed, 51 insertions(+) create mode 100644 target/arm/sdei

[RFC v2 09/14] arm/sdei: override qemu_irq handler when binding interrupt

2019-11-05 Thread Heyi Guo
post_load(). Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/sdei.c | 130 +- target/arm/sdei_int.h | 3 + 2 files changed, 132 insertions(+), 1 deletion(-) diff --git a/target

[RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall

2019-11-05 Thread Heyi Guo
r enabling this cap, all HVC calls unhandled by kvm will be forwarded to user space. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Cornelia Huck Cc: Paolo Bonzini Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- linux-headers/linux/kvm.

[RFC v2 02/14] standard-headers: import arm_sdei.h

2019-11-05 Thread Heyi Guo
Import Linux header file include/uapi/linux/arm_sdei.h from kernel v5.4-rc5. This is to prepare for qemu SDEI emulation. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: "Michael S. Tsirkin" Cc: Cornelia Huck

[RFC v2 10/14] arm/sdei: add support to register interrupt bind notifier

2019-11-05 Thread Heyi Guo
Other qemu modules related with the interrupt bind operation may want to be notified when guest requests to bind interrupt to sdei event, so we add register and unregister interfaces. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse

[RFC v2 13/14] arm/kvm: handle guest exit of hypercall

2019-11-05 Thread Heyi Guo
Add support to handle guest exit of hypercall, and forward to SDEI dispatcher if SDEI is enabled and it is an SDEI request. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/kvm.c | 17 + 1 file

[RFC v2 01/14] update-linux-headers.sh: import linux/arm_sdei.h to standard-headers

2019-11-05 Thread Heyi Guo
This is to prepare for qemu SDEI emulation. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: "Michael S. Tsirkin" Cc: Cornelia Huck Cc: Paolo Bonzini --- Notes: v2: - Update update-linux-header

[RFC v2 05/14] arm/sdei: add support to handle SDEI requests from guest

2019-11-05 Thread Heyi Guo
are case). Return: args[0..3]: x0..x3 as defined in SMCCC. We rely on KVM to extract args[0..3] and write them to x0..x3 when hypercall exit returns. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: M

[RFC v2 00/14] Add SDEI support for arm64

2019-11-05 Thread Heyi Guo
rk Rutland Cc: James Morse Cc: "Michael S. Tsirkin" Cc: Cornelia Huck Cc: Paolo Bonzini Cc: Shannon Zhao Cc: Igor Mammedov v2: - Import import linux/arm_sdei.h to standard-headers - Drop SDEI table definition and add comments - Some bugfix and code refinement Heyi Guo (14): upd

[RFC v2 08/14] core/irq: add qemu_irq_remove_intercept interface

2019-11-05 Thread Heyi Guo
to default one (i.e. ARM GIC). qemu_irq_remove_intercept() is the new interface to do the above job. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- hw/core/irq.c| 11 +++ include/hw/irq.h | 8 ++-- 2 files

[RFC v2 06/14] arm/sdei: add system reset callback

2019-11-05 Thread Heyi Guo
For this is a logical device which is not attached to system bus, we cannot use DeviceClass->reset interface directly. Instead we register our own reset callback to reset SDEI services when system resets. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin

[RFC v2 14/14] virt/acpi: add SDEI table if SDEI is enabled

2019-11-05 Thread Heyi Guo
Add SDEI table if SDEI is enabled, so that guest OS can get aware and utilize the interfaces. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Shannon Zhao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- Not

[RFC v2 07/14] arm/sdei: add support to trigger event by GIC interrupt ID

2019-11-05 Thread Heyi Guo
Add an external interface to trigger an SDEI event bound to an interrupt by providing GIC interrupt ID. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/sdei.c | 37 + target/arm

[RFC v2 04/14] arm: add CONFIG_SDEI build flag

2019-11-05 Thread Heyi Guo
Integrate SDEI support for arm/aarch64 targets by default, if KVM is enabled. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- default-configs/arm-softmmu.mak | 1 + hw/arm/Kconfig | 4 target/arm

[RFC PATCH 03/12] arm/sdei: add support to handle SDEI requests from guest

2019-09-24 Thread Heyi Guo
are case). Return: args[0..3]: x0..x3 as defined in SMCCC. We rely on KVM to extract args[0..3] and write them to x0..x3 when hypercall exit returns. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: M

[RFC PATCH 08/12] arm/sdei: add support to register interrupt bind notifier

2019-09-24 Thread Heyi Guo
Other qemu modules related with the interrupt bind operation may want to be notified when guest requests to bind interrupt to sdei event, so we add register and unregister interfaces. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse

[RFC PATCH 07/12] arm/sdei: override qemu_irq handler when binding interrupt

2019-09-24 Thread Heyi Guo
post_load(). Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/sdei.c | 137 -- target/arm/sdei_int.h | 3 ++ 2 files changed, 137 insertions(+), 3 deletions(-) diff --git

[RFC PATCH 04/12] arm/sdei: add system reset callback

2019-09-24 Thread Heyi Guo
For this is a logical device which is not attached to system bus, we cannot use DeviceClass->reset interface directly. Instead we register our own reset callback to reset SDEI services when system resets. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin

[RFC PATCH 12/12] virt/acpi: add SDEI table if SDEI is enabled

2019-09-24 Thread Heyi Guo
Add SDEI table if SDEI is enabled, so that guest OS can get aware and utilize the interfaces. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: Shannon Zhao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- hw/arm

[RFC PATCH 06/12] core/irq: add qemu_irq_remove_intercept interface

2019-09-24 Thread Heyi Guo
to default one (i.e. ARM GIC). qemu_irq_remove_intercept() is the new interface to do the above job. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- hw/core/irq.c| 11 +++ include/hw/irq.h | 8 ++-- 2 files

[RFC PATCH 00/12] Add SDEI support for arm64

2019-09-24 Thread Heyi Guo
and framework first. We can refine the code for several rounds after the big things have been determined. Please give your comments and suggestions. Thanks, HG Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Heyi Guo (12): linux-headers: import arm_sdei.h

[RFC PATCH 02/12] arm/sdei: add virtual device framework

2019-09-24 Thread Heyi Guo
index as lower bit for each allocated event number, so that we can get property easily from valid input event number, as well as the QemuSDE instance. Signed-off-by: Heyi Guo Signed-off-by: Jingyi Wang Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse

[RFC PATCH 11/12] arm/kvm: handle guest exit of hypercall

2019-09-24 Thread Heyi Guo
Add support to handle guest exit of hypercall, and forward to SDEI dispatcher if SDEI is enabled and it is an SDEI request. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/kvm.c | 17 + 1 file

[RFC PATCH 05/12] arm/sdei: add support to trigger event by GIC interrupt ID

2019-09-24 Thread Heyi Guo
Add an external interface to trigger an SDEI event bound to an interrupt by providing GIC interrupt ID. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/sdei.c | 38 ++ target/arm

[RFC PATCH 09/12] linux-headers/kvm.h: add capability to forward hypercall

2019-09-24 Thread Heyi Guo
e also use an additional argument to pass exception bit mask, to request KVM to forward all hypercalls except the classes specified in the bit mask. Currently only PSCI can be set as exception, so that we can still keep consistent with the original PSCI processing flow. Signed-off-by: Heyi Guo Cc: Pet

[RFC PATCH 10/12] arm/sdei: check KVM cap and enable SDEI

2019-09-24 Thread Heyi Guo
Check KVM hypercall forward capability and enable it, and set global flag "sdei_enabled" to true if everything works well. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse --- target/arm/sdei.c | 17 +

[RFC PATCH 01/12] linux-headers: import arm_sdei.h

2019-09-24 Thread Heyi Guo
Import Linux header file include/uapi/linux/arm_sdei.h from kernel v5.3 release. This is to prepare for qemu SDEI emulation. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: "Michael S. Tsirkin" Cc: Cornelia Huck

Re: [Qemu-devel] Question: can we hot plug a PCIe switch on machine "virt"

2019-04-11 Thread Heyi Guo
Hi Eric and Michael, Appreciate your sharing of this information. But sorry I'm still a little confused due to my poor English... On 2019/4/11 20:19, Auger Eric wrote: Hi Heyi, On 4/11/19 1:30 PM, Heyi Guo wrote: Hi Eric, Could you help to confirm? Practically I have not tried anything

Re: [Qemu-devel] Question: can we hot plug a PCIe switch on machine "virt"

2019-04-11 Thread Heyi Guo
Hi Eric, Could you help to confirm? Thanks, Heyi On 2019/4/7 9:59, Heyi Guo wrote: Hi Eric, My real interesting is about the hotplug of PCIe switch, which means we don't need to provide lots of PCIe root ports or PCIe down stream ports at the beginning, but we can extend the capacity

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-04-11 Thread Heyi Guo
19/3/27 1:12, Steven Price wrote: Hi Heyi, On 26/03/2019 13:53, Heyi Guo wrote: I also tested save/restore operations, and observed that clock in guest would not jump after restoring either. If we consider guest clock not being synchronized with real wall clock as an issue, does it mean save/

Re: [Qemu-devel] [RFC] arm/virt: add one more uart for UEFI runtime debug

2019-04-07 Thread Heyi Guo
On 2019/4/7 21:16, Peter Maydell wrote: On Sun, 7 Apr 2019 at 09:19, Heyi Guo wrote: This patch is based on the discussion in TianoCore edk2-devel mailing list: https://lists.01.org/pipermail/edk2-devel/2019-March/037986.html The conclusion is that we need an individual UART for UEFI

[Qemu-devel] [RFC] arm/virt: add one more uart for UEFI runtime debug

2019-04-07 Thread Heyi Guo
: Peter Maydell Cc: Laszlo Ersek Signed-off-by: Heyi Guo --- hw/arm/virt.c | 29 +++-- include/hw/arm/virt.h | 1 + 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ce2664a..cbc5a66 100644 --- a/hw/arm/virt.c +++ b

Re: [Qemu-devel] Question: can we hot plug a PCIe switch on machine "virt"

2019-04-06 Thread Heyi Guo
ys, either they can't be hot-plugged into an non-existing Upstream Port or another place... Thanks, Heyi On 2019/4/4 15:39, Auger Eric wrote: Hi Heyi, On 4/3/19 8:50 PM, Michael S. Tsirkin wrote: On Wed, Apr 03, 2019 at 03:32:09PM +0800, Heyi Guo wrote: Hi folks, In physical world, a P

[Qemu-devel] Question: can we hot plug a PCIe switch on machine "virt"

2019-04-03 Thread Heyi Guo
Hi folks, In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements: Line 230: Be aware that PCI Express Downstream Ports can't be

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-26 Thread Heyi Guo
Guo wrote: Hi Steven, Thanks for your explanation. Please see my comments below. On 2019/3/21 0:29, Steven Price wrote: On 19/03/2019 14:39, Heyi Guo wrote: Hi Christoffer and Steve, On 2019/3/15 16:59, Christoffer Dall wrote: Hi Steve, On Wed, Mar 13, 2019 at 10:11:30AM +, Steven Price

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-26 Thread Heyi Guo
Hi Steven, Thanks for your explanation. Please see my comments below. On 2019/3/21 0:29, Steven Price wrote: On 19/03/2019 14:39, Heyi Guo wrote: Hi Christoffer and Steve, On 2019/3/15 16:59, Christoffer Dall wrote: Hi Steve, On Wed, Mar 13, 2019 at 10:11:30AM +, Steven Price wrote

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-19 Thread Heyi Guo
Hi Christoffer and Steve, On 2019/3/15 16:59, Christoffer Dall wrote: Hi Steve, On Wed, Mar 13, 2019 at 10:11:30AM +, Steven Price wrote: Personally I think what we need is: * Either a patch like the one from Heyi Guo (save/restore CNTVCT_EL0) or alternatively hooking up

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-14 Thread Heyi Guo
Hi Peter and Steven, On 2019/3/13 18:11, Steven Price wrote: On 12/03/2019 14:12, Marc Zyngier wrote: Hi Peter, On 12/03/2019 10:08, Peter Maydell wrote: On Tue, 12 Mar 2019 at 06:10, Heyi Guo wrote: When we stop a VM for more than 30 seconds and then resume it, by qemu monitor command

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-12 Thread Heyi Guo
dell wrote: On Tue, 12 Mar 2019 at 06:10, Heyi Guo wrote: When we stop a VM for more than 30 seconds and then resume it, by qemu monitor command "stop" and "cont", Linux on VM will complain of "soft lockup - CPU#x stuck for xxs!" as below: [ 2783.809517] watchdog:

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-12 Thread Heyi Guo
Hi Richard, On 2019/3/12 22:59, Richard Henderson wrote: On 3/12/19 12:57 AM, Heyi Guo wrote: int kvm_arm_vcpu_init(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); struct kvm_vcpu_init init; +/* + * Only add change state handler for arch timer once, for KVM will help

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-12 Thread Heyi Guo
Hi all, I'm sorry this patch failed the docker-mingw@fedora build test. I'm going to move the code to target/arm/kvm.c. Please ignore this one. Thanks, Heyi On 2019/3/12 14:09, Heyi Guo wrote: When we stop a VM for more than 30 seconds and then resume it, by qemu monitor command "

[Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-12 Thread Heyi Guo
his patch is to fix this issue by saving the value of CNTVCT_EL0 when stopping and restoring it when resuming. Cc: Peter Maydell Signed-off-by: Heyi Guo --- target/arm/kvm.c | 66 1 file changed, 66 insertions(+) diff --git a/target/arm/

[Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-12 Thread Heyi Guo
his patch is to fix this issue by saving the value of CNTVCT_EL0 when stopping and restoring it when resuming. Cc: Peter Maydell Signed-off-by: Heyi Guo --- target/arm/cpu.c | 65 1 file changed, 65 insertions(+) diff --git a/target/arm/

Re: [Qemu-devel] [PATCH v4 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-08 Thread Heyi Guo
On 2019/3/7 0:34, Igor Mammedov wrote: On Wed, 6 Mar 2019 21:36:56 +0800 Heyi Guo wrote: The last argument of AML bit and/or statement is the target variable, so we don't need to use a NULL target and then an additional store operation; a single bit and/or statement is enough. s: a single

[Qemu-devel] [PATCH v5 2/2] hw/arm/acpi: enable SHPC native hot plug

2019-03-08 Thread Heyi Guo
r Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index cebec4c..b6fef28 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -265,7 +265,12 @@ s

[Qemu-devel] [PATCH v5 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-08 Thread Heyi Guo
Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index d7e2e48..cebec4c 100644 --- a/hw/arm/virt-ac

[Qemu-devel] [PATCH v5 0/2] arm/acpi: simplify aml code and enable SHPC

2019-03-08 Thread Heyi Guo
: - Refine commit message of patch 1/2 v4: - Improve the code indention. Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Heyi Guo (2): hw/arm/acpi: simplify AML bit and/or statement hw/arm/acpi: enable SHPC native hot plug hw/arm/virt-acpi-bu

Re: [Qemu-devel] [PATCH v3 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-06 Thread Heyi Guo
Got it; thanks. Heyi On 2019/3/7 0:20, Igor Mammedov wrote: On Wed, 6 Mar 2019 21:09:11 +0800 Heyi Guo wrote: Sorry, I didn't know the indention policy of qemu code. So we need to indent the 2nd line just after the parentheses it belongs to? See "[PATCH v6 0/2] CODING_STYLE: tr

[Qemu-devel] [PATCH v4 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-06 Thread Heyi Guo
d-by: Igor Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index d7e2e48..cebec4c 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c

[Qemu-devel] [PATCH v4 2/2] hw/arm/acpi: enable SHPC native hot plug

2019-03-06 Thread Heyi Guo
After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enable SHPC native hot plug. Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Heyi Gu

[Qemu-devel] [PATCH v4 0/2] arm/acpi: simplify aml code and enable SHPC

2019-03-06 Thread Heyi Guo
: - Improve the code indention. Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Heyi Guo (2): hw/arm/acpi: simplify AML bit and/or statement hw/arm/acpi: enable SHPC native hot plug hw/arm/virt-acpi-build.c | 21 + 1 file c

Re: [Qemu-devel] [PATCH v3 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-06 Thread Heyi Guo
Sorry, I didn't know the indention policy of qemu code. So we need to indent the 2nd line just after the parentheses it belongs to? Will change that and send next version. Thanks, Heyi On 2019/3/6 18:33, Igor Mammedov wrote: On Wed, 6 Mar 2019 06:03:48 +0800 Heyi Guo wrote: The last

[Qemu-devel] [PATCH v3 2/2] hw/arm/acpi: enable SHPC native hot plug

2019-03-05 Thread Heyi Guo
After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug. Cc: Shannon Zhao Cc: Peter Maydell Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Heyi Gu

[Qemu-devel] [PATCH v3 1/2] hw/arm/acpi: simplify AML bit and/or statement

2019-03-05 Thread Heyi Guo
d-by: Igor Mammedov Signed-off-by: Heyi Guo --- hw/arm/virt-acpi-build.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 04b62c7..1c84e87 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -265,

  1   2   >