From linux-kernel Tue Sep 07 22:17:09 2021 From: Keith Packard Date: Tue, 07 Sep 2021 22:17:09 +0000 To: linux-kernel Subject: Re: [PATCH 2/3] ARM: Move thread_info into task_struct (v7 only) Message-Id: <87pmtkav4q.fsf () keithp ! com> X-MARC-Message: https://marc.info/?l=linux-kernel&m=163105716315282 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ard Biesheuvel writes: > That is still a bit tricky, given that you now have to swap out the > per-CPU offset when you migrate a task, and the generic code is not > really set up for that. Yeah, I decided to just leverage as much generic code as possible and re-purposed the TPIDRPRW register for 'current', leaving the per_cpu_offset data in memory. That makes the patch series pretty compact, with a bunch of restructuring changes followed by fairly short functional changes. > I had a stab at this myself today (long boring day with no Internet conne= ction). > > https://android-kvm.googlesource.com/linux/+log/refs/heads/ardb/arm32-ti-= in-task > > It resembles your code in some places - I suppose we went on the same > journey in a sense :-) We'll fix up the credits before this gets > resubmitted. This does look great, and preserves the optimization of keeping the per_cpu_offset value in a register. With the series I posted, getting the per_cpu_offset value requires fetching the cpu value from task_struct and then using that to index the per_cpu_offset arrray. I don't have a good feeling of how important this optimization is? We could stick the per_cpu_offset value into thread_info to avoid one fetch? > Fixing the per-task stack protector plugin on top of these changes > should be trivial but I need a coffee first. I haven't even looked at that step yet :-) =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmE35OUACgkQ2yIaaQAA ABGChhAApVwLSfm9sLvgnN+jdEQbOboHxuZF+jmX38rDyBdk9IeY/qp6p9aDGbXu hrmOqv5vkJ+XRmt6qseKxsFRAGv5DEMttLxLeM+ntRr0VprxMVjF08Zl8QMW1rF6 vbQF08Axbim7hjiChGvnpFhbV1TK1+ByF7DK7jHKVW+C9qXG/Lyuciy3D2Fmmvsz ZfA6fto4AMrTRnXyXujUYdi4IrCdIats1OB7Kje9AFsgqsOndQZqJQjcBXBUgMUB cTv/7TsS7P91aSO7PdsL5uEnz0+wBLSgxR561cHU7a8E8qBfhfku3COZTh73Ehul CKfabvdmAvHfYp4FOeLBoJG99///7ivV2FxiLrASZDuMRsIqG0ZT6mfX+hpF3Nhq Q2ymLZJ9ySLpIS2Ihh1j6IuKlAfK3746mnJ5/lRGxErn67xCrqjOFCh6S6VhBktO sN4X3OavBNeoaxMF1J2gNaHXp46NA6PKdNxcm4qg78tqEXYKKWRq5Gw9PZoKRMfQ a+DCCcKCzcAjOE3zwpAAYY6Udk80l1WGIsUQfN+AslFSbuBFxfBx175LtfVvZHYy 1G5+XtRopD32fmFgXn28qNL3uU5khZfdJDFBQvVaJKC2tWSkUt3/hxj//n79iaki /NvjmdjqUfXbGHlNXtKoknCnV4frtUa0cJXsdL/aHO79cxlscj0= =REhG -----END PGP SIGNATURE----- --=-=-=--