Re: [XEN PATCH 2/2] x86/msr: add suffix 'U' to MSR_AMD_CSTATE_CFG macro.

2024-04-24 Thread Teddy Astie
0010296 > +#define MSR_AMD_CSTATE_CFG 0xc0010296U > > /* >* Legacy MSR constants in need of cleanup. No new MSRs below this comment. Hello, thanks for the patches I wonder if the same approach should be also taken for all the other MSR constants of this file that are simila

[RFC XEN PATCH v1] xen/public: Add initial files for PV-IOMMU

2024-04-23 Thread Teddy Astie
MMU driver interface. + * + * Copyright (c) 2024 Teddy Astie + */ + +#ifndef __XEN_PUBLIC_PV_IOMMU_H__ +#define __XEN_PUBLIC_PV_IOMMU_H__ + +#include "xen.h" +#include "physdev.h" + +#define IOMMU_DEFAULT_CONTEXT (0) + +/** + * Query PV-IOMMU capabilities for this domain. + */

[RFC XEN v1] docs/designs: Introduce IOMMU context management

2024-04-23 Thread Teddy Astie
SMMUv3 + +TODO + +* * * + +[1] See pv-iommu.md + +[2] pci: phantom functions assigned to incorrect contexts +https://xenbits.xen.org/xsa/advisory-449.html -- 2.44.0 Teddy Astie | Vates XCP-ng Intern XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech

[XEN PATCH v5 3/3] x86/iommu: Disable intrerrupt remapping if cx16 is not supported

2024-04-18 Thread Teddy Astie
All hardware with VT-d/AMD-Vi has CMPXCHG16B support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/amd/iommu_intr.c | 6 ++ xen/drivers/passthrough/vtd

[XEN PATCH v5 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-18 Thread Teddy Astie
p Changed in v5: * Folded VT-d/AMD-Vi cx16 cleanup patches Teddy Astie (3): x86/iommu: Disable IOMMU if cx16 isn't supported VT-d: Cleanup MAP_SINGLE_DEVICE and related code x86/iommu: Disable intrerrupt remapping if cx16 is not supported xen/drivers/passthrough/amd/iommu_intr.c|

[XEN PATCH v5 2/3] VT-d: Cleanup MAP_SINGLE_DEVICE and related code

2024-04-18 Thread Teddy Astie
This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2 files changed, 5 insertions

[XEN PATCH v5 1/3] x86/iommu: Disable IOMMU if cx16 isn't supported

2024-04-18 Thread Teddy Astie
All hardware with VT-d/AMD-Vi has CMPXCHG16B support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/amd/iommu_map.c | 42 xen/drivers

Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable

2024-04-16 Thread Teddy Astie
ted interrupts were supposed to be dependent on VMX/SVM instead. I suppose this is a leftover from the original RFC ? > https://lore.kernel.org/xen-devel/e29e375f-3d30-0eb1-7e28-b93f2d831...@suse.com/ Teddy --- Teddy Astie | Vates XCP-ng Intern XCP-ng & Xen Orchestra - Vates solutions

Re: [XEN PATCH v4 0/5] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-15 Thread Teddy Astie
Le 15/04/2024 à 14:15, Teddy Astie a écrit : > All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside > specifically crafted virtual machines). > > Some IOMMU code paths in Xen consider cases where VT-d/AMD-Vi is supported > while cx16 isn't, those path

[XEN PATCH v4 2/5] AMD-Vi: Disable IOMMU if cx16 isn't supported

2024-04-15 Thread Teddy Astie
All hardware with AMD-Vi has CMPXCHG16 support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/amd/iommu_map.c | 42 +++-- xen/drivers

[XEN PATCH v4 1/5] VT-d: Disable IOMMU if cx16 isn't supported

2024-04-15 Thread Teddy Astie
All hardware with VT-d has CMPXCHG16B support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 73 ++--- 1 file changed, 25

[XEN PATCH v4 3/5] VT-d: Cleanup MAP_SINGLE_DEVICE and related code

2024-04-15 Thread Teddy Astie
This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2 files changed, 5 insertions

[XEN PATCH v4 5/5] AMD-Vi: Disable intrerrupt remapping if cx16 is not supported

2024-04-15 Thread Teddy Astie
All hardware with AMD-Vi has CMPXCHG16 support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/amd/iommu_intr.c | 6 ++ 1 file changed, 6 insertions(+) diff

