Re: [GIT PULL 0/8] perf/urgent fixes

2012-12-01 Thread Ingo Molnar

* Arnaldo Carvalho de Melo a...@infradead.org wrote:

 Hi Ingo,
 
   Tested using a cross-compiler and directly on a Raspberry pi (ARM) with
 raspbian.
 
   Please consider pulling.
 
 - Arnaldo
 
 The following changes since commit 18423d3562f396206e0928a71177eeb2edfed077:
 
   Merge tag 'perf-urgent-for-mingo' of 
 git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent 
 (2012-11-13 18:51:51 +0100)
 
 are available in the git repository at:
 
 
   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux 
 tags/perf-urgent-for-mingo
 
 for you to fetch changes up to 7321090f6751c9987c26a8c81c63680d16a614d7:
 
   perf kvm: Fix building perf kvm on non x86 arches (2012-11-23 20:40:17 
 -0300)
 
 
 perf/urgent fixes
 
 . Don't build 'perf kvm stat on non-x86 arches, fix from Xiao Guangrong.
 
 . UAPI fixes to get perf building again in non-x86 arches, from David Howells.
 
 Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com
 
 
 Arnaldo Carvalho de Melo (1):
   Merge tag 'perf-uapi-20121119' of 
 git://git.infradead.org/users/dhowells/linux-headers into perf/urgent
 
 David Howells (6):
   x86: Export asm/{svm.h,vmx.h,perf_regs.h}
   Merge branch 'x86-pre-uapi' into perf-uapi
   tools: Define a Makefile function to do subdir processing
   tools: Honour the O= flag when tool build called from a higher Makefile
   tools: Pass the target in descend
   perf: Make perf build for x86 with UAPI disintegration applied
 
 Sukadev Bhattiprolu (1):
   perf powerpc: Use uapi/unistd.h to fix build error
 
 Xiao Guangrong (2):
   perf kvm: Rename perf_kvm to perf_kvm_stat
   perf kvm: Fix building perf kvm on non x86 arches
 
  Makefile|6 +-
  arch/x86/include/asm/Kbuild |3 +
  include/linux/hw_breakpoint.h   |   31 +---
  include/uapi/linux/Kbuild   |1 +
  include/uapi/linux/hw_breakpoint.h  |   30 
  tools/Makefile  |   24 +++---
  tools/perf/Makefile |   29 +++-
  tools/perf/arch/x86/include/perf_regs.h |2 +-
  tools/perf/builtin-kvm.c|  121 
 +--
  tools/perf/builtin-test.c   |2 +-
  tools/perf/perf.h   |   16 +---
  tools/perf/util/evsel.c |4 +-
  tools/perf/util/evsel.h |3 +-
  tools/perf/util/header.h|2 +-
  tools/perf/util/parse-events-test.c |2 +-
  tools/perf/util/parse-events.c  |2 +-
  tools/perf/util/parse-events.h  |2 +-
  tools/perf/util/pmu.h   |2 +-
  tools/perf/util/session.h   |2 +-
  tools/scripts/Makefile.include  |   23 +-
  20 files changed, 181 insertions(+), 126 deletions(-)
  create mode 100644 include/uapi/linux/hw_breakpoint.h

Pulled, thanks a lot Arnaldo!

I'll get this to Linus ASAP.

Note: got a conflict with perf/core in tools/perf/Makefile, when 
merging in tip:master. It appeared to me that perf/core already 
included all the changes to BASIC_CFLAGS that perf/urgent 
updated, so I picked the perf/core version.

The merged result seems to work fine but please double check it 
nevertheless.

Thanks,

