From patchwork Wed May 1 16:49:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 2508181 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 702B2DF230 for ; Wed, 1 May 2013 16:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713Ab3EAQv1 (ORCPT ); Wed, 1 May 2013 12:51:27 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:56979 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751050Ab3EAQv0 (ORCPT ); Wed, 1 May 2013 12:51:26 -0400 Received: from e103592.cambridge.arm.com (e103592.cambridge.arm.com [10.1.209.159]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id r41GnUUP029372; Wed, 1 May 2013 17:49:30 +0100 From: Dave P Martin To: kvmarm@lists.cs.columbia.edu Cc: patches@linaro.org, Christoffer Dall , Marc Zyngier , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dave P Martin Subject: [PATCH] ARM: KVM: Don't handle PSCI calls via SMC Date: Wed, 1 May 2013 17:49:28 +0100 Message-Id: <1367426968-5577-1-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 1.7.9.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Currently, kvmtool unconditionally declares that HVC should be used to call PSCI, so the function numbers in the DT tell the guest nothing about the function ID namespace or calling convention for SMC. We already assume that the guest will examine and honour the DT, since there is no way it could possibly guess the KVM-specific PSCI function IDs otherwise. So let's not encourage guests to violate what's specified in the DT by using SMC to make the call. Signed-off-by: Dave P Martin Acked-by: Marc Zyngier --- arch/arm/kvm/arm.c | 3 --- arch/arm/kvm/psci.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 5a93698..32a3495 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -503,9 +503,6 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) { - if (kvm_psci_call(vcpu)) - return 1; - kvm_inject_undefined(vcpu); return 1; } diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index 7ee5bb7..86a693a 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c @@ -75,7 +75,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) * kvm_psci_call - handle PSCI call if r0 value is in range * @vcpu: Pointer to the VCPU struct * - * Handle PSCI calls from guests through traps from HVC or SMC instructions. + * Handle PSCI calls from guests through traps from HVC instructions. * The calling convention is similar to SMC calls to the secure world where * the function number is placed in r0 and this function returns true if the * function number specified in r0 is withing the PSCI range, and false