[XEN PATCH v4 0/5] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-15 Thread Teddy Astie
in case we have IOMMU hardware but no cx16, then cleanup no-cx16 handling logic from VT-d and AMD-Vi drivers. Also disable interrupt remapping that also relies on cx16. Teddy Astie (5): VT-d: Disable IOMMU if cx16 isn't supported AMD-Vi: Disable IOMMU if cx16 isn't supported VT-d: Cleanup

[XEN PATCH v4 4/5] VT-d: Disable intrerrupt remapping if cx16 is not supported

2024-04-15 Thread Teddy Astie
All hardware with VT-d has CMPXCHG16B support. Check this at initialisation time, and remove the effectively-dead logic for the non-cx16 case. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/intremap.c | 70 -- xen/drivers

Re: [XEN PATCH v3 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Teddy Astie
tch 3, you should drop the Suggested-by me.  You found that one > all yourself. > Will change this. Teddy --- Teddy Astie | Vates XCP-ng Intern XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech

[XEN PATCH v3 3/3] VT-d: Cleanup MAP_SINGLE_DEVICE and related code

2024-04-12 Thread Teddy Astie
This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2

[XEN PATCH v3 1/3] VT-d: Disable IOMMU if cx16 isn't supported

2024-04-12 Thread Teddy Astie
No hardware has VT-d support while not having cx16 support, disable IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie

[XEN PATCH v3 2/3] AMD-Vi: Disable IOMMU if cx16 isn't supported

2024-04-12 Thread Teddy Astie
No hardware has AMD-Vi support while not having cx16 support, disable IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie

[XEN PATCH v3 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Teddy Astie
. Teddy Astie (3): VT-d: Disable IOMMU if cx16 isn't supported AMD-Vi: Disable IOMMU if cx16 isn't supported VT-d: Cleanup MAP_SINGLE_DEVICE and related code xen/arch/x86/apic.c | 6 ++ xen/drivers/passthrough/amd/iommu_map.c | 42 -- xen/drivers/passthrough

Re: [XEN PATCH v2 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Teddy Astie
Le 11/04/2024 à 22:05, Andrew Cooper a écrit : > On 08/04/2024 2:02 pm, Teddy Astie wrote: >> All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside >> specifically crafted virtual machines). >> >> Some IOMMU code paths in Xen consider cases whe

[XEN PATCH v2 3/3] VT-d: Cleanup MAP_SINGLE_DEVICE and related code

2024-04-08 Thread Teddy Astie
This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2

[XEN PATCH v2 1/3] VT-d: Disable IOMMU if cx16 isn't supported

2024-04-08 Thread Teddy Astie
No hardware has VT-d support while not having cx16 support, disable IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie

[XEN PATCH v2 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-08 Thread Teddy Astie
in case we have IOMMU hardware but no cx16, then cleanup no-cx16 handling logic from VT-d and AMD-Vi drivers. Teddy Changed in v2: * Added cleanup no-cx16 code for x2APIC * Fixed commit and code formatting * Added missing Suggested-by note Teddy Astie (3): VT-d: Disable IOMMU if cx16 isn't

[XEN PATCH v2 2/3] AMD-Vi: Disable IOMMU if cx16 isn't supported

2024-04-08 Thread Teddy Astie
No hardware has AMD-Vi support while not having cx16 support, disable IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie

[XEN PATCH 3/3] VT-d: Cleanup MAP_SINGLE_DEVICE and related dead code.

2024-03-21 Thread Teddy Astie
This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Signed-off-by Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2 files changed, 5 insertions

[XEN PATCH 1/3] VT-d: Disable IOMMU if cx16 isn't supported

2024-03-21 Thread Teddy Astie
No hardware has VT-d support while not having cx16 support, consider disabling IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Signed-off-by Teddy Astie --- xen/drivers

[XEN PATCH 2/3] AMD-Vi: Disable IOMMU if cx16 isn't supported

2024-03-21 Thread Teddy Astie
No hardware has VT-d support while not having cx16 support, consider disabling IOMMU in this case to avoid potentially buggy code. Now that IOMMU is only enabled if cx16 is supported, drop dead code that handles cases where cx16 isn't supported. Signed-off-by Teddy Astie --- xen/drivers

[XEN PATCH 0/3] x86/iommu: Drop IOMMU support when cpu doesn't support cx16.

2024-03-21 Thread Teddy Astie
disabling IOMMU in case we have IOMMU hardware but no cx16, then cleanup no-cx16 handling logic from VT-d and AMD-Vi drivers. Teddy Astie (3): VT-d: Disable IOMMU if cx16 isn't supported AMD-Vi: Disable IOMMU if cx16 isn't supported VT-d: Cleanup MAP_SINGLE_DEVICE and related dead code. xen