* [PATCH] KVM/PPC: emulate ehpriv
@ 2013-04-19 2:44 Tiejun Chen
2013-04-19 12:13 ` Alexander Graf
0 siblings, 1 reply; 3+ messages in thread
From: Tiejun Chen @ 2013-04-19 2:44 UTC (permalink / raw)
To: agraf; +Cc: kvm, kvm-ppc
We can provide this emulation to simplify more extension later.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
arch/powerpc/include/asm/disassemble.h | 4 ++++
arch/powerpc/kvm/e500_emulate.c | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/powerpc/include/asm/disassemble.h b/arch/powerpc/include/asm/disassemble.h
index 9b198d1..856f8de 100644
--- a/arch/powerpc/include/asm/disassemble.h
+++ b/arch/powerpc/include/asm/disassemble.h
@@ -77,4 +77,8 @@ static inline unsigned int get_d(u32 inst)
return inst & 0xffff;
}
+static inline unsigned int get_oc(u32 inst)
+{
+ return (inst >> 11) & 0x7fff;
+}
#endif /* __ASM_PPC_DISASSEMBLE_H__ */
diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
index e78f353..36492cf 100644
--- a/arch/powerpc/kvm/e500_emulate.c
+++ b/arch/powerpc/kvm/e500_emulate.c
@@ -26,6 +26,7 @@
#define XOP_TLBRE 946
#define XOP_TLBWE 978
#define XOP_TLBILX 18
+#define XOP_EHPRIV 270
#ifdef CONFIG_KVM_E500MC
static int dbell2prio(ulong param)
@@ -80,6 +81,18 @@ static int kvmppc_e500_emul_msgsnd(struct kvm_vcpu *vcpu, int rb)
return EMULATE_DONE;
}
+
+static int kvmppc_e500_emul_ehpriv(struct kvm_run *run, struct kvm_vcpu *vcpu,
+ unsigned int inst)
+{
+ int emulated = EMULATE_DONE;
+
+ switch (get_oc(inst)) {
+ default:
+ emulated = EMULATE_FAIL;
+ }
+ return emulated;
+}
#endif
int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
@@ -130,6 +143,10 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
emulated = kvmppc_e500_emul_tlbivax(vcpu, ea);
break;
+ case XOP_EHPRIV:
+ emulated = kvmppc_e500_emul_ehpriv(run, vcpu, inst);
+ break;
+
default:
emulated = EMULATE_FAIL;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM/PPC: emulate ehpriv
2013-04-19 2:44 [PATCH] KVM/PPC: emulate ehpriv Tiejun Chen
@ 2013-04-19 12:13 ` Alexander Graf
2013-04-19 15:29 ` Bhushan Bharat-R65777
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2013-04-19 12:13 UTC (permalink / raw)
To: Tiejun Chen; +Cc: kvm@vger.kernel.org mailing list, kvm-ppc, Bharat Bhushan
On 19.04.2013, at 04:44, Tiejun Chen wrote:
> We can provide this emulation to simplify more extension later.
Works for me, but this should really be part of a series that makes use of ehpriv.
Alex
>
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
> arch/powerpc/include/asm/disassemble.h | 4 ++++
> arch/powerpc/kvm/e500_emulate.c | 17 +++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/disassemble.h b/arch/powerpc/include/asm/disassemble.h
> index 9b198d1..856f8de 100644
> --- a/arch/powerpc/include/asm/disassemble.h
> +++ b/arch/powerpc/include/asm/disassemble.h
> @@ -77,4 +77,8 @@ static inline unsigned int get_d(u32 inst)
> return inst & 0xffff;
> }
>
> +static inline unsigned int get_oc(u32 inst)
> +{
> + return (inst >> 11) & 0x7fff;
> +}
> #endif /* __ASM_PPC_DISASSEMBLE_H__ */
> diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
> index e78f353..36492cf 100644
> --- a/arch/powerpc/kvm/e500_emulate.c
> +++ b/arch/powerpc/kvm/e500_emulate.c
> @@ -26,6 +26,7 @@
> #define XOP_TLBRE 946
> #define XOP_TLBWE 978
> #define XOP_TLBILX 18
> +#define XOP_EHPRIV 270
>
> #ifdef CONFIG_KVM_E500MC
> static int dbell2prio(ulong param)
> @@ -80,6 +81,18 @@ static int kvmppc_e500_emul_msgsnd(struct kvm_vcpu *vcpu, int rb)
>
> return EMULATE_DONE;
> }
> +
> +static int kvmppc_e500_emul_ehpriv(struct kvm_run *run, struct kvm_vcpu *vcpu,
> + unsigned int inst)
> +{
> + int emulated = EMULATE_DONE;
> +
> + switch (get_oc(inst)) {
> + default:
> + emulated = EMULATE_FAIL;
> + }
> + return emulated;
> +}
> #endif
>
> int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
> @@ -130,6 +143,10 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
> emulated = kvmppc_e500_emul_tlbivax(vcpu, ea);
> break;
>
> + case XOP_EHPRIV:
> + emulated = kvmppc_e500_emul_ehpriv(run, vcpu, inst);
> + break;
> +
> default:
> emulated = EMULATE_FAIL;
> }
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] KVM/PPC: emulate ehpriv
2013-04-19 12:13 ` Alexander Graf
@ 2013-04-19 15:29 ` Bhushan Bharat-R65777
0 siblings, 0 replies; 3+ messages in thread
From: Bhushan Bharat-R65777 @ 2013-04-19 15:29 UTC (permalink / raw)
To: Alexander Graf, Tiejun Chen
Cc: kvm@vger.kernel.org mailing list, kvm-ppc@vger.kernel.org
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Friday, April 19, 2013 5:44 PM
> To: Tiejun Chen
> Cc: kvm@vger.kernel.org mailing list; kvm-ppc@vger.kernel.org; Bhushan Bharat-
> R65777
> Subject: Re: [PATCH] KVM/PPC: emulate ehpriv
>
>
> On 19.04.2013, at 04:44, Tiejun Chen wrote:
>
> > We can provide this emulation to simplify more extension later.
>
> Works for me, but this should really be part of a series that makes use of
> ehpriv.
Alex, this already planned to be in my debug patches. I know you are busy and I am just waiting for other patches to be reviewed :)
-Bharat
>
>
> Alex
>
> >
> > Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> > ---
> > arch/powerpc/include/asm/disassemble.h | 4 ++++
> > arch/powerpc/kvm/e500_emulate.c | 17 +++++++++++++++++
> > 2 files changed, 21 insertions(+)
> >
> > diff --git a/arch/powerpc/include/asm/disassemble.h
> > b/arch/powerpc/include/asm/disassemble.h
> > index 9b198d1..856f8de 100644
> > --- a/arch/powerpc/include/asm/disassemble.h
> > +++ b/arch/powerpc/include/asm/disassemble.h
> > @@ -77,4 +77,8 @@ static inline unsigned int get_d(u32 inst)
> > return inst & 0xffff;
> > }
> >
> > +static inline unsigned int get_oc(u32 inst) {
> > + return (inst >> 11) & 0x7fff;
> > +}
> > #endif /* __ASM_PPC_DISASSEMBLE_H__ */ diff --git
> > a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
> > index e78f353..36492cf 100644
> > --- a/arch/powerpc/kvm/e500_emulate.c
> > +++ b/arch/powerpc/kvm/e500_emulate.c
> > @@ -26,6 +26,7 @@
> > #define XOP_TLBRE 946
> > #define XOP_TLBWE 978
> > #define XOP_TLBILX 18
> > +#define XOP_EHPRIV 270
> >
> > #ifdef CONFIG_KVM_E500MC
> > static int dbell2prio(ulong param)
> > @@ -80,6 +81,18 @@ static int kvmppc_e500_emul_msgsnd(struct kvm_vcpu
> > *vcpu, int rb)
> >
> > return EMULATE_DONE;
> > }
> > +
> > +static int kvmppc_e500_emul_ehpriv(struct kvm_run *run, struct kvm_vcpu
> *vcpu,
> > + unsigned int inst)
> > +{
> > + int emulated = EMULATE_DONE;
> > +
> > + switch (get_oc(inst)) {
> > + default:
> > + emulated = EMULATE_FAIL;
> > + }
> > + return emulated;
> > +}
> > #endif
> >
> > int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
> > @@ -130,6 +143,10 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct
> kvm_vcpu *vcpu,
> > emulated = kvmppc_e500_emul_tlbivax(vcpu, ea);
> > break;
> >
> > + case XOP_EHPRIV:
> > + emulated = kvmppc_e500_emul_ehpriv(run, vcpu, inst);
> > + break;
> > +
> > default:
> > emulated = EMULATE_FAIL;
> > }
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-19 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 2:44 [PATCH] KVM/PPC: emulate ehpriv Tiejun Chen
2013-04-19 12:13 ` Alexander Graf
2013-04-19 15:29 ` Bhushan Bharat-R65777
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox