linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: KVM: Don't handle PSCI calls via SMC
@ 2013-05-01 16:49 Dave P Martin
  2013-05-01 17:59 ` Christoffer Dall
  0 siblings, 1 reply; 3+ messages in thread
From: Dave P Martin @ 2013-05-01 16:49 UTC (permalink / raw)
  To: linux-arm-kernel

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 <Dave.Martin@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
---
 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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ARM: KVM: Don't handle PSCI calls via SMC
  2013-05-01 16:49 [PATCH] ARM: KVM: Don't handle PSCI calls via SMC Dave P Martin
@ 2013-05-01 17:59 ` Christoffer Dall
  2013-05-02 17:19   ` Dave Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Christoffer Dall @ 2013-05-01 17:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 1, 2013 at 9:49 AM, Dave P Martin <Dave.Martin@arm.com> wrote:
> 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 <Dave.Martin@arm.com>
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks, applied.

-Christoffer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ARM: KVM: Don't handle PSCI calls via SMC
  2013-05-01 17:59 ` Christoffer Dall
@ 2013-05-02 17:19   ` Dave Martin
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Martin @ 2013-05-02 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 01, 2013 at 10:59:13AM -0700, Christoffer Dall wrote:
> On Wed, May 1, 2013 at 9:49 AM, Dave P Martin <Dave.Martin@arm.com> wrote:
> > 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 <Dave.Martin@arm.com>
> > Acked-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> Thanks, applied.
> 
> -Christoffer

Thanks
---Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-02 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 16:49 [PATCH] ARM: KVM: Don't handle PSCI calls via SMC Dave P Martin
2013-05-01 17:59 ` Christoffer Dall
2013-05-02 17:19   ` Dave Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).