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 X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E7E1C433E0 for ; Mon, 18 Jan 2021 14:56:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B4C722C7E for ; Mon, 18 Jan 2021 14:56:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B4C722C7E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g16ljLMDwZwLhQugqzwxP/+kXAtaz8gHr0i++l08S0I=; b=f+vEOQcH/K19OTaVPn9+eDFVw zgsu8PSmMQYzB62wImLRdmSj9RDblp5byIQwOlZ5BLIf2+U3p6yNcRZh634URjvh9f+kB6zeNAmbS ZceZbS2JJnXqOIUw5pqFGSBSb8r5j5IXXd3TJlx7wOd/gsdOOLHQ+9tJKyMnvUBw8BweXB0PhtO+q YIyg88ZUo5RWz90/u6x78FknJr3AXH8bEXk/phOtNSIpqhzgArxNX/A1xorCuYMLF90c5GOsdFmaZ VmtQhA/hPas+lIAyLgFPB9z+9iFmMaVPWL1gecAbo4/4bC7Npp0UKMoL97AF7fl7VKrFIzZNxafHE gjIa+KGbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1VvW-0000ve-AR; Mon, 18 Jan 2021 14:54:42 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1VvT-0000uX-Az for linux-arm-kernel@lists.infradead.org; Mon, 18 Jan 2021 14:54:40 +0000 Received: by mail-wm1-x32f.google.com with SMTP id r4so14007588wmh.5 for ; Mon, 18 Jan 2021 06:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bJKOCIhgp2n2XDRcM4f1+mhwqcxWdVNau3p3HbDQCsQ=; b=KbFMIpZl8sxRjKqORQuoy0bbEKHAsIFWrTPauw8EWR0jhNuKKZEGP/zuqK95fjHeX/ lFy76l4st/jJl3GWQDDUSj2JYqxUIHVU9VRmQcZlyNZW8NJ4hhnbH8k6hmZZXx/RWHV/ 7odDwx25iRfazRG0bagwmgXkvV5SkjJANBw0UVpp3gK1N+OeDB23LZe86HKnhHty0Wzv Z90YdryTRsnJzyCLcR3y6v4Ig56vmt9IwH6Umd977izSVciVE1zIofrC+O1VJERXB6iY pPUmwZmH7jOF3CZ8y1xi9a1O3lJXkSKdOCbPhBlkpdS05RAITTywf3lujT4zteEEBY++ Go0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bJKOCIhgp2n2XDRcM4f1+mhwqcxWdVNau3p3HbDQCsQ=; b=fcvs2rmmponKaGGZb6rxIBpVltgjDIaKvLkogE/fLwxpZwx+Fmeu95d5YRAw1iKAoF /2Y/tCi1+dxWMG6XsRXS8ULnYYTbK49lA7/qWK8va3UcAxHdygCaJAl4si6agnVmUIyh p5X/n9pVoOu1l5uktPHSFikYUgBwrE40lAp3f2TEorJTQA8jcwv1QmS20D1UNlAmLcrZ zZLEA0VG/9nXwB1cMab4qY63pE+rS9W7gwqf9jg5HMqa64GyAj0tR+J6I3N5nwRAneIl qLXIWgw8ry9n8g1QrR2LubZu8aZJjkES7IDn9XskO2WNbLfkMeJSj7r+QEvNEjQZc2Ey YZSQ== X-Gm-Message-State: AOAM531e06uFNXNIyqE7GF5E5fvfIQZDo1wJP/PGl2fZnseqIpf8rJay sXXiriDl8v4qoJK2bsTOpyiGNA== X-Google-Smtp-Source: ABdhPJz6bW3BGvz8nTjOKnqiVeRy9unK18MMh2g7waN9oE7GE7k4Wvz87vgOhlNoIs3aMnmGr/BJ+Q== X-Received: by 2002:a1c:6a02:: with SMTP id f2mr21519184wmc.36.1610981676034; Mon, 18 Jan 2021 06:54:36 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:3d4d:985d:87b7:4d55]) by smtp.gmail.com with ESMTPSA id h125sm12879816wmh.16.2021.01.18.06.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 06:54:35 -0800 (PST) Date: Mon, 18 Jan 2021 14:54:34 +0000 From: David Brazdil To: Marc Zyngier Subject: Re: [PATCH v4 00/21] arm64: Early CPU feature override, and applications to VHE, BTI and PAuth Message-ID: <20210118145434.2lar7xkgwy5yj54i@google.com> References: <20210118094533.2874082-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210118094533.2874082-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210118_095439_412690_F8A47710 X-CRM114-Status: GOOD ( 28.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Jing Zhang , kernel-team@android.com, Srinivas Ramana , Suzuki K Poulose , Catalin Marinas , Alexandru Elisei , linux-kernel@vger.kernel.org, Ard Biesheuvel , James Morse , Julien Thierry , Ajay Patil , Prasad Sodagudi , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 18, 2021 at 09:45:12AM +0000, Marc Zyngier wrote: > It recently came to light that there is a need to be able to override > some CPU features very early on, before the kernel is fully up and > running. The reasons for this range from specific feature support > (such as using Protected KVM on VHE HW, which is the main motivation > for this work) to errata workaround (a feature is broken on a CPU and > needs to be turned off, or rather not enabled). > > This series tries to offer a limited framework for this kind of > problems, by allowing a set of options to be passed on the > command-line and altering the feature set that the cpufeature > subsystem exposes to the rest of the kernel. Note that this doesn't > change anything for code that directly uses the CPU ID registers. > > The series completely changes the way a VHE-capable system boots, by > *always* booting non-VHE first, and then upgrading to VHE when deemed > capable. Although it sounds scary, this is actually simple to > implement (and I wish I had done that five years ago). The "upgrade to > VHE" path is then conditioned on the VHE feature not being disabled > from the command-line. > > Said command-line parsing borrows a lot from the kaslr code, and > subsequently allows the "nokaslr" option to be moved to the new > infrastructure (though it all looks a bit... odd). > > Further patches now add support for disabling BTI and PAuth, the > latter being based on an initial series by Srinivas Ramana[0]. There > is some ongoing discussions about being able to disable MTE, but no > clear resolution on that subject yet. > > This has been tested on multiple VHE and non-VHE systems. > > * From v3 [3]: > - Fixed the VHE_RESTART stub (duh!) > - Switched to using arm64_ftr_safe_value() instead of the user > provided value > - Per-feature override warning > > * From v2 [2]: > - Simplify the VHE_RESTART stub > - Fixed a number of spelling mistakes, and hopefully introduced a > few more > - Override features in __read_sysreg_by_encoding() > - Allow both BTI and PAuth to be overridden on the command line > - Rebased on -rc3 > > * From v1 [1]: > - Fix SPE init on VHE when EL2 doesn't own SPE > - Fix re-init when KASLR is used > - Handle the resume path > - Rebased to 5.11-rc2 > > [0] https://lore.kernel.org/r/1610152163-16554-1-git-send-email-sramana@codeaurora.org > [1] https://lore.kernel.org/r/20201228104958.1848833-1-maz@kernel.org > [2] https://lore.kernel.org/r/20210104135011.2063104-1-maz@kernel.org > [3] https://lore.kernel.org/r/20210111132811.2455113-1-maz@kernel.org Pretty cool! Left a few minor comments here and there, other than that: Acked-by: David Brazdil _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel