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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 8164EC388F9 for ; Wed, 21 Oct 2020 22:06:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14ACE2419B for ; Wed, 21 Oct 2020 22:06:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BHInRJZg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2506551AbgJUWGk (ORCPT ); Wed, 21 Oct 2020 18:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2506539AbgJUWGj (ORCPT ); Wed, 21 Oct 2020 18:06:39 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B4A6C0613CF for ; Wed, 21 Oct 2020 15:06:38 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id o7so2317189pgv.6 for ; Wed, 21 Oct 2020 15:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=IK+ZMP2az0RfPWcNkCMoV3EvgaO3Q2+DaxT88xfq70s=; b=BHInRJZgPQYw3GolT2+P917F3CtK3B8WgMft9Alp2/I+WOKq9JqCMQKJK3RU0DDC5O uNaO25XfQEfIKgjWpoDj7b4bKjpTZzqr8JT5Fy8/NTu1j610//2wrmIPrsuPjC/mNrpB McmoPnHMSK4nrvJQAFXU+LbLYUmj1DeEMUm+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=IK+ZMP2az0RfPWcNkCMoV3EvgaO3Q2+DaxT88xfq70s=; b=GPAqenpW05Gv5C4Qw7KNjop5IhSyfXRsPlcv+4830fRTiVb4sGxQfNPdwBaWifhLBe Qm/DaOKweo6VjB/RTJ7N2Q3DnHbq4JJT4/YJyY1dvc2eR3GR2xcduhNYrkt5ZEokt99/ X+4OVHh1tpa8YgGnCwFyiP93vcjCBUCvhpxXvTLwq1sHP7+sKnS3yYJuHHmK3pR+gtZm MvAqn3ILG5N76S3nUHP4h97xwE8ZVqObdVRt/zbUWfFIMMspK3YzTwbwzronf708G5Re bPaK5LNE4dxrp6b/KxPrzQbLuUL9xyYK4EtDB6w0OVQGAM5NuwysKwpTcghULnwekZfk d3zw== X-Gm-Message-State: AOAM532++E5b8FJozZAbncXEADZ061fmb2G6zZkvZfd/pygS028AnCT5 odvC4Us9oNRAhHZNJUXtQny25Q== X-Google-Smtp-Source: ABdhPJwfIN8B8/sBkUHsjFMnj0A33TfVS6lON7NRuGhEjueahqVrrlMGzM6dQm51TqTvvEkyU5p7OA== X-Received: by 2002:a63:1e0b:: with SMTP id e11mr5003372pge.72.1603317997512; Wed, 21 Oct 2020 15:06:37 -0700 (PDT) Received: from chromium.org ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id b142sm3293301pfb.186.2020.10.21.15.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 15:06:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201021211326.GA18548@willie-the-truck> References: <20201020214544.3206838-1-swboyd@chromium.org> <20201020214544.3206838-2-swboyd@chromium.org> <20201021075722.GA17230@willie-the-truck> <160329383454.884498.3396883189907056188@swboyd.mtv.corp.google.com> <20201021154909.GD18071@willie-the-truck> <160329672229.884498.3370140649393072677@swboyd.mtv.corp.google.com> <20201021211326.GA18548@willie-the-truck> Subject: Re: [PATCH 1/2] arm64: ARM_SMCCC_ARCH_WORKAROUND_1 doesn't return SMCCC_RET_NOT_REQUIRED From: Stephen Boyd Cc: Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andre Przywara , Steven Price , Marc Zyngier , stable@vger.kernel.org To: Will Deacon Date: Wed, 21 Oct 2020 15:06:35 -0700 Message-ID: <160331799505.884498.376133101315233761@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Will Deacon (2020-10-21 14:13:26) > On Wed, Oct 21, 2020 at 09:12:02AM -0700, Stephen Boyd wrote: >=20 > > My read of the spec was that the intent is to remove the call at some > > point and have the removal of the call mean that it isn't vulnerable. >=20 > No, the CSV2 field in whichever ID register is for that. We check that in > spectre_v2_get_cpu_hw_mitigation_state(). Alright, makes sense! >=20 > > Because NOT_SUPPORTED per the spec means "not needed", "maybe needed", > > or "firmware doesn't know". Aha maybe they wanted us to make the call on > > each CPU (i.e. PE) and then if any of them return 0 we should consider > > it vulnerable and if they return NOT_SUPPORTED we should keep calling > > for each CPU until we are sure we don't see a 0 and only see a 1 or > > NOT_SUPPORTED? Looks like a saturating value sort of thing, across CPUs > > that we care/know about. >=20 > The mitigation state is always per-cpu because of big/little systems, the= re > just isn't a short-cut for the firmware to say "all CPUs are unaffected" > like there is for SMCCC_ARCH_WORKAROUND_2 with its "NOT_REQUIRED" return > code. >=20 Ok. Can/should kvm be emulating the CSV2 bit that the guest sees? Just wondering why I'm falling into this (ghost) trap in the first place.