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

RE: [PATCH] xen/arm: Add Cortex-A73 erratum 858921 workaround


  • To: Julien Grall <julien@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 13 Nov 2020 03:37:14 +0000
  • Accept-language: en-US
  • 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=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-SenderADCheck; bh=zR0mUZEINPlIFc+O7RnwFQBxekV/jcU5KdwgczRi60M=; b=jz/11U3/membc8fytqg7Q0FrwwxzZZseC/RsEtWlyuNTO6LG+EjRlwFqqGOTB6oZnP/IWnaH6wUQdYz0dul8WAPx813Ru5j7ztF0IBf+AIGURg9IMcZ6PJ7KN4RAR4WgKJYEAGUHkPC95rlF/y0aJF+9J5uTU+4Au/gbebKw1NjNITRblPju7gSafKyhJrCQisJMhulJu4aVSm9q5KgrZc1G5IhVRlEuHGJpiQvyVltVSQNPxf26xIzsfgvt027SooEUvk4wEL2ekI60KyYtAc6peqPXX36tqrAnB0MPJ9NHaSzHp3cxGSMCECsvsQhRy1FUKSdnGpRU6AGhSkIzPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b1Ru7VTtiEUSGEeOqAi0ZkotkkGXew2wlvI4liyRbuMewFTWlmo8/0cfuNC8M/e4zlZmSJMdCmru35h7xowWh5m53DqMjZ28g1BxfxAg6Fz9HcSpcnrNw/G5k8ovoxiEvFrzlN8qv3iWSsT4sDqF+xNxQvuKd2EDWvIvNMpTlAy59PrnQMrdgVqM64CUC3rYIDLPnSKOB4G53AiOnr7lRXTpuoRSUXHTlQmc9NTdxYmkWgHG2weFumDVrOgTlVdXOgSwiOfV59i44/wKjWaocC4owIGVlFEPIYrud8NhddK1NvUrPxtSzaSlqVzAB6v4QGdjs2kn/0Q0oWECNy/gcA==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Andre Przywara <Andre.Przywara@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Kaly Xin <Kaly.Xin@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Fri, 13 Nov 2020 03:37:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWtnF2jWNIb4RgFU+PRE0mwpdPDam/tA6AgAW2ODA=
  • Thread-topic: [PATCH] xen/arm: Add Cortex-A73 erratum 858921 workaround

HI Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2020年11月9日 20:04
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx
> Cc: Andre Przywara <Andre.Przywara@xxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Wei Chen <Wei.Chen@xxxxxxx>; Kaly Xin
> <Kaly.Xin@xxxxxxx>; nd <nd@xxxxxxx>
> Subject: Re: [PATCH] xen/arm: Add Cortex-A73 erratum 858921 workaround
> 
> Hi,
> 
> On 09/11/2020 08:21, Penny Zheng wrote:
> > CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
> > might return a wrong value when the counter crosses a 32bit boundary.
> >
> > Until now, there is no case for Xen itself to access CNTVCT_EL0,
> > and it also should be the Guest OS's responsibility to deal with
> > this part.
> >
> > But for CNTPCT, there exists several cases in Xen involving reading
> > CNTPCT, so a possible workaround is that performing the read twice,
> > and to return one or the other depending on whether a transition has
> > taken place.
> >
> > Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> 
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
> 
> On a related topic, do we need a fix similar to Linux commit
> 75a19a0202db "arm64: arch_timer: Ensure counter register reads occur
> with seqlock held"?
> 

I take a look at this Linux commit, it seems to prevent the seq-lock to be
speculated.  Using an enforce ordering instead of ISB after the read counter
operation seems to be for performance reasons.

I have found that you had placed an ISB before read counter in get_cycles
to prevent counter value to be speculated. But you haven't placed the second
ISB after reading. Is it because we haven't used the get_cycles in seq lock
critical context (Maybe I didn't find the right place)? So should we need to 
fix it
now, or you prefer to fix it now for future usage?

Regards,
Wei Chen

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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