Ingo
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 05/12] KVM: PPC: e500: Add emulation helper for getting instruction ea

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 Add emulation helper for getting instruction ea and refactor tlb instruction
 emulation to use it.
 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 v1: use _t_ype instead of _t_arget _r_egister in tlbilx emulation.
 
 arch/powerpc/include/asm/kvm_ppc.h |   11 +++
 arch/powerpc/kvm/e500.h|6 +++---
 arch/powerpc/kvm/e500_emulate.c|   15 ++-
 arch/powerpc/kvm/e500_tlb.c|   33 +++--
 4 files changed, 35 insertions(+), 30 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/kvm_ppc.h 
 b/arch/powerpc/include/asm/kvm_ppc.h
 index 609cca3..a08e756 100644
 --- a/arch/powerpc/include/asm/kvm_ppc.h
 +++ b/arch/powerpc/include/asm/kvm_ppc.h
 @@ -293,4 +293,15 @@ static inline void kvmppc_lazy_ee_enable(void)
 #endif
 }
 
 +static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int 
 rb)
 +{
 + ulong ea;
 +
 + ea = kvmppc_get_gpr(vcpu, rb);
 + if (ra)
 + ea += kvmppc_get_gpr(vcpu, ra);
 +
 + return ea;
 +}
 +
 #endif /* __POWERPC_KVM_PPC_H__ */
 diff --git a/arch/powerpc/kvm/e500.h b/arch/powerpc/kvm/e500.h
 index d162286..32e98a7 100644
 --- a/arch/powerpc/kvm/e500.h
 +++ b/arch/powerpc/kvm/e500.h
 @@ -129,9 +129,9 @@ int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 
 *vcpu_e500,
   ulong value);
 int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu);
 int kvmppc_e500_emul_tlbre(struct kvm_vcpu *vcpu);
 -int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, int ra, int rb);
 -int kvmppc_e500_emul_tlbilx(struct kvm_vcpu *vcpu, int rt, int ra, int rb);
 -int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb);
 +int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, gva_t ea);
 +int kvmppc_e500_emul_tlbilx(struct kvm_vcpu *vcpu, int type, gva_t ea);
 +int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, gva_t ea);
 int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500);
 void kvmppc_e500_tlb_uninit(struct kvmppc_vcpu_e500 *vcpu_e500);
 
 diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
 index e04b0ef..3bf2486 100644
 --- a/arch/powerpc/kvm/e500_emulate.c
 +++ b/arch/powerpc/kvm/e500_emulate.c
 @@ -88,7 +88,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct 
 kvm_vcpu *vcpu,
   int emulated = EMULATE_DONE;
   int ra = get_ra(inst);
   int rb = get_rb(inst);
 - int rt = get_rt(inst);

