diff mbox series

[XEN,v2,3/3] xen/mm: add declaration for first_valid_mfn

Message ID 2c02524be7d02064fdf2f5003ef1c507034e4437.1701947290.git.nicola.vetrini@bugseng.com (mailing list archive)
State Superseded
Headers show
Series address some violations of MISRA C Rule 8.4 | expand

Commit Message

Nicola Vetrini Dec. 7, 2023, 11:11 a.m. UTC
Such declaration is needed to comply with MISRA C Rule 8.4, because a
compatible declaration is not visible in xen/common/page_alloc.c, where the
variable is defined. That variable can't yet be static because of the lack of
support from ARM and PPC for NUMA.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Having this declaration essentially sidesteps the current impossibility
of having a static variable, as described in the comments in
ARM and PCC's asm/numa.h.
---
 xen/include/xen/mm.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Julien Grall Dec. 7, 2023, 1:52 p.m. UTC | #1
Hi,

On 07/12/2023 11:11, Nicola Vetrini wrote:
> Such declaration is needed to comply with MISRA C Rule 8.4, because a
> compatible declaration is not visible in xen/common/page_alloc.c, where the
> variable is defined. That variable can't yet be static because of the lack of
> support from ARM and PPC for NUMA.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Having this declaration essentially sidesteps the current impossibility
> of having a static variable, as described in the comments in
> ARM and PCC's asm/numa.h.
With this change, is there any reason to keep the various declaration of 
first_valid_mfn in numa.h?

Cheers,
Nicola Vetrini Dec. 7, 2023, 2:14 p.m. UTC | #2
On 2023-12-07 14:52, Julien Grall wrote:
> Hi,
> 
> On 07/12/2023 11:11, Nicola Vetrini wrote:
>> Such declaration is needed to comply with MISRA C Rule 8.4, because a
>> compatible declaration is not visible in xen/common/page_alloc.c, 
>> where the
>> variable is defined. That variable can't yet be static because of the 
>> lack of
>> support from ARM and PPC for NUMA.
>> 
>> No functional change.
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Having this declaration essentially sidesteps the current 
>> impossibility
>> of having a static variable, as described in the comments in
>> ARM and PCC's asm/numa.h.
> With this change, is there any reason to keep the various declaration 
> of first_valid_mfn in numa.h?
> 
> Cheers,

Good point: no reason comes to mind. I didn't think of it while revising 
the patch.
diff mbox series

Patch

diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 3d9b2d05a5c8..a13a9a46ced7 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -118,6 +118,8 @@  int destroy_xen_mappings(unsigned long s, unsigned long e);
 /* Retrieve the MFN mapped by VA in Xen virtual address space. */
 mfn_t xen_map_to_mfn(unsigned long va);
 
+extern mfn_t first_valid_mfn;
+
 /*
  * Create only non-leaf page table entries for the
  * page range in Xen virtual address space.