[PATCH 1/2] x86/pagewalk: Address MISRA R8.3 violation in guest_walk_tables()

Andrew Cooper posted 2 patches 5 months ago
[PATCH 1/2] x86/pagewalk: Address MISRA R8.3 violation in guest_walk_tables()
Posted by Andrew Cooper 5 months ago
Commit 4c5d78a10dc8 ("x86/pagewalk: Re-implement the pagetable walker")
intentionally renamed guest_walk_tables()'s 'pfec' parameter to 'walk' because
it's not a PageFault Error Code, despite the name of some of the constants
passed in.  Sadly the constants-cleanup I've been meaning to do since then
still hasn't come to pass.

Update the declaration to match, to placate MISRA.

Fixes: 4c5d78a10dc8 ("x86/pagewalk: Re-implement the pagetable walker")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: consulting@bugseng.com <consulting@bugseng.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/guest_pt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/guest_pt.h b/xen/arch/x86/include/asm/guest_pt.h
index bc312343cdf1..7b0c9b005c1f 100644
--- a/xen/arch/x86/include/asm/guest_pt.h
+++ b/xen/arch/x86/include/asm/guest_pt.h
@@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
 
 bool
 guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
-                  unsigned long va, walk_t *gw, uint32_t pfec,
+                  unsigned long va, walk_t *gw, uint32_t walk,
                   gfn_t top_gfn, mfn_t top_mfn, void *top_map);
 
 /* Pretty-print the contents of a guest-walk */
-- 
2.39.2


Re: [PATCH 1/2] x86/pagewalk: Address MISRA R8.3 violation in guest_walk_tables()
Posted by Stefano Stabellini 5 months ago
On Fri, 21 Jun 2024, Andrew Cooper wrote:
> Commit 4c5d78a10dc8 ("x86/pagewalk: Re-implement the pagetable walker")
> intentionally renamed guest_walk_tables()'s 'pfec' parameter to 'walk' because
> it's not a PageFault Error Code, despite the name of some of the constants
> passed in.  Sadly the constants-cleanup I've been meaning to do since then
> still hasn't come to pass.
> 
> Update the declaration to match, to placate MISRA.
> 
> Fixes: 4c5d78a10dc8 ("x86/pagewalk: Re-implement the pagetable walker")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>