The function scope rt variable shouldn't hurt, as the compiler will be smart 
enough to only calculate it when it's actually used.

 + gva_t ea;
 
   switch (get_op(inst)) {
   case 31:
 @@ -113,15 +113,20 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct 
 kvm_vcpu *vcpu,
   break;
 
   case XOP_TLBSX:
 - emulated = kvmppc_e500_emul_tlbsx(vcpu,rb);
 + ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
 + emulated = kvmppc_e500_emul_tlbsx(vcpu, ea);
   break;
 
 - case XOP_TLBILX:
 - emulated = kvmppc_e500_emul_tlbilx(vcpu, rt, ra, rb);
 + case XOP_TLBILX: {
 + int t = (inst  21)  0x3;

so we can remove this

 + ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
 + emulated = kvmppc_e500_emul_tlbilx(vcpu, t, ea);

and instead here pass rt  3.

The rest of the patch looks fine, so I'll do the change while applying it.


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 05/12] KVM: PPC: e500: Add emulation helper for getting instruction ea

2012-12-01 Thread Alexander Graf

On 01.12.2012, at 14:28, Alexander Graf wrote:

 
 On 11.10.2012, at 18:13, Mihai Caraman wrote:
 
 Add emulation helper for getting instruction ea and refactor tlb instruction
 emulation to use it.
 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 v1: use _t_ype instead of _t_arget _r_egister in tlbilx emulation.
 
 arch/powerpc/include/asm/kvm_ppc.h |   11 +++
 arch/powerpc/kvm/e500.h|6 +++---
 arch/powerpc/kvm/e500_emulate.c|   15 ++-
 arch/powerpc/kvm/e500_tlb.c|   33 +++--
 4 files changed, 35 insertions(+), 30 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/kvm_ppc.h 
 b/arch/powerpc/include/asm/kvm_ppc.h
 index 609cca3..a08e756 100644
 --- a/arch/powerpc/include/asm/kvm_ppc.h
 +++ b/arch/powerpc/include/asm/kvm_ppc.h
 @@ -293,4 +293,15 @@ static inline void kvmppc_lazy_ee_enable(void)
 #endif
 }
 
 +static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, 
 int rb)
 +{
 +ulong ea;
 +
 +ea = kvmppc_get_gpr(vcpu, rb);
 +if (ra)
 +ea += kvmppc_get_gpr(vcpu, ra);
 +
 +return ea;
 +}
 +
 #endif /* __POWERPC_KVM_PPC_H__ */
 diff --git a/arch/powerpc/kvm/e500.h b/arch/powerpc/kvm/e500.h
 index d162286..32e98a7 100644
 --- a/arch/powerpc/kvm/e500.h
 +++ b/arch/powerpc/kvm/e500.h
 @@ -129,9 +129,9 @@ int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 
 *vcpu_e500,
  ulong value);
 int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu);
 int kvmppc_e500_emul_tlbre(struct kvm_vcpu *vcpu);
 -int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, int ra, int rb);
 -int kvmppc_e500_emul_tlbilx(struct kvm_vcpu *vcpu, int rt, int ra, int rb);
 -int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb);
 +int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, gva_t ea);
 +int kvmppc_e500_emul_tlbilx(struct kvm_vcpu *vcpu, int type, gva_t ea);
 +int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, gva_t ea);
 int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500);
 void kvmppc_e500_tlb_uninit(struct kvmppc_vcpu_e500 *vcpu_e500);
 
 diff --git a/arch/powerpc/kvm/e500_emulate.c 
 b/arch/powerpc/kvm/e500_emulate.c
 index e04b0ef..3bf2486 100644
 --- a/arch/powerpc/kvm/e500_emulate.c
 +++ b/arch/powerpc/kvm/e500_emulate.c
 @@ -88,7 +88,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct 
 kvm_vcpu *vcpu,
  int emulated = EMULATE_DONE;
  int ra = get_ra(inst);
  int rb = get_rb(inst);
 -int rt = get_rt(inst);
 
 The function scope rt variable shouldn't hurt, as the compiler will be smart 
 enough to only calculate it when it's actually used.
 
 +gva_t ea;
 
  switch (get_op(inst)) {
  case 31:
 @@ -113,15 +113,20 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct 
 kvm_vcpu *vcpu,
  break;
 
  case XOP_TLBSX:
 -emulated = kvmppc_e500_emul_tlbsx(vcpu,rb);
 +ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
 +emulated = kvmppc_e500_emul_tlbsx(vcpu, ea);
  break;
 
 -case XOP_TLBILX:
 -emulated = kvmppc_e500_emul_tlbilx(vcpu, rt, ra, rb);
 +case XOP_TLBILX: {
 +int t = (inst  21)  0x3;
 
 so we can remove this
 
 +ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
 +emulated = kvmppc_e500_emul_tlbilx(vcpu, t, ea);
 
 and instead here pass rt  3.
 
 The rest of the patch looks fine, so I'll do the change while applying it.

Reading my old comment on the previous version, I realized that I was slightly 
too fuzzy in my wording. I meant to make the parameter that gets passed into 
the functions a variable of a different type (like you did). Calculating that 
one from rt is fine.


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 09/12] KVM: PPC: bookehv: Add guest computation mode for irq delivery

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 When delivering guest IRQs, update MSR computation mode according to guest
 interrupt computation mode found in EPCR.
 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 v1: added intermediate msr variable.
 
 arch/powerpc/kvm/booke.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)
 
 diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
 index 7c9c389..86f0d0d 100644
 --- a/arch/powerpc/kvm/booke.c
 +++ b/arch/powerpc/kvm/booke.c
 @@ -312,6 +312,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
 *vcpu,
   bool crit;
   bool keep_irq = false;
   enum int_class int_class;
 + ulong new_msr = vcpu-arch.shared-msr;
 
   /* Truncate crit indicators in 32 bit mode */
   if (!(vcpu-arch.shared-msr  MSR_SF)) {
 @@ -407,7 +408,13 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
 *vcpu,
   set_guest_esr(vcpu, vcpu-arch.queued_esr);
   if (update_dear == true)
   set_guest_dear(vcpu, vcpu-arch.queued_dear);
 - kvmppc_set_msr(vcpu, vcpu-arch.shared-msr  msr_mask);
 +
 + new_msr = msr_mask;
 +#if defined(CONFIG_64BIT)  defined(CONFIG_KVM_BOOKE_HV)

Why the dependency on booke_hv? This is booke code and according to booke, ICM 
declares the interrupt mode a guest will be in, right?

I'll just remove the BOOKE_HV ifdef bit.


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] KVM: PPC: Make EPCR a valid field for booke64 and bookehv

