* [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
@ 2017-03-17 8:31 ` Alexey Kardashevskiy
0 siblings, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-17 8:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Alexey Kardashevskiy, Paul Mackerras, kvm-ppc
This adds missing stdx emulation which allow Mellanox driver from
recent kernels work when MMIO emulation is enforced in the userspace.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
arch/powerpc/include/asm/ppc-opcode.h | 1 +
arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index e7d6d86563ee..ca1bbe49590b 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -92,6 +92,7 @@
#define OP_31_XOP_TRAP_64 68
#define OP_31_XOP_DCBF 86
#define OP_31_XOP_LBZX 87
+#define OP_31_XOP_STDX 149
#define OP_31_XOP_STWX 151
#define OP_31_XOP_STBX 215
#define OP_31_XOP_LBZUX 119
diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch/powerpc/kvm/emulate_loadstore.c
index 6d3c0ee1d744..9fdbeb8ea86c 100644
--- a/arch/powerpc/kvm/emulate_loadstore.c
+++ b/arch/powerpc/kvm/emulate_loadstore.c
@@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
break;
+ case OP_31_XOP_STDX:
+ emulated = kvmppc_handle_store(run, vcpu,
+ kvmppc_get_gpr(vcpu, rs),
+ 8, 1);
+ break;
+
case OP_31_XOP_STWX:
emulated = kvmppc_handle_store(run, vcpu,
kvmppc_get_gpr(vcpu, rs),
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
@ 2017-03-17 8:31 ` Alexey Kardashevskiy
0 siblings, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-17 8:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Alexey Kardashevskiy, Paul Mackerras, kvm-ppc
This adds missing stdx emulation which allow Mellanox driver from
recent kernels work when MMIO emulation is enforced in the userspace.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
arch/powerpc/include/asm/ppc-opcode.h | 1 +
arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index e7d6d86563ee..ca1bbe49590b 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -92,6 +92,7 @@
#define OP_31_XOP_TRAP_64 68
#define OP_31_XOP_DCBF 86
#define OP_31_XOP_LBZX 87
+#define OP_31_XOP_STDX 149
#define OP_31_XOP_STWX 151
#define OP_31_XOP_STBX 215
#define OP_31_XOP_LBZUX 119
diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch/powerpc/kvm/emulate_loadstore.c
index 6d3c0ee1d744..9fdbeb8ea86c 100644
--- a/arch/powerpc/kvm/emulate_loadstore.c
+++ b/arch/powerpc/kvm/emulate_loadstore.c
@@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
break;
+ case OP_31_XOP_STDX:
+ emulated = kvmppc_handle_store(run, vcpu,
+ kvmppc_get_gpr(vcpu, rs),
+ 8, 1);
+ break;
+
case OP_31_XOP_STWX:
emulated = kvmppc_handle_store(run, vcpu,
kvmppc_get_gpr(vcpu, rs),
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
2017-03-17 8:31 ` Alexey Kardashevskiy
@ 2017-03-17 12:11 ` Alexey Kardashevskiy
-1 siblings, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-17 12:11 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, kvm-ppc
On 17/03/17 19:31, Alexey Kardashevskiy wrote:
> This adds missing stdx emulation which allow Mellanox driver from
> recent kernels work when MMIO emulation is enforced in the userspace.
btw what would its load counterpart? Load Doubleword Indexed - ldx RT,RA,RB?
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> arch/powerpc/include/asm/ppc-opcode.h | 1 +
> arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
> index e7d6d86563ee..ca1bbe49590b 100644
> --- a/arch/powerpc/include/asm/ppc-opcode.h
> +++ b/arch/powerpc/include/asm/ppc-opcode.h
> @@ -92,6 +92,7 @@
> #define OP_31_XOP_TRAP_64 68
> #define OP_31_XOP_DCBF 86
> #define OP_31_XOP_LBZX 87
> +#define OP_31_XOP_STDX 149
> #define OP_31_XOP_STWX 151
> #define OP_31_XOP_STBX 215
> #define OP_31_XOP_LBZUX 119
> diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch/powerpc/kvm/emulate_loadstore.c
> index 6d3c0ee1d744..9fdbeb8ea86c 100644
> --- a/arch/powerpc/kvm/emulate_loadstore.c
> +++ b/arch/powerpc/kvm/emulate_loadstore.c
> @@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
> kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
> break;
>
> + case OP_31_XOP_STDX:
> + emulated = kvmppc_handle_store(run, vcpu,
> + kvmppc_get_gpr(vcpu, rs),
> + 8, 1);
> + break;
> +
> case OP_31_XOP_STWX:
> emulated = kvmppc_handle_store(run, vcpu,
> kvmppc_get_gpr(vcpu, rs),
>
--
Alexey
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
@ 2017-03-17 12:11 ` Alexey Kardashevskiy
0 siblings, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-17 12:11 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, kvm-ppc
On 17/03/17 19:31, Alexey Kardashevskiy wrote:
> This adds missing stdx emulation which allow Mellanox driver from
> recent kernels work when MMIO emulation is enforced in the userspace.
btw what would its load counterpart? Load Doubleword Indexed - ldx RT,RA,RB?
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> arch/powerpc/include/asm/ppc-opcode.h | 1 +
> arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
> index e7d6d86563ee..ca1bbe49590b 100644
> --- a/arch/powerpc/include/asm/ppc-opcode.h
> +++ b/arch/powerpc/include/asm/ppc-opcode.h
> @@ -92,6 +92,7 @@
> #define OP_31_XOP_TRAP_64 68
> #define OP_31_XOP_DCBF 86
> #define OP_31_XOP_LBZX 87
> +#define OP_31_XOP_STDX 149
> #define OP_31_XOP_STWX 151
> #define OP_31_XOP_STBX 215
> #define OP_31_XOP_LBZUX 119
> diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch/powerpc/kvm/emulate_loadstore.c
> index 6d3c0ee1d744..9fdbeb8ea86c 100644
> --- a/arch/powerpc/kvm/emulate_loadstore.c
> +++ b/arch/powerpc/kvm/emulate_loadstore.c
> @@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
> kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
> break;
>
> + case OP_31_XOP_STDX:
> + emulated = kvmppc_handle_store(run, vcpu,
> + kvmppc_get_gpr(vcpu, rs),
> + 8, 1);
> + break;
> +
> case OP_31_XOP_STWX:
> emulated = kvmppc_handle_store(run, vcpu,
> kvmppc_get_gpr(vcpu, rs),
>
--
Alexey
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
2017-03-17 12:11 ` Alexey Kardashevskiy
@ 2017-03-19 5:40 ` Benjamin Herrenschmidt
-1 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2017-03-19 5:40 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Paul Mackerras, kvm-ppc
On Fri, 2017-03-17 at 23:11 +1100, Alexey Kardashevskiy wrote:
> On 17/03/17 19:31, Alexey Kardashevskiy wrote:
> > This adds missing stdx emulation which allow Mellanox driver from
> > recent kernels work when MMIO emulation is enforced in the
> > userspace.
>
>
> btw what would its load counterpart? Load Doubleword Indexed - ldx
> RT,RA,RB?
Yes.
Do we also do the more "classic" ld/std ?
Cheers,
Ben.
>
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> > arch/powerpc/include/asm/ppc-opcode.h | 1 +
> > arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/arch/powerpc/include/asm/ppc-opcode.h
> > b/arch/powerpc/include/asm/ppc-opcode.h
> > index e7d6d86563ee..ca1bbe49590b 100644
> > --- a/arch/powerpc/include/asm/ppc-opcode.h
> > +++ b/arch/powerpc/include/asm/ppc-opcode.h
> > @@ -92,6 +92,7 @@
> > #define OP_31_XOP_TRAP_64 68
> > #define OP_31_XOP_DCBF 86
> > #define OP_31_XOP_LBZX 87
> > +#define OP_31_XOP_STDX 149
> > #define OP_31_XOP_STWX 151
> > #define OP_31_XOP_STBX 215
> > #define OP_31_XOP_LBZUX 119
> > diff --git a/arch/powerpc/kvm/emulate_loadstore.c
> > b/arch/powerpc/kvm/emulate_loadstore.c
> > index 6d3c0ee1d744..9fdbeb8ea86c 100644
> > --- a/arch/powerpc/kvm/emulate_loadstore.c
> > +++ b/arch/powerpc/kvm/emulate_loadstore.c
> > @@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu
> > *vcpu)
> > kvmppc_set_gpr(vcpu, ra, vcpu-
> > >arch.vaddr_accessed);
> > break;
> >
> > + case OP_31_XOP_STDX:
> > + emulated = kvmppc_handle_store(run, vcpu,
> > + kvmppc_get_
> > gpr(vcpu, rs),
> > + 8, 1);
> > + break;
> > +
> > case OP_31_XOP_STWX:
> > emulated = kvmppc_handle_store(run, vcpu,
> > kvmppc_get_
> > gpr(vcpu, rs),
> >
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed)
@ 2017-03-19 5:40 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2017-03-19 5:40 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Paul Mackerras, kvm-ppc
On Fri, 2017-03-17 at 23:11 +1100, Alexey Kardashevskiy wrote:
> On 17/03/17 19:31, Alexey Kardashevskiy wrote:
> > This adds missing stdx emulation which allow Mellanox driver from
> > recent kernels work when MMIO emulation is enforced in the
> > userspace.
>
>
> btw what would its load counterpart? Load Doubleword Indexed - ldx
> RT,RA,RB?
Yes.
Do we also do the more "classic" ld/std ?
Cheers,
Ben.
>
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> > arch/powerpc/include/asm/ppc-opcode.h | 1 +
> > arch/powerpc/kvm/emulate_loadstore.c | 6 ++++++
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/arch/powerpc/include/asm/ppc-opcode.h
> > b/arch/powerpc/include/asm/ppc-opcode.h
> > index e7d6d86563ee..ca1bbe49590b 100644
> > --- a/arch/powerpc/include/asm/ppc-opcode.h
> > +++ b/arch/powerpc/include/asm/ppc-opcode.h
> > @@ -92,6 +92,7 @@
> > #define OP_31_XOP_TRAP_64 68
> > #define OP_31_XOP_DCBF 86
> > #define OP_31_XOP_LBZX 87
> > +#define OP_31_XOP_STDX 149
> > #define OP_31_XOP_STWX 151
> > #define OP_31_XOP_STBX 215
> > #define OP_31_XOP_LBZUX 119
> > diff --git a/arch/powerpc/kvm/emulate_loadstore.c
> > b/arch/powerpc/kvm/emulate_loadstore.c
> > index 6d3c0ee1d744..9fdbeb8ea86c 100644
> > --- a/arch/powerpc/kvm/emulate_loadstore.c
> > +++ b/arch/powerpc/kvm/emulate_loadstore.c
> > @@ -82,6 +82,12 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu
> > *vcpu)
> > kvmppc_set_gpr(vcpu, ra, vcpu-
> > >arch.vaddr_accessed);
> > break;
> >
> > + case OP_31_XOP_STDX:
> > + emulated = kvmppc_handle_store(run, vcpu,
> > + kvmppc_get_
> > gpr(vcpu, rs),
> > + 8, 1);
> > + break;
> > +
> > case OP_31_XOP_STWX:
> > emulated = kvmppc_handle_store(run, vcpu,
> > kvmppc_get_
> > gpr(vcpu, rs),
> >
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-19 5:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 8:31 [PATCH kernel] KVM: PPC: Add MMIO emulation for stdx (store doubleword indexed) Alexey Kardashevskiy
2017-03-17 8:31 ` Alexey Kardashevskiy
2017-03-17 12:11 ` Alexey Kardashevskiy
2017-03-17 12:11 ` Alexey Kardashevskiy
2017-03-19 5:40 ` Benjamin Herrenschmidt
2017-03-19 5:40 ` Benjamin Herrenschmidt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.