Message ID | 1519908862-11425-37-git-send-email-alex.shi@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2764801edc; Thu, 1 Mar 2018 05:00:27 -0800 (PST) X-Google-Smtp-Source: AG47ELuqZy05gGX5IIH70SA0IqbIks5QWdvkSu2H6/dpq4z+wEUFbpuAxb6ko54SOTVZHiWWFH5x X-Received: by 10.98.89.156 with SMTP id k28mr1856637pfj.130.1519909227468; Thu, 01 Mar 2018 05:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909227; cv=none; d=google.com; s=arc-20160816; b=yLtzzAoMiNwoIfkZM5AoxCu5O/M/epP0gvjjjSX4qjkf3O8hx7BOzJTzqYTPL1qOzH Vw5fn0j3KP4Pzs2c1VivmOvqOZQd+Bf/ByvYJTXUfXWfcar6XKoSDMF0P3pMzf6D6s2F oXI/UIzj+qF0Dwnjue4fF3u1xQW5sXCDXl8O7xcgdM3HiVjb2iEDNANuFwZi7flbM3fy KoxL6UvB7ZLRNhdryOHxXNXhp+fq4YXWPF5hi4QvIQ/ZggDiW4/z8f1tk9IDZQRGuMTV hSeyXO/sMp/h3vUH6BtittlW57m7hYPZ6J96dzpnTrGVAl0+HIWJudsOiu5j3uCwcLfe Y2hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=xGNCJVfC7y0l2iGx2mX+dT6QeG2673qeY24WMPI/LQ5ZTWtK9MtVTVbIHcu71rZnBf e5iO1IO4BNx4uyapjQ6TwcX9Jadt68MkOkQS723Tl43wwKw7rkXpvQvYqaamth3WDSaL IypZQshgo3CQPZ5LTQi35NJgpwC8GCB+HyzrBQ91zHe58+DZqOvDwt95XA2QFo/X2Vr0 rWRNPzeJZNfWA58K9n9EfGEPXWuNro9+xLc6gyp+rmnFZ0kvZYT0ccAjI4vrn9gCXnW5 A6k4xJhbP8JfG3lZ6wxh9wasMzEDoba2/7N/7/Zcawze4LeeQy4JoRnllMgE3bWzuJ5X hwWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eBmCz7H/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si3003318plh.450.2018.03.01.05.00.22; Thu, 01 Mar 2018 05:00:27 -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=@linaro.org header.s=google header.b=eBmCz7H/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031092AbeCANAS (ORCPT <rfc822; dan.rue@linaro.org> + 28 others); Thu, 1 Mar 2018 08:00:18 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:44205 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030915AbeCANAO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Mar 2018 08:00:14 -0500 Received: by mail-pg0-f67.google.com with SMTP id l4so2267941pgp.11 for <linux-kernel@vger.kernel.org>; Thu, 01 Mar 2018 05:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=eBmCz7H/8d4JQQbcrfHGWDJ3JynokepH2HqubcLqlc3m1OaXtObxOsE2XLy7O+HbA0 4rYWONP5Ps/H1G5zQpnv9Hvgg/CPGjM0tU+NlAJ2zzZjixcfYPGMv36Ipzmzhkc58lp3 0HYZPoQ7dSUd7csijiGK7lVrGddwCDEGZZokI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=RHkIn33Zk2P8/6RnP6mtGUKudVDV67If0AEUE8lWroyTLG+/USNPn7z6IA3Oy7bVN3 xY6TPcVQVEZKAqfbd7+OkSq675lDuZ4gIKSq4cyoGSCJBaTLWEyW2riqVMMMBjnp/72f WcHCKbEz4J5QTkKfGjTz7B3d/TWAD65e9EiP2qdJiHOmRd9orwn/XXVT6+MJl5cZOyGV 9FMnmRKA6m0QvNJimIz00zImQobLyrTZmWko4gd1xWOt22gt2rHneFiwie7c/TXvFHZG y3HgJjgcWbfcKcTtJCGaBoDRKAkXt+2cg3Jx/Etb6XENLAWZWtkyDTfiernLLAym1UkW JGew== X-Gm-Message-State: APf1xPCoTEFc1EmZMfYFYX2IzFTt4kP2dSCJatf40PR4bFgErciGXkUL sIMkW6cSE6iqDP9fHSiEV0iZkw== X-Received: by 10.101.73.197 with SMTP id t5mr1513480pgs.426.1519909212255; Thu, 01 Mar 2018 05:00:12 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.05.00.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 05:00:11 -0800 (PST) From: Alex Shi <alex.shi@linaro.org> To: Marc Zyngier <marc.zyngier@arm.com>, Will Deacon <will.deacon@arm.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, Catalin Marinas <catalin.marinas@arm.com>, stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alex Shi <alex.shi@linaro.org> Subject: [PATCH 36/45] arm64: KVM: Make PSCI_VERSION a fast path Date: Thu, 1 Mar 2018 20:54:13 +0800 Message-Id: <1519908862-11425-37-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
arm Spectre fix backport review for LTS 4.9
|
expand
|
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index cf6d962..3eab6ac 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c @@ -17,6 +17,7 @@ #include <linux/types.h> #include <linux/jump_label.h> +#include <uapi/linux/psci.h> #include <asm/kvm_asm.h> #include <asm/kvm_emulate.h> @@ -308,6 +309,18 @@ int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu) if (exit_code == ARM_EXCEPTION_TRAP && !__populate_fault_info(vcpu)) goto again; + if (exit_code == ARM_EXCEPTION_TRAP && + (kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_HVC64 || + kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_HVC32) && + vcpu_get_reg(vcpu, 0) == PSCI_0_2_FN_PSCI_VERSION) { + u64 val = PSCI_RET_NOT_SUPPORTED; + if (test_bit(KVM_ARM_VCPU_PSCI_0_2, vcpu->arch.features)) + val = 2; + + vcpu_set_reg(vcpu, 0, val); + goto again; + } + if (static_branch_unlikely(&vgic_v2_cpuif_trap) && exit_code == ARM_EXCEPTION_TRAP) { bool valid;