2012-12-01 Thread Alexander Graf
In BookE, EPCR is defined and valid when either the HV or the 64bit
category are implemented. Reflect this in the field definition.

Today the only KVM target on 64bit is HV enabled, so there is no
change in actual source code, but this keeps the code closer to the
spec and doesn't build up artificial road blocks for a PR KVM
on 64bit.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/include/asm/kvm_host.h |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_host.h 
b/arch/powerpc/include/asm/kvm_host.h
index 62fbd38..3480526 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -405,14 +405,19 @@ struct kvm_vcpu_arch {
 #ifdef CONFIG_KVM_BOOKE_HV
u32 host_mas4;
u32 host_mas6;
-   u32 shadow_epcr;
-   u32 epcr;
u32 shadow_msrp;
u32 eplc;
u32 epsc;
u32 oldpir;
 #endif
 
+#if defined(CONFIG_BOOKE)
+#if defined(CONFIG_KVM_BOOKE_HV) || defined(CONFIG_64BIT)
+   u32 shadow_epcr;
+   u32 epcr;
+#endif
+#endif
+
 #ifdef CONFIG_PPC_BOOK3S
/* For Gekko paired singles */
u32 qpr[32];
-- 
1.6.0.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 10/12] KVM: PPC: bookehv: Add EPCR support in mtspr/mfspr emulation

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 Add EPCR support in booke mtspr/mfspr emulation. EPCR register is defined only
 for 64-bit and HV categories, we will expose it at this point only to 64-bit
 virtual processors running on 64-bit HV hosts.
 Define a reusable setter function for vcpu's EPCR.
 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 v1: extended guard defines with CONFIG_KVM_BOOKE_HV required by arch's epcr 
 and
 shadow_epcr fields.

I removed that constraint in another patch I just sent out and will remove the 
guards on HV while applying the patch.


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 11/12] KVM: PPC: booke: Add EPCR support in sregs

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs for 64-bit
 hosts.

Why would we need this if we have a proper ONE_REG interface for EPCR?


Alex

 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 arch/powerpc/kvm/booke.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)
 
 diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
 index e6159f5..d396374 100644
 --- a/arch/powerpc/kvm/booke.c
 +++ b/arch/powerpc/kvm/booke.c
 @@ -1215,6 +1215,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu,
   u64 tb = get_tb();
 
   sregs-u.e.features |= KVM_SREGS_E_BASE;
 +#ifdef CONFIG_64BIT
 + sregs-u.e.features |= KVM_SREGS_E_64;
 +#endif
 
   sregs-u.e.csrr0 = vcpu-arch.csrr0;
   sregs-u.e.csrr1 = vcpu-arch.csrr1;
 @@ -1226,6 +1229,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu,
   sregs-u.e.dec = kvmppc_get_dec(vcpu, tb);
   sregs-u.e.tb = tb;
   sregs-u.e.vrsave = vcpu-arch.vrsave;
 +#if defined(CONFIG_64BIT)  defined(CONFIG_KVM_BOOKE_HV)
 + sregs-u.e.epcr = vcpu-arch.epcr;
 +#endif
 }
 
 static int set_sregs_base(struct kvm_vcpu *vcpu,
 @@ -1241,6 +1247,7 @@ static int set_sregs_base(struct kvm_vcpu *vcpu,
   set_guest_dear(vcpu, sregs-u.e.dear);
   vcpu-arch.vrsave = sregs-u.e.vrsave;
   kvmppc_set_tcr(vcpu, sregs-u.e.tcr);
 + kvmppc_set_epcr(vcpu, sregs-u.e.epcr);
 
   if (sregs-u.e.update_special  KVM_SREGS_E_UPDATE_DEC) {
   vcpu-arch.dec = sregs-u.e.dec;
 -- 
 1.7.4.1
 
 
 --
 To unsubscribe from this list: send the line unsubscribe kvm-ppc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 12/12] KVM: PPC: booke: Get/set guest EPCR register using ONE_REG interface

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 Implement ONE_REG interface for EPCR register adding KVM_REG_PPC_EPCR to
 the list of ONE_REG PPC supported registers.
 
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 Documentation/virtual/kvm/api.txt |1 +
 arch/powerpc/include/asm/kvm.h|2 ++
 arch/powerpc/kvm/booke.c  |   16 
 3 files changed, 19 insertions(+), 0 deletions(-)
 
 diff --git a/Documentation/virtual/kvm/api.txt 
 b/Documentation/virtual/kvm/api.txt
 index e726d76..c78dff4 100644
 --- a/Documentation/virtual/kvm/api.txt
 +++ b/Documentation/virtual/kvm/api.txt
 @@ -1773,6 +1773,7 @@ registers, find a list below:
   PPC   | KVM_REG_PPC_VPA_ADDR  | 64
   PPC   | KVM_REG_PPC_VPA_SLB   | 128
   PPC   | KVM_REG_PPC_VPA_DTL   | 128
 +  PPC   | KVM_REG_PPC_EPCR   | 32
 
 4.69 KVM_GET_ONE_REG
 
 diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
 index b89ae4d..beb6b20 100644
 --- a/arch/powerpc/include/asm/kvm.h
 +++ b/arch/powerpc/include/asm/kvm.h
 @@ -386,4 +386,6 @@ struct kvm_book3e_206_tlb_params {
 #define KVM_REG_PPC_VPA_SLB   (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x83)
 #define KVM_REG_PPC_VPA_DTL   (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x84)
 
 +#define KVM_REG_PPC_EPCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x85)
 +
 #endif /* __LINUX_KVM_POWERPC_H */
 diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
 index d396374..60b8237 100644
 --- a/arch/powerpc/kvm/booke.c
 +++ b/arch/powerpc/kvm/booke.c
 @@ -1395,6 +1395,12 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, 
 struct kvm_one_reg *reg)
vcpu-arch.dbg_reg.dac[dac], sizeof(u64));
   break;
   }
 +#if defined(CONFIG_64BIT)  defined(CONFIG_KVM_BOOKE_HV)

