* [PATCH v12 1/8] PPC: epapr: create define for return code value of success
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 2/8] KVM: PPC: use definitions in epapr header for hcalls Stuart Yoder
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/include/asm/epapr_hcalls.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
index bf2c06c..c0c7adc 100644
--- a/arch/powerpc/include/asm/epapr_hcalls.h
+++ b/arch/powerpc/include/asm/epapr_hcalls.h
@@ -88,7 +88,8 @@
#define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
#define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)
-/* epapr error codes */
+/* epapr return codes */
+#define EV_SUCCESS 0
#define EV_EPERM 1 /* Operation not permitted */
#define EV_ENOENT 2 /* Entry Not Found */
#define EV_EIO 3 /* I/O error occured */
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 2/8] KVM: PPC: use definitions in epapr header for hcalls
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 1/8] PPC: epapr: create define for return code value of success Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 3/8] KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500 Stuart Yoder
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/include/asm/kvm_para.h | 21 +++++++++++----------
arch/powerpc/kernel/kvm.c | 2 +-
arch/powerpc/kvm/powerpc.c | 10 +++++-----
3 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h
index c18916b..a168ce3 100644
--- a/arch/powerpc/include/asm/kvm_para.h
+++ b/arch/powerpc/include/asm/kvm_para.h
@@ -75,9 +75,10 @@ struct kvm_vcpu_arch_shared {
};
#define KVM_SC_MAGIC_R0 0x4b564d21 /* "KVM!" */
-#define HC_VENDOR_KVM (42 << 16)
-#define HC_EV_SUCCESS 0
-#define HC_EV_UNIMPLEMENTED 12
+
+#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)
+
+#include <asm/epapr_hcalls.h>
#define KVM_FEATURE_MAGIC_PAGE 1
@@ -121,7 +122,7 @@ static unsigned long kvm_hypercall(unsigned long *in,
unsigned long *out,
unsigned long nr)
{
- return HC_EV_UNIMPLEMENTED;
+ return EV_UNIMPLEMENTED;
}
#endif
@@ -132,7 +133,7 @@ static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
unsigned long out[8];
unsigned long r;
- r = kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ r = kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
*r2 = out[0];
return r;
@@ -143,7 +144,7 @@ static inline long kvm_hypercall0(unsigned int nr)
unsigned long in[8];
unsigned long out[8];
- return kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
}
static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
@@ -152,7 +153,7 @@ static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
unsigned long out[8];
in[0] = p1;
- return kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
}
static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
@@ -163,7 +164,7 @@ static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
in[0] = p1;
in[1] = p2;
- return kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
}
static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
@@ -175,7 +176,7 @@ static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
in[0] = p1;
in[1] = p2;
in[2] = p3;
- return kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
}
static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
@@ -189,7 +190,7 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
in[1] = p2;
in[2] = p3;
in[3] = p4;
- return kvm_hypercall(in, out, nr | HC_VENDOR_KVM);
+ return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
}
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 1c13307..5fcc537 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -419,7 +419,7 @@ static void kvm_map_magic_page(void *data)
in[0] = KVM_MAGIC_PAGE;
in[1] = KVM_MAGIC_PAGE;
- kvm_hypercall(in, out, HC_VENDOR_KVM | KVM_HC_PPC_MAP_MAGIC_PAGE);
+ kvm_hypercall(in, out, KVM_HCALL_TOKEN(KVM_HC_PPC_MAP_MAGIC_PAGE));
*features = out[0];
}
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 87f4dc8..a98f7e0 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -67,18 +67,18 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
}
switch (nr) {
- case HC_VENDOR_KVM | KVM_HC_PPC_MAP_MAGIC_PAGE:
+ case KVM_HCALL_TOKEN(KVM_HC_PPC_MAP_MAGIC_PAGE):
{
vcpu->arch.magic_page_pa = param1;
vcpu->arch.magic_page_ea = param2;
r2 = KVM_MAGIC_FEAT_SR | KVM_MAGIC_FEAT_MAS0_TO_SPRG7;
- r = HC_EV_SUCCESS;
+ r = EV_SUCCESS;
break;
}
- case HC_VENDOR_KVM | KVM_HC_FEATURES:
- r = HC_EV_SUCCESS;
+ case KVM_HCALL_TOKEN(KVM_HC_FEATURES):
+ r = EV_SUCCESS;
#if defined(CONFIG_PPC_BOOK3S) || defined(CONFIG_KVM_E500V2)
/* XXX Missing magic page on 44x */
r2 |= (1 << KVM_FEATURE_MAGIC_PAGE);
@@ -87,7 +87,7 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
/* Second return value is in r4 */
break;
default:
- r = HC_EV_UNIMPLEMENTED;
+ r = EV_UNIMPLEMENTED;
break;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 3/8] KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 1/8] PPC: epapr: create define for return code value of success Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 2/8] KVM: PPC: use definitions in epapr header for hcalls Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel Stuart Yoder
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Liu Yu <yu.liu@freescale.com>
[stuart: factored this out from idle hcall support in host patch]
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/kvm/powerpc.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index a98f7e0..30cf01c 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -739,9 +739,16 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
{
+ u32 inst_nop = 0x60000000;
+#ifdef CONFIG_KVM_BOOKE_HV
+ u32 inst_sc1 = 0x44000022;
+ pvinfo->hcall[0] = inst_sc1;
+ pvinfo->hcall[1] = inst_nop;
+ pvinfo->hcall[2] = inst_nop;
+ pvinfo->hcall[3] = inst_nop;
+#else
u32 inst_lis = 0x3c000000;
u32 inst_ori = 0x60000000;
- u32 inst_nop = 0x60000000;
u32 inst_sc = 0x44000002;
u32 inst_imm_mask = 0xffff;
@@ -758,6 +765,7 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
pvinfo->hcall[1] = inst_ori | (KVM_SC_MAGIC_R0 & inst_imm_mask);
pvinfo->hcall[2] = inst_sc;
pvinfo->hcall[3] = inst_nop;
+#endif
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (2 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 3/8] KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500 Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 19:33 ` Alexander Graf
2012-07-03 15:48 ` [PATCH v12 5/8] KVM: PPC: ev_idle hcall support for e500 guests Stuart Yoder
` (4 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Liu Yu-B13201 <Yu.Liu@freescale.com>
And add a new flag definition in kvm_ppc_pvinfo to indicate
whether the host supports the EV_IDLE hcall.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
[stuart.yoder@freescale.com: cleanup,fixes for conditions allowing idle]
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: use EV_HCALL_TOKEN macro
Documentation/virtual/kvm/api.txt | 7 +++++--
arch/powerpc/include/asm/Kbuild | 1 +
arch/powerpc/kvm/powerpc.c | 10 ++++++++--
include/linux/kvm.h | 2 ++
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 310fe50..920c3c4 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -1190,12 +1190,15 @@ struct kvm_ppc_pvinfo {
This ioctl fetches PV specific information that need to be passed to the guest
using the device tree or other means from vm context.
-For now the only implemented piece of information distributed here is an array
-of 4 instructions that make up a hypercall.
+The hcall array defines 4 instructions that make up a hypercall.
If any additional field gets added to this structure later on, a bit for that
additional piece of information will be set in the flags bitmap.
+The flags bitmap is defined as:
+
+ /* the host supports the ePAPR idle hcall
+ #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
4.48 KVM_ASSIGN_PCI_DEVICE
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 7e313f1..13d6b7b 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -34,5 +34,6 @@ header-y += termios.h
header-y += types.h
header-y += ucontext.h
header-y += unistd.h
+header-y += epapr_hcalls.h
generic-y += rwsem.h
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 30cf01c..1a4db32 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -38,8 +38,7 @@
int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
{
- return !(v->arch.shared->msr & MSR_WE) ||
- !!(v->arch.pending_exceptions) ||
+ return !!(v->arch.pending_exceptions) ||
v->requests;
}
@@ -86,6 +85,11 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
/* Second return value is in r4 */
break;
+ case EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, EV_IDLE):
+ r = EV_SUCCESS;
+ kvm_vcpu_block(vcpu);
+ clear_bit(KVM_REQ_UNHALT, &vcpu->requests);
+ break;
default:
r = EV_UNIMPLEMENTED;
break;
@@ -767,6 +771,8 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
pvinfo->hcall[3] = inst_nop;
#endif
+ pvinfo->flags = KVM_PPC_PVINFO_FLAGS_EV_IDLE;
+
return 0;
}
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 2ce09aa..c03e59e 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -473,6 +473,8 @@ struct kvm_ppc_smmu_info {
struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
};
+#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
+
#define KVMIO 0xAE
/* machine type bits, to be used as argument to KVM_CREATE_VM */
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel
2012-07-03 15:48 ` [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel Stuart Yoder
@ 2012-07-03 19:33 ` Alexander Graf
2012-07-03 19:40 ` Yoder Stuart-B08248
0 siblings, 1 reply; 12+ messages in thread
From: Alexander Graf @ 2012-07-03 19:33 UTC (permalink / raw)
To: Stuart Yoder; +Cc: kvm-ppc, kvm
On 03.07.2012, at 17:48, Stuart Yoder wrote:
> From: Liu Yu-B13201 <Yu.Liu@freescale.com>
>
> And add a new flag definition in kvm_ppc_pvinfo to indicate
> whether the host supports the EV_IDLE hcall.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> [stuart.yoder@freescale.com: cleanup,fixes for conditions allowing idle]
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
> ---
> v12: use EV_HCALL_TOKEN macro
>
> Documentation/virtual/kvm/api.txt | 7 +++++--
> arch/powerpc/include/asm/Kbuild | 1 +
> arch/powerpc/kvm/powerpc.c | 10 ++++++++--
> include/linux/kvm.h | 2 ++
> 4 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index 310fe50..920c3c4 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -1190,12 +1190,15 @@ struct kvm_ppc_pvinfo {
> This ioctl fetches PV specific information that need to be passed to the guest
> using the device tree or other means from vm context.
>
> -For now the only implemented piece of information distributed here is an array
> -of 4 instructions that make up a hypercall.
> +The hcall array defines 4 instructions that make up a hypercall.
>
> If any additional field gets added to this structure later on, a bit for that
> additional piece of information will be set in the flags bitmap.
>
> +The flags bitmap is defined as:
> +
> + /* the host supports the ePAPR idle hcall
> + #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
>
> 4.48 KVM_ASSIGN_PCI_DEVICE
>
> diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
> index 7e313f1..13d6b7b 100644
> --- a/arch/powerpc/include/asm/Kbuild
> +++ b/arch/powerpc/include/asm/Kbuild
> @@ -34,5 +34,6 @@ header-y += termios.h
> header-y += types.h
> header-y += ucontext.h
> header-y += unistd.h
> +header-y += epapr_hcalls.h
>
> generic-y += rwsem.h
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index 30cf01c..1a4db32 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -38,8 +38,7 @@
>
> int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
> {
> - return !(v->arch.shared->msr & MSR_WE) ||
> - !!(v->arch.pending_exceptions) ||
> + return !!(v->arch.pending_exceptions) ||
> v->requests;
> }
>
> @@ -86,6 +85,11 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
>
> /* Second return value is in r4 */
> break;
> + case EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, EV_IDLE):
Did you try to compile this? :)
Will fix it up locally.
Alex
^ permalink raw reply [flat|nested] 12+ messages in thread* RE: [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel
2012-07-03 19:33 ` Alexander Graf
@ 2012-07-03 19:40 ` Yoder Stuart-B08248
0 siblings, 0 replies; 12+ messages in thread
From: Yoder Stuart-B08248 @ 2012-07-03 19:40 UTC (permalink / raw)
To: Alexander Graf; +Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Tuesday, July 03, 2012 2:34 PM
> To: Yoder Stuart-B08248
> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org
> Subject: Re: [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel
>
>
> On 03.07.2012, at 17:48, Stuart Yoder wrote:
>
> > From: Liu Yu-B13201 <Yu.Liu@freescale.com>
> >
> > And add a new flag definition in kvm_ppc_pvinfo to indicate
> > whether the host supports the EV_IDLE hcall.
> >
> > Signed-off-by: Liu Yu <yu.liu@freescale.com>
> > [stuart.yoder@freescale.com: cleanup,fixes for conditions allowing idle]
> > Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
> > ---
> > v12: use EV_HCALL_TOKEN macro
> >
> > Documentation/virtual/kvm/api.txt | 7 +++++--
> > arch/powerpc/include/asm/Kbuild | 1 +
> > arch/powerpc/kvm/powerpc.c | 10 ++++++++--
> > include/linux/kvm.h | 2 ++
> > 4 files changed, 16 insertions(+), 4 deletions(-)
> >
> > diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> > index 310fe50..920c3c4 100644
> > --- a/Documentation/virtual/kvm/api.txt
> > +++ b/Documentation/virtual/kvm/api.txt
> > @@ -1190,12 +1190,15 @@ struct kvm_ppc_pvinfo {
> > This ioctl fetches PV specific information that need to be passed to the guest
> > using the device tree or other means from vm context.
> >
> > -For now the only implemented piece of information distributed here is an array
> > -of 4 instructions that make up a hypercall.
> > +The hcall array defines 4 instructions that make up a hypercall.
> >
> > If any additional field gets added to this structure later on, a bit for that
> > additional piece of information will be set in the flags bitmap.
> >
> > +The flags bitmap is defined as:
> > +
> > + /* the host supports the ePAPR idle hcall
> > + #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
> >
> > 4.48 KVM_ASSIGN_PCI_DEVICE
> >
> > diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
> > index 7e313f1..13d6b7b 100644
> > --- a/arch/powerpc/include/asm/Kbuild
> > +++ b/arch/powerpc/include/asm/Kbuild
> > @@ -34,5 +34,6 @@ header-y += termios.h
> > header-y += types.h
> > header-y += ucontext.h
> > header-y += unistd.h
> > +header-y += epapr_hcalls.h
> >
> > generic-y += rwsem.h
> > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> > index 30cf01c..1a4db32 100644
> > --- a/arch/powerpc/kvm/powerpc.c
> > +++ b/arch/powerpc/kvm/powerpc.c
> > @@ -38,8 +38,7 @@
> >
> > int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
> > {
> > - return !(v->arch.shared->msr & MSR_WE) ||
> > - !!(v->arch.pending_exceptions) ||
> > + return !!(v->arch.pending_exceptions) ||
> > v->requests;
> > }
> >
> > @@ -86,6 +85,11 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
> >
> > /* Second return value is in r4 */
> > break;
> > + case EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, EV_IDLE):
>
> Did you try to compile this? :)
Hmm...could have swore I did. :(
> Will fix it up locally.
Thanks.
Stuart
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v12 5/8] KVM: PPC: ev_idle hcall support for e500 guests
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (3 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 4/8] KVM: PPC: Add support for ePAPR idle hcall in host kernel Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 6/8] PPC: select EPAPR_PARAVIRT for all users of epapr hcalls Stuart Yoder
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Liu Yu-B13201 <Yu.Liu@freescale.com>
Signed-off-by: Liu Yu <yu.liu@freescale.com>
[varun: 64-bit changes]
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: use new CURRENT_THREAD_INFO macro
arch/powerpc/include/asm/epapr_hcalls.h | 11 ++++++-----
arch/powerpc/kernel/epapr_hcalls.S | 28 ++++++++++++++++++++++++++++
arch/powerpc/kernel/epapr_paravirt.c | 11 ++++++++++-
3 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
index c0c7adc..833ce2c 100644
--- a/arch/powerpc/include/asm/epapr_hcalls.h
+++ b/arch/powerpc/include/asm/epapr_hcalls.h
@@ -50,10 +50,6 @@
#ifndef _EPAPR_HCALLS_H
#define _EPAPR_HCALLS_H
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <asm/byteorder.h>
-
#define EV_BYTE_CHANNEL_SEND 1
#define EV_BYTE_CHANNEL_RECEIVE 2
#define EV_BYTE_CHANNEL_POLL 3
@@ -109,6 +105,11 @@
#define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */
#define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */
+#ifndef __ASSEMBLY__
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <asm/byteorder.h>
+
/*
* Hypercall register clobber list
*
@@ -506,5 +507,5 @@ static inline unsigned int ev_idle(void)
return r3;
}
-
+#endif /* !__ASSEMBLY__ */
#endif
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 697b390..62c0dc2 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -8,13 +8,41 @@
*/
#include <linux/threads.h>
+#include <asm/epapr_hcalls.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/cputable.h>
#include <asm/thread_info.h>
#include <asm/ppc_asm.h>
+#include <asm/asm-compat.h>
#include <asm/asm-offsets.h>
+/* epapr_ev_idle() was derived from e500_idle() */
+_GLOBAL(epapr_ev_idle)
+ CURRENT_THREAD_INFO(r3, r1)
+ PPC_LL r4, TI_LOCAL_FLAGS(r3) /* set napping bit */
+ ori r4, r4,_TLF_NAPPING /* so when we take an exception */
+ PPC_STL r4, TI_LOCAL_FLAGS(r3) /* it will return to our caller */
+
+ wrteei 1
+
+idle_loop:
+ LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
+
+.global epapr_ev_idle_start
+epapr_ev_idle_start:
+ li r3, -1
+ nop
+ nop
+ nop
+
+ /*
+ * Guard against spurious wakeups from a hypervisor --
+ * only interrupt will cause us to return to LR due to
+ * _TLF_NAPPING.
+ */
+ b idle_loop
+
/* Hypercall entry point. Will be patched with device tree instructions. */
.global epapr_hypercall_start
epapr_hypercall_start:
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 028aeae..f3eab85 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -21,6 +21,10 @@
#include <asm/epapr_hcalls.h>
#include <asm/cacheflush.h>
#include <asm/code-patching.h>
+#include <asm/machdep.h>
+
+extern void epapr_ev_idle(void);
+extern u32 epapr_ev_idle_start[];
bool epapr_paravirt_enabled;
@@ -41,8 +45,13 @@ static int __init epapr_paravirt_init(void)
if (len % 4 || len > (4 * 4))
return -ENODEV;
- for (i = 0; i < (len / 4); i++)
+ for (i = 0; i < (len / 4); i++) {
patch_instruction(epapr_hypercall_start + i, insts[i]);
+ patch_instruction(epapr_ev_idle_start + i, insts[i]);
+ }
+
+ if (of_get_property(hyper_node, "has-idle", NULL))
+ ppc_md.power_save = epapr_ev_idle;
epapr_paravirt_enabled = true;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 6/8] PPC: select EPAPR_PARAVIRT for all users of epapr hcalls
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (4 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 5/8] KVM: PPC: ev_idle hcall support for e500 guests Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 7/8] powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls Stuart Yoder
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/platforms/Kconfig | 1 +
drivers/tty/Kconfig | 1 +
drivers/virt/Kconfig | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index e7a896a..48a920d 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -90,6 +90,7 @@ config MPIC
config PPC_EPAPR_HV_PIC
bool
default n
+ select EPAPR_PARAVIRT
config MPIC_WEIRD
bool
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 830cd62..aa99cd2 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -358,6 +358,7 @@ config TRACE_SINK
config PPC_EPAPR_HV_BYTECHAN
tristate "ePAPR hypervisor byte channel driver"
depends on PPC
+ select EPAPR_PARAVIRT
help
This driver creates /dev entries for each ePAPR hypervisor byte
channel, thereby allowing applications to communicate with byte
diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig
index 2dcdbc9..99ebdde 100644
--- a/drivers/virt/Kconfig
+++ b/drivers/virt/Kconfig
@@ -15,6 +15,7 @@ if VIRT_DRIVERS
config FSL_HV_MANAGER
tristate "Freescale hypervisor management driver"
depends on FSL_SOC
+ select EPAPR_PARAVIRT
help
The Freescale hypervisor management driver provides several services
to drivers and applications related to the Freescale hypervisor:
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 7/8] powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (5 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 6/8] PPC: select EPAPR_PARAVIRT for all users of epapr hcalls Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 15:48 ` [PATCH v12 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation Stuart Yoder
2012-07-03 19:41 ` [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Alexander Graf
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/sysdev/fsl_msi.c | 9 +++++++--
arch/powerpc/sysdev/fsl_soc.c | 2 ++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 6e097de..7e2b2f2 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -236,7 +236,6 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
u32 intr_index;
u32 have_shift = 0;
struct fsl_msi_cascade_data *cascade_data;
- unsigned int ret;
cascade_data = irq_get_handler_data(irq);
msi_data = cascade_data->msi_data;
@@ -268,7 +267,9 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
case FSL_PIC_IP_IPIC:
msir_value = fsl_msi_read(msi_data->msi_regs, msir_index * 0x4);
break;
- case FSL_PIC_IP_VMPIC:
+#ifdef CONFIG_EPAPR_PARAVIRT
+ case FSL_PIC_IP_VMPIC: {
+ unsigned int ret;
ret = fh_vmpic_get_msir(virq_to_hw(irq), &msir_value);
if (ret) {
pr_err("fsl-msi: fh_vmpic_get_msir() failed for "
@@ -277,6 +278,8 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
}
break;
}
+#endif
+ }
while (msir_value) {
intr_index = ffs(msir_value) - 1;
@@ -508,10 +511,12 @@ static const struct of_device_id fsl_of_msi_ids[] = {
.compatible = "fsl,ipic-msi",
.data = (void *)&ipic_msi_feature,
},
+#ifdef CONFIG_EPAPR_PARAVIRT
{
.compatible = "fsl,vmpic-msi",
.data = (void *)&vmpic_msi_feature,
},
+#endif
{}
};
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index c449dbd..97118dc 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -253,6 +253,7 @@ struct platform_diu_data_ops diu_ops;
EXPORT_SYMBOL(diu_ops);
#endif
+#ifdef CONFIG_EPAPR_PARAVIRT
/*
* Restart the current partition
*
@@ -278,3 +279,4 @@ void fsl_hv_halt(void)
pr_info("hv exit\n");
fh_partition_stop(-1);
}
+#endif
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v12 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (6 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 7/8] powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls Stuart Yoder
@ 2012-07-03 15:48 ` Stuart Yoder
2012-07-03 19:41 ` [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Alexander Graf
8 siblings, 0 replies; 12+ messages in thread
From: Stuart Yoder @ 2012-07-03 15:48 UTC (permalink / raw)
To: agraf, kvm-ppc, kvm
From: Liu Yu-B13201 <Yu.Liu@freescale.com>
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
v12: no changes
arch/powerpc/include/asm/epapr_hcalls.h | 22 +++++++++---------
arch/powerpc/include/asm/fsl_hcalls.h | 36 +++++++++++++++---------------
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
index 833ce2c..b8d9445 100644
--- a/arch/powerpc/include/asm/epapr_hcalls.h
+++ b/arch/powerpc/include/asm/epapr_hcalls.h
@@ -195,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt,
r5 = priority;
r6 = destination;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6)
: : EV_HCALL_CLOBBERS4
);
@@ -224,7 +224,7 @@ static inline unsigned int ev_int_get_config(unsigned int interrupt,
r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG);
r3 = interrupt;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6)
: : EV_HCALL_CLOBBERS4
);
@@ -254,7 +254,7 @@ static inline unsigned int ev_int_set_mask(unsigned int interrupt,
r3 = interrupt;
r4 = mask;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -279,7 +279,7 @@ static inline unsigned int ev_int_get_mask(unsigned int interrupt,
r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK);
r3 = interrupt;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -307,7 +307,7 @@ static inline unsigned int ev_int_eoi(unsigned int interrupt)
r11 = EV_HCALL_TOKEN(EV_INT_EOI);
r3 = interrupt;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -346,7 +346,7 @@ static inline unsigned int ev_byte_channel_send(unsigned int handle,
r7 = be32_to_cpu(p[2]);
r8 = be32_to_cpu(p[3]);
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3),
"+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8)
: : EV_HCALL_CLOBBERS6
@@ -385,7 +385,7 @@ static inline unsigned int ev_byte_channel_receive(unsigned int handle,
r3 = handle;
r4 = *count;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4),
"=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8)
: : EV_HCALL_CLOBBERS6
@@ -423,7 +423,7 @@ static inline unsigned int ev_byte_channel_poll(unsigned int handle,
r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL);
r3 = handle;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5)
: : EV_HCALL_CLOBBERS3
);
@@ -456,7 +456,7 @@ static inline unsigned int ev_int_iack(unsigned int handle,
r11 = EV_HCALL_TOKEN(EV_INT_IACK);
r3 = handle;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -480,7 +480,7 @@ static inline unsigned int ev_doorbell_send(unsigned int handle)
r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND);
r3 = handle;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -500,7 +500,7 @@ static inline unsigned int ev_idle(void)
r11 = EV_HCALL_TOKEN(EV_IDLE);
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "=r" (r3)
: : EV_HCALL_CLOBBERS1
);
diff --git a/arch/powerpc/include/asm/fsl_hcalls.h b/arch/powerpc/include/asm/fsl_hcalls.h
index 922d9b5..3abb583 100644
--- a/arch/powerpc/include/asm/fsl_hcalls.h
+++ b/arch/powerpc/include/asm/fsl_hcalls.h
@@ -96,7 +96,7 @@ static inline unsigned int fh_send_nmi(unsigned int vcpu_mask)
r11 = FH_HCALL_TOKEN(FH_SEND_NMI);
r3 = vcpu_mask;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -151,7 +151,7 @@ static inline unsigned int fh_partition_get_dtprop(int handle,
r9 = (uint32_t)propvalue_addr;
r10 = *propvalue_len;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
"+r" (r8), "+r" (r9), "+r" (r10)
@@ -205,7 +205,7 @@ static inline unsigned int fh_partition_set_dtprop(int handle,
r9 = (uint32_t)propvalue_addr;
r10 = propvalue_len;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
"+r" (r8), "+r" (r9), "+r" (r10)
@@ -229,7 +229,7 @@ static inline unsigned int fh_partition_restart(unsigned int partition)
r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART);
r3 = partition;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -262,7 +262,7 @@ static inline unsigned int fh_partition_get_status(unsigned int partition,
r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS);
r3 = partition;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -295,7 +295,7 @@ static inline unsigned int fh_partition_start(unsigned int partition,
r4 = entry_point;
r5 = load;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5)
: : EV_HCALL_CLOBBERS3
);
@@ -317,7 +317,7 @@ static inline unsigned int fh_partition_stop(unsigned int partition)
r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP);
r3 = partition;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -376,7 +376,7 @@ static inline unsigned int fh_partition_memcpy(unsigned int source,
#endif
r7 = count;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7)
: : EV_HCALL_CLOBBERS5
@@ -399,7 +399,7 @@ static inline unsigned int fh_dma_enable(unsigned int liodn)
r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
r3 = liodn;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -421,7 +421,7 @@ static inline unsigned int fh_dma_disable(unsigned int liodn)
r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
r3 = liodn;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -447,7 +447,7 @@ static inline unsigned int fh_vmpic_get_msir(unsigned int interrupt,
r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR);
r3 = interrupt;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -469,7 +469,7 @@ static inline unsigned int fh_system_reset(void)
r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET);
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "=r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -506,7 +506,7 @@ static inline unsigned int fh_err_get_info(int queue, uint32_t *bufsize,
r6 = addr_lo;
r7 = peek;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6),
"+r" (r7)
: : EV_HCALL_CLOBBERS5
@@ -542,7 +542,7 @@ static inline unsigned int fh_get_core_state(unsigned int handle,
r3 = handle;
r4 = vcpu;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -572,7 +572,7 @@ static inline unsigned int fh_enter_nap(unsigned int handle, unsigned int vcpu)
r3 = handle;
r4 = vcpu;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -597,7 +597,7 @@ static inline unsigned int fh_exit_nap(unsigned int handle, unsigned int vcpu)
r3 = handle;
r4 = vcpu;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2
);
@@ -618,7 +618,7 @@ static inline unsigned int fh_claim_device(unsigned int handle)
r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE);
r3 = handle;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
@@ -645,7 +645,7 @@ static inline unsigned int fh_partition_stop_dma(unsigned int handle)
r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA);
r3 = handle;
- __asm__ __volatile__ ("sc 1"
+ asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1
);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support
2012-07-03 15:48 [PATCH v12 0/8] KVM: PPC: Add ePAPR idle hcall support Stuart Yoder
` (7 preceding siblings ...)
2012-07-03 15:48 ` [PATCH v12 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation Stuart Yoder
@ 2012-07-03 19:41 ` Alexander Graf
8 siblings, 0 replies; 12+ messages in thread
From: Alexander Graf @ 2012-07-03 19:41 UTC (permalink / raw)
To: Stuart Yoder; +Cc: kvm-ppc, kvm
On 03.07.2012, at 17:48, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>
> v12 has a couple of updates to address feedback
> -use new CURRENT_THREAD_INFO macro in epapr_hcalls.S
> -use EV_HCALL_TOKEN to create epapr hcall token
>
> A prerequisite to applying this patch is the patch:
> PPC: use CURRENT_THREAD_INFO instead of open coded assembly
>
> Liu Yu-B13201 (3):
> KVM: PPC: Add support for ePAPR idle hcall in host kernel
> KVM: PPC: ev_idle hcall support for e500 guests
> PPC: Don't use hardcoded opcode for ePAPR hcall invocation
>
> Scott Wood (1):
> powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls
>
> Stuart Yoder (4):
> PPC: epapr: create define for return code value of success
> KVM: PPC: use definitions in epapr header for hcalls
> KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500
> PPC: select EPAPR_PARAVIRT for all users of epapr hcalls
Thanks, applied all (with the small fix to 4/8) to kvm-ppc-next.
Alex
^ permalink raw reply [flat|nested] 12+ messages in thread