Re: [PATCH v2 08/10] target/i386/kvm: reset AMD PMU registers during VM reset

2025-03-05 Thread Francesco Lavra
On 2025-03-02 at 22:00, Dongli Zhang wrote: > +static bool is_same_vendor(CPUX86State *env) > +{ > +static uint32_t host_cpuid_vendor1; > +static uint32_t host_cpuid_vendor2; > +static uint32_t host_cpuid_vendor3; What's the purpose of making these variables static? > +host_cpuid(

Re: [PATCH v7 38/52] i386/apic: Skip kvm_apic_put() for TDX

2025-02-27 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > KVM neithers allow writing to MSR_IA32_APICBASE for TDs, nor allow > for > KVM_SET_LAPIC[*]. > > Note, KVM_GET_LAPIC is also disallowed for TDX. It is called in the > path > >   do_kvm_cpu_synchronize_state() >   -> kvm_arch_get_registers() >

Re: [PATCH v7 28/52] i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility

2025-02-27 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > diff --git a/system/runstate.c b/system/runstate.c > index 272801d30769..c4244c8915c6 100644 > --- a/system/runstate.c > +++ b/system/runstate.c > @@ -565,6 +565,60 @@ static void qemu_system_wakeup(void) > } >  } >   > +static char *tdx_p

Re: [PATCH v7 19/52] i386/tdx: Track mem_ptr for each firmware entry of TDVF

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c > index 73f90b0a2217..8564b3ae905d 100644 > --- a/target/i386/kvm/tdx.c > +++ b/target/i386/kvm/tdx.c > @@ -12,10 +12,14 @@ >  #include "qemu/osdep.h" >  #include "qemu/error-report.h"