No need for the HV dependency here.

 + case KVM_REG_PPC_EPCR:
 + r = copy_to_user((u32 __user *)(long)reg-addr,
 +  vcpu-arch.epcr, sizeof(u32));

This can be put_user. The reason we don't do it for the other ONE_REG variables 
is that they are u64s which can't be put_user'd on 32bit systems.

 + break;
 +#endif
   default:
   break;
   }
 @@ -1422,6 +1428,16 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, 
 struct kvm_one_reg *reg)
(u64 __user *)(long)reg-addr, sizeof(u64));
   break;
   }
 +#if defined(CONFIG_64BIT)  defined(CONFIG_KVM_BOOKE_HV)

Same as above

 + case KVM_REG_PPC_EPCR: {
 + u32 new_epcr;
 + r = copy_from_user(new_epcr,
 +  (u32 __user *)(long)reg-addr, sizeof(u32));

Same as above.

I'll fix those up for you when applying the patch.


Alex

 + if (r == 0)
 + kvmppc_set_epcr(vcpu, new_epcr);
 + break;
 + }
 +#endif
   default:
   break;
   }
 -- 
 1.7.4.1
 
 
 --
 To unsubscribe from this list: send the line unsubscribe kvm-ppc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/12] KVM: PPC: 64-bit Book3E arch support

2012-12-01 Thread Alexander Graf

On 11.10.2012, at 18:13, Mihai Caraman wrote:

 This patchset adds arch support to KVM for 64-bit Book3E PowerPC procesosrs
 with Embedded.Hypervisor category. The support is limited to the bolted TLB 
 miss
 exception handlers version and was validated on Freescale's e5500 cores
 using P5020DS boards.

Thanks, applied all except for 11/12 with their respective small fine-tunings 
to kvm-ppc-next :).


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: 3.7-rc7: BUG: MAX_STACK_TRACE_ENTRIES too low!

2012-12-01 Thread Christian Kujau
On Wed, 28 Nov 2012 at 16:41, Li Zhong wrote:
 On Tue, 2012-11-27 at 19:22 -0800, Christian Kujau wrote:
  On Tue, 27 Nov 2012 at 19:06, Christian Kujau wrote:
   the same thing[0] happened again in 3.7-rc7, after ~20h uptime:
  
  I found the following on patchwork, but this seems to deal with powerpc64 
  only, while this PowerBook G4 of mine is powerpc32:
  
