Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Joelle van Dyne
On Mon, Sep 9, 2024 at 2:56 AM Kevin Wolf wrote: > > Am 09.09.2024 um 03:58 hat Joelle van Dyne geschrieben: > > New optional argument for 'blockdev-change-medium' QAPI command to allow > > the caller to specify if they wish to enable file locking. > > > &g

Re: [PATCH] block: support locking on change medium

2024-09-09 Thread Joelle van Dyne
On Mon, Sep 9, 2024 at 12:36 AM Akihiko Odaki wrote: > > On 2024/09/09 10:58, Joelle van Dyne wrote: > > New optional argument for 'blockdev-change-medium' QAPI command to allow > > the caller to specify if they wish to enable file locking. > >

[PATCH] block: support locking on change medium

2024-09-08 Thread Joelle van Dyne
New optional argument for 'blockdev-change-medium' QAPI command to allow the caller to specify if they wish to enable file locking. Signed-off-by: Joelle van Dyne --- qapi/block.json| 23 ++- block/monitor/block-hmp-cmds.c | 2 +- block/qap

Re: [PATCH v5 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-11-24 Thread Joelle van Dyne
On Fri, Nov 24, 2023 at 8:26 AM Stefan Berger wrote: > > > > On 11/24/23 11:21, Joelle van Dyne wrote: > > On Fri, Nov 24, 2023 at 8:17 AM Stefan Berger wrote: > >> > >> > >> > >> On 11/23/23 19:56, Joelle van Dyne wrote: > >&g

Re: [PATCH v5 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-11-24 Thread Joelle van Dyne
On Fri, Nov 24, 2023 at 8:17 AM Stefan Berger wrote: > > > > On 11/23/23 19:56, Joelle van Dyne wrote: > > On Tue, Nov 14, 2023 at 4:12 PM Stefan Berger wrote: > >> > >> > >> > >> On 11/14/23 16:05, Stefan Berger wrote: &g

Re: [PATCH v5 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-11-23 Thread Joelle van Dyne
On Tue, Nov 14, 2023 at 4:12 PM Stefan Berger wrote: > > > > On 11/14/23 16:05, Stefan Berger wrote: > > > > > > On 11/14/23 13:03, Stefan Berger wrote: > >> > >> > >> On 11/14/23 04:36, Marc-André Lureau wrote: > >>>

Re: [PATCH v5 05/14] tpm_crb: move ACPI table building to device interface

2023-11-14 Thread Joelle van Dyne
On Tue, Nov 14, 2023 at 8:44 AM Stefan Berger wrote: > > > > On 11/14/23 11:37, Stefan Berger wrote: > > > > > > On 11/13/23 21:09, Joelle van Dyne wrote: > >> This logic is similar to TPM TIS ISA device. Since TPM CRB can only > >> suppor

Re: [PATCH v5 00/14] tpm: introduce TPM CRB SysBus device

2023-11-14 Thread Joelle van Dyne
On Tue, Nov 14, 2023 at 1:38 AM Marc-André Lureau wrote: > > Hi > > On Tue, Nov 14, 2023 at 6:10 AM Joelle van Dyne wrote: > > > > The impetus for this patch set is to get TPM 2.0 working on Windows 11 > > ARM64. > > Windows' tpm.sys does not seem to w

[PATCH v5 06/14] tpm-sysbus: add plug handler for TPM on SysBus

2023-11-13 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- include/sysemu/tpm.h | 4 hw/tpm/tpm-sysbus.c | 47 hw/tpm/meson.build | 1 + 3 files changed

[PATCH v5 11/14] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-11-13 Thread Joelle van Dyne
`` $ swtpm \ --ctrl type=unixio,path=tpm.sock,terminate \ --tpmstate backend-uri=file://tpm.data \ --tpm2 ``` Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 1 + include/sysemu/tpm.h| 3 + hw/acpi/aml-build.c | 7 +- hw/arm/virt.c

[PATCH v5 04/14] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-11-13 Thread Joelle van Dyne
to worry about updating it for reads. In order to maintain migration compatibility with older versions of QEMU, we store a copy of the register data and command data which is used only during save/restore. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 5 +- hw/tpm/tpm_crb.c

[PATCH v5 02/14] tpm_crb: CTRL_RSP_ADDR is 64-bits wide

2023-11-13 Thread Joelle van Dyne
address so this was not an issue. However, once we support SysBus CRB device, the address can be anywhere in 64-bit space. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- include/hw/acpi/tpm.h | 3 ++- hw/tpm/tpm_crb_common.c| 3 ++- tests/qtest/tpm-crb-test.c | 2 +- tests

[PATCH v5 08/14] hw/loongarch/virt: connect TPM to platform bus

2023-11-13 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/loongarch/virt.c | 7 +++ hw/loongarch/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4b7dc67a2d..feed0f8bbf 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch

[PATCH v5 03/14] tpm_ppi: refactor memory space initialization

2023-11-13 Thread Joelle van Dyne
Instead of calling `memory_region_add_subregion` directly, we defer to the caller to do it. This allows us to re-use the code for a SysBus device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_ppi.h| 10 +++--- hw/tpm/tpm_crb.c| 4 ++-- hw/tpm

[PATCH v5 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-11-13 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- tests/qtest/bios-tables-test.c | 43 -- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 71af5cf69f..bb4ebf00c1

[PATCH v5 01/14] tpm_crb: refactor common code

2023-11-13 Thread Joelle van Dyne
In preparation for the SysBus variant, we move common code styled after the TPM TIS devices. To maintain compatibility, we do not rename the existing tpm-crb device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 1 + hw/tpm/tpm_crb.h| 76

[PATCH v5 05/14] tpm_crb: move ACPI table building to device interface

2023-11-13 Thread Joelle van Dyne
This logic is similar to TPM TIS ISA device. Since TPM CRB can only support TPM 2.0 backends, we check for this in realize. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 2 ++ hw/i386/acpi-build.c| 16 +--- hw/tpm/tpm_crb.c| 16 hw/tpm

[PATCH v5 10/14] tests: acpi: prepare for TPM CRB tests

2023-11-13 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | 0 tests/data/acpi/q35/TPM2.crb.tpm2 | 0 tests/data/acpi/virt/DSDT.crb-device.tpm2 | 0 tests/data/acpi/virt/TPM2.crb

[PATCH v5 13/14] tests: acpi: updated expected blobs for TPM CRB

2023-11-13 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Tested-by: Stefan Berger --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | Bin 0 -> 8355 bytes tests/data/acpi/q35/TPM2.crb.tpm2 | Bin 0 -> 76 bytes tests/data/acpi/virt/DSDT.crb-devic

[PATCH v5 14/14] tests: add TPM-CRB sysbus tests for aarch64

2023-11-13 Thread Joelle van Dyne
- Factor out common test code from tpm-crb-test.c -> tpm-tests.c - Store device addr in `tpm_device_base_addr` (unify with TIS tests) - Add new tests for aarch64 Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- tests/qtest/tpm-tests.h | 2 + tests/qtest/

[PATCH v5 09/14] tpm_tis_sysbus: move DSDT AML generation to device

2023-11-13 Thread Joelle van Dyne
avoid any TPM specific code in the ACPI table generation. However, currently we still have to call `build_tpm2` anyways and it does not look like most other ACPI devices support the `ACPI_DEV_AML_IF` interface. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/arm/virt-acpi-build.c

[PATCH v5 00/14] tpm: introduce TPM CRB SysBus device

2023-11-13 Thread Joelle van Dyne
s saved separately instead of as a RAM block. Joelle van Dyne (14): tpm_crb: refactor common code tpm_crb: CTRL_RSP_ADDR is 64-bits wide tpm_ppi: refactor memory space initialization tpm_crb: use a single read-as-mem/write-as-mmio mapping tpm_crb: move ACPI table building to device interfac

[PATCH v5 07/14] hw/arm/virt: connect TPM to platform bus

2023-11-13 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/arm/virt.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 85e3c5ba9d..36e2506420 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2811,6 +2811,13 @@ static void

Re: [PATCH v4 04/14] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-11-13 Thread Joelle van Dyne
On Wed, Nov 1, 2023 at 2:25 PM Stefan Berger wrote: > > > > On 10/31/23 00:00, Joelle van Dyne wrote: > > On Apple Silicon, when Windows performs a LDP on the CRB MMIO space, > > the exception is not decoded by hardware and we cannot trap the MMIO > > read. This led

Re: [PATCH v4 05/14] tpm_crb: move ACPI table building to device interface

2023-11-02 Thread Joelle van Dyne
On Thu, Nov 2, 2023 at 11:50 AM Stefan Berger wrote: > > > > On 10/31/23 00:00, Joelle van Dyne wrote: > > This logic is similar to TPM TIS ISA device. Since TPM CRB can only > > support TPM 2.0 backends, we check for this in realize. > > The problem on x86_64 is

[PATCH v4 13/14] tests: acpi: updated expected blobs for TPM CRB

2023-10-30 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | Bin 0 -> 8355 bytes tests/data/acpi/q35/TPM2.crb.tpm2 | Bin 0 -> 76 bytes tests/data/acpi/virt/DSDT.crb-device.tpm2 | Bin 0 -> 5276 byt

[PATCH v4 07/14] hw/arm/virt: connect TPM to platform bus

2023-10-30 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/arm/virt.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 529f1c089c..f1a161b0ea 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2806,6 +2806,13 @@ static void

[PATCH v4 01/14] tpm_crb: refactor common code

2023-10-30 Thread Joelle van Dyne
In preparation for the SysBus variant, we move common code styled after the TPM TIS devices. To maintain compatibility, we do not rename the existing tpm-crb device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 1 + hw/tpm/tpm_crb.h| 76

[PATCH v4 06/14] tpm-sysbus: add plug handler for TPM on SysBus

2023-10-30 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- include/sysemu/tpm.h | 4 hw/tpm/tpm-sysbus.c | 47 hw/tpm/meson.build | 1 + 3 files changed, 52 insertions(+) create

[PATCH v4 08/14] hw/loongarch/virt: connect TPM to platform bus

2023-10-30 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/loongarch/virt.c | 7 +++ hw/loongarch/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4b7dc67a2d..feed0f8bbf 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch

[PATCH v4 05/14] tpm_crb: move ACPI table building to device interface

2023-10-30 Thread Joelle van Dyne
This logic is similar to TPM TIS ISA device. Since TPM CRB can only support TPM 2.0 backends, we check for this in realize. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_crb.h| 2 ++ hw/i386/acpi-build.c| 23 --- hw/tpm/tpm_crb.c

[PATCH v4 10/14] tests: acpi: prepare for TPM CRB tests

2023-10-30 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | 0 tests/data/acpi/q35/TPM2.crb.tpm2 | 0 tests/data/acpi/virt/DSDT.crb-device.tpm2 | 0 tests/data/acpi/virt/TPM2.crb

[PATCH v4 00/14] tpm: introduce TPM CRB SysBus device

2023-10-30 Thread Joelle van Dyne
1. This shouldn't be an issue but we changed it back just in case. - Added a patch to migrate saved VMstate from an older version with the regs saved separately instead of as a RAM block. Joelle van Dyne (14): tpm_crb: refactor common code tpm_crb: CTRL_RSP_ADDR is 64-bits wide

[PATCH v4 03/14] tpm_ppi: refactor memory space initialization

2023-10-30 Thread Joelle van Dyne
Instead of calling `memory_region_add_subregion` directly, we defer to the caller to do it. This allows us to re-use the code for a SysBus device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_ppi.h| 10 +++--- hw/tpm/tpm_crb.c| 4 ++-- hw/tpm

[PATCH v4 11/14] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-10-30 Thread Joelle van Dyne
`` $ swtpm \ --ctrl type=unixio,path=tpm.sock,terminate \ --tpmstate backend-uri=file://tpm.data \ --tpm2 ``` Signed-off-by: Joelle van Dyne --- docs/specs/tpm.rst | 1 + include/sysemu/tpm.h| 3 + hw/acpi/aml-build.c | 7 +- hw/arm/virt.c | 1 + hw/core/sy

[PATCH v4 04/14] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-10-30 Thread Joelle van Dyne
to worry about updating it for reads. In order to maintain migration compatibility with older versions of QEMU, we store a copy of the register data and command data which is used only during save/restore. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 5 +- hw/tpm/tpm_crb.c

[PATCH v4 14/14] tests: add TPM-CRB sysbus tests for aarch64

2023-10-30 Thread Joelle van Dyne
- Factor out common test code from tpm-crb-test.c -> tpm-tests.c - Store device addr in `tpm_device_base_addr` (unify with TIS tests) - Add new tests for aarch64 Signed-off-by: Joelle van Dyne --- tests/qtest/tpm-tests.h | 2 + tests/qtest/tpm-util.h |

[PATCH v4 02/14] tpm_crb: CTRL_RSP_ADDR is 64-bits wide

2023-10-30 Thread Joelle van Dyne
address so this was not an issue. However, once we support SysBus CRB device, the address can be anywhere in 64-bit space. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- include/hw/acpi/tpm.h | 3 ++- hw/tpm/tpm_crb_common.c| 3 ++- tests/qtest/tpm-crb-test.c | 2 +- tests

[PATCH v4 09/14] tpm_tis_sysbus: move DSDT AML generation to device

2023-10-30 Thread Joelle van Dyne
avoid any TPM specific code in the ACPI table generation. However, currently we still have to call `build_tpm2` anyways and it does not look like most other ACPI devices support the `ACPI_DEV_AML_IF` interface. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/arm/virt-acpi-build.c

[PATCH v4 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-10-30 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- tests/qtest/bios-tables-test.c | 43 -- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 9f4bc15aab..c63bad0205

Re: [PATCH v3 13/14] tests: acpi: updated expected blobs for TPM CRB

2023-10-30 Thread Joelle van Dyne
> > > On 10/29/23 02:03, Joelle van Dyne wrote: > >> Signed-off-by: Joelle van Dyne > > > > I see this error here with the test cases: > > > > > > | 364/377 ERROR:../tests/qtest/bios-tables-test.c:535:test_acpi_asl: > > assertion failed: (all_t

Re: [PATCH v3 11/14] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-10-30 Thread Joelle van Dyne
On Mon, Oct 30, 2023 at 2:09 PM Stefan Berger wrote: > > > On 10/29/23 02:03, Joelle van Dyne wrote: > > This SysBus variant of the CRB interface supports dynamically locating > > the MMIO interface so that Virt machines can use it. This interface > > is currently the

Re: [PATCH v3 06/14] tpm-sysbus: add plug handler for TPM on SysBus

2023-10-30 Thread Joelle van Dyne
M Stefan Berger wrote: > > > On 10/29/23 02:03, Joelle van Dyne wrote: > > TPM needs to know its own base address in order to generate its DSDT > > device entry. > > > > Signed-off-by: Joelle van Dyne > > --- > > in

[PATCH v3 08/14] hw/loongarch/virt: connect TPM to platform bus

2023-10-28 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- hw/loongarch/virt.c | 7 +++ hw/loongarch/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4b7dc67a2d..feed0f8bbf 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1004,6 +1004,13

[PATCH v3 04/14] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-10-28 Thread Joelle van Dyne
to worry about updating it for reads. In order to maintain migration compatibility with older versions of QEMU, we store a copy of the register data and command data which is used only during save/restore. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 5 +- hw/tpm/tpm_crb.c

[PATCH v3 11/14] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-10-28 Thread Joelle van Dyne
`` $ swtpm \ --ctrl type=unixio,path=tpm.sock,terminate \ --tpmstate backend-uri=file://tpm.data \ --tpm2 ``` Signed-off-by: Joelle van Dyne --- docs/specs/tpm.rst | 1 + include/sysemu/tpm.h| 3 + hw/acpi/aml-build.c | 7 +- hw/arm/virt.c | 1 + hw/core/sy

[PATCH v3 14/14] tests: add TPM-CRB sysbus tests for aarch64

2023-10-28 Thread Joelle van Dyne
- Factor out common test code from tpm-crb-test.c -> tpm-tests.c - Store device addr in `tpm_device_base_addr` (unify with TIS tests) - Add new tests for aarch64 Signed-off-by: Joelle van Dyne --- tests/qtest/tpm-tests.h | 2 + tests/qtest/tpm-util.h |

[PATCH v3 13/14] tests: acpi: updated expected blobs for TPM CRB

2023-10-28 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | Bin 0 -> 8981 bytes tests/data/acpi/q35/TPM2.crb.tpm2 | Bin 0 -> 76 bytes tests/data/acpi/virt/DSDT.crb-device.tpm2 | Bin 0 -> 5276 byt

[PATCH v3 02/14] tpm_crb: CTRL_RSP_ADDR is 64-bits wide

2023-10-28 Thread Joelle van Dyne
address so this was not an issue. However, once we support SysBus CRB device, the address can be anywhere in 64-bit space. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- include/hw/acpi/tpm.h | 3 ++- hw/tpm/tpm_crb_common.c| 3 ++- tests/qtest/tpm-crb-test.c | 2 +- tests

[PATCH v3 00/14] tpm: introduce TPM CRB SysBus device

2023-10-28 Thread Joelle van Dyne
n issue but we changed it back just in case. - Added a patch to migrate saved VMstate from an older version with the regs saved separately instead of as a RAM block. Joelle van Dyne (14): tpm_crb: refactor common code tpm_crb: CTRL_RSP_ADDR is 64-bits wide tpm_ppi: refactor memory space i

[PATCH v3 10/14] tests: acpi: prepare for TPM CRB tests

2023-10-28 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- tests/qtest/bios-tables-test-allowed-diff.h | 4 tests/data/acpi/q35/DSDT.crb.tpm2 | 0 tests/data/acpi/q35/TPM2.crb.tpm2 | 0 tests/data/acpi/virt/DSDT.crb-device.tpm2 | 0 tests/data/acpi/virt/TPM2.crb-device.tpm2 | 0 5 files

[PATCH v3 09/14] tpm_tis_sysbus: move DSDT AML generation to device

2023-10-28 Thread Joelle van Dyne
avoid any TPM specific code in the ACPI table generation. However, currently we still have to call `build_tpm2` anyways and it does not look like most other ACPI devices support the `ACPI_DEV_AML_IF` interface. Signed-off-by: Joelle van Dyne --- hw/arm/virt-acpi-build.c | 38

[PATCH v3 01/14] tpm_crb: refactor common code

2023-10-28 Thread Joelle van Dyne
In preparation for the SysBus variant, we move common code styled after the TPM TIS devices. To maintain compatibility, we do not rename the existing tpm-crb device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 1 + hw/tpm/tpm_crb.h| 76

[PATCH v3 05/14] tpm_crb: move ACPI table building to device interface

2023-10-28 Thread Joelle van Dyne
This logic is similar to TPM TIS ISA device. Since TPM CRB can only support TPM 2.0 backends, we check for this in realize. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_crb.h| 2 ++ hw/i386/acpi-build.c| 23 --- hw/tpm/tpm_crb.c

[PATCH v3 03/14] tpm_ppi: refactor memory space initialization

2023-10-28 Thread Joelle van Dyne
Instead of calling `memory_region_add_subregion` directly, we defer to the caller to do it. This allows us to re-use the code for a SysBus device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_ppi.h| 10 +++--- hw/tpm/tpm_crb.c| 4 ++-- hw/tpm

[PATCH v3 06/14] tpm-sysbus: add plug handler for TPM on SysBus

2023-10-28 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- include/sysemu/tpm.h | 4 hw/tpm/tpm-sysbus.c | 33 + hw/tpm/meson.build | 1 + 3 files changed, 38 insertions(+) create mode 100644

[PATCH v3 07/14] hw/arm/virt: connect TPM to platform bus

2023-10-28 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- hw/arm/virt.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 529f1c089c..f1a161b0ea 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2806,6 +2806,13 @@ static void virt_machine_device_plug_cb(HotplugHandler

[PATCH v3 12/14] tests: acpi: implement TPM CRB tests for ARM virt

2023-10-28 Thread Joelle van Dyne
Signed-off-by: Joelle van Dyne --- tests/qtest/bios-tables-test.c | 43 -- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 9f4bc15aab..c63bad0205 100644 --- a/tests/qtest/bios

Re: [PATCH v2 10/11] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-10-28 Thread Joelle van Dyne
On Mon, Jul 17, 2023 at 7:23 AM Igor Mammedov wrote: > > On Fri, 14 Jul 2023 00:09:26 -0700 > Joelle van Dyne wrote: > > > This SysBus variant of the CRB interface supports dynamically locating > > the MMIO interface so that Virt machines can use it. This interface >

Re: [PATCH v2 06/11] tpm_crb: move ACPI table building to device interface

2023-07-31 Thread Joelle van Dyne
On Mon, Jul 17, 2023 at 6:42 AM Igor Mammedov wrote: > > On Fri, 14 Jul 2023 13:21:33 -0400 > Stefan Berger wrote: > > > On 7/14/23 03:09, Joelle van Dyne wrote: > > > This logic is similar to TPM TIS ISA device. Since TPM CRB can only > > > support TPM 2.0 ba

Re: [PATCH v2 05/11] tpm_crb: use the ISA bus

2023-07-31 Thread Joelle van Dyne
On Tue, Jul 18, 2023 at 7:16 AM Stefan Berger wrote: > > > > On 7/17/23 09:46, Igor Mammedov wrote: > > On Fri, 14 Jul 2023 00:09:21 -0700 > > Joelle van Dyne wrote: > > > >> Since this device is gated to only build for targets with the PC > >> co

Re: [PATCH v2 11/11] tpm_crb: support restoring older vmstate

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 12:12 PM Stefan Berger wrote: > > > > On 7/14/23 14:49, Joelle van Dyne wrote: > > On Fri, Jul 14, 2023 at 11:41 AM Stefan Berger > > wrote: > >> > >> > >> > >> On 7/14/23 14:22, Stefan Berger wrote: > >

Re: [PATCH v2 11/11] tpm_crb: support restoring older vmstate

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 11:41 AM Stefan Berger wrote: > > > > On 7/14/23 14:22, Stefan Berger wrote: > > On 7/14/23 13:04, Joelle van Dyne wrote: > >> On Fri, Jul 14, 2023 at 7:51 AM Stefan Berger > >> wrote: > >>> > >>> > >>&

Re: [PATCH v2 09/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 11:01 AM Stefan Berger wrote: > > > > On 7/14/23 13:46, Joelle van Dyne wrote: > > On Fri, Jul 14, 2023 at 10:43 AM Stefan Berger > > wrote: > >> > >> > >> > >> On 7/14/23 13:39, Joelle van Dyne wrote: > &

Re: [PATCH v2 09/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 10:43 AM Stefan Berger wrote: > > > > On 7/14/23 13:39, Joelle van Dyne wrote: > > On Fri, Jul 14, 2023 at 10:37 AM Stefan Berger > > wrote: > >> > >> > >> > >> On 7/14/23 13:29, Joelle van Dyne wrote: >

Re: [PATCH v2 09/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 10:37 AM Stefan Berger wrote: > > > > On 7/14/23 13:29, Joelle van Dyne wrote: > > On Fri, Jul 14, 2023 at 9:19 AM Stefan Berger wrote: > >> > >> > >> > >> > >> I don't know whether we would want mu

Re: [PATCH 04/11] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 4:57 AM Stefan Berger wrote: > > > > On 7/14/23 06:05, Peter Maydell wrote: > > On Thu, 13 Jul 2023 at 19:43, Stefan Berger wrote: > >> > >> > >> > >> On 7/13/23 13:18, Peter Maydell wrote: > >>> On Thu, 13 Jul 2023 at 18:16, Stefan Berger wrote: > I guess the first

Re: [PATCH v2 09/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 9:19 AM Stefan Berger wrote: > > > > > I don't know whether we would want multiple devices. tpm_find() usage is > certainly not prepared for multiple devices. Sorry, "multiple TPM interfaces" here does not mean "at the same time". Will clarify the description. > > > Good

Re: [PATCH v2 10/11] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 7:27 AM Stefan Berger wrote: > > > > On 7/14/23 03:09, Joelle van Dyne wrote: > > This SysBus variant of the CRB interface supports dynamically locating > > the MMIO interface so that Virt machines can use it. This interface > > is currently

Re: [PATCH v2 07/11] hw/arm/virt: add plug handler for TPM on SysBus

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 5:11 AM Stefan Berger wrote: > > > > On 7/14/23 03:09, Joelle van Dyne wrote: > > TPM needs to know its own base address in order to generate its DSDT > > device entry. > > > > Signed-off-by: Joelle van Dy

Re: [PATCH v2 11/11] tpm_crb: support restoring older vmstate

2023-07-14 Thread Joelle van Dyne
On Fri, Jul 14, 2023 at 7:51 AM Stefan Berger wrote: > > > > On 7/14/23 10:05, Stefan Berger wrote: > > > > > > On 7/14/23 03:09, Joelle van Dyne wrote: > >> When we moved to a single mapping and modified TPM CRB's VMState, it > >> broke resto

[PATCH v2 09/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-14 Thread Joelle van Dyne
in the ACPI table generation. However, currently we still have to call `build_tpm2` anyways and it does not look like most other ACPI devices support the `ACPI_DEV_AML_IF` interface. Signed-off-by: Joelle van Dyne --- hw/arm/virt-acpi-build.c | 38 ++ hw

[PATCH v2 08/11] hw/loongarch/virt: add plug handler for TPM on SysBus

2023-07-14 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- hw/loongarch/virt.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index e19b042ce8

[PATCH v2 07/11] hw/arm/virt: add plug handler for TPM on SysBus

2023-07-14 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- hw/arm/virt.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 7d9dbc2663..432148ef47 100644 --- a

[PATCH v2 11/11] tpm_crb: support restoring older vmstate

2023-07-14 Thread Joelle van Dyne
When we moved to a single mapping and modified TPM CRB's VMState, it broke restoring of VMs that were saved on an older version. This change allows those VMs to gracefully migrate to the new memory mapping. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 1 + hw/tpm/tpm_

[PATCH v2 03/11] tpm_ppi: refactor memory space initialization

2023-07-14 Thread Joelle van Dyne
Instead of calling `memory_region_add_subregion` directly, we defer to the caller to do it. This allows us to re-use the code for a SysBus device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- hw/tpm/tpm_ppi.h| 10 +++--- hw/tpm/tpm_crb.c| 4 ++-- hw/tpm

[PATCH v2 05/11] tpm_crb: use the ISA bus

2023-07-14 Thread Joelle van Dyne
Since this device is gated to only build for targets with the PC configuration, we should use the ISA bus like with TPM TIS. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.c | 52 hw/tpm/Kconfig | 2 +- 2 files changed, 27 insertions(+), 27

[PATCH v2 10/11] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-07-14 Thread Joelle van Dyne
\ --tpmstate backend-uri=file://tpm.data \ --tpm2 ``` Signed-off-by: Joelle van Dyne --- docs/specs/tpm.rst | 1 + include/hw/acpi/aml-build.h | 1 + include/sysemu/tpm.h| 3 + hw/acpi/aml-build.c | 7 +- hw/arm/virt.c | 1 + hw/core/sysbus-fdt.c

[PATCH v2 02/11] tpm_crb: CTRL_RSP_ADDR is 64-bits wide

2023-07-14 Thread Joelle van Dyne
address so this was not an issue. However, once we support SysBus CRB device, the address can be anywhere in 64-bit space. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- include/hw/acpi/tpm.h | 3 ++- hw/tpm/tpm_crb_common.c| 3 ++- tests/qtest/tpm-crb-test.c | 2 +- tests

[PATCH v2 06/11] tpm_crb: move ACPI table building to device interface

2023-07-14 Thread Joelle van Dyne
This logic is similar to TPM TIS ISA device. Since TPM CRB can only support TPM 2.0 backends, we check for this in realize. Signed-off-by: Joelle van Dyne --- hw/i386/acpi-build.c | 23 --- hw/tpm/tpm_crb.c | 29 + 2 files changed, 29

[PATCH v2 04/11] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-07-14 Thread Joelle van Dyne
to worry about updating it for reads. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 2 - hw/tpm/tpm_crb.c| 3 - hw/tpm/tpm_crb_common.c | 126 +--- 3 files changed, 65 insertions(+), 66 deletions(-) diff --git a/hw/tpm/tpm_crb.h b

[PATCH v2 01/11] tpm_crb: refactor common code

2023-07-14 Thread Joelle van Dyne
In preparation for the SysBus variant, we move common code styled after the TPM TIS devices. To maintain compatibility, we do not rename the existing tpm-crb device. Signed-off-by: Joelle van Dyne Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 1 + hw/tpm/tpm_crb.h| 76

[PATCH v2 00/11] tpm: introduce TPM CRB SysBus device

2023-07-14 Thread Joelle van Dyne
ACPI entry, we accidently changed _UID from 0 to 1. This shouldn't be an issue but we changed it back just in case. - Added a patch to migrate saved VMstate from an older version with the regs saved separately instead of as a RAM block. Joelle van Dyne (11): tpm_crb: refactor common code

Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option

2023-07-13 Thread Joelle van Dyne
On Thu, Jul 13, 2023 at 11:07 PM Joelle van Dyne wrote: > > On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger wrote: > > > > The ppi command line option for the TIS device on sysbus never worked > > and caused an immediate segfault. Remove support for it since it also

Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option

2023-07-13 Thread Joelle van Dyne
On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger wrote: > > The ppi command line option for the TIS device on sysbus never worked > and caused an immediate segfault. Remove support for it since it also > needs support in the firmware and needs testing inside the VM. > > Reproducer with the ppi=on op

Re: [PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled

2023-07-13 Thread Joelle van Dyne
On Thu, Jul 13, 2023 at 9:49 AM Stefan Berger wrote: > > > The tpm-tis-device doesn't work for x86_64 but for aarch64. > > > We have this here in this file: > > DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, false), > > I don't know whether ppi would work on aarch64. It needs firm

Re: [PATCH 06/11] tpm_crb: move ACPI table building to device interface

2023-07-13 Thread Joelle van Dyne
In that case, do you think we should have a check in "realize" to make sure the backend is 2.0? On Thu, Jul 13, 2023 at 9:08 AM Stefan Berger wrote: > > > > On 7/12/23 23:51, Joelle van Dyne wrote: > > This logic is similar to TPM TIS ISA device. > >

Re: [PATCH 07/11] hw/arm/virt: add plug handler for TPM on SysBus

2023-07-13 Thread Joelle van Dyne
On Thu, Jul 13, 2023 at 8:31 AM Peter Maydell wrote: > > On Thu, 13 Jul 2023 at 04:52, Joelle van Dyne wrote: > > > > TPM needs to know its own base address in order to generate its DSDT > > device entry. > > > > Signed-off-by: Joelle van D

Re: [PATCH 00/11] tpm: introduce TPM CRB SysBus device

2023-07-13 Thread Joelle van Dyne
On Thu, Jul 13, 2023 at 6:07 AM Stefan Berger wrote: > > > > On 7/12/23 23:51, Joelle van Dyne wrote: > > The impetus for this patch set is to get TPM 2.0 working on Windows 11 > > ARM64. > > Windows' tpm.sys does not seem to work on a TPM TIS device (as verifi

[PATCH 01/11] tpm_crb: refactor common code

2023-07-12 Thread Joelle van Dyne
In preparation for the SysBus variant, we move common code styled after the TPM TIS devices. To maintain compatibility, we do not rename the existing tpm-crb device. Signed-off-by: Joelle van Dyne --- docs/specs/tpm.rst | 1 + hw/tpm/tpm_crb.h| 76 +++ hw/tpm/tpm_crb.c

[PATCH 11/11] tpm_crb_sysbus: introduce TPM CRB SysBus device

2023-07-12 Thread Joelle van Dyne
van Dyne --- docs/specs/tpm.rst | 1 + include/hw/acpi/aml-build.h | 1 + include/sysemu/tpm.h| 3 + hw/acpi/aml-build.c | 7 +- hw/arm/virt.c | 1 + hw/core/sysbus-fdt.c| 1 + hw/loongarch/virt.c | 1 + hw/riscv/virt.c

[PATCH 07/11] hw/arm/virt: add plug handler for TPM on SysBus

2023-07-12 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- hw/arm/virt.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 7d9dbc2663..432148ef47 100644 --- a

[PATCH 10/11] tpm_tis_sysbus: move DSDT AML generation to device

2023-07-12 Thread Joelle van Dyne
in the ACPI table generation. However, currently we still have to call `build_tpm2` anyways and it does not look like most other ACPI devices support the `ACPI_DEV_AML_IF` interface. Signed-off-by: Joelle van Dyne --- hw/arm/virt-acpi-build.c | 38 ++ hw

[PATCH 04/11] tpm_crb: use a single read-as-mem/write-as-mmio mapping

2023-07-12 Thread Joelle van Dyne
. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.h| 2 - hw/tpm/tpm_crb.c| 3 - hw/tpm/tpm_crb_common.c | 124 3 files changed, 63 insertions(+), 66 deletions(-) diff --git a/hw/tpm/tpm_crb.h b/hw/tpm/tpm_crb.h index da3a0cf256

[PATCH 03/11] tpm_ppi: refactor memory space initialization

2023-07-12 Thread Joelle van Dyne
Instead of calling `memory_region_add_subregion` directly, we defer to the caller to do it. This allows us to re-use the code for a SysBus device. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_ppi.h| 10 +++--- hw/tpm/tpm_crb.c| 4 ++-- hw/tpm/tpm_crb_common.c | 3 +++ hw

[PATCH 08/11] hw/loongarch/virt: add plug handler for TPM on SysBus

2023-07-12 Thread Joelle van Dyne
TPM needs to know its own base address in order to generate its DSDT device entry. Signed-off-by: Joelle van Dyne --- hw/loongarch/virt.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index e19b042ce8

[PATCH 06/11] tpm_crb: move ACPI table building to device interface

2023-07-12 Thread Joelle van Dyne
This logic is similar to TPM TIS ISA device. Signed-off-by: Joelle van Dyne --- hw/i386/acpi-build.c | 23 --- hw/tpm/tpm_crb.c | 28 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c

[PATCH 02/11] tpm_crb: CTRL_RSP_ADDR is 64-bits wide

2023-07-12 Thread Joelle van Dyne
address so this was not an issue. However, once we support SysBus CRB device, the address can be anywhere in 64-bit space. Signed-off-by: Joelle van Dyne --- include/hw/acpi/tpm.h | 3 ++- hw/tpm/tpm_crb_common.c| 3 ++- tests/qtest/tpm-crb-test.c | 2 +- tests/qtest/tpm-util.c | 2

[PATCH 05/11] tpm_crb: use the ISA bus

2023-07-12 Thread Joelle van Dyne
Since this device is gated to only build for targets with the PC configuration, we should use the ISA bus like with TPM TIS. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_crb.c | 52 hw/tpm/Kconfig | 2 +- 2 files changed, 27 insertions(+), 27

[PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled

2023-07-12 Thread Joelle van Dyne
If 'ppi' property is set, then `tpm_ppi_reset` is called on reset which SEGFAULTs because `tpmppi->buf` is not allocated. Signed-off-by: Joelle van Dyne --- hw/tpm/tpm_tis_sysbus.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_s

  1   2   3   4   >