Re: [PATCH v7 19/52] i386/tdx: Track mem_ptr for each firmware entry of TDVF

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > +static void tdx_finalize_vm(Notifier *notifier, void *unused) > +{ > +    TdxFirmware *tdvf = &tdx_guest->tdvf; > +    TdxFirmwareEntry *entry; > + > +    for_each_tdx_fw_entry(tdvf, entry) { > +    switch (entry->type) { > +    case T

Re: [PATCH v7 16/52] i386/tdvf: Introduce function to parse TDVF metadata

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > +int tdvf_parse_metadata(TdxFirmware *fw, void *flash_ptr, int size) > +{ > +    g_autofree TdvfSectionEntry *sections = NULL; > +    TdvfMetadata *metadata; > +    ssize_t entries_size; > +    int i; > + > +    metadata = tdvf_get_metadata(fla

Re: [PATCH v7 08/52] i386/tdx: Initialize TDX before creating TD vcpus

2025-02-19 Thread Francesco Lavra
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote: > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c > index 45867dbe0839..e35a9fbd687e 100644 > --- a/accel/kvm/kvm-all.c > +++ b/accel/kvm/kvm-all.c > @@ -540,8 +540,15 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) >   > trace_kvm_

Re: [PATCH v7 05/52] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2025-02-18 Thread Francesco Lavra
On Fri, 24 Jan 2025 08:20:01 -0500, Xiaoyao Li wrote: > diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c > index 4ff94860815d..bd212abab865 100644 > --- a/target/i386/kvm/tdx.c > +++ b/target/i386/kvm/tdx.c > @@ -10,17 +10,122 @@ > */ > > #include "qemu/osdep.h" > +#include "qemu/err

Re: [PATCH v6 60/60] docs: Add TDX documentation

2024-11-12 Thread Francesco Lavra
On Tue, 2024-11-05 at 01:24 -0500, Xiaoyao Li wrote: > diff --git a/docs/system/confidential-guest-support.rst > b/docs/system/confidential-guest-support.rst > index 0c490dbda2b7..66129fbab64c 100644 > --- a/docs/system/confidential-guest-support.rst > +++ b/docs/system/confidential-guest-support.

[Qemu-devel] [PATCH v3 2/2] Versatile Express: Add modelling of NOR flash

2012-09-19 Thread Francesco Lavra
This patch adds modelling of the two NOR flash banks found on the Versatile Express motherboard. Tested with U-Boot running on an emulated Versatile Express, with either A9 or A15 CoreTile. Signed-off-by: Francesco Lavra --- Changes in v3: - When registering either flash bank as CFI device

[Qemu-devel] [PATCH v2 1/2] Versatile Express: Fix NOR flash 0 address and remove flash alias

2012-09-19 Thread Francesco Lavra
simplicity removes the alias definition. Signed-off-by: Francesco Lavra --- hw/vexpress.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/vexpress.c b/hw/vexpress.c index b615844..454c2bb 100644 --- a/hw/vexpress.c +++ b/hw/vexpress.c @@ -62,7 +62,6 @@ enum

[Qemu-devel] [PATCH v3 0/2] Versatile Express: Add modelling of NOR flash

2012-09-19 Thread Francesco Lavra
: - When registering either flash bank as CFI device results in an error, terminate QEMU. Changes in v2: - Fix definition of NOR flash 0 address and remove flash alias in Cortex-A Series memory map. - Use drive_get_next() instead of drive_get() to get a backing storage for each flash bank. Francesco

Re: [Qemu-devel] [PATCH v2 2/2] Versatile Express: add modelling of NOR flash

2012-09-19 Thread Francesco Lavra
On 09/19/2012 12:26 PM, Peter Maydell wrote: > On 18 September 2012 21:59, Francesco Lavra > wrote: >> On 09/18/2012 03:46 PM, Peter Maydell wrote: >>> On 17 September 2012 21:08, Francesco Lavra >>> wrote: >>>> qemu_irq pic[64]; >>>

Re: [Qemu-devel] [PATCH v2 2/2] Versatile Express: add modelling of NOR flash

2012-09-18 Thread Francesco Lavra
On 09/18/2012 03:46 PM, Peter Maydell wrote: > On 17 September 2012 21:08, Francesco Lavra > wrote: >> This patch adds modelling of the two NOR flash banks found on the >> Versatile Express motherboard. Tested with U-Boot running on an emulated >> Versatile Expres

[Qemu-devel] [PATCH v2 2/2] Versatile Express: add modelling of NOR flash

2012-09-17 Thread Francesco Lavra
This patch adds modelling of the two NOR flash banks found on the Versatile Express motherboard. Tested with U-Boot running on an emulated Versatile Express, with either A9 or A15 CoreTile. Signed-off-by: Francesco Lavra --- Changes in v2: Use drive_get_next() instead of drive_get() to get a

[Qemu-devel] [PATCH v2 1/2] Versatile Express: Fix NOR flash 0 address and remove flash alias

2012-09-17 Thread Francesco Lavra
simplicity removes the alias definition. Signed-off-by: Francesco Lavra --- hw/vexpress.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/vexpress.c b/hw/vexpress.c index b615844..454c2bb 100644 --- a/hw/vexpress.c +++ b/hw/vexpress.c @@ -62,7 +62,6 @@ enum

[Qemu-devel] [PATCH v2 0/2] Versatile Express: add modelling of NOR flash

2012-09-17 Thread Francesco Lavra
: Fix definition of NOR flash 0 address and remove flash alias in Cortex-A Series memory map. Use drive_get_next() instead of drive_get() to get a backing storage for each flash bank. Francesco Lavra (2): Versatile Express: Fix NOR flash 0 address and remove flash alias Versatile Express: Add

Re: [Qemu-devel] [PATCH] Versatile Express: add modelling of NOR flash

2012-09-17 Thread Francesco Lavra
On 09/17/2012 03:21 PM, Peter Maydell wrote: > On 5 September 2012 20:07, Francesco Lavra > wrote: >> Documentation at >> http://infocenter.arm.com/help/topic/com.arm.doc.ddi0503c/CHDEFDJF.html >> says that the entire first 512 MB can be mapped to either SMC (which is &g

Re: [Qemu-devel] [PATCH] Versatile Express: add modelling of NOR flash

2012-09-15 Thread Francesco Lavra
On 09/05/2012 09:07 PM, Francesco Lavra wrote: > Hi, > > On 09/05/2012 10:47 AM, Peter Maydell wrote: >> On 5 September 2012 06:16, Stefan Weil wrote: >>> Am 04.09.2012 19:08, schrieb Francesco Lavra: >>>> /* VE_NORFLASH0ALIAS: not modelled */ >>

Re: [Qemu-devel] [PATCH] Versatile Express: add modelling of NOR flash

2012-09-05 Thread Francesco Lavra
Hi, On 09/05/2012 10:47 AM, Peter Maydell wrote: > On 5 September 2012 06:16, Stefan Weil wrote: >> Am 04.09.2012 19:08, schrieb Francesco Lavra: >>> /* VE_NORFLASH0ALIAS: not modelled */ >> >> >> What about that alias? It's not d

[Qemu-devel] [PATCH] Versatile Express: add modelling of NOR flash

2012-09-04 Thread Francesco Lavra
This patch adds modelling of the two NOR flash banks found in the Versatile Express motherboard. Tested with U-Boot running on an emulated Versatile Express A9. The alias of the first NOR flash in the Cortex-A Series memory map is not modelled. Signed-off-by: Francesco Lavra --- hw/vexpress.c