[PATCH v4 1/6] xen/x86: move declaration from mem_access.h to altp2m.h

Penny Zheng posted 6 patches 1 week, 3 days ago
Only 5 patches received!
[PATCH v4 1/6] xen/x86: move declaration from mem_access.h to altp2m.h
Posted by Penny Zheng 1 week, 3 days ago
Memory access and ALTP2M are two seperate features, and each could be
controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move declaration
of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
- p2m_set_suppress_ve
- p2m_set_suppress_ve_multi
- p2m_get_suppress_ve
Potential error on altp2m.c also breaks Misra Rule 8.4.

Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/include/asm/altp2m.h     | 10 ++++++++++
 xen/arch/x86/include/asm/mem_access.h | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/altp2m.h b/xen/arch/x86/include/asm/altp2m.h
index 8ecd74f363..9c1ac3cc26 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -46,6 +46,16 @@ void altp2m_vcpu_destroy(struct vcpu *v);
 int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn);
 void altp2m_vcpu_disable_ve(struct vcpu *v);
 
+int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
+                        unsigned int altp2m_idx);
+
+struct xen_hvm_altp2m_suppress_ve_multi;
+int p2m_set_suppress_ve_multi(struct domain *d,
+                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
+
+int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
+                        unsigned int altp2m_idx);
+
 #else
 
 static inline bool altp2m_is_eptp_valid(const struct domain *d,
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 1a52a10322..257ed33de1 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -34,16 +34,6 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
 /* Sanity check for mem_access hardware support */
 bool p2m_mem_access_sanity_check(const struct domain *d);
 
-int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
-                        unsigned int altp2m_idx);
-
-struct xen_hvm_altp2m_suppress_ve_multi;
-int p2m_set_suppress_ve_multi(struct domain *d,
-                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
-
-int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
-                        unsigned int altp2m_idx);
-
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
 /*
-- 
2.34.1
Re: [PATCH v4 1/6] xen/x86: move declaration from mem_access.h to altp2m.h
Posted by Tamas K Lengyel 1 week, 3 days ago
On Thu, Jan 15, 2026 at 4:29 AM Penny Zheng <Penny.Zheng@amd.com> wrote:

> Memory access and ALTP2M are two seperate features, and each could be
> controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
> when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move
> declaration
> of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
> - p2m_set_suppress_ve
> - p2m_set_suppress_ve_multi
> - p2m_get_suppress_ve
> Potential error on altp2m.c also breaks Misra Rule 8.4.
>
> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>


Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
Re: [PATCH v4 1/6] xen/x86: move declaration from mem_access.h to altp2m.h
Posted by Jan Beulich 1 week, 3 days ago
On 16.01.2026 00:07, Tamas K Lengyel wrote:
> On Thu, Jan 15, 2026 at 4:29 AM Penny Zheng <Penny.Zheng@amd.com> wrote:
> 
>> Memory access and ALTP2M are two seperate features, and each could be
>> controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
>> when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move
>> declaration
>> of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
>> - p2m_set_suppress_ve
>> - p2m_set_suppress_ve_multi
>> - p2m_get_suppress_ve
>> Potential error on altp2m.c also breaks Misra Rule 8.4.
>>
>> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
> 
> Acked-by: Tamas K Lengyel <tamas@tklengyel.com>

Thanks for the ack here as well as the ones for 4 and 6. What about 2, 3,
and 5 though?

Jan

Re: [PATCH v4 1/6] xen/x86: move declaration from mem_access.h to altp2m.h
Posted by Jan Beulich 1 week, 3 days ago
On 15.01.2026 10:28, Penny Zheng wrote:
> Memory access and ALTP2M are two seperate features, and each could be
> controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
> when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move declaration
> of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
> - p2m_set_suppress_ve
> - p2m_set_suppress_ve_multi
> - p2m_get_suppress_ve
> Potential error on altp2m.c also breaks Misra Rule 8.4.
> 
> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
> ---
>  xen/arch/x86/include/asm/altp2m.h     | 10 ++++++++++
>  xen/arch/x86/include/asm/mem_access.h | 10 ----------
>  2 files changed, 10 insertions(+), 10 deletions(-)

Tamas - can we please get an ack here? I guess I'll time out on waiting for
one in a day or two.

Penny - may I remind you that it is on you to chase missing acks?

Jan