Re: E820 memory allocation issue on Threadripper platforms

2024-01-11 Thread Xenia Ragiadakou
On 11/1/24 10:37, Jan Beulich wrote: On 11.01.2024 03:29, Patrick Plenefisch wrote: Hi, I ran into a memory allocation issue, I think. It is the same as https://github.com/QubesOS/qubes-issues/issues/8791 and I saw at the end it was recommended (by marmarek) that the issue reporter forward

Re: [PATCH] x86/hvm: don't expose XENFEAT_hvm_pirqs by default

2024-01-11 Thread Xenia Ragiadakou
Hi Roger, On 10/1/24 17:21, Roger Pau Monné wrote: On Wed, Jan 10, 2024 at 03:47:12PM +0200, Xenia Ragiadakou wrote: On 10/1/24 12:26, Jan Beulich wrote: On 10.01.2024 10:53, Roger Pau Monne wrote: The HVM pirq feature allows routing interrupts from both physical and emulated devices over

Re: [PATCH] x86/hvm: don't expose XENFEAT_hvm_pirqs by default

2024-01-10 Thread Xenia Ragiadakou
On 10/1/24 12:26, Jan Beulich wrote: On 10.01.2024 10:53, Roger Pau Monne wrote: The HVM pirq feature allows routing interrupts from both physical and emulated devices over event channels, this was done a performance improvement. However its usage is fully undocumented, and the only

Re: [PATCH v6 06/11] softmmu/memory: enable automatic deallocation of memory regions

2023-12-21 Thread Xenia Ragiadakou
On 21/12/23 09:50, Akihiko Odaki wrote: On 2023/12/21 16:35, Xenia Ragiadakou wrote: On 21/12/23 07:45, Akihiko Odaki wrote: On 2023/12/19 16:53, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically

Re: [PATCH v6 07/11] virtio-gpu: Handle resource blob commands

2023-12-20 Thread Xenia Ragiadakou
,blob=true Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko Signed-off-by: Xenia Ragiadakou Signed-off-by: Huang Rui --- Changes in v6: - Use new struct virgl_gpu_resource. - Unmap, unref and destroy the resource only after the memory region    has been completely removed

Re: [PATCH v6 06/11] softmmu/memory: enable automatic deallocation of memory regions

2023-12-20 Thread Xenia Ragiadakou
On 21/12/23 07:45, Akihiko Odaki wrote: On 2023/12/19 16:53, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically released, once has been unparent and once all of her references have gone away, via

[PATCH] x86/irq: do not insert IRQ_MSI_EMU in emuirq mappings

2023-10-31 Thread Xenia Ragiadakou
Do not use emuirq mappings for MSIs injected by emulated devices. This kind of pirq shares the same emuirq value and is not remapped. Fixes: 88fccdd11ca0 ('xen: event channel remapping for emulated MSIs') Signed-off-by: Xenia Ragiadakou --- Question: is there any strong reason why Linux HVM

[PATCH v3] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-31 Thread Xenia Ragiadakou
ditionals to include so far unconsidered cases as well, uniformly returning the lowest available address. Fixes: 73b47eea2104 ('x86/dom0: improve PVH initrd and metadata placement') Signed-off-by: Xenia Ragiadakou Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- Changes in v3: - m

[PATCH v2] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-30 Thread Xenia Ragiadakou
This patch reorganizes the conditionals to include so far unconsidered cases as well, uniformly returning the lowest available address. Fixes: 73b47eea2104 ('x86/dom0: improve PVH initrd and metadata placement') Signed-off-by: Xenia Ragiadakou Signed-off-by: Jan Beulich --- Changes in v2: - cover fur

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-30 Thread Xenia Ragiadakou
On 27/10/23 15:01, Jan Beulich wrote: On 27.10.2023 13:18, Xenia Ragiadakou wrote: On 27/10/23 09:37, Jan Beulich wrote: On 26.10.2023 18:55, Xenia Ragiadakou wrote: On 26/10/23 17:55, Jan Beulich wrote: On 26.10.2023 15:58, Xenia Ragiadakou wrote: On 26/10/23 15:37, Jan Beulich wrote

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-27 Thread Xenia Ragiadakou
On 27/10/23 09:37, Jan Beulich wrote: On 26.10.2023 18:55, Xenia Ragiadakou wrote: On 26/10/23 17:55, Jan Beulich wrote: On 26.10.2023 15:58, Xenia Ragiadakou wrote: On 26/10/23 15:37, Jan Beulich wrote: On 26.10.2023 14:35, Xenia Ragiadakou wrote: On 26/10/23 14:51, Jan Beulich

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 17:55, Jan Beulich wrote: On 26.10.2023 15:58, Xenia Ragiadakou wrote: On 26/10/23 15:37, Jan Beulich wrote: On 26.10.2023 14:35, Xenia Ragiadakou wrote: On 26/10/23 14:51, Jan Beulich wrote: On 26.10.2023 11:46, Xenia Ragiadakou wrote: On 26/10/23 11:45, Jan Beulich wrote

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 15:37, Jan Beulich wrote: On 26.10.2023 14:35, Xenia Ragiadakou wrote: On 26/10/23 14:51, Jan Beulich wrote: On 26.10.2023 11:46, Xenia Ragiadakou wrote: On 26/10/23 11:45, Jan Beulich wrote: On 26.10.2023 10:34, Xenia Ragiadakou wrote: On 26/10/23 10:35, Jan Beulich wrote

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 14:51, Jan Beulich wrote: On 26.10.2023 11:46, Xenia Ragiadakou wrote: On 26/10/23 11:45, Jan Beulich wrote: On 26.10.2023 10:34, Xenia Ragiadakou wrote: On 26/10/23 10:35, Jan Beulich wrote: On 26.10.2023 08:45, Xenia Ragiadakou wrote: --- a/xen/arch/x86/hvm/dom0_build.c

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 14:41, Jan Beulich wrote: On 26.10.2023 12:31, Andrew Cooper wrote: On 26/10/2023 9:34 am, Xenia Ragiadakou wrote: On 26/10/23 10:35, Jan Beulich wrote: On 26.10.2023 08:45, Xenia Ragiadakou wrote: Given that start < kernel_end and end > kernel_start, the logic that dete

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 11:45, Jan Beulich wrote: On 26.10.2023 10:34, Xenia Ragiadakou wrote: On 26/10/23 10:35, Jan Beulich wrote: On 26.10.2023 08:45, Xenia Ragiadakou wrote: Given that start < kernel_end and end > kernel_start, the logic that determines the best placement for dom0

