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: 16559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83FC823942 for ; Wed, 1 May 2013 16:49:58 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ha12sf3145526vcb.1 for ; Wed, 01 May 2013 09:49:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=6MV3lQKBmVHdrFY+htoCvIaE/T4OipU0oRUTP8ik7XM=; b=Hsv8tMTJJm3eddtVtP4jLqF4uxOPhMjur/RpSGmIokd04qs2zEOb2SjYrP3dcQKZup 19KE0gtjByq/kyN6NBtRQcUBFkpUjBn3tDpRSN42ql0PPxwNNHAuIOdnBGXMAKMsfQRp TaFPVZov4fB5dzfjRu+qfTG10E/JBxMTa6UHoRWHjEoEJvUzClhcIx7MNSIR/MvQZOPT XnCxiivdHiPpVPNdBn6ebBNsU13OXf+jtG+AOBiiKA/+xkB7V+g+1NYZw47IgWt1rpMp G0RimIIN4wr+O4t/vQalSXYQOy/+2xO+Sxra+7VrAZHt2ki8uq8/kqvEpZ02DyTLI0/K wlPQ== X-Received: by 10.236.91.206 with SMTP id h54mr2291897yhf.27.1367426992824; Wed, 01 May 2013 09:49:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.72 with SMTP id ks8ls832876qeb.92.gmail; Wed, 01 May 2013 09:49:52 -0700 (PDT) X-Received: by 10.52.31.36 with SMTP id x4mr934086vdh.44.1367426992398; Wed, 01 May 2013 09:49:52 -0700 (PDT) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [2607:f8b0:400c:c02::232]) by mx.google.com with ESMTPS id sc6si1477392vdc.112.2013.05.01.09.49.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 09:49:52 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::232; Received: by mail-vb0-f50.google.com with SMTP id w15so1380136vbb.9 for ; Wed, 01 May 2013 09:49:52 -0700 (PDT) X-Received: by 10.58.48.166 with SMTP id m6mr1015271ven.59.1367426992283; Wed, 01 May 2013 09:49:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp162781veb; Wed, 1 May 2013 09:49:51 -0700 (PDT) X-Received: by 10.194.178.162 with SMTP id cz2mr3648774wjc.27.1367426990950; Wed, 01 May 2013 09:49:50 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com. [217.140.96.21]) by mx.google.com with ESMTPS id m8si992690wib.116.2013.05.01.09.49.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 May 2013 09:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of Dave.Martin@arm.com designates 217.140.96.21 as permitted sender) client-ip=217.140.96.21; 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 X-Gm-Message-State: ALoCoQl0NB1XQ5cqWHWhz1QBMJr0B3mDoEBVKxg9Yhhrmi5MZN80k3RJ182mUOzI5T54IiDm+Zhl X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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