Message ID | 20180412111138.40990-34-mark.rutland@arm.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1572536ljb; Thu, 12 Apr 2018 04:13:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49cpyfFEMkHtskLGliKre65iX9nFtH1Jnuf/O+Hv93p6KIR/QAijnau8YbBBBKXJHu37clu X-Received: by 2002:a17:902:227:: with SMTP id 36-v6mr544703plc.134.1523531618103; Thu, 12 Apr 2018 04:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523531618; cv=none; d=google.com; s=arc-20160816; b=iUFE9c+PqkNiQvaLbd5yTIyPmoVsutY0nnRLpVGI1lQcMuDaFdhjO3jWoKx8D00M7D CEPcbrdRfhXoXsOzOAu/w7FSuYSUdylg/zv7g5nDzvzjeGPxdsJT8clA7AXdO61+yTGH BDH2ebtWUbSk5nEiqOYe7IzpGvlEiTO9GKCBGm5Wiaej2v/4Hh3ZY+cHWH16yJDGPhWx 8E0xSEvfOjMshioVTUdj+17JKBPH7Rn5BRvsivieXXtkyWKBSi0MtslmUxpwm6D+fM+O Yq0ZNQLKkCACvbFiOyIBqPop78L9F4h00SWnMu29DUdos6HEqkjE/ThuunmAA9rdO2oM ViQQ== 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:arc-authentication-results; bh=k62GKY5pBm3tvSP53hrSa5XnsqoKd6HCvHq5XcgGCpQ=; b=ZK2q3Vr+M1LCD6qwuP06Obprfg8FSI17VjrnNN8kIKktbwbwA5hfsk8L46pDKp86BY qxOrQ6kZ0vQO20Hf5pooI1FNrLup2ecmTLubI2n2wwUJdY1VFX+1LcrYrpSLnvGPIQPm R7MiGt1SdShE/eBf/hKWjfnVnRNKVedgvmzzG2DqoYqqOgHORYzVws8+8fiVU9rCF4f0 N1Mnglnzk16HMneKb9YLvME198k5HBYqphkH4/ItPT2G8D0DYUN4tpm2WDM9OD/yzbeT guuAJGozXwG6V0EAAz3V5T/8bn2r+oBKooJmEJ1XgfDnFhSzYCiBX9ZQair9f9K9Ky62 VVTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si2494850pfk.116.2018.04.12.04.13.37; Thu, 12 Apr 2018 04:13:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752959AbeDLLNh (ORCPT <rfc822;semen.protsenko@linaro.org> + 11 others); Thu, 12 Apr 2018 07:13:37 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59614 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbeDLLNg (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 12 Apr 2018 07:13:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AD05280D; Thu, 12 Apr 2018 04:13:36 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0C4653F24A; Thu, 12 Apr 2018 04:13:34 -0700 (PDT) From: Mark Rutland <mark.rutland@arm.com> To: stable@vger.kernel.org Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, ghackmann@google.com, shankerd@codeaurora.org Subject: [PATCH v4.9.y 33/42] arm64: KVM: Make PSCI_VERSION a fast path Date: Thu, 12 Apr 2018 12:11:29 +0100 Message-Id: <20180412111138.40990-34-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180412111138.40990-1-mark.rutland@arm.com> References: <20180412111138.40990-1-mark.rutland@arm.com> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
arm64 spectre patches
|
expand
|
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index cf6d962f9639..3eab6ac18d7d 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;