Received: by 10.223.176.5 with SMTP id f5csp1398791wra; Wed, 31 Jan 2018 05:59:14 -0800 (PST) X-Google-Smtp-Source: AH8x224JOOKipRf3K9CWVvZsemX9rQl+a+xMzOHG97aDW0BU1MPB5PuGUCrOpAT4Ta/B2otZ7XsS X-Received: by 10.98.31.131 with SMTP id l3mr34169231pfj.116.1517407154852; Wed, 31 Jan 2018 05:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517407154; cv=none; d=google.com; s=arc-20160816; b=LqHxa7nugGnxWDb7jsna/bdnK5GvqzeV5hxEK0yA3W42+8U48Z/pYPtP5hveL3EeB+ X7j7DOGTN8Q1caNNkjsF+a8q3YIgyj99OKnTo4lSsYw5GP94GL4tqCnEs4Dk3PHoL+gz q4Xe2pv1RRjTpv3/D/xnI71G5prVc2to8DeuTWCU0zkFVrFcVxoRMYPE1F1XqzKRSgWI +TJttqtAZlsX4uJNqoYgizzmJQdOyLUkE6OfyM1ji80pneo8QRlupgwdsaRNVHDFnKWr fFMN6TRkqCaaQaK94kVq9r2snew1S/KPzfSQ/FCwEVs97IvzSQ6JqK/RgPi/a6WLC1C5 hbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=sGnjTdRqyp+eFU1NAKCmoYv9HwQKB7AlKomSuXhu13k=; b=pCPTTPj5N+f9JUO1fQ4lSQ2JBsuSL8oYuFhiUjtVmas3yPKX+dGgPV488DweRUggBp r3HI12WL6C6O5eZRouEZF4cPylx5yHbh7ihoEpXg91+JgjKK+syVJeFsXDU7bN1kj+6L z/jaK233/Edp95UVCGAP7+GsJVq+XfzOsMMS3katYWZubFwE/ahqK0i0+WvFFj7KejNw 9ngDIYoA3zQAziG+UGvIWzS0IEcddW0h+1zLeWtvdRCg7KZadB6rgP5rt7oW1YMxbTa9 gX93rtt10Thrg3tGpLzwANdqdo7Bo77yjkhOp+6wggqgTVYORE/dqC7zBo5hviU0mOs+ xP9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si2165227plj.274.2018.01.31.05.59.00; Wed, 31 Jan 2018 05:59:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753591AbeAaN5a (ORCPT + 99 others); Wed, 31 Jan 2018 08:57:30 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:53513 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752296AbeAaN52 (ORCPT ); Wed, 31 Jan 2018 08:57:28 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3B9F8DF273CE1; Wed, 31 Jan 2018 21:57:16 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 31 Jan 2018 21:57:13 +0800 Subject: Re: [PATCH v2 16/16] arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support To: Marc Zyngier , , , CC: Catalin Marinas , Will Deacon , Peter Maydell , "Christoffer Dall" , Lorenzo Pieralisi , Mark Rutland , "Robin Murphy" , Ard Biesheuvel , Jon Masters References: <20180129174559.1866-1-marc.zyngier@arm.com> <20180129174559.1866-17-marc.zyngier@arm.com> From: Hanjun Guo Message-ID: <476d111e-6fb0-9bef-2448-a94d0cc03f45@huawei.com> Date: Wed, 31 Jan 2018 21:56:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180129174559.1866-17-marc.zyngier@arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 2018/1/30 1:45, Marc Zyngier wrote: > static int enable_psci_bp_hardening(void *data) > { > const struct arm64_cpu_capabilities *entry = data; > > - if (psci_ops.get_version) > + if (psci_ops.get_version) { > + if (check_smccc_arch_workaround_1(entry)) > + return 0; If I'm using the new version SMCCC, the firmware have the choice to decide whether this machine needs the workaround, even if the CPU is vulnerable for CVE-2017-5715, but.. > + > install_bp_hardening_cb(entry, > (bp_hardening_cb_t)psci_ops.get_version, > __psci_hyp_bp_inval_start, > __psci_hyp_bp_inval_end); ..the code above seems will enable get_psci_version() for CPU and will trap to trust firmware even the new version of firmware didn't say we need the workaround, did I understand it correctly? I'm ask this because some platform will not expose to users to take advantage of CVE-2017-5715, and we can use different firmware to report we need such workaround or not, then use a single kernel image for both vulnerable platforms and no vulnerable ones. Thanks Hanjun