Received: by 10.223.185.116 with SMTP id b49csp1634331wrg; Sun, 11 Feb 2018 17:18:44 -0800 (PST) X-Google-Smtp-Source: AH8x225ifMw+Gm/1NR8qMcjYNIschOrhd0miOItokhwGSH4cW0c1QnqGiFaii1USDqO4Xcvmutzl X-Received: by 2002:a17:902:9343:: with SMTP id g3-v6mr9424494plp.319.1518398324627; Sun, 11 Feb 2018 17:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518398324; cv=none; d=google.com; s=arc-20160816; b=zh8VACS1exjo8/lkqXnOR2vApnRpdO9/7yg6SEPIgB8Uh2P4JWLYRdc/bcmrXe2j5B dkbzPkgs79I6XNgH9rpxc3SVaDkaqMMidcs68VBRqjqei9lQDPr7P3KiqHTW53ZkssHI OF8ROOupla7VFmKop2og+Z1VyEO2P8vX3vLS/9n1hh5X/gHfb21H7k4Kejk+NZKVdF9i xPTV5Yob10ZTfzR3hqRBVXWoTMf5EtBEOs8jVdBRxYG9kTIVpdIG97Cyrl9VYCuv7YvL IU7NkG4XqtJXAkuEuclDquJ74l3s0pBeS3Dd8mLols2BPRfapdJ1qtMVN7KGPGQ1kZbp nbXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=kvSK/3ioNWR4a6Gu+xLQ52lysazHJcesSi/yGn9gM9Y=; b=0L1vyEF8D1AwwgwWebRsbUUx9pN6VhuwqYFEwZwUW+QDtpXMktNngtI7kvSvDUkUwK YnrO+i3YQ26oxDH7Rp0FhUgQiAg7lHTwxeRZ5ydXGDBfHNOlLPjLLdpTsl8VGFl97I6M FkhYgT9g8ps/RwcE2cLsRsqg8k4tTwUrgN4EhUJGfOarViA1aHFPDC794NSUTbjgel4G AKmCtyXG/39qynUf9gehK6pcnzkZIpGlgv0VGPsSn0dNZRJLJZD1gLtryha8CEyBp67U srnc9O04OgOzwdQb+lxj+yumpHXLDytLo+xm5vsKW2okHjCzPH3jGZmzg8XGixfZ+mcz 3IYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fTgOCNa5; dkim=pass header.i=@codeaurora.org header.s=default header.b=fxzYg8An; 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 g2-v6si5210978pli.43.2018.02.11.17.18.30; Sun, 11 Feb 2018 17:18:44 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=fTgOCNa5; dkim=pass header.i=@codeaurora.org header.s=default header.b=fxzYg8An; 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 S932418AbeBLBQh (ORCPT + 99 others); Sun, 11 Feb 2018 20:16:37 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39444 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbeBLBQg (ORCPT ); Sun, 11 Feb 2018 20:16:36 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AD98560F71; Mon, 12 Feb 2018 01:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518398195; bh=u256UtVIpb2yu8avJLIabAq3YhuD1xk+uTiFVDopCuE=; h=From:To:Cc:Subject:Date:From; b=fTgOCNa5t6RK34i7OaZ8VKRRuHk/4SSFxSKabj2ss+7738qxj9Uz8SSqoIW2zS1T7 aHNqrpLijGUcx+LQ1LV55tn41lmJ3/eKbFoMx5NzSdXdCTSG+nZYXSTEVEm7EDw2kA oS8Uf+97Py4MinVSfQ2iUjcxd7Kp3G5iQFFfD5gY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from shankerd-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: shankerd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BF5B8608BF; Mon, 12 Feb 2018 01:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518398194; bh=u256UtVIpb2yu8avJLIabAq3YhuD1xk+uTiFVDopCuE=; h=From:To:Cc:Subject:Date:From; b=fxzYg8AnkVQpMqKYXhKmjyUXfSGyIkNK6qX0GgW6makd1XAud4m1ArEgz7M0wLXQk FunUKTv2XBGruNiIcZQAT78hQqAe6exJdTQqbsl4v6372qVN8H1WiCCYAN83YsH2+q WLTdxHJe7BXmftqD8/kc/F1KdIdk4V1Ej/rMKKus= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BF5B8608BF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=shankerd@codeaurora.org From: Shanker Donthineni To: Will Deacon , Marc Zyngier , Christoffer Dall , linux-kernel , linux-arm-kernel , kvmarm Cc: Paolo Bonzini , Catalin Marinas , Vikram Sethi , Sean Campbell , Thomas Speier , Shanker Donthineni Subject: [PATCH] arm64: Add missing Falkor part number for branch predictor hardening Date: Sun, 11 Feb 2018 19:16:15 -0600 Message-Id: <1518398175-28378-1-git-send-email-shankerd@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org References to CPU part number MIDR_QCOM_FALKOR were dropped from the mailing list patch due to mainline/arm64 branch dependency. So this patch adds the missing part number. Fixes: ec82b567a74f ("arm64: Implement branch predictor hardening for Falkor") Signed-off-by: Shanker Donthineni --- arch/arm64/kernel/cpu_errata.c | 9 +++++++++ arch/arm64/kvm/hyp/switch.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 0782359..52f15cd 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -408,6 +408,15 @@ static int qcom_enable_link_stack_sanitization(void *data) }, { .capability = ARM64_HARDEN_BRANCH_PREDICTOR, + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR), + .enable = qcom_enable_link_stack_sanitization, + }, + { + .capability = ARM64_HARDEN_BP_POST_GUEST_EXIT, + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR), + }, + { + .capability = ARM64_HARDEN_BRANCH_PREDICTOR, MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), .enable = enable_smccc_arch_workaround_1, }, diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index 116252a8..870f4b1 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c @@ -407,8 +407,10 @@ int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu) u32 midr = read_cpuid_id(); /* Apply BTAC predictors mitigation to all Falkor chips */ - if ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1) + if (((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR) || + ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1)) { __qcom_hyp_sanitize_btac_predictors(); + } } fp_enabled = __fpsimd_enabled(); -- Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.