Re: [PATCH v11 21/39] arm64/gcs: Ensure that new threads have a GCS

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

 



On Thu, Aug 22, 2024 at 02:15:24AM +0100, Mark Brown wrote:
> @@ -512,10 +538,16 @@ static void gcs_thread_switch(struct task_struct *next)
>  		gcs_set_el0_mode(next);
>  
>  	/*
> -	 * Ensure that GCS changes are observable by/from other PEs in
> -	 * case of migration.
> +	 * Ensure that GCS memory effects of the 'prev' thread are
> +	 * ordered before other memory accesses with release semantics
> +	 * (or preceded by a DMB) on the current PE. In addition, any
> +	 * memory accesses with acquire semantics (or succeeded by a
> +	 * DMB) are ordered before GCS memory effects of the 'next'
> +	 * thread. This will ensure that the GCS memory effects are
> +	 * visible to other PEs in case of migration.
>  	 */
> -	gcsb_dsync();
> +	if (task_gcs_el0_enabled(current) || task_gcs_el0_enabled(next))
> +		gcsb_dsync();
>  }

Ah, the comment turned up in this patch. It looks fine.

Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux