From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0631C54EAA for ; Fri, 27 Jan 2023 19:22:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30E4C6B0072; Fri, 27 Jan 2023 14:22:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BF216B0073; Fri, 27 Jan 2023 14:22:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AD106B0074; Fri, 27 Jan 2023 14:22:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 09DE36B0072 for ; Fri, 27 Jan 2023 14:22:50 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C8716A0713 for ; Fri, 27 Jan 2023 19:22:49 +0000 (UTC) X-FDA: 80401551258.03.958C354 Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) by imf15.hostedemail.com (Postfix) with ESMTP id 19F87A0024 for ; Fri, 27 Jan 2023 19:22:39 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kylehuey.com header.s=google header.b=aJZ1B9f8; spf=pass (imf15.hostedemail.com: domain of me@kylehuey.com designates 209.85.219.176 as permitted sender) smtp.mailfrom=me@kylehuey.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674847361; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=33nY2jk6WQSiyX6zTaQDTWxuzmJWTPZzm06YNlPupLM=; b=R/6TSOOge5p1ibNYjM5D07oC557XJIZXDC5ZeO7PLLHJSMeEJjREWn61+F3pWRxA3jreHr Bn0iXAehB6fv0YsWNMpYO2s5ibVv56F8D678S+Xlbh3dCSedWUEondKeLZwKLbMVQHOecW lYTZTGpKDCCRc6Rs7THv9tHV1sxxz2M= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kylehuey.com header.s=google header.b=aJZ1B9f8; spf=pass (imf15.hostedemail.com: domain of me@kylehuey.com designates 209.85.219.176 as permitted sender) smtp.mailfrom=me@kylehuey.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674847361; a=rsa-sha256; cv=none; b=rvrb/y3UyT4CNixpc/vdA6f6K4FvcykEkG2QRZNgQFr0MFt9tHIdvS2mbSK9fA2h+7jFJE jqkTVRNbG9TZXfIWAVd/eTXcNIF6laX/hOrCJwcy0h3Dph3Qg2RHr1R1ISoFi9SkLqmp9l iG0iXVoboXkuQAkYbe9tZMvIM2DqANQ= Received: by mail-yb1-f176.google.com with SMTP id 123so7196266ybv.6 for ; Fri, 27 Jan 2023 11:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kylehuey.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=33nY2jk6WQSiyX6zTaQDTWxuzmJWTPZzm06YNlPupLM=; b=aJZ1B9f8UnxX/f6PLjm3laIHjM2ai2NKzEHpScu1wgMzxJXDEqO1SUvMvVGJzznOue 4DRUNwA8vda1vh0wk0f3PHuUSWntEtAyGH33VZ/yUGGS9lfbgb7PNyeK7S9i0rjm1F0c Xyiz3KyGzX2ptun8xuErzq4JSE5WAdnzfcTxPeCp6tAuOyQSGEqSPOGj69r9q9QAJW7L eDGtvlvnhLMzz0T3ChytvJNNTu/nc8pI94ZHHn75n0UCrz23z1zzAnfRon5oL226bMEj 0yucMGVu1iZ4ybW8Wh7cCl1LwbYjboWhypdqOGIdpSv6MLp3VGOY8Hjqy+jm045xDExV nlJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=33nY2jk6WQSiyX6zTaQDTWxuzmJWTPZzm06YNlPupLM=; b=JjuJNaBSYxWHuo0w+oAA2K3EaMGca6T7/NDpUc4rSoX6EL1ul/L9/ayr3iE4yQwup2 SDb4SEB1DBiDL6tnOB0UF92fQeKucxC+QJDMTMdn3pEOqXwJlVaj2Mj7Wwpj7q7fXo2C uqke3oULaPKiBaKWyIkngHEkCnxu9eNKwITFEdBUcTT0S63A/twnO6Qk6mH7CACI/HqT 7KYQzgw9zv3UTmEqghek3Z68Z/h8JLF+M22mlqQMg6Htl2yb2I9gcquCCXNq++xNi9WB +E58KcR/xcU3JPFga8EIZIsnByivrOmZK/JEOcD9gUWjkhtTpWhwtINf8TXh3X/a1WAn WZ0g== X-Gm-Message-State: AFqh2krBAsOGhvZjLHqJVv9BTjM1qOMqMhg5OeGZG/ijB9mHmsMPV0sz c4ofVLy60PRcCVIGvs4bAYLjIHdsbJgGsWajhXCObQ== X-Google-Smtp-Source: AMrXdXsCiSeB5nAp7g4t1d3RBvu0AYhxgnKKC40R+IiCJIecvQn+eYYpTjKNNtdD4+pe4bQKKO2GA8Tvh52iLC1jyPU= X-Received: by 2002:a25:b7c9:0:b0:724:ea53:decc with SMTP id u9-20020a25b7c9000000b00724ea53deccmr3211250ybj.96.1674847359136; Fri, 27 Jan 2023 11:22:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Huey Date: Fri, 27 Jan 2023 11:22:23 -0800 Message-ID: Subject: Re: x86/pkeys in early kernel version To: Jeff Xu Cc: Dave Hansen , linux-mm@kvack.org, =?UTF-8?Q?Stephen_R=C3=B6ttger?= , "tglx@linutronix.de" , Jorge Lucangeli Obes , Kees Cook , Guenter Roeck Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 19F87A0024 X-Stat-Signature: duh47b498ews5sqx4upxqop1gd3g3a3r X-Rspam-User: X-HE-Tag: 1674847359-952446 X-HE-Meta: U2FsdGVkX18JAxJ+vRSa3ETLBc1R8fu2nrhYXoL/KvJ+6Nyk9QozFFenHb/bd/wNe7y7CXObIOQ6+44o2V0lYOIMK1Xu659IDoAabEevdDhsni+pc+aZaRF6DlqOanRsTqvw6y/6D3We2/CghfwhTJsQier8JGqTxgLQmiTwnVNtvvZIamM7LY0fj77/K0U3iVPTegkq9o9tVpUk5NtiB4eBxUrCrIAZ97MQG4F6/zgDvLlFrn1jJGX7qEmX7/MVNScHRkIsDpyJvdt79ye13k7bQq9hQYartVzBAEZSOujUji3/F3J35iImSkJjpIuEMtpcw/joTCsiI1MzlE2HEAfpsy6P1PxNujzo+hf5li8kn1pZ+GgiQFgpM8mIVzZ7T5cNsm0KuRSofun8DwCWey1sOMRwtVrews7tzkcfZNuTvBC9sEUt940JkvX6lzqeef+Q9WvY6gzpCk5oGkQJCy/QcmlLwGjH5LBoRh1UoBtWaNi22vRAi6Jca1yMzEH8PsG7yQq53Alw9UFvuQp5nUJtkSIXmU+EilVyWO9H4CIIh691UXRAEwG4eYx8kues3nk4GO4qZ12nca12fAfEyEzhzU1+40pASI0li+ekjI0+rg70H9zqVKqMq6TmHWHO2aEOOl/u0QfmiTqxUPFcN/uw/FGVsPwsCsQz7QLm6o02TUhV6mESu/PqrZw9YKSWStqEx3zalY7xPu8vbNwqtzkbkH25v84WBbMD5bOFNUR6H793d9ncgvQYaUk7kiVhY03AZd0f29zczLcLzsA2v9KAlN53bnxwsnlDdDWUzoGXJ1/cj0z03xHNRBVpjLYrq/cKYASWvmG2L94uElKDsaM4qIG6sS+CslWo10Ie1Ne8PHOymyjrWVrjJRyse/fOAY7G2O6ukgUo5vnOgI4YibLi6KN9x4xSbG/Hk489NyzjLOWp4IdtdhwIfMsIx+LeIoIKaUmY51k6KtzeAKM 7qjTNCRp HrEyKIms72fOvgcI3UDNCVtV1ufMkk3AgGvqFc4KbrFNK90UQUZPHSvveX6jXKvIEMz50YfYtWh0pQrD8po9EhFY2XBriIIKJObkrU5NWMQraOSOV7T06lVJZmaHihbvLOwlqi4pNw8MY/rQSUfbg7oE1QrC8TXt98fKoHEGswalpxctu9ov+j+KNkAi4sEQ+MukxLFoUiLX5Zw+ESEDHCX8B3W+nW9PCjjfq5/QduM/WkZY46epPsCaqXvUOmG1IK1KsdpJ4if8UgL02+aqtBEiAEHfuiZhXesq2xtfEQ0XEzByFmggKlXeHZLTgyKjHWLuEzyAEU+etmTq0f3fJFrfuegUfEiBmvrZqiUMO/WQwC3O1P6flaJoaFdvbrJ+GMcCKeInj35OWhknH8hBn2XizT2fdW6mqbEeqGY9unENPaznQr+09HBYvnd7jlIuJ2wXIuCNXSfc+0Hc3dLswoQt5/zobvdpuZ6rC4dTgCmD7fcWtqPZtWhhPeEVyhcFhJ/JFGhtPPJcUWUreit2OMfgHTWyOznPvB4cGhHIShLzDOP/EeuRKSbgw84fFpz+lwrEc1E7oTaU18dgXdHjftLoS/7eJlrQMioX7QjL30XJdlCUq0p3VKvOPaGHAGBi1OaioUoMWV8Yen9oGwr4s9O14wnuLP/k7MB9bLkgBsU7YxVznVtm2ZracpzSwlvTlJoLYJ32KaVIDqmcI4D8GhLb2eH8VnhjAqMwXkhdbUNdke8ZPuLOyZ9t2c3yfdDtRrgBuUIb8hUNEsnvkC8tG0uWShIxcE4tT2vaS X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 27, 2023 at 11:08 AM Jeff Xu wrote: > > On Thu, Jan 26, 2023 at 9:55 PM Kyle Huey wrote: > > > > On Thu, Jan 26, 2023 at 9:36 PM Jeff Xu wrote: > > > > > > On Wed, Jan 25, 2023 at 5:43 PM Jeff Xu wrote: > > > > > > > > On Wed, Jan 25, 2023 at 11:13 AM Dave Hansen wrote: > > > > > > > > > > On 1/25/23 11:02, Jeff Xu wrote: > > > > > > I'm investigating if there is a need to backport x86/pkeys > > > > > > fix/feature into earlier kernel versions, Chrome is starting to use > > > > > > PKEY in x86, and I hope experts here can give advice on this. > > > > > > > > > > > > For background, ChromeOS regularly syncs with upstream kernel > > > > > > versions, and has production that uses 4.4/4.14/4.19/5.4/5.10/5.15. > > > > > To be honest, I haven't got the foggiest idea what you need to backport. > > > > > I can barely keep track of mainline. > > > > > > > > > > Are there really production 4.4 kernels that you need to run on > > > > > pkey-capable hardware? That would mean running a 2015-era kernel on a > > > > > CPU released in late 2020. I think Q3'2020 is when the 11th gen CPUs > > > > > came out which were the first non-server CPUs that had pkeys. > > > > > > > > > Thanks! > > > > For 11th gen CPUs, chromebook uses 5.4 and above, so that eliminate > > > > half of the versions. > > > > > > > > > On a positive note, the pkeys selftest has been pretty consistently > > > > > updated as we find bugs. I'd be curious how well a mainline version of > > > > > that selftests runs on old kernels. But, I'm too scared to find out > > > > > what's down that particular rabbit hole myself. > > > > > > > I took the latest selftest from main and run on 5.15 kernel, > > > all passed except test_ptrace_modifies_pkru > > > assert() at protection_keys.c::1623 test_nr: 20 iteration: 1 > > > > > > Is there a bugfix for the ptrace area ? > > > Thanks > > > > > > What 5.15 series kernel did you run it on? The patches for that didn't > > get backported until 5.15.88 > > > Thanks! I'm using 5.15.87. > Will this patch set be backported to 5.4 and 5.10 ? > The selftest (from main) also failed on 5.4, in the same test, > but at different line: > assert() at protection_keys.c::1651 test_nr: 20 iteration: 1 The regression that patch set was intended to fix was introduced in 5.14. I don't know why the test is failing on 5.4 but I have no plans to investigate it. - Kyle > - Jeff > > > - Kyle > > > > > > > > > > > > I can start with 5.10 or 5.15, it seems there are quite some changes though, > > > > for example, this one by Thomas > > > > https://lore.kernel.org/lkml/20210623120127.327154589@linutronix.de/ > > > > > > > > My question is, if I have to pick a version that doesn't require a lot > > > > of backporting, > > > > and functionality is stable enough, what version would this be ? 5.4/5.10/5.15 ? > > > > > > > > -Jeff