Message ID | 1519633227-29832-37-git-send-email-alex.shi@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3358509lja; Mon, 26 Feb 2018 00:25:54 -0800 (PST) X-Google-Smtp-Source: AH8x224MORAkvqvO50lLxyuRz8/EjWuBLnhyvds5cwM3mSUydXpcQr6/dSlYd25w9JHULd4cwZYM X-Received: by 10.99.116.25 with SMTP id p25mr7910810pgc.109.1519633554393; Mon, 26 Feb 2018 00:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519633554; cv=none; d=google.com; s=arc-20160816; b=Am+lAZ/IKmM2rXuOZd1L5LUPyS357hS0EsPn9Ggbwlew8oLv7VGG4EoYSxuELzOW/Q vsX5jzeg87b+NPQLVR5b/FMgV14C5602bVJmRljVna1cItcX8dUB/MlMGP1TSH3IHWBN fqhgZTQcH2QF96eFeSccIDyZhoAIUCKFmS6lSHC66IDIksVjt7RRUwJRp77uXqSEr0sq Yg48hKtH5csm1+jWOX8MHY1tpH0DfPHFSc1ryGtrz6WyQfP+jnbP6MoR/BBx1j2TAdyl BGS7Ba6uj8PUbx05TOWhdytct/UTzFpiGnJ4vfdHB4tILUjDSp93YBaymSm3Fy0hIWQU 0Qmg== 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:to:from:dkim-signature:arc-authentication-results; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=yrOSN8iHO1ojCEIbLiQwui3VYmzwDacdac3vN0Uk1tms73Du2GCxRQIIaSUvjHX3rL WnSs3pCbqzaWyACcCfAhJ5ZyiXXVgDRVuKl7VVnPdxqgLj8BH4NSJFv395bplS2hbe9d FPYN0w3vvN4M3BLH+bQaTyvo/7bOjtcxRxgw9fDjGdm/xG+iwAcpHcBfY4F552oh9LAP FNH3POKvcvgI6Z0HGsHSup24NsEKip+s1jXbcbw5fvBfi+FaTe2qZLuWB5f+Xt2HKc21 R0eaRhC4NVTEdkOf7ESz/RgTvddbRZULtJxwc5V5Ota2uq9H84uNANd/3veAsljWEkOg TDLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GMSh1cUz; 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 u62si5274966pgd.579.2018.02.26.00.25.54; Mon, 26 Feb 2018 00:25:54 -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=GMSh1cUz; 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 S1752057AbeBZIZv (ORCPT <rfc822; dan.rue@linaro.org> + 28 others); Mon, 26 Feb 2018 03:25:51 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46945 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102AbeBZIZo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Feb 2018 03:25:44 -0500 Received: by mail-pf0-f193.google.com with SMTP id z10so1883406pfh.13 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2018 00:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=GMSh1cUzLcfYYCAjsxCGkkHOlpOgzYDYRr0AeSZcqTDL7AidefGBvuSZCvhK7rVp8R 7INieTcJI8C6FRncoiPVFIRmwm05Dv79AbD0SNdNLvmqSUI5Ec0I4dq1lzD9/t9Wxr1Q rwz+LMTWWjfuIhgCB4P7HEeg/pbSH8bb0pNuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ccWpB6B5MEm475gq8sjuImnJLMpKY94QLsRYdXyhfpw=; b=qJNyK/1FDb/Mjj6FDvt8PgFz+FBm8hcAWNPTOx+ojEJA/Zvyd3IaF9FEx9R0kB3yVA FbUlP24enNy+yyQUA9FWX0F2zPHr3K8BfDYXdsdaue0oOkIsFQ9dFg5RWfDCkT6VQ1iY Gf8qpykp2HpJNLbJVcTF597s9XRm3WW9yGw/yJwf26mlfwWPv508i0zkB53B2ujMbeBL S/S5W3fSDkrz1w/zAXqKHoTdV8nrq+Yz5f0CCL9mj7lVCncn2aSEn0s3kdXwBlfNVG6z V6tr/ali8kpc8bnCykRmQiAN1hjBcHSWy3PHEk9TlRJ9a1VfvLQtddoz1ZVDagfc0D7w CKgg== X-Gm-Message-State: APf1xPCJnraWiMor/+z4ja0w9DAv4+vSGALSdDzp5dzVqlCG6AoqHMWo dC8u2pReQBKiI1xZkstOy1xa4Q== X-Received: by 10.99.167.66 with SMTP id w2mr642864pgo.357.1519633543999; Mon, 26 Feb 2018 00:25:43 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id o86sm1422706pfi.87.2018.02.26.00.25.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 00:25:43 -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, Paolo Bonzini <pbonzini@redhat.com>, =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= <rkrcmar@redhat.com>, Christoffer Dall <christoffer.dall@linaro.org>, kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)), linux-arm-kernel@lists.infradead.org (moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)), kvmarm@lists.cs.columbia.edu (open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 36/52] arm64: KVM: Make PSCI_VERSION a fast path Date: Mon, 26 Feb 2018 16:20:10 +0800 Message-Id: <1519633227-29832-37-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> References: <1519633227-29832-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 |
None
|
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;