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 36266C54EAA for ; Fri, 27 Jan 2023 19:09:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B16C6B0072; Fri, 27 Jan 2023 14:09:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5613E6B0073; Fri, 27 Jan 2023 14:09:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 429166B0074; Fri, 27 Jan 2023 14:09:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3168F6B0072 for ; Fri, 27 Jan 2023 14:09:01 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DBAD640FDA for ; Fri, 27 Jan 2023 19:09:00 +0000 (UTC) X-FDA: 80401516440.20.E81EF58 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf15.hostedemail.com (Postfix) with ESMTP id 30DBDA0032 for ; Fri, 27 Jan 2023 19:08:50 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=l9RQAQJG; spf=pass (imf15.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.218.45 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674846533; 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=xIfkEEaMSE0a7xZFVggIJwc1teaH5msNV+1pNiJajEk=; b=Gq11H+LYwLn2baTpUB84i8dtbKLPDNuvNVpteCNrYwYEO9eDL+d+dMcmqERIglExi6dYJY F7qNJU+vMK+yMO0kPw5HsDSGSxr+x66IUw/sYp6J7+kDRhDVFcsXBcEzoBkM6v0Puq5pT/ e7hYk/Pb9U4F4gTGK/x87s6YrlDmGVc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=l9RQAQJG; spf=pass (imf15.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.218.45 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674846533; a=rsa-sha256; cv=none; b=hXaQskKY6ZGcV3j6yPEQ3KcJD14u5iPNlTP/JHrP2JsPrrPbzgWuQ6HfXdD4aoFLGm/iRL dGmNIhjbMATDL65IlJIOS6gNUCpGX8wUuh45iZBPOiBP2pF7ySZbeyBwjUtikZDKMJvOdV XyCEq6iBaQ33G9B7Y0nTC5iHDmcJ71E= Received: by mail-ej1-f45.google.com with SMTP id m2so15816080ejb.8 for ; Fri, 27 Jan 2023 11:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; 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=xIfkEEaMSE0a7xZFVggIJwc1teaH5msNV+1pNiJajEk=; b=l9RQAQJGEYiEwThydlPr6fKbPucUs/TVSj0Zl54ymVUXTWwRx4Vj68VaIK1CNoT8kd NrwwxKXxYCtNBg5Y3O3M2qqbgTQ93Ju+BSJ9H+sHO0f1ccbOnV372aRynxetsKX/jvFa TfGKLxcVCFGhOkxOl7YmUAkeSbKlPL7oLEHQQ= 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=xIfkEEaMSE0a7xZFVggIJwc1teaH5msNV+1pNiJajEk=; b=gtIPVIZBATvhZEh95AdjsBV8WsgIuWGmhvQboQtLZ//VL3eGtgXBeDKNfE5VSCXzFu unN7VYSiwcX8meGQKyZIAfDnes45JRC362MK4v6AZdgWG7LD0DUoHK39WcFdH180TqJ1 dTM3aPxIhUkAy+H2dULd5JNfZdHBj1mARyAWSg2iXnRpFr8374IFfMdjTT5kF9b4EVIQ 2hNJzlqrmifsMuqHSQlI5y82Mn4+vUKjAdb9CAeU8MU+xYkxMMGB7dQAVaRqkbAKhGPE lt9SH858GLrVvbHPwopXcU6zVPnhjnfOTY/7HbbVwQHvkclN+JIP0bpMWnVT6FpH+Llp Clbw== X-Gm-Message-State: AO0yUKW9yH67teV95RCuoxkBIGhVq4Du6NoF9epQY+hfGZO0L0idI8fw yvuO2WizOg63+bxgzkLrCCNVUfF9TS4+7f9rbRuh4Q== X-Google-Smtp-Source: AK7set8jIvOLMne9ppBifpJVykTyD3aA6ARpZgwasJS52ktASPICbmigsngqg1SpcG/KSzRzDcPDztq77kuKvPpaPhk= X-Received: by 2002:a17:906:d113:b0:87b:dbb6:a7c with SMTP id b19-20020a170906d11300b0087bdbb60a7cmr631198ejz.192.1674846517523; Fri, 27 Jan 2023 11:08:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Xu Date: Fri, 27 Jan 2023 11:08:25 -0800 Message-ID: Subject: Re: x86/pkeys in early kernel version To: Kyle Huey 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: rspam07 X-Rspamd-Queue-Id: 30DBDA0032 X-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precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 - 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