Re: [PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
On 26/10/23 10:35, Jan Beulich wrote: On 26.10.2023 08:45, Xenia Ragiadakou wrote: Given that start < kernel_end and end > kernel_start, the logic that determines the best placement for dom0 initrd and metadata, does not take into account the two cases below: (1) start > kernel_sta

[PATCH] x86/hvm/dom0: fix PVH initrd and metadata placement

2023-10-26 Thread Xenia Ragiadakou
under evaluation. This patch rephrases the if condition to include the above two cases without affecting the behaviour for the case where start < kernel_start && end > kernel_end Fixes: 73b47eea2104 ('x86/dom0: improve PVH initrd and metadata placement') Signed-off-by: Xenia Ragiadakou --- x

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-20 Thread Xenia Ragiadakou
On 20/9/23 01:18, Akihiko Odaki wrote: On 2023/09/19 23:21, Xenia Ragiadakou wrote: On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-19 Thread Xenia Ragiadakou
On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-19 Thread Xenia Ragiadakou
On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically released, once has been unparent and once all of her references have gone away, via

[PATCH] paravirt: call pci_bios_init_devices() when runningOnXen()

2023-07-14 Thread Xenia Ragiadakou
the reason why any subsequent guest access to those registers is not handled. This patch adds a call to pci_bios_init_devices() to the early xen platform setup code. Signed-off-by: Xenia Ragiadakou --- src/fw/paravirt.c | 1 + src/fw/pciinit.c | 2 +- src/util.h| 1 + 3 files changed, 3

[PATCH] OvmfPkg/OvmfXen: Fix S3

2023-07-13 Thread Xenia Ragiadakou
ing happens under guest's feet, so any subsequent attempt of the guest to access the shared info page results in nested page faults. This patch removes any local APIC timer initializion and calibration from S3 resume path. Signed-off-by: Xenia Ragiadakou --- OvmfPkg/XenPlatformPei/F

Re: [PATCH 2/2] xen/x86/pvh: copy ACPI tables to Dom0 instead of mapping

2023-05-18 Thread Xenia Ragiadakou
On 18/5/23 12:31, Roger Pau Monné wrote: On Thu, May 18, 2023 at 10:24:10AM +0300, Xenia Ragiadakou wrote: On 15/5/23 17:17, Jan Beulich wrote: On 13.05.2023 03:17, Stefano Stabellini wrote: From: Stefano Stabellini Mapping the ACPI tables to Dom0 PVH 1:1 leads to memory corruptions

Re: [PATCH 2/2] xen/x86/pvh: copy ACPI tables to Dom0 instead of mapping

2023-05-18 Thread Xenia Ragiadakou
On 15/5/23 17:17, Jan Beulich wrote: On 13.05.2023 03:17, Stefano Stabellini wrote: From: Stefano Stabellini Mapping the ACPI tables to Dom0 PVH 1:1 leads to memory corruptions of the tables in the guest. Instead, copy the tables to Dom0. Do you really mean "in the guest" (i.e. from Xen's

[PATCH v2 3/3] x86/hvm: create hvm_funcs for {svm,vmx}_{set,clear}_msr_intercept()

2023-04-24 Thread Xenia Ragiadakou
Add hvm_funcs hooks for {set,clear}_msr_intercept() for controlling the msr intercept in common vpmu code. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - change the parameter types to unsigned int xen/arch/x86/cpu/vpmu_amd.c | 10

[PATCH v2 2/3] x86/vmx: replace enum vmx_msr_intercept_type with the msr access flags

2023-04-24 Thread Xenia Ragiadakou
Replace enum vmx_msr_intercept_type with the msr access flags, defined in hvm.h, so that the functions {svm,vmx}_{set,clear}_msr_intercept() share the same prototype. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - change from int to unsigned int the type

[PATCH v2 1/3] x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept()

2023-04-24 Thread Xenia Ragiadakou
time, take the opportunity to remove excess parentheses. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - restore BUG_ON(), reported by Jan - coding style fixes, reported by Jan - remove excess parentheses from macros, suggested by Jan - change from int to un

[PATCH v2 0/3] hvm: add hvm_funcs hooks for msr intercept handling

2023-04-24 Thread Xenia Ragiadakou
of virtualization techonology-specific code, and whether this abstraction is actually usefull to have. Xenia Ragiadakou (3): x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept() x86/vmx: replace enum vmx_msr_intercept_type with the msr access flags x86/hvm: create hvm_funcs for {svm

Re: [PATCH 4/4] x86/hvm: create hvm_funcs for {svm,vmx}_{set,clear}_msr_intercept()

2023-02-28 Thread Xenia Ragiadakou
On 2/28/23 16:58, Jan Beulich wrote: On 27.02.2023 08:56, Xenia Ragiadakou wrote: Add hvm_funcs hooks for {set,clear}_msr_intercept() for controlling the msr intercept in common vpmu code. What is this going to buy us? All calls ... --- a/xen/arch/x86/cpu/vpmu_amd.c +++ b/xen/arch/x86/cpu

Re: [PATCH 2/4] x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept()

2023-02-28 Thread Xenia Ragiadakou
On 2/28/23 17:10, Jan Beulich wrote: On 28.02.2023 16:05, Xenia Ragiadakou wrote: On 2/28/23 16:20, Jan Beulich wrote: On 27.02.2023 08:56, Xenia Ragiadakou wrote: This change aims to render the control interface of MSR intercepts identical between SVM and VMX code, so that the control

Re: [PATCH 3/4] x86/vmx: replace enum vmx_msr_intercept_type with the msr access flags

2023-02-28 Thread Xenia Ragiadakou
On 2/28/23 16:34, Jan Beulich wrote: On 28.02.2023 15:31, Jan Beulich wrote: On 27.02.2023 08:56, Xenia Ragiadakou wrote: --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h @@ -644,18 +644,8 @@ static inline int vmx_write_guest_msr(struct vcpu *v

Re: [PATCH 2/4] x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept()

2023-02-28 Thread Xenia Ragiadakou
Hi Jan, On 2/28/23 16:20, Jan Beulich wrote: On 27.02.2023 08:56, Xenia Ragiadakou wrote: This change aims to render the control interface of MSR intercepts identical between SVM and VMX code, so that the control of the MSR intercept in common code can be done through an hvm_funcs callback

Re: [PATCH v3 10/14] x86/vmx: move declarations used only by vmx code from vmx.h to private headers

2023-02-27 Thread Xenia Ragiadakou
On 2/27/23 17:25, Jan Beulich wrote: On 24.02.2023 19:50, Xenia Ragiadakou wrote: --- /dev/null +++ b/xen/arch/x86/hvm/vmx/pi.h @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * pi.h: VMX Posted Interrupts + * + * Copyright (c) 2004, Intel Corporation. + */ + +#ifndef

Re: [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup

2023-02-27 Thread Xenia Ragiadakou
On 2/27/23 14:17, Jan Beulich wrote: On 27.02.2023 13:06, Andrew Cooper wrote: On 27/02/2023 11:33 am, Jan Beulich wrote: On 27.02.2023 12:15, Andrew Cooper wrote: On 27/02/2023 10:46 am, Jan Beulich wrote: On 24.02.2023 22:33, Andrew Cooper wrote: But I think we want to change tact

Re: [PATCH v3 05.5/14] x86/svm: Decouple types in struct nestedsvm

2023-02-27 Thread Xenia Ragiadakou
more of the SVM internal infrastructure. Signed-off-by: Andrew Cooper Reviewed-by: Xenia Ragiadakou -- Xenia

[PATCH 3/4] x86/vmx: replace enum vmx_msr_intercept_type with the msr access flags

2023-02-26 Thread Xenia Ragiadakou
Replace enum vmx_msr_intercept_type with the msr access flags, defined in hvm.h, so that the functions {svm,vmx}_{set,clear}_msr_intercept() share the same prototype. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/cpu/vpmu_intel.c | 24

[PATCH 4/4] x86/hvm: create hvm_funcs for {svm,vmx}_{set,clear}_msr_intercept()

2023-02-26 Thread Xenia Ragiadakou
Add hvm_funcs hooks for {set,clear}_msr_intercept() for controlling the msr intercept in common vpmu code. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/cpu/vpmu_amd.c | 10 - xen/arch/x86/cpu/vpmu_intel.c | 24

[PATCH 0/4] hvm: add hvm_funcs hooks for msr intercept handling

2023-02-26 Thread Xenia Ragiadakou
through a generic hvm wrapper function. Xenia Ragiadakou (4): x86/vpmu: rename {svm,vmx}_vpmu_initialise to {amd,core2}_vpmu_initialise x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept() x86/vmx: replace enum vmx_msr_intercept_type with the msr access flags x86/hvm

[PATCH 2/4] x86/svm: split svm_intercept_msr() into svm_{set,clear}_msr_intercept()

2023-02-26 Thread Xenia Ragiadakou
of the flags in asm/hvm/hvm.h because there is the intention to be used by VMX code as well. Remove svm_intercept_msr() and MSR_INTERCEPT_* definitions, and use the new functions and flags instead. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/cpu/vpmu_amd.c

[PATCH 1/4] x86/vpmu: rename {svm,vmx}_vpmu_initialise to {amd,core2}_vpmu_initialise

2023-02-26 Thread Xenia Ragiadakou
, and correct the filename. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/cpu/vpmu_amd.c | 6 +++--- xen/arch/x86/cpu/vpmu_intel.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c index

Re: [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup

2023-02-24 Thread Xenia Ragiadakou
On 2/24/23 23:33, Andrew Cooper wrote: On 24/02/2023 8:08 pm, Xenia Ragiadakou wrote: On 2/24/23 21:29, Andrew Cooper wrote: On 24/02/2023 6:49 pm, Xenia Ragiadakou wrote: There are more detailed per-patch changesets. Xenia Ragiadakou (14):    x86/svm: move declarations used only by svm

Re: [PATCH v3 05/14] x86/svm: move nestedsvm declarations used only by svm code to private header

2023-02-24 Thread Xenia Ragiadakou
On 2/24/23 22:12, Andrew Cooper wrote: On 24/02/2023 6:50 pm, Xenia Ragiadakou wrote: diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h new file mode 100644 index 00..43245e13de --- /dev/null +++ b/xen/arch/x86/hvm/svm/nestedhvm.h @@ -0,0 +1,77

Re: [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup

2023-02-24 Thread Xenia Ragiadakou
On 2/24/23 21:29, Andrew Cooper wrote: On 24/02/2023 6:49 pm, Xenia Ragiadakou wrote: There are more detailed per-patch changesets. Xenia Ragiadakou (14): x86/svm: move declarations used only by svm code from svm.h to private header x86/svm: make asid.h private x86/svm: delete

Re: [PATCH v3 04/14 - ALT] x86/svm: Remove the asm/hvm/svm/emulate.h header

2023-02-24 Thread Xenia Ragiadakou
On 2/24/23 21:58, Andrew Cooper wrote: These days, this is just two length helpers. Move into the private svm.h No functional change intended. Signed-off-by: Andrew Cooper Reviewed-by: Xenia Ragiadakou -- Xenia

Re: [PATCH v3 02/14 - ALT] x86/svm: Remove the asm/hvm/svm/asid.h header

2023-02-24 Thread Xenia Ragiadakou
h, forward declaring cpuinfo_x86 in preference to including asm/processor.h No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Xenia Ragiadakou

[PATCH v3 11/14] x86/vmx: remove unused included headers from vmx.c

2023-02-24 Thread Xenia Ragiadakou
change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - none xen/arch/x86/hvm/vmx/vmx.c | 56 +- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index cb8b133ed5..9b009ebcef

[PATCH v3 14/14] x86/vmx: move vmcs declarations used only by vmx code to private header

2023-02-24 Thread Xenia Ragiadakou
, all structures first, then all variable declarations, all function delarations, and finally all inline functions. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch xen/arch/x86/hvm/vmx/intr.c | 1 + xen/arch/x86/hvm/vmx/vmcs.c

[PATCH v3 13/14] x86/vmx: move vvmx declarations used only by vmx code to private header

2023-02-24 Thread Xenia Ragiadakou
, all structures first, then all variable decalarations, all function delarations, and finally all inline functions. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch xen/arch/x86/hvm/vmx/intr.c | 1 + xen/arch/x86/hvm/vmx/vmcs.c

[PATCH v3 10/14] x86/vmx: move declarations used only by vmx code from vmx.h to private headers

2023-02-24 Thread Xenia Ragiadakou
of GAS_VMX_OP definition. Also, rearrange the code in the following way, place all structures first, then all variable decalarations, all function delarations, and finally all inline functions. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - add SPDX

[PATCH v3 06/14] x86/svm: move vmcb declarations used only by svm code to private header

2023-02-24 Thread Xenia Ragiadakou
intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch xen/arch/x86/hvm/svm/asid.c | 1 + xen/arch/x86/hvm/svm/emulate.c | 1 + xen/arch/x86/hvm/svm/intr.c | 1 + xen/arch/x86/hvm/svm/nestedsvm.c| 1 + xen/arch/x86/hvm/svm/svm.c

[PATCH v3 12/14] x86/vmx: declare nvmx_enqueue_n2_exceptions() static

2023-02-24 Thread Xenia Ragiadakou
Reduce the scope of nvmx_enqueue_n2_exceptions() to static because it is used only in this file. Take the opportunity to remove a trailing space. Signed-off-by: Xenia Ragiadakou Reviewed-by: Jan Beulich --- Changes in v3: - add Jan's R-b tag xen/arch/x86/hvm/vmx/vmx.c | 2 +- 1 file

[PATCH v3 09/14] x86/vmx: remove unused included headers from vmx.h

2023-02-24 Thread Xenia Ragiadakou
the opportunity to include xen/types.h in the place of asm/types.h and replace u* with uint*_t and bool_t with bool. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - reword the commit message to not look like a bug fix, reported by JAn - include xen/types.h

[PATCH v3 08/14] x86/vmx: move vmx_update_debug_state() in vmcs.c and declare it static

2023-02-24 Thread Xenia Ragiadakou
Move vmx_update_debug_state() in vmcs.c because it is used only in this file and limit its scope to this file by declaring it static and removing its declaration from vmx.h. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - apply the change before moving

[PATCH v3 05/14] x86/svm: move nestedsvm declarations used only by svm code to private header

2023-02-24 Thread Xenia Ragiadakou
Create a new private header in arch/x86/hvm/svm called nestedsvm.h and move there all definitions and declarations that are used only by svm code and don't need to reside in an external header. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch

[PATCH v3 07/14] x86/svm: move svmdebug.h declarations to private vmcb.h and delete it

2023-02-24 Thread Xenia Ragiadakou
Move the declarations in svmdebug.h to private vmcb.h because are vmcb specific and are used only by internal svm code, and delete svmdebug.h. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch, suggested by Andrew xen/arch/x86/hvm/svm/nestedsvm.c

[PATCH v3 03/14] x86/svm: delete header asm/hvm/svm/intr.h

2023-02-24 Thread Xenia Ragiadakou
Delete asm/hvm/svm/intr.h because it contains only the declaration of svm_intr_assist() which is referenced only by assembly. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch, suggested by Andrew xen/arch/x86/hvm/svm/intr.c | 1

[PATCH v3 04/14] x86/svm: make emulate.h private

2023-02-24 Thread Xenia Ragiadakou
The header asm/hvm/svm/emulate.h is used only internally by the SVM code, so it can be changed into a private header. Take the opportunity to use an SPDX tag for the licence. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - new patch xen/arch/x86/hvm/svm

[PATCH v3 02/14] x86/svm: make asid.h private

2023-02-24 Thread Xenia Ragiadakou
The asm/hvm/svm/asid.h is used only internally by the SVM code, so it can be changed into a private header. Take the opportunity to use an SPDX tag for the licence and remove included but unused xen/types.h. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3

[PATCH v3 01/14] x86/svm: move declarations used only by svm code from svm.h to private header

2023-02-24 Thread Xenia Ragiadakou
the opportunity to re-arrange the header as follows, all structures first, then all variable decalarations, all function delarations, and finally all inline functions. No functional change intended. Signed-off-by: Xenia Ragiadakou --- Changes in v3: - add SPDX identifier in priv header

[PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup

2023-02-24 Thread Xenia Ragiadakou
and rearrange the code per Jan's suggestion - replace u* with uint*_t - rebased to the latest staging There are more detailed per-patch changesets. Xenia Ragiadakou (14): x86/svm: move declarations used only by svm code from svm.h to private header x86/svm: make asid.h private x86/svm

Re: [PATCH v2 6/9] x86/vmx: move declations used only by vmx code from vmx.h to private header

2023-02-23 Thread Xenia Ragiadakou
Hi Jan, On 2/23/23 12:47, Jan Beulich wrote: On 22.02.2023 13:00, Xenia Ragiadakou wrote: --- /dev/null +++ b/xen/arch/x86/hvm/vmx/vmx.h @@ -0,0 +1,459 @@ +#include + +#include +#include +#include +#include As in the earlier patch, please use xen/types.h right away. +extern int8_t

Re: [PATCH v2 3/9] x86/svm: move declarations used only by svm code from svm.h to private header

2023-02-23 Thread Xenia Ragiadakou
On 2/23/23 13:16, Andrew Cooper wrote: On 22/02/2023 12:00 pm, Xenia Ragiadakou wrote: Create a new private header in arch/x86/hvm/svm called svm.h and move there all definitions and declarations that are used solely by svm code. The function svm_invlpga() stays in arch/x86/hvm/svm/svm.h

Re: [PATCH v2 1/9] x86/svm: remove unused forward declaration of struct vcpu from svm.h

2023-02-23 Thread Xenia Ragiadakou
On 2/23/23 12:50, Andrew Cooper wrote: On 22/02/2023 12:59 pm, Jan Beulich wrote: On 22.02.2023 13:00, Xenia Ragiadakou wrote: Remove forward declaration of struct vcpu, that is a leftover since the removal of svm_update_guest_cr()'s declaration from svm.h. Signed-off-by: Xenia Ragiadakou

Re: [PATCH v2 5/9] x86/vmx: reduce scope of GAS_VMX_OP definition

2023-02-23 Thread Xenia Ragiadakou
On 2/23/23 12:31, Jan Beulich wrote: On 22.02.2023 13:00, Xenia Ragiadakou wrote: Since GAS_VMX_OP is used only by vm{read,write}_safe, move its definition just above those functions and undefine it after use. Signed-off-by: Xenia Ragiadakou This can easily be done as part of the next

Re: [PATCH v2 4/9] x86/vmx: remove unused included headers from vmx.h

2023-02-23 Thread Xenia Ragiadakou
On 2/23/23 12:29, Jan Beulich wrote: On 22.02.2023 13:00, Xenia Ragiadakou wrote: Do not include the headers: asm/i387.h asm/hvm/trace.h asm/processor.h asm/regs.h because none of the declarations and macro definitions in them is used in this file. Sort the rest of the headers

[PATCH v2 8/9] x86/vmx: declare nvmx_enqueue_n2_exceptions() static

2023-02-22 Thread Xenia Ragiadakou
Reduce the scope of nvmx_enqueue_n2_exceptions() to static because it is used only in this file. Take the opportunity to remove a trailing space. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - none xen/arch/x86/hvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 9/9] x86/vmx: move vmx_update_debug_state() in vmcs.c and declare it static

2023-02-22 Thread Xenia Ragiadakou
Move vmx_update_debug_state() in vmcs.c because it is used only in this file and limit its scope to this file by declaring it static and removing its declaration from private vmx.h Signed-off-by: Xenia Ragiadakou --- Changes in v2: - remove it from the private vmx.h header instead

[PATCH v2 6/9] x86/vmx: move declations used only by vmx code from vmx.h to private header

2023-02-22 Thread Xenia Ragiadakou
(), used in arch/x86/cpu, and consequently the opcodes stay in asm/hvm/vmx/vmx.h. Take the opportunity to remove a trailing white space from __vmxon(). Signed-off-by: Xenia Ragiadakou --- Changes in v2: - new patch, creation of private header for holding declarations and definitions consumed

[PATCH v2 5/9] x86/vmx: reduce scope of GAS_VMX_OP definition

2023-02-22 Thread Xenia Ragiadakou
Since GAS_VMX_OP is used only by vm{read,write}_safe, move its definition just above those functions and undefine it after use. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - none xen/arch/x86/include/asm/hvm/vmx/vmx.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH v2 7/9] x86/vmx: remove unused included headers from vmx.c

2023-02-22 Thread Xenia Ragiadakou
-by: Xenia Ragiadakou --- Changes in v2: -add a blank line between different types of hesders xen/arch/x86/hvm/vmx/vmx.c | 56 +- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index

[PATCH v2 1/9] x86/svm: remove unused forward declaration of struct vcpu from svm.h

2023-02-22 Thread Xenia Ragiadakou
Remove forward declaration of struct vcpu, that is a leftover since the removal of svm_update_guest_cr()'s declaration from svm.h. Signed-off-by: Xenia Ragiadakou Fixes: b158e72abe30 ("x86/hvm: CFI hardening for hvm_funcs") --- Changes in v2: - leave the forward declaration

[PATCH v2 2/9] x86/svm: opencode SVM_PAUSE{FILTER,THRESH}_INIT

2023-02-22 Thread Xenia Ragiadakou
Delete the macros SVM_PAUSE{FILTER,THRESH}_INIT from svm.h and opencode their values, since they are used in a single place and using macros is just unnecessary obfuscation. Signed-off-by: Xenia Ragiadakou --- Changes in v2: - opencode instead of moving the macros in vmcs.c, suggested

[PATCH v2 4/9] x86/vmx: remove unused included headers from vmx.h

2023-02-22 Thread Xenia Ragiadakou
(). Signed-off-by: Xenia Ragiadakou --- Changes in v2: -add a blank line between different types of headers, reported by Andrew -fix english in commit message, reported by Andrew xen/arch/x86/hvm/vmx/vmx.c | 1 + xen/arch/x86/include/asm/hvm/vmx/vmx.h | 9 +++-- 2 files

[PATCH v2 0/9] x86/hvm: {svm,vmx}.{c,h} cleanup

2023-02-22 Thread Xenia Ragiadakou
. Xenia Ragiadakou (9): x86/svm: remove unused forward declaration of struct vcpu from svm.h x86/svm: opencode SVM_PAUSE{FILTER,THRESH}_INIT x86/svm: move declarations used only by svm code from svm.h to private header x86/vmx: remove unused included headers from vmx.h x86/vmx: reduce scope

[PATCH v2 3/9] x86/svm: move declarations used only by svm code from svm.h to private header

2023-02-22 Thread Xenia Ragiadakou
Create a new private header in arch/x86/hvm/svm called svm.h and move there all definitions and declarations that are used solely by svm code. The function svm_invlpga() stays in arch/x86/hvm/svm/svm.h because it is used by arch/x86/hvm/svm/asid.h. Signed-off-by: Xenia Ragiadakou --- Changes

Re: [PATCH 1/4] x86/svm: cleanup svm.c

2023-02-21 Thread Xenia Ragiadakou
On 2/21/23 13:12, Jan Beulich wrote: On 21.02.2023 08:45, Xenia Ragiadakou wrote: Hi Andrew, On 2/21/23 00:12, Andrew Cooper wrote: On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: Do not include the headers: xen/irq.h asm/hvm/svm/intr.h asm/io.h asm/mem_sharing.h asm

Re: [PATCH 4/4] x86/vmx: cleanup vmx.h

2023-02-21 Thread Xenia Ragiadakou
On 2/21/23 13:23, Jan Beulich wrote: On 17.02.2023 19:48, Xenia Ragiadakou wrote: Do not include the headers: asm/i387.h asm/hvm/trace.h asm/processor.h asm/regs.h because none of the declarations and macro definitions in them is used in this file. Sort alphabetically the rest

Re: [PATCH 3/4] x86/vmx: cleanup vmx.c

2023-02-21 Thread Xenia Ragiadakou
Hi Jan, On 2/21/23 13:26, Jan Beulich wrote: On 17.02.2023 19:48, Xenia Ragiadakou wrote: Do not include the headers: asm/hvm/vpic.h asm/hvm/vpt.h asm/io.h asm/mce.h asm/mem_sharing.h asm/regs.h public/arch-x86/cpuid.h public/hvm/save.h because none of the declarations

Re: [PATCH 2/4] x86/svm: cleanup svm.h

2023-02-20 Thread Xenia Ragiadakou
On 2/21/23 01:08, Andrew Cooper wrote: On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: Remove the forward declaration of struct vcpu because it is not used. Huh, turns out that was my fault in c/s b158e72abe, shortly after I introduced them in the first place. Also, looking

Re: [PATCH 1/4] x86/svm: cleanup svm.c

2023-02-20 Thread Xenia Ragiadakou
Hi Andrew, On 2/21/23 00:12, Andrew Cooper wrote: On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: Do not include the headers: xen/irq.h asm/hvm/svm/intr.h asm/io.h asm/mem_sharing.h asm/regs.h Out of interest, how are you calculating these?  They're accurate as far as I can

[PATCH 4/4] x86/vmx: cleanup vmx.h

2023-02-17 Thread Xenia Ragiadakou
of: ve_info_t ept_qual_t idt_or_gdt_instr_info_t ldt_or_tr_instr_info_t because they are used only in this file. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/hvm/vmx/vmcs.c| 31 xen/arch/x86/hvm/vmx/vmx.c | 141 ++ xen

[PATCH 2/4] x86/svm: cleanup svm.h

2023-02-17 Thread Xenia Ragiadakou
in svm.c because they are used only in this file. Move the definitions of SVM_PAUSE{FILTER,THRESH}_INIT in vmcb.c because they are used only in this file. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/hvm/svm/svm.c | 6 ++ xen/arch/x86/hvm/svm

[PATCH 0/4] x86/hvm: {svm,vmx}.{c,h} cleanup

2023-02-17 Thread Xenia Ragiadakou
This patch series attempts a cleanup of files {svm,vmx}.{c,h} by removing redundant headers and sorting the rest, removing forward declarations for static functions, reducing the scope of declarations and definitions, removing redundant new lines and trailing spaces etc Xenia Ragiadakou (4

[PATCH 1/4] x86/svm: cleanup svm.c

2023-02-17 Thread Xenia Ragiadakou
() after the svm_function_table's definition. Replace double new lines with one. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/hvm/svm/svm.c | 159 + 1 file changed, 72 insertions(+), 87 deletions(-) diff --git a/xen/arch/x86

Re: [PATCH v3] x86/vlapic: call vmx_vlapic_msr_changed through an hvm_function callback

2023-02-16 Thread Xenia Ragiadakou
Hi Andrew, On 2/16/23 12:28, Andrew Cooper wrote: On 13/02/2023 11:50 am, Xenia Ragiadakou wrote: diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h index 234da4a7f4..97d6b810ec 100644 --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h +++ b/xen/arch/x86

Re: [RFC 06/10] x86/domain: guard svm specific functions with AMD_SVM

2023-02-14 Thread Xenia Ragiadakou
On 2/14/23 18:24, Jan Beulich wrote: On 13.02.2023 15:57, Xenia Ragiadakou wrote: The functions svm_load_segs() and svm_load_segs_prefetch() are AMD-V specific so guard their calls in common code with AMD_SVM. Since AMD_SVM depends on HVM, it can be used alone. No functional change intended

Re: [RFC 09/10] x86/ioreq: guard VIO_realmode_completion with INTEL_VMX

2023-02-14 Thread Xenia Ragiadakou
On 2/14/23 18:46, Jan Beulich wrote: On 13.02.2023 15:57, Xenia Ragiadakou wrote: VIO_realmode_completion is specific to vmx realmode, so guard the completion handling code with INTEL_VMX. While it means slightly bigger a code change, personally I'd prefer if VIO_realmode_completion simply

Re: [RFC 08/10] x86: wire cpu_has_svm/vmx_* to false when svm/vmx not enabled

2023-02-14 Thread Xenia Ragiadakou
On 2/14/23 18:36, Jan Beulich wrote: On 13.02.2023 15:57, Xenia Ragiadakou wrote: To be able to use cpu_has_svm/vmx_* macros in common code without enclosing Both in the title and here the spelling you use made me first think that you talk about "cpu_has_svm". May I suggest you f

Re: [RFC 02/10] x86/hvm: separate AMD-V and Intel VT-x hvm_function_table initializers

2023-02-13 Thread Xenia Ragiadakou
On 2/13/23 18:47, Jan Beulich wrote: On 13.02.2023 15:57, Xenia Ragiadakou wrote: --- a/xen/arch/x86/include/asm/hvm/hvm.h +++ b/xen/arch/x86/include/asm/hvm/hvm.h @@ -261,8 +261,16 @@ extern struct hvm_function_table hvm_funcs; extern bool_t hvm_enabled; extern s8 hvm_port80_allowed

Re: [RFC 01/10] x86: introduce AMD-V and Intel VT-x Kconfig options

2023-02-13 Thread Xenia Ragiadakou
On 2/13/23 17:11, Jan Beulich wrote: On 13.02.2023 15:57, Xenia Ragiadakou wrote: --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -117,6 +117,12 @@ config HVM If unsure, say Y. +config AMD_SVM + def_bool y if HVM + +config INTEL_VMX + def_bool y if HVM I'm

[RFC 10/10] x86/hvm: make AMD-V and Intel VT-x support configurable

2023-02-13 Thread Xenia Ragiadakou
support, make the controls user selectable only if EXPERT is enabled. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/Kconfig | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index

[RFC 09/10] x86/ioreq: guard VIO_realmode_completion with INTEL_VMX

2023-02-13 Thread Xenia Ragiadakou
VIO_realmode_completion is specific to vmx realmode, so guard the completion handling code with INTEL_VMX. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/hvm/ioreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86

[RFC 06/10] x86/domain: guard svm specific functions with AMD_SVM

2023-02-13 Thread Xenia Ragiadakou
The functions svm_load_segs() and svm_load_segs_prefetch() are AMD-V specific so guard their calls in common code with AMD_SVM. Since AMD_SVM depends on HVM, it can be used alone. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/domain.c | 4 ++-- 1 file changed

[RFC 05/10] x86/traps: guard vmx specific functions with INTEL_VMX

2023-02-13 Thread Xenia Ragiadakou
The functions vmx_vmcs_enter() and vmx_vmcs_exit() are VT-x specific. Guard their calls with INTEL_VMX. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen

[RFC 08/10] x86: wire cpu_has_svm/vmx_* to false when svm/vmx not enabled

2023-02-13 Thread Xenia Ragiadakou
To be able to use cpu_has_svm/vmx_* macros in common code without enclosing them inside #ifdef guards when the respective virtualization technology is not enabled, define them as false when not applicable. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/include

[RFC 07/10] x86/oprofile: guard svm specific symbols with AMD_SVM

2023-02-13 Thread Xenia Ragiadakou
The symbol svm_stgi_label is AMD-V specific so guard its usage in common code with AMD_SVM. Since AMD_SVM depends on HVM, it can be used alone. Also, use #ifdef instead of #if. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/oprofile/op_model_athlon.c | 2 +- 1

[RFC 04/10] x86/vpmu: separate AMD-V and Intel VT-x init arch_vpmu_ops initializers

2023-02-13 Thread Xenia Ragiadakou
inline null-returning functions when the respective technology is not enabled. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/include/asm/vpmu.h | 9 + 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm

[RFC 03/10] x86/p2m: guard vmx specific ept functions with INTEL_VMX

2023-02-13 Thread Xenia Ragiadakou
The functions ept_p2m_init(), ept_p2m_uninit() and p2m_init_altp2m_ept() are VT-x specific. Implement them as unreachable static inline functions when !INTEL_VMX. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/mm/p2m.h | 16 1 file changed, 16

[RFC 02/10] x86/hvm: separate AMD-V and Intel VT-x hvm_function_table initializers

2023-02-13 Thread Xenia Ragiadakou
is not enabled. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/arch/x86/include/asm/hvm/hvm.h | 8 1 file changed, 8 insertions(+) diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h index 43d3fc2498..353e48f4e3 100644 --- a/xen/arch/x86

  1   2   3   4   >