lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d5fa8a3-8c93-d0de-1428-9bda1f847102@intel.com>
Date:   Fri, 10 Dec 2021 08:59:22 +0000
From:   "Wang, Zhi A" <zhi.a.wang@...el.com>
To:     Rikard Falkeborn <rikard.falkeborn@...il.com>,
        Zhenyu Wang <zhenyuw@...ux.intel.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        "Joonas Lahtinen" <joonas.lahtinen@...ux.intel.com>,
        "Vivi, Rodrigo" <rodrigo.vivi@...el.com>,
        Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>
CC:     "intel-gvt-dev@...ts.freedesktop.org" 
        <intel-gvt-dev@...ts.freedesktop.org>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/9] drm/i915/gvt: Constify intel_gvt_gtt_pte_ops

On 12/4/2021 12:55 PM, Rikard Falkeborn wrote:
> These are never modified, so make them const to allow the compiler to
> put them in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>
> ---
>   drivers/gpu/drm/i915/gvt/gtt.c | 4 ++--
>   drivers/gpu/drm/i915/gvt/gtt.h | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
> index 53d0cb327539..6efa48727052 100644
> --- a/drivers/gpu/drm/i915/gvt/gtt.c
> +++ b/drivers/gpu/drm/i915/gvt/gtt.c
> @@ -516,7 +516,7 @@ static struct intel_gvt_gtt_pte_ops gen8_gtt_pte_ops = {
>   	.set_pfn = gen8_gtt_set_pfn,
>   };
>   
> -static struct intel_gvt_gtt_gma_ops gen8_gtt_gma_ops = {
> +static const struct intel_gvt_gtt_gma_ops gen8_gtt_gma_ops = {
>   	.gma_to_ggtt_pte_index = gma_to_ggtt_pte_index,
>   	.gma_to_pte_index = gen8_gma_to_pte_index,
>   	.gma_to_pde_index = gen8_gma_to_pde_index,
> @@ -2097,7 +2097,7 @@ unsigned long intel_vgpu_gma_to_gpa(struct intel_vgpu_mm *mm, unsigned long gma)
>   	struct intel_vgpu *vgpu = mm->vgpu;
>   	struct intel_gvt *gvt = vgpu->gvt;
>   	struct intel_gvt_gtt_pte_ops *pte_ops = gvt->gtt.pte_ops;
> -	struct intel_gvt_gtt_gma_ops *gma_ops = gvt->gtt.gma_ops;
> +	const struct intel_gvt_gtt_gma_ops *gma_ops = gvt->gtt.gma_ops;
>   	unsigned long gpa = INTEL_GVT_INVALID_ADDR;
>   	unsigned long gma_index[4];
>   	struct intel_gvt_gtt_entry e;
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h
> index 3bf45672ef98..d0d598322404 100644
> --- a/drivers/gpu/drm/i915/gvt/gtt.h
> +++ b/drivers/gpu/drm/i915/gvt/gtt.h
> @@ -92,7 +92,7 @@ struct intel_gvt_gtt_gma_ops {
>   
>   struct intel_gvt_gtt {
>   	struct intel_gvt_gtt_pte_ops *pte_ops;
> -	struct intel_gvt_gtt_gma_ops *gma_ops;
> +	const struct intel_gvt_gtt_gma_ops *gma_ops;
>   	int (*mm_alloc_page_table)(struct intel_vgpu_mm *mm);
>   	void (*mm_free_page_table)(struct intel_vgpu_mm *mm);
>   	struct list_head oos_page_use_list_head;

It seems like the tittle doesn't match with the modification. I guess it 
should be Constify intel_gvt_gtt_gma_ops. I can fix that for you when 
applied.

Reviewed-by: Zhi Wang <zhi.a.wang@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