[PATCH 3/3] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface

Michal Orzel posted 3 patches 3 days, 11 hours ago
[PATCH 3/3] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Posted by Michal Orzel 3 days, 11 hours ago
gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
interface size) instead of vsize (virtual CPU interface size) when
calculating the number of pages to deny for the virtual CPU interface
region at vbase.

Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index b3e104ea4ad0..5641ee870f23 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1631,7 +1631,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     if ( vbase != INVALID_PADDR )
     {
         mfn = vbase >> PAGE_SHIFT;
-        nr = PFN_UP(csize);
+        nr = PFN_UP(vsize);
         return iomem_deny_access(d, mfn, mfn + nr - 1);
     }
 
-- 
2.43.0
Re: [PATCH 3/3] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Posted by Luca Fancellu 3 days, 8 hours ago
Hi Michal,

> On 9 Apr 2026, at 12:39, Michal Orzel <michal.orzel@amd.com> wrote:
> 
> gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
> interface size) instead of vsize (virtual CPU interface size) when
> calculating the number of pages to deny for the virtual CPU interface
> region at vbase.
> 
> Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Cheers,
Luca
Re: [PATCH 3/3] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Posted by Stefano Stabellini 2 days, 22 hours ago
On Thu, 9 Apr 2026, Luca Fancellu wrote:
> Hi Michal,
> 
> > On 9 Apr 2026, at 12:39, Michal Orzel <michal.orzel@amd.com> wrote:
> > 
> > gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
> > interface size) instead of vsize (virtual CPU interface size) when
> > calculating the number of pages to deny for the virtual CPU interface
> > region at vbase.
> > 
> > Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
> > Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> > ---
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Re: [PATCH 3/3] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Posted by Halder, Ayan Kumar 3 days, 10 hours ago
On 09/04/2026 12:39, Michal Orzel wrote:
> gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
> interface size) instead of vsize (virtual CPU interface size) when
> calculating the number of pages to deny for the virtual CPU interface
> region at vbase.
good catch
>
> Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>

- Ayan