http://patchwork.ozlabs.org/patch/193414/
  
  It looks related, but then again, I fail to parse assember...
 
 Hi Christian, 
 
 Would you please help to try the following fix? I don't have a powerpc32
 machine for test...

After 3 days of uptime with your patch applied (and normal usage, just 
as before) no such BUG message occured. So, from my point of view, feel
free to add:

   Tested-by: Christian Kujau li...@nerdbynature.de

Thanks!
Christian.

 ==
 diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
 index 9499385..cadebfd 100644
 --- a/arch/powerpc/kernel/entry_32.S
 +++ b/arch/powerpc/kernel/entry_32.S
 @@ -439,6 +439,8 @@ ret_from_fork:
  ret_from_kernel_thread:
   REST_NVGPRS(r1)
   bl  schedule_tail
 + li  r3,0
 + stw r3,0(r1)
   mtlrr14
   mr  r3,r15
   PPC440EP_ERR42
 ==
 
  
  Christian.
  
   [40007.339487] [sched_delayed] sched: RT throttling activated
   [69731.388717] BUG: MAX_STACK_TRACE_ENTRIES too low!
   [69731.390371] turning off the locking correctness validator.
   [69731.391942] Call Trace:
   [69731.393525] [c9a61c10] [c0009064] show_stack+0x70/0x1bc (unreliable)
   [69731.395152] [c9a61c50] [c0077460] save_trace+0xfc/0x114
   [69731.396735] [c9a61c60] [c007be20] __lock_acquire+0x1568/0x19b8
   [69731.398296] [c9a61d00] [c007c2c0] lock_acquire+0x50/0x70
   [69731.399857] [c9a61d20] [c0550e28] _raw_spin_lock_irq+0x5c/0x78
   [69731.401419] [c9a61d40] [c054fb58] __schedule+0xd8/0x534
   [69731.402972] [c9a61da0] [c0550094] _cond_resched+0x50/0x68
   [69731.404527] [c9a61db0] [c0479908] dst_gc_task+0xbc/0x258
   [69731.406070] [c9a61e40] [c004eeb8] process_one_work+0x1f4/0x49c
   [69731.407585] [c9a61e80] [c004f644] worker_thread+0x14c/0x400
   [69731.409075] [c9a61eb0] [c0057634] kthread+0xbc/0xc0
   [69731.410521] [c9a61f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
   [...repeated 54 times...]
   
   Anyone knows what this is about?
   
   Thanks,
   Christian.
   
   [0] http://lkml.indiana.edu/hypermail/linux/kernel/1211.0/03025.html

-- 
BOFH excuse #267:

The UPS is on strike.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.

2012-12-01 Thread Tabi Timur-B04825
Varun Sethi wrote:
 Following is a brief description of the PAMU hardware:
 PAMU determines what action to take and whether to authorize the action on
 the basis of the memory address, a Logical IO Device Number (LIODN), and
 PAACT table (logically) indexed by LIODN and address. Hardware devices which
 need to access memory must provide an LIODN in addition to the memory address.

 Peripheral Access Authorization and Control Tables (PAACTs) are the primary
 data structures used by PAMU. A PAACT is a table of peripheral access
 authorization and control entries (PAACE).Each PAACE defines the range of
 I/O bus address space that is accessible by the LIOD and the associated access
 capabilities.

 There are two types of PAACTs: primary PAACT (PPAACT) and secondary PAACT
 (SPAACT).A given physical I/O device may be able to act as one or more
 independent logical I/O devices (LIODs). Each such logical I/O device is
 assigned an identifier called logical I/O device number (LIODN). A LIODN is
 allocated a contiguous portion of the I/O bus address space called the DSA 
 window
 for performing DSA operations. The DSA window may optionally be divided into
 multiple sub-windows, each of which may be used to map to a region in system
 storage space. The first sub-window is referred to as the primary sub-window
 and the remaining are called secondary sub-windows.

 This patch provides the PAMU driver (fsl_pamu.c) and the corresponding IOMMU
 API implementation (fsl_pamu_domain.c). The PAMU hardware driver (fsl_pamu.c)
 has been derived from the work done by Ashish Kalra and Timur Tabi
 (ti...@freescale.com).

 Signed-off-by: Timur Tabiti...@freescale.com
 Signed-off-by: Varun Sethivarun.se...@freescale.com
 ---

Acked-by: Timur Tabi ti...@freescale.com


-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev