From patchwork Wed Jan 15 17:36:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1223749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47yZK75Gmyz9s4Y; Thu, 16 Jan 2020 04:37:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1irmbf-0003Q8-N2; Wed, 15 Jan 2020 17:37:27 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1irmbR-0003Nb-IF for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 17:37:13 +0000 Received: from mail-wr1-f72.google.com ([209.85.221.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1irmbR-0008Iy-A6 for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 17:37:13 +0000 Received: by mail-wr1-f72.google.com with SMTP id c17so8194414wrp.10 for ; Wed, 15 Jan 2020 09:37:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rIiZndolEQffzrUwJhqYd4C+HQo/qU3l4yStbXiVZtY=; b=InSQ0/R241fvnQqg+mAUToU4LVFdMLGZv29bpHZePN6DV3kyAqiPglrR32gl+O1yMm +Z5lE8Yc0DQuAVmCDGytWmYw+ZWPZxesHg+mZ9UaSUhvDGIVzj8fCeJktBKsy3lDkzdq 7Y/E/i2NpFGehAFXAjjoE0as/2FbWoT5K4BPSSzdZHZEuXt5vd8tdfrA2igEF84dplfi 4sQf83oCff5ou762wK+sY+hBMAcMhpfrk34XKyDYEVi5JyA15pnnUvVvp7EkJMtcFGQh 5szCv9QL02/2Vy3nJazA64ZHxTn1LlpD6dQ4IziAu6uEtsCNghuJ3Ksghaz76R8j1kGU ojBA== X-Gm-Message-State: APjAAAUnGP9+Qi8p3LNs+CeaqcpmIqH13sVSFwS88Vs2Shf1XFL4AssQ 3EVA2x3PalxTGBao/WdFqIPvSkGGdlN6/nmrRY5BsrkvDIGiAcllDvYYi/ZOeFUUZkaDVhN5UJy kXVqmt+Q3/iJy9U/B5cQOPme1cJhsP2OeRsKTwEoyOA== X-Received: by 2002:a05:6000:12:: with SMTP id h18mr30906775wrx.87.1579109832675; Wed, 15 Jan 2020 09:37:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzQP8ZediZuhNm5BDVMTdRtDKtnlOgeddVzj3+dweiZ1VYWtSJvwQtIMH8+9B36k6anWuUvJQ== X-Received: by 2002:a05:6000:12:: with SMTP id h18mr30906748wrx.87.1579109832325; Wed, 15 Jan 2020 09:37:12 -0800 (PST) Received: from localhost.localdomain ([81.221.209.144]) by smtp.gmail.com with ESMTPSA id d12sm26278934wrp.62.2020.01.15.09.37.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:37:11 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic][PATCH 1/2] arm64: Check for errata before evaluating cpu features Date: Wed, 15 Jan 2020 18:36:37 +0100 Message-Id: <20200115173638.31514-2-juergh@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200115173638.31514-1-juergh@canonical.com> References: <20200115173638.31514-1-juergh@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dirk Mueller BugLink: https://bugs.launchpad.net/bugs/1857074 BugLink: https://bugs.launchpad.net/bugs/1853485 BugLink: https://bugs.launchpad.net/bugs/1853326 Since commit d3aec8a28be3b8 ("arm64: capabilities: Restrict KPTI detection to boot-time CPUs") we rely on errata flags being already populated during feature enumeration. The order of errata and features was flipped as part of commit ed478b3f9e4a ("arm64: capabilities: Group handling of features and errata workarounds"). Return to the orginal order of errata and feature evaluation to ensure errata flags are present during feature evaluation. Fixes: ed478b3f9e4a ("arm64: capabilities: Group handling of features and errata workarounds") CC: Suzuki K Poulose CC: Marc Zyngier Signed-off-by: Dirk Mueller Reviewed-by: Suzuki K Poulose Signed-off-by: Will Deacon (cherry picked from commit dc0e36581eb2da1aa3c63ceeff0f10ef1e899b2a) Signed-off-by: Juerg Haefliger --- arch/arm64/kernel/cpufeature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index b96d1a635a16..3d332823ba93 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1360,9 +1360,9 @@ static void __update_cpu_capabilities(const struct arm64_cpu_capabilities *caps, static void update_cpu_capabilities(u16 scope_mask) { - __update_cpu_capabilities(arm64_features, scope_mask, "detected:"); __update_cpu_capabilities(arm64_errata, scope_mask, "enabling workaround for"); + __update_cpu_capabilities(arm64_features, scope_mask, "detected:"); } static int __enable_cpu_capability(void *arg) @@ -1417,8 +1417,8 @@ __enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps, static void __init enable_cpu_capabilities(u16 scope_mask) { - __enable_cpu_capabilities(arm64_features, scope_mask); __enable_cpu_capabilities(arm64_errata, scope_mask); + __enable_cpu_capabilities(arm64_features, scope_mask); } /*