From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 13 Oct 2019 21:00:15 -0000 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1iJkyM-0004Uf-6d for speck@linutronix.de; Sun, 13 Oct 2019 23:00:14 +0200 Received: from chatham.yeoldevic.com ([81.2.79.67] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJkyL-0001gK-3g for speck@linutronix.de; Sun, 13 Oct 2019 22:00:13 +0100 Received: from ben by deadeye with local (Exim 4.92.2) (envelope-from ) id 1iJkyK-0008OO-GN for speck@linutronix.de; Sun, 13 Oct 2019 22:00:12 +0100 Message-ID: <506e2d5dc5ebf9ec8d5bdf79a94dc2aee9572361.camel@decadent.org.uk> Subject: [MODERATED] Re: [PATCH v6 9/9] TAAv6 9 From: Ben Hutchings Date: Sun, 13 Oct 2019 22:00:11 +0100 In-Reply-To: <67b50974c10173d0399025c96dabc53c1a0e6314.camel@decadent.org.uk> References: <5d9e6f13.1c69fb81.d7036.be99SMTPIN_ADDED_BROKEN@mx.google.com> <20191010065412.GD256999@kroah.com> <20191012014102.GA22297@guptapadev.amr> <67b50974c10173d0399025c96dabc53c1a0e6314.camel@decadent.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-GqEmuth0UGbEv0Lxso5+" To: speck@linutronix.de List-ID: --=-GqEmuth0UGbEv0Lxso5+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2019-10-13 at 21:05 +0100, speck for Ben Hutchings wrote: > On Fri, 2019-10-11 at 18:41 -0700, speck for Pawan Gupta wrote: > > On Thu, Oct 10, 2019 at 08:54:12AM +0200, speck for Greg KH wrote: > [...] > > > > +/* Take tsx_mutex lock and update tsx_ctrl_state when calling this= function */ > > > > +static void tsx_update_on_each_cpu(bool val) > > > > +{ > > > > + get_online_cpus(); > > > > + on_each_cpu(tsx_update_this_cpu, (void *)val, 1); > > > > + put_online_cpus(); > > > > +} > > >=20 > > > Why take the lock? This is only called in one place. > >=20 > > So that TSX_CTRL MSR state stays consistent across all CPUs between > > multiple on_each_cpu() calls. Otherwise overlapping conflicting TSX_CTR= L MSR > > writes could end up in some CPUs with TSX enabled and others with TSX > > disabled. > [...] >=20 > get_online_cpus() is a read lock, so it doesn't prevent concurrent > updates. Sorry, now I realise "the lock" meant tsx_mutex as mentioned in the comment. Ben. --=20 Ben Hutchings The obvious mathematical breakthrough [to break modern encryption] would be development of an easy way to factor large prime numbers. - Bill Gates --=-GqEmuth0UGbEv0Lxso5+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAl2jkFwACgkQ57/I7JWG EQlSURAAw8uIdPYscuSfDFr7rlp0es4ii4GUmWfb82qzho2SxzjqsReGbFJO3yrv BOx7TbARZ8Oz5c5WFTOVSsk9Z8uk63QM2c9QM7daeHI5Ue+IWNpb0YAntuzMvFYX NeBM9uLEqSBg3T7Ok4zrcRsbjEoNAUanzvu1J5cNeN+h3GgXMMe59/Ibu2bsYdRz /01nU0uL8o9SWBGvf0c1nLAvitbEdKdERYcpljeacGTVp+w7GXfMbPTRRILRUtdR ZXw/xDQ7EbIAvKik8WFqDzW8UMBJAJomiyTNWGBWwhfnZK4flcaaJu5LmJJhkaBs 20t6caX8N3V4eeBu6NeF8NnikbERGYLUBKQSFqZZSdEPWsZ2IcuMQabuFAAR8JY9 Z5GOmTgRMfSQakrQVaAfANkZUb0JcLDTq4EU5706CIr/PGVy4aB/977xmAuo/Dct KqTshLqS7ZmkNdn5ME5W6XRUdEV9rYiCyrvaZnzKIdLpA6od8Uhi03P+pp+EdsoS D7P5MBlCN9SHoNUjoYmVvrTKEVeAnGGutbUslsLAQBlWgWSUAH+039VkK35nY53K P51TKH1EmC2TFugUlSq71HHzppBW84proQ/IW3Pczm3QZZhUosxpIJi+Zj8soCn5 4VsceM4LykaO8XEjGZwBhbe8S4lIJAWpbx1dV4XS+Q1BWJCOdSs= =nADH -----END PGP SIGNATURE----- --=-GqEmuth0UGbEv0Lxso5+--