[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/2] arm/vgic: drop const attribute from gic_iomem_deny_access()


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 28 Sep 2022 14:26:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dut5FZxIQvOieyniQrkTETxjPPlI4cVyzE43JJNsBT4=; b=JANtpLAICSxAY6YP3b3tSg8kSRv/jpOVU+fcC0wvTVaGwFX/VKvlsI7R0bmCy0wvKwpwtx1eJYZgcu7VSZinsHLtS6X5RXDS2TjWZ0qUR6E9VPy1jKWiO6p87yn4aGHV97haamRGGAwAeGNZnJnO+UT5tZ8TYLsBTwisuMzprXS9gVRhSHymWKTC1caUlHrkxveNGbFE4RQ0OviRN/jw4fgC+IkHYIGBuYwEJbdqz1e6/iwC9sLue3ocpLtkrQDGOL69l5n1J6e+v3dlMOLH/AwFMTQZgkGDleQbuCyUf6Ns4ORCXuwbXnOR28KbtMUa/P4ipG5nd+7pjsSQ7ZUXmg==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dut5FZxIQvOieyniQrkTETxjPPlI4cVyzE43JJNsBT4=; b=SHLWbA3PRDk2cqlwBHIK0bviLdDXyLTpJzfbJJWCyDTrgJooa4UT11M1+LAVFIK52CrHIr26fluhNK99rG6j4K9m8BagNTf9JnzdALGLeP5S/Pm2Wmt61ta3J053g16iYUsl2CGbP1x9KZRTl/xLZF1O7cEYjpf/bbWSoWVt0EZ1tWxMQm6lEyRwDVx62wE7yelUYGu4f54vF6oPddFp1fU8KoDWh9TiTfVHgDH1KocYGFhHmPgaop/G0yA1KdjRGIv9mTZPYcodwODPCVRraAi5sCczODKAvtPJ3LouW1yFn3AXQD45F0w8MscEa4OqmI/7LNNSO3o/Yv/XO28wOA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VENKByYEBY7fRRI1GREQLI9Jp2+4IxU4hBpOjGrpQ36Xghflgr9L5Iwcwe91gIOm0/mC7fgZUv8lYxsfr8K8zDu2IbspNU12ICH3+P6lR5nWpg6trwULBnXOBBdtnk4F/F/76B6v94g/1ocounyuvHHBNOV/BMSmQjkcu1cZloQDEYXvmI8/NUWHaNxVCasFFhVvEN1QYwYAW933uzUdRYzJC0iaDXHdiwwhhxb3y2gfBaQkmaS9yGzvbYAYkoHiV44XCdk9MZHeZgc1RYK9OngWc8oKi5wx2WDtsQmHuf7uKEA5PU0p5XS4sxwDsGbgKbIkUZhZNLlmquJc8MUgtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NYvwbJFIj1KY73tUvNTYQaxsfZ41uq9SYCFzZJu2OREXQplyKAbsCHGjKuXiOai5XESg1rL62eg6NQMbEVgsBiiMvgLpSRXt5e50+lAVI5z7+uWr77PzTY6GZ7lOzo5sA2+zAZXOH62gvMqpty3RaFrNE5zOZ8CO5ToQj0E3SQQ3vG7RpzZh0WkvsbsA5tdaUdRrf2JyggVX+uiEHQjtkceGvXpkRtmFw/h1TtSSOCGj9kNmC6jvX2TLznWX93F/dFz1a8ecZiZaGZg/c/2hEQ51shmY9evzI2nkkbShg+bB0l7aslZL4csBzFS/PlLBH8+m3jyGGo+2Srf6oQZOMw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 28 Sep 2022 14:26:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHY00Q8lAoIzTsqYkip0fWlnJ+tE6305hgA
  • Thread-topic: [PATCH v3 1/2] arm/vgic: drop const attribute from gic_iomem_deny_access()

Hi Roger,

> On 28 Sep 2022, at 16:11, Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:
> 
> While correct from a code point of view, the usage of the const
> attribute for the domain parameter of gic_iomem_deny_access() is at
> least partially bogus.  Contents of the domain structure (the iomem
> rangeset) is modified by the function.  Such modifications succeed
> because right now the iomem rangeset is allocated separately from
> struct domain, and hence is not subject to the constness of struct
> domain.
> 
> Amend this by dropping the const attribute from the function
> parameter.
> 
> This is required by further changes that will convert
> iomem_{permit,deny}_access into a function.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/gic-v2.c          | 2 +-
> xen/arch/arm/gic-v3.c          | 2 +-
> xen/arch/arm/gic.c             | 2 +-
> xen/arch/arm/include/asm/gic.h | 4 ++--
> 4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index bd773bcc67..ae5bd8e95f 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -1083,7 +1083,7 @@ static void __init gicv2_dt_init(void)
>     gicv2_extension_dt_init(node);
> }
> 
> -static int gicv2_iomem_deny_access(const struct domain *d)
> +static int gicv2_iomem_deny_access(struct domain *d)
> {
>     int rc;
>     unsigned long mfn, nr;
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 64b36cec25..018fa0dfa0 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -1424,7 +1424,7 @@ static void __init gicv3_dt_init(void)
>                               &vbase, &vsize);
> }
> 
> -static int gicv3_iomem_deny_access(const struct domain *d)
> +static int gicv3_iomem_deny_access(struct domain *d)
> {
>     int rc, i;
>     unsigned long mfn, nr;
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 3b0331b538..9b82325442 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -462,7 +462,7 @@ unsigned long gic_get_hwdom_madt_size(const struct domain 
> *d)
> }
> #endif
> 
> -int gic_iomem_deny_access(const struct domain *d)
> +int gic_iomem_deny_access(struct domain *d)
> {
>     return gic_hw_ops->iomem_deny_access(d);
> }
> diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
> index 3692fae393..76e3fa5dc4 100644
> --- a/xen/arch/arm/include/asm/gic.h
> +++ b/xen/arch/arm/include/asm/gic.h
> @@ -392,7 +392,7 @@ struct gic_hw_operations {
>     /* Map extra GIC MMIO, irqs and other hw stuffs to the hardware domain. */
>     int (*map_hwdom_extra_mappings)(struct domain *d);
>     /* Deny access to GIC regions */
> -    int (*iomem_deny_access)(const struct domain *d);
> +    int (*iomem_deny_access)(struct domain *d);
>     /* Handle LPIs, which require special handling */
>     void (*do_LPI)(unsigned int lpi);
> };
> @@ -449,7 +449,7 @@ unsigned long gic_get_hwdom_madt_size(const struct domain 
> *d);
> #endif
> 
> int gic_map_hwdom_extra_mappings(struct domain *d);
> -int gic_iomem_deny_access(const struct domain *d);
> +int gic_iomem_deny_access(struct domain *d);
> 
> #endif /* __ASSEMBLY__ */
> #endif
> -- 
> 2.37.3
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.