* Re: [PATCH v2 09/10] mm, cma: move output param to the end of param list
From: Michal Nazarewicz @ 2014-06-12 11:38 UTC (permalink / raw)
To: Joonsoo Kim, Andrew Morton, Aneesh Kumar K.V, Marek Szyprowski
Cc: Russell King - ARM Linux, kvm, linux-mm, Gleb Natapov,
Greg Kroah-Hartman, Alexander Graf, kvm-ppc, linux-kernel,
Minchan Kim, Paul Mackerras, Paolo Bonzini, Joonsoo Kim,
linuxppc-dev, linux-arm-kernel
In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com>
On Thu, Jun 12 2014, Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:
> Conventionally, we put output param to the end of param list.
> cma_declare_contiguous() doesn't look like that, so change it.
Perhaps the function should be changed to return an error-pointer?
> Additionally, move down cma_areas reference code to the position
> where it is really needed.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
>
> diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book=
3s_hv_builtin.c
> index 28ec226..97613ea 100644
> --- a/arch/powerpc/kvm/book3s_hv_builtin.c
> +++ b/arch/powerpc/kvm/book3s_hv_builtin.c
> @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void)
>=20=20
> align_size =3D max(kvm_rma_pages << PAGE_SHIFT, align_size);
> cma_declare_contiguous(selected_size, 0, 0, align_size,
> - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false);
> + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma);
> }
> }
>=20=20
> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
> index f177f73..bfd4553 100644
> --- a/drivers/base/dma-contiguous.c
> +++ b/drivers/base/dma-contiguous.c
> @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t si=
ze, phys_addr_t base,
> {
> int ret;
>=20=20
> - ret =3D cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed);
> + ret =3D cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma);
> if (ret)
> return ret;
>=20=20
> diff --git a/include/linux/cma.h b/include/linux/cma.h
> index e38efe9..e53eead 100644
> --- a/include/linux/cma.h
> +++ b/include/linux/cma.h
> @@ -6,7 +6,7 @@ struct cma;
> extern int __init cma_declare_contiguous(phys_addr_t size,
> phys_addr_t base, phys_addr_t limit,
> phys_addr_t alignment, int order_per_bit,
> - struct cma **res_cma, bool fixed);
> + bool fixed, struct cma **res_cma);
> extern struct page *cma_alloc(struct cma *cma, int count, unsigned int a=
lign);
> extern bool cma_release(struct cma *cma, struct page *pages, int count);
> #endif
> diff --git a/mm/cma.c b/mm/cma.c
> index 01a0713..22a5b23 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas);
> * @limit: End address of the reserved memory (optional, 0 for any).
> * @alignment: Alignment for the contiguous memory area, should be power=
of 2
> * @order_per_bit: Order of pages represented by one bit on bitmap.
> - * @res_cma: Pointer to store the created cma region.
> * @fixed: hint about where to place the reserved area
> + * @res_cma: Pointer to store the created cma region.
> *
> * This function reserves memory from early allocator. It should be
> * called by arch specific code once the early allocator (memblock or bo=
otmem)
> @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas);
> int __init cma_declare_contiguous(phys_addr_t size,
> phys_addr_t base, phys_addr_t limit,
> phys_addr_t alignment, int order_per_bit,
> - struct cma **res_cma, bool fixed)
> + bool fixed, struct cma **res_cma)
> {
> - struct cma *cma =3D &cma_areas[cma_area_count];
> + struct cma *cma;
> int ret =3D 0;
>=20=20
> pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
> @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size,
> * Each reserved area must be initialised later, when more kernel
> * subsystems (like slab allocator) are available.
> */
> + cma =3D &cma_areas[cma_area_count];
> cma->base_pfn =3D PFN_DOWN(base);
> cma->count =3D size >> PAGE_SHIFT;
> cma->order_per_bit =3D order_per_bit;
> --=20
> 1.7.9.5
>
--=20
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o
..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =
(o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
^ permalink raw reply
* Re: Kernel build issues after yesterdays merge by Linus
From: Anton Blanchard @ 2014-06-12 12:09 UTC (permalink / raw)
To: Christoph Lameter; +Cc: Rusty Russell, linuxppc-dev
In-Reply-To: <alpine.DEB.2.10.1406111013580.8422@gentwo.org>
Hi Christoph,
> This is under Ubuntu Utopic Unicorn on a Power 8 system while simply
> trying to build with the Ubuntu standard kernel config. It could be
> that these issues come about because we do not have an rc1 yet but I
> wanted to give some early notice. Also this is a new arch to me so I
> may not be aware of how things work.
>
> 1. Bad relocation while building:
>
> root@rd-power8:/rdhome/clameter/linux# make
> CHK include/config/kernel.release
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CALL scripts/checksyscalls.sh
> CHK include/generated/compile.h
> SKIPPED include/generated/compile.h
> CALL arch/powerpc/kernel/systbl_chk.sh
> CALL arch/powerpc/kernel/prom_init_check.sh
> CHK kernel/config_data.h
> CALL arch/powerpc/relocs_check.pl
> WARNING: 1 bad relocations
> c000000000cc7df0 R_PPC64_ADDR64 __crc_TOC.
The TOC symbol export is special and I think we might need to get our
script to ignore it.
> 2. "make install" fails
>
> root@rd-power8:/rdhome/clameter/linux# make install
> sh -x /rdhome/clameter/linux/arch/powerpc/boot/install.sh "3.15.0+"
> vmlinux System.map "/boot" arch/powerpc/boot/zImage.pseries
> arch/powerpc/boot/zImage.epapr
> + set -e
> + [ -x /home/clameter/bin/installkernel ]
> + [ -x /sbin/installkernel ]
> + exec /sbin/installkernel 3.15.0+ vmlinux System.map /boot
> arch/powerpc/boot/zImage.pseries arch/powerpc/boot/zImage.epapr
> Usage: installkernel <version> <image> <System.map> <directory>
> /rdhome/clameter/linux/arch/powerpc/boot/Makefile:393: recipe for target
> 'install' failed
> make[1]: *** [install] Error 1
> /rdhome/clameter/linux/arch/powerpc/Makefile:294: recipe for target
> 'install' failed
> make: *** [install] Error 2
Shows how much we use make install :) Below is a quick hack to get you going
but we should look at either fixing the Ubuntu installkernel to handle
extra optional args, or stop passing them from the ppc64 kernel
install.sh script.
Anton
--
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
index b6a256b..e096e5a 100644
--- a/arch/powerpc/boot/install.sh
+++ b/arch/powerpc/boot/install.sh
@@ -23,8 +23,8 @@ set -e
# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
+if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} $1 $2 $3 $4; fi
+if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} $1 $2 $3 $4; fi
# Default install
^ permalink raw reply related
* Re: powerpc/ppc64: Allow allmodconfig to build (finally !)
From: Guenter Roeck @ 2014-06-12 12:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1399874254.17624.85.camel@pasglop>
On Mon, May 12, 2014 at 03:57:34PM +1000, Benjamin Herrenschmidt wrote:
> This shuffles code around in exceptions-64s.S in order to
> allow an allmodconfig build to succeed.
>
> The main problems were:
>
> - We have a fixed hole from 0x7000 to 0x8000 for use by FW,
> under some circumstances the code before that would grow too
> big and hit the . = 0x7000
>
> - The various attempts at making space in there would trigger
> cases where short conditional branches from assembly would no
> longer be able to reach their target. This is especially nasty
> when these branches reside in alternate feature sections which
> are appended at the end of each .o file
>
> This fixes it by essentially moving all the "second level"
> exception handlers to after the hole and moving a couple of
> functions near the hole itself so they sit at reachable distance
> of both the first level handlers (before the hole) and the alternate
> feature sections (end of file).
>
> In the long run, if we start hitting this again, we'll probably
> have to split the file in two, probably at the hole location,
> to keep the alt sections used by the first level handlers close
> to them, and move everything else further away.
>
> But for now, this will do.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
Hi Ben,
what happened with this patch ?
Thanks,
Guenter
^ permalink raw reply
* Re: power and percpu: Could we move the paca into the percpu area?
From: Segher Boessenkool @ 2014-06-12 12:26 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: Tejun Heo, linuxppc-dev, Christoph Lameter
In-Reply-To: <20140611210351.GA7155@visitor2.iram.es>
> Actually, from gcc/config/rs6000.h:
>
> /* 1 for registers that have pervasive standard uses
> and are not available for the register allocator.
[snip]
> So cr5, which is number 73, is never used by gcc.
Not available for RA is not the same thing at all as not used by GCC.
For example, GPR1 and XER[CA] are also fixed regs.
But, indeed, it does look like GCC doesn't use it. It seems to me that
some ABI forbade userland (or non-libraries or whatever) from using it.
I'll see what I can find out.
Segher
^ permalink raw reply
* RE: Kernel build issues after yesterdays merge by Linus
From: David Laight @ 2014-06-12 12:36 UTC (permalink / raw)
To: 'Anton Blanchard', Christoph Lameter
Cc: Rusty Russell, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140612220912.3447677f@kryten>
RnJvbTogQW50b24gQmxhbmNoYXJkDQouLi4NCj4gZGlmZiAtLWdpdCBhL2FyY2gvcG93ZXJwYy9i
b290L2luc3RhbGwuc2ggYi9hcmNoL3Bvd2VycGMvYm9vdC9pbnN0YWxsLnNoDQo+IGluZGV4IGI2
YTI1NmIuLmUwOTZlNWEgMTAwNjQ0DQo+IC0tLSBhL2FyY2gvcG93ZXJwYy9ib290L2luc3RhbGwu
c2gNCj4gKysrIGIvYXJjaC9wb3dlcnBjL2Jvb3QvaW5zdGFsbC5zaA0KPiBAQCAtMjMsOCArMjMs
OCBAQCBzZXQgLWUNCj4gDQo+ICAjIFVzZXIgbWF5IGhhdmUgYSBjdXN0b20gaW5zdGFsbCBzY3Jp
cHQNCj4gDQo+IC1pZiBbIC14IH4vYmluLyR7SU5TVEFMTEtFUk5FTH0gXTsgdGhlbiBleGVjIH4v
YmluLyR7SU5TVEFMTEtFUk5FTH0gIiRAIjsgZmkNCj4gLWlmIFsgLXggL3NiaW4vJHtJTlNUQUxM
S0VSTkVMfSBdOyB0aGVuIGV4ZWMgL3NiaW4vJHtJTlNUQUxMS0VSTkVMfSAiJEAiOyBmaQ0KPiAr
aWYgWyAteCB+L2Jpbi8ke0lOU1RBTExLRVJORUx9IF07IHRoZW4gZXhlYyB+L2Jpbi8ke0lOU1RB
TExLRVJORUx9ICQxICQyICQzICQ0OyBmaQ0KPiAraWYgWyAteCAvc2Jpbi8ke0lOU1RBTExLRVJO
RUx9IF07IHRoZW4gZXhlYyAvc2Jpbi8ke0lOU1RBTExLRVJORUx9ICQxICQyICQzICQ0OyBmaQ0K
DQpZb3UgcHJvYmFibHkgd2FudCB0byBlbmNsb3NlIHRoZSAkMSBpbiAiIGFzOg0KDQo+ICtpZiBb
IC14IC9zYmluLyR7SU5TVEFMTEtFUk5FTH0gXTsgdGhlbiBleGVjIC9zYmluLyR7SU5TVEFMTEtF
Uk5FTH0gIiQxIiAiJDIiICIkMyIgIiQ0IjsgZmkNCg0KCURhdmlkDQoNCg==
^ permalink raw reply
* [PATCH] KVM: PPC: e500mc: Relax tlb invalidation condition on vcpu schedule
From: Mihai Caraman @ 2014-06-12 14:00 UTC (permalink / raw)
To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm
On vcpu schedule, the condition checked for tlb pollution is too tight.
The tlb entries of one vcpu are polluted when a different vcpu from the
same partition runs in-between. Relax the current tlb invalidation
condition taking into account the lpid.
Signed-off-by: Mihai Caraman <mihai.caraman <at> freescale.com>
Cc: Scott Wood <scottwood <at> freescale.com>
---
arch/powerpc/kvm/e500mc.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
index 17e4562..2e0cd69 100644
--- a/arch/powerpc/kvm/e500mc.c
+++ b/arch/powerpc/kvm/e500mc.c
@@ -111,10 +111,12 @@ void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr)
}
static DEFINE_PER_CPU(struct kvm_vcpu *, last_vcpu_on_cpu);
+static DEFINE_PER_CPU(int, last_lpid_on_cpu);
static void kvmppc_core_vcpu_load_e500mc(struct kvm_vcpu *vcpu, int cpu)
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
+ bool update_last = false, inval_tlb = false;
kvmppc_booke_vcpu_load(vcpu, cpu);
@@ -140,12 +142,24 @@ static void kvmppc_core_vcpu_load_e500mc(struct kvm_vcpu *vcpu, int cpu)
mtspr(SPRN_GDEAR, vcpu->arch.shared->dar);
mtspr(SPRN_GESR, vcpu->arch.shared->esr);
- if (vcpu->arch.oldpir != mfspr(SPRN_PIR) ||
- __get_cpu_var(last_vcpu_on_cpu) != vcpu) {
- kvmppc_e500_tlbil_all(vcpu_e500);
+ if (vcpu->arch.oldpir != mfspr(SPRN_PIR)) {
+ /* tlb entries deprecated */
+ inval_tlb = update_last = true;
+ } else if (__get_cpu_var(last_vcpu_on_cpu) != vcpu) {
+ update_last = true;
+ /* tlb entries polluted */
+ inval_tlb = __get_cpu_var(last_lpid_on_cpu) ==
+ vcpu->kvm->arch.lpid;
+ }
+
+ if (update_last) {
__get_cpu_var(last_vcpu_on_cpu) = vcpu;
+ __get_cpu_var(last_lpid_on_cpu) = vcpu->kvm->arch.lpid;
}
+ if (inval_tlb)
+ kvmppc_e500_tlbil_all(vcpu_e500);
+
kvmppc_load_guest_fp(vcpu);
}
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
From: Steve Munroe @ 2014-06-12 15:13 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, Adhemerval Zanella, Michael J Wolf,
Hanns-Joachim Uhl
In-Reply-To: <1402376680.14780.12.camel@pasglop>
[-- Attachment #1.1: Type: text/plain, Size: 3660 bytes --]
The precedent we have used is that features that refer to ISA Categories
include _HAS_ following the PPC_FEATURE[2]. So GLIBC specifies in hwcap.h:
/* Feature definitions in AT_HWCAP2. */
#define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */
#define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional
Memory */
#define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control
Register */
#define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */
#define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */
#define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */
This was carried from the original AT_HWCAP defines.
$ grep _HAS_ ./sysdeps/powerpc/bits/hwcap.h
#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 /* SIMD/Vector Unit. */
#define PPC_FEATURE_HAS_FPU 0x08000000 /* Floating Point Unit. */
#define PPC_FEATURE_HAS_MMU 0x04000000 /* Memory Management Unit. */
#define PPC_FEATURE_HAS_4xxMAC 0x02000000 /* 4xx Multiply
Accumulator. */
#define PPC_FEATURE_HAS_SPE 0x00800000 /* Signal Processing ext. */
#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */
#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
#define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
So could we agree on PPC_FEATURE2_HAS_VEC_CRYPTO or the shorter
PPC_FEATURE2_HAS_VCRYPTO?
Steven J. Munroe
Linux on Power Toolchain Architect
IBM Corporation, Linux Technology Center
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Cc: Steve Munroe/Rochester/IBM@IBMUS, Hanns-Joachim Uhl
<hannsj_uhl@de.ibm.com>, Diane Brent/Poughkeepsie/IBM@IBMUS,
Jeffrey Scheel/Rochester/IBM@IBMUS, Adhemerval Zanella
<azanella@linux.vnet.ibm.com>
Date: 06/10/2014 12:05 AM
Subject: [PATCH] powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category
support
The Vector Crypto category instructions are supported by current POWER8
chips, advertise them to userspace using a specific bit to properly
differentiate with chips of the same architecture level that might not
have them.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: <stable@vger.kernel.org> [v3.10+]
--
diff --git a/arch/powerpc/include/uapi/asm/cputable.h
b/arch/powerpc/include/uapi/asm/cputable.h
index 5b76579..de2c0e4 100644
--- a/arch/powerpc/include/uapi/asm/cputable.h
+++ b/arch/powerpc/include/uapi/asm/cputable.h
@@ -41,5 +41,6 @@
#define PPC_FEATURE2_EBB 0x10000000
#define PPC_FEATURE2_ISEL 0x08000000
#define PPC_FEATURE2_TAR 0x04000000
+#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
#endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */
diff --git a/arch/powerpc/kernel/cputable.c
b/arch/powerpc/kernel/cputable.c
index c1faade..11da04a 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -109,7 +109,8 @@ extern void __restore_cpu_e6500(void);
PPC_FEATURE_PSERIES_PERFMON_COMPAT)
#define COMMON_USER2_POWER8 (PPC_FEATURE2_ARCH_2_07 | \
PPC_FEATURE2_HTM_COMP |
PPC_FEATURE2_DSCR | \
- PPC_FEATURE2_ISEL |
PPC_FEATURE2_TAR)
+ PPC_FEATURE2_ISEL |
PPC_FEATURE2_TAR | \
+ PPC_FEATURE2_VEC_CRYPTO)
#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T
|\
PPC_FEATURE_TRUE_LE | \
PPC_FEATURE_HAS_ALTIVEC_COMP)
[-- Attachment #1.2: Type: text/html, Size: 6435 bytes --]
[-- Attachment #2: graycol.gif --]
[-- Type: image/gif, Size: 105 bytes --]
^ permalink raw reply related
* Re: [PATCH 3/4 v3] KVM: PPC: Alow kvmppc_get_last_inst() to fail
From: Alexander Graf @ 2014-06-12 15:15 UTC (permalink / raw)
To: Mihai Caraman; +Cc: linuxppc-dev, kvm, kvm-ppc
In-Reply-To: <1401724216-26486-4-git-send-email-mihai.caraman@freescale.com>
On 06/02/2014 05:50 PM, Mihai Caraman wrote:
> On book3e, guest last instruction is read on the exit path using load
> external pid (lwepx) dedicated instruction. This load operation may fail
> due to TLB eviction and execute-but-not-read entries.
>
> This patch lay down the path for an alternative solution to read the guest
> last instruction, by allowing kvmppc_get_lat_inst() function to fail.
> Architecture specific implmentations of kvmppc_load_last_inst() may read
> last guest instruction and instruct the emulation layer to re-execute the
> guest in case of failure.
>
> Make kvmppc_get_last_inst() definition common between architectures.
>
> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
> ---
> v3:
> - these changes compile on book3s, please validate the functionality and
> do the necessary adaptations!
> - rework patch description
> - add common definition for kvmppc_get_last_inst()
> - check return values in book3s code
>
> v2:
> - integrated kvmppc_get_last_inst() in book3s code and checked build
> - addressed cosmetic feedback
>
> arch/powerpc/include/asm/kvm_book3s.h | 28 ++------
> arch/powerpc/include/asm/kvm_booke.h | 7 +-
> arch/powerpc/include/asm/kvm_ppc.h | 16 +++++
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 16 ++---
> arch/powerpc/kvm/book3s_paired_singles.c | 38 ++++++----
> arch/powerpc/kvm/book3s_pr.c | 116 +++++++++++++++++--------------
> arch/powerpc/kvm/booke.c | 3 +
> arch/powerpc/kvm/e500_mmu_host.c | 5 ++
> arch/powerpc/kvm/emulate.c | 18 +++--
> arch/powerpc/kvm/powerpc.c | 10 ++-
> 10 files changed, 142 insertions(+), 115 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
> index f52f656..3409572 100644
> --- a/arch/powerpc/include/asm/kvm_book3s.h
> +++ b/arch/powerpc/include/asm/kvm_book3s.h
> @@ -274,30 +274,14 @@ static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu)
> return (kvmppc_get_msr(vcpu) & MSR_LE) != (MSR_KERNEL & MSR_LE);
> }
>
> -static inline u32 kvmppc_get_last_inst_internal(struct kvm_vcpu *vcpu, ulong pc)
> +static inline int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, bool prev,
Please make prev an enum :)
> + u32 *inst)
> {
> - /* Load the instruction manually if it failed to do so in the
> - * exit path */
> - if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
> - kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
> + ulong pc = kvmppc_get_pc(vcpu);
>
> - return kvmppc_need_byteswap(vcpu) ? swab32(vcpu->arch.last_inst) :
> - vcpu->arch.last_inst;
> -}
> -
> -static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu)
> -{
> - return kvmppc_get_last_inst_internal(vcpu, kvmppc_get_pc(vcpu));
> -}
> -
> -/*
> - * Like kvmppc_get_last_inst(), but for fetching a sc instruction.
> - * Because the sc instruction sets SRR0 to point to the following
> - * instruction, we have to fetch from pc - 4.
> - */
> -static inline u32 kvmppc_get_last_sc(struct kvm_vcpu *vcpu)
> -{
> - return kvmppc_get_last_inst_internal(vcpu, kvmppc_get_pc(vcpu) - 4);
> + if (prev)
> + pc -= 4;
> + return kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
> }
In this case we're already in the slow path. Can we move this into a .c
file instead? That would unify it with booke and ...
>
> static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu)
> diff --git a/arch/powerpc/include/asm/kvm_booke.h b/arch/powerpc/include/asm/kvm_booke.h
> index c7aed61..1e28371 100644
> --- a/arch/powerpc/include/asm/kvm_booke.h
> +++ b/arch/powerpc/include/asm/kvm_booke.h
> @@ -33,6 +33,8 @@
> #define KVMPPC_INST_EHPRIV_DEBUG (KVMPPC_INST_EHPRIV | \
> (EHPRIV_OC_DEBUG << EHPRIV_OC_SHIFT))
>
> +extern int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, bool prev, u32 *inst);
... allow us to move this to a common header file :).
> +
> static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val)
> {
> vcpu->arch.gpr[num] = val;
> @@ -69,11 +71,6 @@ static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu)
> return false;
> }
>
> -static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu)
> -{
> - return vcpu->arch.last_inst;
> -}
> -
> static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val)
> {
> vcpu->arch.ctr = val;
> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
> index 4a7cc45..619be2f 100644
> --- a/arch/powerpc/include/asm/kvm_ppc.h
> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> @@ -234,6 +234,22 @@ struct kvmppc_ops {
> extern struct kvmppc_ops *kvmppc_hv_ops;
> extern struct kvmppc_ops *kvmppc_pr_ops;
>
> +static inline int kvmppc_get_last_inst(struct kvm_vcpu *vcpu, bool prev,
> + u32 *inst)
> +{
> + int ret = EMULATE_DONE;
> +
> + /* Load the instruction manually if it failed to do so in the
> + * exit path */
> + if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
> + ret = kvmppc_load_last_inst(vcpu, prev, &vcpu->arch.last_inst);
> +
> + *inst = kvmppc_need_byteswap(vcpu) ? swab32(vcpu->arch.last_inst) :
> + vcpu->arch.last_inst;
> +
> + return ret;
> +}
> +
> static inline bool is_kvmppc_hv_enabled(struct kvm *kvm)
> {
> return kvm->arch.kvm_ops == kvmppc_hv_ops;
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index 8056107..2ffb3dd 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -530,21 +530,13 @@ static int instruction_is_store(unsigned int instr)
> static int kvmppc_hv_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu,
> unsigned long gpa, gva_t ea, int is_store)
> {
> - int ret;
> u32 last_inst;
> - unsigned long srr0 = kvmppc_get_pc(vcpu);
>
> - /* We try to load the last instruction. We don't let
> - * emulate_instruction do it as it doesn't check what
> - * kvmppc_ld returns.
> + /*
> * If we fail, we just return to the guest and try executing it again.
> */
> - if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED) {
> - ret = kvmppc_ld(vcpu, &srr0, sizeof(u32), &last_inst, false);
> - if (ret != EMULATE_DONE || last_inst == KVM_INST_FETCH_FAILED)
> - return RESUME_GUEST;
> - vcpu->arch.last_inst = last_inst;
> - }
> + if (kvmppc_get_last_inst(vcpu, false, &last_inst) != EMULATE_DONE)
> + return RESUME_GUEST;
>
> /*
> * WARNING: We do not know for sure whether the instruction we just
> @@ -558,7 +550,7 @@ static int kvmppc_hv_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu,
> * we just return and retry the instruction.
> */
>
> - if (instruction_is_store(kvmppc_get_last_inst(vcpu)) != !!is_store)
> + if (instruction_is_store(last_inst) != !!is_store)
> return RESUME_GUEST;
>
> /*
> diff --git a/arch/powerpc/kvm/book3s_paired_singles.c b/arch/powerpc/kvm/book3s_paired_singles.c
> index 6c8011f..6362ad4 100644
> --- a/arch/powerpc/kvm/book3s_paired_singles.c
> +++ b/arch/powerpc/kvm/book3s_paired_singles.c
> @@ -639,26 +639,36 @@ static int kvmppc_ps_one_in(struct kvm_vcpu *vcpu, bool rc,
>
> int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu)
> {
> - u32 inst = kvmppc_get_last_inst(vcpu);
> + u32 inst;
> enum emulation_result emulated = EMULATE_DONE;
> + int ax_rd, ax_ra, ax_rb, ax_rc;
> + short full_d;
> + u64 *fpr_d, *fpr_a, *fpr_b, *fpr_c;
>
> - int ax_rd = inst_get_field(inst, 6, 10);
> - int ax_ra = inst_get_field(inst, 11, 15);
> - int ax_rb = inst_get_field(inst, 16, 20);
> - int ax_rc = inst_get_field(inst, 21, 25);
> - short full_d = inst_get_field(inst, 16, 31);
> -
> - u64 *fpr_d = &VCPU_FPR(vcpu, ax_rd);
> - u64 *fpr_a = &VCPU_FPR(vcpu, ax_ra);
> - u64 *fpr_b = &VCPU_FPR(vcpu, ax_rb);
> - u64 *fpr_c = &VCPU_FPR(vcpu, ax_rc);
> -
> - bool rcomp = (inst & 1) ? true : false;
> - u32 cr = kvmppc_get_cr(vcpu);
> + bool rcomp;
> + u32 cr;
> #ifdef DEBUG
> int i;
> #endif
>
> + emulated = kvmppc_get_last_inst(vcpu, false, &inst);
> + if (emulated != EMULATE_DONE)
> + return emulated;
> +
> + ax_rd = inst_get_field(inst, 6, 10);
> + ax_ra = inst_get_field(inst, 11, 15);
> + ax_rb = inst_get_field(inst, 16, 20);
> + ax_rc = inst_get_field(inst, 21, 25);
> + full_d = inst_get_field(inst, 16, 31);
> +
> + fpr_d = &VCPU_FPR(vcpu, ax_rd);
> + fpr_a = &VCPU_FPR(vcpu, ax_ra);
> + fpr_b = &VCPU_FPR(vcpu, ax_rb);
> + fpr_c = &VCPU_FPR(vcpu, ax_rc);
> +
> + rcomp = (inst & 1) ? true : false;
> + cr = kvmppc_get_cr(vcpu);
> +
> if (!kvmppc_inst_is_paired_single(vcpu, inst))
> return EMULATE_FAIL;
>
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 23367a7..48b633c 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -637,42 +637,6 @@ static void kvmppc_giveup_fac(struct kvm_vcpu *vcpu, ulong fac)
> #endif
> }
>
> -static int kvmppc_read_inst(struct kvm_vcpu *vcpu)
> -{
> - ulong srr0 = kvmppc_get_pc(vcpu);
> - u32 last_inst = kvmppc_get_last_inst(vcpu);
> - int ret;
> -
> - ret = kvmppc_ld(vcpu, &srr0, sizeof(u32), &last_inst, false);
> - if (ret == -ENOENT) {
> - ulong msr = kvmppc_get_msr(vcpu);
> -
> - msr = kvmppc_set_field(msr, 33, 33, 1);
> - msr = kvmppc_set_field(msr, 34, 36, 0);
> - msr = kvmppc_set_field(msr, 42, 47, 0);
> - kvmppc_set_msr_fast(vcpu, msr);
> - kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_INST_STORAGE);
> - return EMULATE_AGAIN;
> - }
> -
> - return EMULATE_DONE;
> -}
> -
> -static int kvmppc_check_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr)
> -{
> -
> - /* Need to do paired single emulation? */
> - if (!(vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE))
> - return EMULATE_DONE;
> -
> - /* Read out the instruction */
> - if (kvmppc_read_inst(vcpu) == EMULATE_DONE)
> - /* Need to emulate */
> - return EMULATE_FAIL;
> -
> - return EMULATE_AGAIN;
> -}
> -
> /* Handle external providers (FPU, Altivec, VSX) */
> static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr,
> ulong msr)
> @@ -977,15 +941,24 @@ int kvmppc_handle_exit_pr(struct kvm_run *run, struct kvm_vcpu *vcpu,
> {
> enum emulation_result er;
> ulong flags;
> + u32 last_inst;
> + int emul;
>
> program_interrupt:
> flags = vcpu->arch.shadow_srr1 & 0x1f0000ull;
>
> + emul = kvmppc_get_last_inst(vcpu, false, &last_inst);
> + if (emul != EMULATE_DONE) {
> + r = RESUME_GUEST;
> + break;
> + }
> +
> if (kvmppc_get_msr(vcpu) & MSR_PR) {
> #ifdef EXIT_DEBUG
> - printk(KERN_INFO "Userspace triggered 0x700 exception at 0x%lx (0x%x)\n", kvmppc_get_pc(vcpu), kvmppc_get_last_inst(vcpu));
> + pr_info("Userspace triggered 0x700 exception at\n"
I don't think we want the \n here :).
> + "0x%lx (0x%x)\n", kvmppc_get_pc(vcpu), last_inst);
> #endif
> - if ((kvmppc_get_last_inst(vcpu) & 0xff0007ff) !=
> + if ((last_inst & 0xff0007ff) !=
> (INS_DCBZ & 0xfffffff7)) {
> kvmppc_core_queue_program(vcpu, flags);
> r = RESUME_GUEST;
> @@ -1004,7 +977,7 @@ program_interrupt:
> break;
> case EMULATE_FAIL:
> printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
> - __func__, kvmppc_get_pc(vcpu), kvmppc_get_last_inst(vcpu));
> + __func__, kvmppc_get_pc(vcpu), last_inst);
> kvmppc_core_queue_program(vcpu, flags);
> r = RESUME_GUEST;
> break;
> @@ -1021,8 +994,25 @@ program_interrupt:
> break;
> }
> case BOOK3S_INTERRUPT_SYSCALL:
> + {
> + u32 last_sc;
> + int emul;
> +
> + /* Get last sc for papr */
> + if (vcpu->arch.papr_enabled) {
> + /*
> + * The sc instuction sets SRR0 to point to the next inst
> + */
> + emul = kvmppc_get_last_inst(vcpu, true, &last_sc);
> + if (emul != EMULATE_DONE) {
> + kvmppc_set_pc(vcpu, kvmppc_get_pc(vcpu) - 4);
> + r = RESUME_GUEST;
> + break;
> + }
> + }
> +
> if (vcpu->arch.papr_enabled &&
> - (kvmppc_get_last_sc(vcpu) == 0x44000022) &&
> + (last_sc == 0x44000022) &&
> !(kvmppc_get_msr(vcpu) & MSR_PR)) {
> /* SC 1 papr hypercalls */
> ulong cmd = kvmppc_get_gpr(vcpu, 3);
> @@ -1067,36 +1057,53 @@ program_interrupt:
> r = RESUME_GUEST;
> }
> break;
> + }
> case BOOK3S_INTERRUPT_FP_UNAVAIL:
> case BOOK3S_INTERRUPT_ALTIVEC:
> case BOOK3S_INTERRUPT_VSX:
> {
> int ext_msr = 0;
> + int emul;
> + u32 last_inst;
>
> - switch (exit_nr) {
> - case BOOK3S_INTERRUPT_FP_UNAVAIL: ext_msr = MSR_FP; break;
> - case BOOK3S_INTERRUPT_ALTIVEC: ext_msr = MSR_VEC; break;
> - case BOOK3S_INTERRUPT_VSX: ext_msr = MSR_VSX; break;
> - }
> + if (!(vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE)) {
> + /* Do paired single emulation */
> +
> + switch (exit_nr) {
> + case BOOK3S_INTERRUPT_FP_UNAVAIL:
> + ext_msr = MSR_FP;
> + break;
> +
> + case BOOK3S_INTERRUPT_ALTIVEC:
> + ext_msr = MSR_VEC;
> + break;
> +
> + case BOOK3S_INTERRUPT_VSX:
> + ext_msr = MSR_VSX;
> + break;
> + }
>
> - switch (kvmppc_check_ext(vcpu, exit_nr)) {
> - case EMULATE_DONE:
> - /* everything ok - let's enable the ext */
> r = kvmppc_handle_ext(vcpu, exit_nr, ext_msr);
> break;
> - case EMULATE_FAIL:
> + }
> +
> + emul = kvmppc_get_last_inst(vcpu, false, &last_inst);
> + if (emul == EMULATE_DONE) {
> /* we need to emulate this instruction */
> goto program_interrupt;
> break;
> - default:
> - /* nothing to worry about - go again */
> - break;
> + } else {
> + r = RESUME_GUEST;
> }
> +
> break;
> }
> case BOOK3S_INTERRUPT_ALIGNMENT:
> - if (kvmppc_read_inst(vcpu) == EMULATE_DONE) {
Phew - this removes the ability to inject an instruction page fault on
this path. It's probably ok to do so, but please eliminate
kvmppc_read_inst() in a separate patch before this one so we can later
bisect it more easily when it fails.
Alex
> - u32 last_inst = kvmppc_get_last_inst(vcpu);
> + {
> + u32 last_inst;
> + int emul = kvmppc_get_last_inst(vcpu, false, &last_inst);
> +
> + if (emul == EMULATE_DONE) {
> u32 dsisr;
> u64 dar;
>
> @@ -1110,6 +1117,7 @@ program_interrupt:
> }
> r = RESUME_GUEST;
> break;
> + }
> #ifdef CONFIG_PPC_BOOK3S_64
> case BOOK3S_INTERRUPT_FAC_UNAVAIL:
> kvmppc_handle_fac(vcpu, vcpu->arch.shadow_fscr >> 56);
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index ab62109..34a42b9 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -752,6 +752,9 @@ static int emulation_exit(struct kvm_run *run, struct kvm_vcpu *vcpu)
> * they were actually modified by emulation. */
> return RESUME_GUEST_NV;
>
> + case EMULATE_AGAIN:
> + return RESUME_GUEST;
> +
> case EMULATE_DO_DCR:
> run->exit_reason = KVM_EXIT_DCR;
> return RESUME_HOST;
> diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
> index dd2cc03..f692c12 100644
> --- a/arch/powerpc/kvm/e500_mmu_host.c
> +++ b/arch/powerpc/kvm/e500_mmu_host.c
> @@ -606,6 +606,11 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
> }
> }
>
> +int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, bool prev, u32 *instr)
> +{
> + return EMULATE_FAIL;
> +}
> +
> /************* MMU Notifiers *************/
>
> int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
> diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
> index da86d9b..c5c64b6 100644
> --- a/arch/powerpc/kvm/emulate.c
> +++ b/arch/powerpc/kvm/emulate.c
> @@ -224,19 +224,25 @@ static int kvmppc_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
> * from opcode tables in the future. */
> int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
> {
> - u32 inst = kvmppc_get_last_inst(vcpu);
> - int ra = get_ra(inst);
> - int rs = get_rs(inst);
> - int rt = get_rt(inst);
> - int sprn = get_sprn(inst);
> - enum emulation_result emulated = EMULATE_DONE;
> + u32 inst;
> + int ra, rs, rt, sprn;
> + enum emulation_result emulated;
> int advance = 1;
>
> /* this default type might be overwritten by subcategories */
> kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
>
> + emulated = kvmppc_get_last_inst(vcpu, false, &inst);
> + if (emulated != EMULATE_DONE)
> + return emulated;
> +
> pr_debug("Emulating opcode %d / %d\n", get_op(inst), get_xop(inst));
>
> + ra = get_ra(inst);
> + rs = get_rs(inst);
> + rt = get_rt(inst);
> + sprn = get_sprn(inst);
> +
> switch (get_op(inst)) {
> case OP_TRAP:
> #ifdef CONFIG_PPC_BOOK3S
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index bab20f4..1dba84b 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -261,6 +261,9 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
> * actually modified. */
> r = RESUME_GUEST_NV;
> break;
> + case EMULATE_AGAIN:
> + r = RESUME_GUEST;
> + break;
> case EMULATE_DO_MMIO:
> run->exit_reason = KVM_EXIT_MMIO;
> /* We must reload nonvolatiles because "update" load/store
> @@ -270,11 +273,14 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
> r = RESUME_HOST_NV;
> break;
> case EMULATE_FAIL:
> + {
> + u32 last_inst;
> + kvmppc_get_last_inst(vcpu, false, &last_inst);
> /* XXX Deliver Program interrupt to guest. */
> - printk(KERN_EMERG "%s: emulation failed (%08x)\n", __func__,
> - kvmppc_get_last_inst(vcpu));
> + pr_emerg("%s: emulation failed (%08x)\n", __func__, last_inst);
> r = RESUME_HOST;
> break;
> + }
> default:
> WARN_ON(1);
> r = RESUME_GUEST;
^ permalink raw reply
* Device Tree Binding for DSA on P1023RDB
From: Pannirselvam Kanagaratnam @ 2014-06-12 15:36 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/html, Size: 43231 bytes --]
^ permalink raw reply
* Re: [PATCH 4/4 v3] KVM: PPC: Bookehv: Get vcpu's last instruction for emulation
From: Alexander Graf @ 2014-06-12 16:04 UTC (permalink / raw)
To: Mihai Caraman; +Cc: Scott Wood, linuxppc-dev, kvm, kvm-ppc
In-Reply-To: <1401724216-26486-5-git-send-email-mihai.caraman@freescale.com>
On 06/02/2014 05:50 PM, Mihai Caraman wrote:
> On book3e, KVM uses load external pid (lwepx) dedicated instruction to read
> guest last instruction on the exit path. lwepx exceptions (DTLB_MISS, DSI
> and LRAT), generated by loading a guest address, needs to be handled by KVM.
> These exceptions are generated in a substituted guest translation context
> (EPLC[EGS] = 1) from host context (MSR[GS] = 0).
>
> Currently, KVM hooks only interrupts generated from guest context (MSR[GS] = 1),
> doing minimal checks on the fast path to avoid host performance degradation.
> lwepx exceptions originate from host state (MSR[GS] = 0) which implies
> additional checks in DO_KVM macro (beside the current MSR[GS] = 1) by looking
> at the Exception Syndrome Register (ESR[EPID]) and the External PID Load Context
> Register (EPLC[EGS]). Doing this on each Data TLB miss exception is obvious
> too intrusive for the host.
>
> Read guest last instruction from kvmppc_load_last_inst() by searching for the
> physical address and kmap it. This address the TODO for TLB eviction and
> execute-but-not-read entries, and allow us to get rid of lwepx until we are
> able to handle failures.
>
> A simple stress benchmark shows a 1% sys performance degradation compared with
> previous approach (lwepx without failure handling):
>
> time for i in `seq 1 10000`; do /bin/echo > /dev/null; done
>
> real 0m 8.85s
> user 0m 4.34s
> sys 0m 4.48s
>
> vs
>
> real 0m 8.84s
> user 0m 4.36s
> sys 0m 4.44s
>
> An alternative solution, to handle lwepx exceptions in KVM, is to temporary
> highjack the interrupt vector from host. Some cores share host IVOR registers
> between hardware threads, which is the case of FSL e6500, which impose additional
> synchronization logic for this solution to work. This optimized solution can
> be developed later on top of this patch.
>
> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
> ---
> v3:
> - reworked patch description
> - use unaltered kmap addr for kunmap
> - get last instruction before beeing preempted
>
> v2:
> - reworked patch description
> - used pr_* functions
> - addressed cosmetic feedback
>
> arch/powerpc/kvm/booke.c | 32 ++++++++++++
> arch/powerpc/kvm/bookehv_interrupts.S | 37 ++++----------
> arch/powerpc/kvm/e500_mmu_host.c | 93 +++++++++++++++++++++++++++++++++++
> 3 files changed, 134 insertions(+), 28 deletions(-)
>
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 34a42b9..4ef52a8 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -880,6 +880,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
> int r = RESUME_HOST;
> int s;
> int idx;
> + u32 last_inst = KVM_INST_FETCH_FAILED;
> + enum emulation_result emulated = EMULATE_DONE;
>
> /* update before a new last_exit_type is rewritten */
> kvmppc_update_timing_stats(vcpu);
> @@ -887,6 +889,15 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
> /* restart interrupts if they were meant for the host */
> kvmppc_restart_interrupt(vcpu, exit_nr);
>
> + /*
> + * get last instruction before beeing preempted
> + * TODO: for e6500 check also BOOKE_INTERRUPT_LRAT_ERROR & ESR_DATA
> + */
> + if (exit_nr == BOOKE_INTERRUPT_DATA_STORAGE ||
> + exit_nr == BOOKE_INTERRUPT_DTLB_MISS ||
> + exit_nr == BOOKE_INTERRUPT_HV_PRIV)
Please make this a switch() - that's easier to read.
> + emulated = kvmppc_get_last_inst(vcpu, false, &last_inst);
> +
> local_irq_enable();
>
> trace_kvm_exit(exit_nr, vcpu);
> @@ -895,6 +906,26 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
> run->exit_reason = KVM_EXIT_UNKNOWN;
> run->ready_for_interrupt_injection = 1;
>
> + switch (emulated) {
> + case EMULATE_AGAIN:
> + r = RESUME_GUEST;
> + goto out;
> +
> + case EMULATE_FAIL:
> + pr_debug("%s: emulation at %lx failed (%08x)\n",
> + __func__, vcpu->arch.pc, last_inst);
> + /* For debugging, encode the failing instruction and
> + * report it to userspace. */
> + run->hw.hardware_exit_reason = ~0ULL << 32;
> + run->hw.hardware_exit_reason |= last_inst;
> + kvmppc_core_queue_program(vcpu, ESR_PIL);
> + r = RESUME_HOST;
> + goto out;
> +
> + default:
> + break;
> + }
I think you can just put this into a function.
Scott, I think the patch overall looks quite good. Can you please check
as well and if you agree give it your reviewed-by? Mike, when Scott
gives you a reviewed-by, please include it for the next version.
Alex
> +
> switch (exit_nr) {
> case BOOKE_INTERRUPT_MACHINE_CHECK:
> printk("MACHINE CHECK: %lx\n", mfspr(SPRN_MCSR));
> @@ -1184,6 +1215,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
> BUG();
> }
>
> +out:
> /*
> * To avoid clobbering exit_reason, only check for signals if we
> * aren't already exiting to userspace for some other reason.
> diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
> index 6ff4480..e000b39 100644
> --- a/arch/powerpc/kvm/bookehv_interrupts.S
> +++ b/arch/powerpc/kvm/bookehv_interrupts.S
> @@ -121,38 +121,14 @@
> 1:
>
> .if \flags & NEED_EMU
> - /*
> - * This assumes you have external PID support.
> - * To support a bookehv CPU without external PID, you'll
> - * need to look up the TLB entry and create a temporary mapping.
> - *
> - * FIXME: we don't currently handle if the lwepx faults. PR-mode
> - * booke doesn't handle it either. Since Linux doesn't use
> - * broadcast tlbivax anymore, the only way this should happen is
> - * if the guest maps its memory execute-but-not-read, or if we
> - * somehow take a TLB miss in the middle of this entry code and
> - * evict the relevant entry. On e500mc, all kernel lowmem is
> - * bolted into TLB1 large page mappings, and we don't use
> - * broadcast invalidates, so we should not take a TLB miss here.
> - *
> - * Later we'll need to deal with faults here. Disallowing guest
> - * mappings that are execute-but-not-read could be an option on
> - * e500mc, but not on chips with an LRAT if it is used.
> - */
> -
> - mfspr r3, SPRN_EPLC /* will already have correct ELPID and EGS */
> PPC_STL r15, VCPU_GPR(R15)(r4)
> PPC_STL r16, VCPU_GPR(R16)(r4)
> PPC_STL r17, VCPU_GPR(R17)(r4)
> PPC_STL r18, VCPU_GPR(R18)(r4)
> PPC_STL r19, VCPU_GPR(R19)(r4)
> - mr r8, r3
> PPC_STL r20, VCPU_GPR(R20)(r4)
> - rlwimi r8, r6, EPC_EAS_SHIFT - MSR_IR_LG, EPC_EAS
> PPC_STL r21, VCPU_GPR(R21)(r4)
> - rlwimi r8, r6, EPC_EPR_SHIFT - MSR_PR_LG, EPC_EPR
> PPC_STL r22, VCPU_GPR(R22)(r4)
> - rlwimi r8, r10, EPC_EPID_SHIFT, EPC_EPID
> PPC_STL r23, VCPU_GPR(R23)(r4)
> PPC_STL r24, VCPU_GPR(R24)(r4)
> PPC_STL r25, VCPU_GPR(R25)(r4)
> @@ -162,10 +138,15 @@
> PPC_STL r29, VCPU_GPR(R29)(r4)
> PPC_STL r30, VCPU_GPR(R30)(r4)
> PPC_STL r31, VCPU_GPR(R31)(r4)
> - mtspr SPRN_EPLC, r8
> - isync
> - lwepx r9, 0, r5
> - mtspr SPRN_EPLC, r3
> +
> + /*
> + * We don't use external PID support. lwepx faults would need to be
> + * handled by KVM and this implies aditional code in DO_KVM (for
> + * DTB_MISS, DSI and LRAT) to check ESR[EPID] and EPLC[EGS] which
> + * is too intrusive for the host. Get last instuction in
> + * kvmppc_get_last_inst().
> + */
> + li r9, KVM_INST_FETCH_FAILED
> stw r9, VCPU_LAST_INST(r4)
> .endif
>
> diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
> index f692c12..0528fe5 100644
> --- a/arch/powerpc/kvm/e500_mmu_host.c
> +++ b/arch/powerpc/kvm/e500_mmu_host.c
> @@ -606,10 +606,103 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
> }
> }
>
> +#ifdef CONFIG_KVM_BOOKE_HV
> int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, bool prev, u32 *instr)
> {
> + gva_t geaddr;
> + hpa_t addr;
> + hfn_t pfn;
> + hva_t eaddr;
> + u32 mas0, mas1, mas2, mas3;
> + u64 mas7_mas3;
> + struct page *page;
> + unsigned int addr_space, psize_shift;
> + bool pr;
> + unsigned long flags;
> +
> + WARN_ON_ONCE(prev);
> +
> + /* Search TLB for guest pc to get the real address */
> + geaddr = kvmppc_get_pc(vcpu);
> +
> + addr_space = (vcpu->arch.shared->msr & MSR_IS) >> MSR_IR_LG;
> +
> + local_irq_save(flags);
> + mtspr(SPRN_MAS6, (vcpu->arch.pid << MAS6_SPID_SHIFT) | addr_space);
> + mtspr(SPRN_MAS5, MAS5_SGS | vcpu->kvm->arch.lpid);
> + asm volatile("tlbsx 0, %[geaddr]\n" : :
> + [geaddr] "r" (geaddr));
> + mtspr(SPRN_MAS5, 0);
> + mtspr(SPRN_MAS8, 0);
> + mas0 = mfspr(SPRN_MAS0);
> + mas1 = mfspr(SPRN_MAS1);
> + mas2 = mfspr(SPRN_MAS2);
> + mas3 = mfspr(SPRN_MAS3);
> + mas7_mas3 = (((u64) mfspr(SPRN_MAS7)) << 32) | mas3;
> + local_irq_restore(flags);
> +
> + /*
> + * If the TLB entry for guest pc was evicted, return to the guest.
> + * There are high chances to find a valid TLB entry next time.
> + */
> + if (!(mas1 & MAS1_VALID))
> + return EMULATE_AGAIN;
> +
> + /*
> + * Another thread may rewrite the TLB entry in parallel, don't
> + * execute from the address if the execute permission is not set
> + */
> + pr = vcpu->arch.shared->msr & MSR_PR;
> + if ((pr && !(mas3 & MAS3_UX)) || (!pr && !(mas3 & MAS3_SX))) {
> + pr_debug("Instuction emulation from a guest page\n"
> + "withot execute permission\n");
> + return EMULATE_FAIL;
> + }
> +
> + /*
> + * We will map the real address through a cacheable page, so we will
> + * not support cache-inhibited guest pages. Fortunately emulated
> + * instructions should not live there.
> + */
> + if (mas2 & MAS2_I) {
> + pr_debug("Instuction emulation from cache-inhibited\n"
> + "guest pages is not supported\n");
> + return EMULATE_FAIL;
> + }
> +
> + /* Get page size */
> + psize_shift = MAS1_GET_TSIZE(mas1) + 10;
> +
> + /* Map a page and get guest's instruction */
> + addr = (mas7_mas3 & (~0ULL << psize_shift)) |
> + (geaddr & ((1ULL << psize_shift) - 1ULL));
> + pfn = addr >> PAGE_SHIFT;
> +
> + /* Guard us against emulation from devices area */
> + if (unlikely(!page_is_ram(pfn))) {
> + pr_debug("Instruction emulation from non-RAM host\n"
> + "pages is not supported\n");
> + return EMULATE_FAIL;
> + }
> +
> + if (unlikely(!pfn_valid(pfn))) {
> + pr_debug("Invalid frame number\n");
> + return EMULATE_FAIL;
> + }
> +
> + page = pfn_to_page(pfn);
> + eaddr = (unsigned long)kmap_atomic(page);
> + *instr = *(u32 *)(eaddr | (addr & ~PAGE_MASK));
> + kunmap_atomic((u32 *)eaddr);
> +
> + return EMULATE_DONE;
> +}
> +#else
> +int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, u32 *instr)
> +{
> return EMULATE_FAIL;
> }
> +#endif
>
> /************* MMU Notifiers *************/
>
^ permalink raw reply
* Re: [PATCH] KVM: PPC: e500mc: Relax tlb invalidation condition on vcpu schedule
From: Alexander Graf @ 2014-06-12 17:04 UTC (permalink / raw)
To: Mihai Caraman; +Cc: Scott Wood, linuxppc-dev, kvm, kvm-ppc
In-Reply-To: <1402581610-16585-1-git-send-email-mihai.caraman@freescale.com>
On 06/12/2014 04:00 PM, Mihai Caraman wrote:
> On vcpu schedule, the condition checked for tlb pollution is too tight.
> The tlb entries of one vcpu are polluted when a different vcpu from the
> same partition runs in-between. Relax the current tlb invalidation
> condition taking into account the lpid.
>
> Signed-off-by: Mihai Caraman <mihai.caraman <at> freescale.com>
Your mailer is broken? :)
This really should be an @.
I think this should work. Scott, please ack.
Alex
> Cc: Scott Wood <scottwood <at> freescale.com>
> ---
> arch/powerpc/kvm/e500mc.c | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
> index 17e4562..2e0cd69 100644
> --- a/arch/powerpc/kvm/e500mc.c
> +++ b/arch/powerpc/kvm/e500mc.c
> @@ -111,10 +111,12 @@ void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr)
> }
>
> static DEFINE_PER_CPU(struct kvm_vcpu *, last_vcpu_on_cpu);
> +static DEFINE_PER_CPU(int, last_lpid_on_cpu);
>
> static void kvmppc_core_vcpu_load_e500mc(struct kvm_vcpu *vcpu, int cpu)
> {
> struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
> + bool update_last = false, inval_tlb = false;
>
> kvmppc_booke_vcpu_load(vcpu, cpu);
>
> @@ -140,12 +142,24 @@ static void kvmppc_core_vcpu_load_e500mc(struct kvm_vcpu *vcpu, int cpu)
> mtspr(SPRN_GDEAR, vcpu->arch.shared->dar);
> mtspr(SPRN_GESR, vcpu->arch.shared->esr);
>
> - if (vcpu->arch.oldpir != mfspr(SPRN_PIR) ||
> - __get_cpu_var(last_vcpu_on_cpu) != vcpu) {
> - kvmppc_e500_tlbil_all(vcpu_e500);
> + if (vcpu->arch.oldpir != mfspr(SPRN_PIR)) {
> + /* tlb entries deprecated */
> + inval_tlb = update_last = true;
> + } else if (__get_cpu_var(last_vcpu_on_cpu) != vcpu) {
> + update_last = true;
> + /* tlb entries polluted */
> + inval_tlb = __get_cpu_var(last_lpid_on_cpu) ==
> + vcpu->kvm->arch.lpid;
> + }
> +
> + if (update_last) {
> __get_cpu_var(last_vcpu_on_cpu) = vcpu;
> + __get_cpu_var(last_lpid_on_cpu) = vcpu->kvm->arch.lpid;
> }
>
> + if (inval_tlb)
> + kvmppc_e500_tlbil_all(vcpu_e500);
> +
> kvmppc_load_guest_fp(vcpu);
> }
>
^ permalink raw reply
* Re: Device Tree Binding for DSA on P1023RDB
From: Scott Wood @ 2014-06-12 21:21 UTC (permalink / raw)
To: Pannirselvam Kanagaratnam; +Cc: linuxppc-dev
In-Reply-To: <5399C8F2.8060108@xsmail.com>
On Thu, 2014-06-12 at 23:36 +0800, Pannirselvam Kanagaratnam wrote:
> The QORIQ P1023RDB has an option to populate the Marvell 88E6165
> Ethernet switch. We populated this device and was able to initialize
> it as a basic switch in U-Boot. However, the switch driver was not
> loaded upon kernel bootup. DSA kernel config was enabled for the
> 88E6165. The following patch was applied:
>
>
> http://patchwork.ozlabs.org/patch/230257/
>
>
> The switch is attached to phy address 0x3 via dtsec2. My dts file is
> as below. Would appreciate any feedback on whether the DSA is
> correctly structured in the dts.
If you have a dtsec driver you're not working with an upstream kernel
(or you've ported a lot of SDK code to it)... What tree are you working
with? Are there prerequisites to the above patch that you might be
missing?
The above patch is a platform driver and you put the node in the
toplevel device tree node. Have you added marvell,dsa to the list of
compatible strings that get probed (of_device_ids in corenet_generic.c
or an equivalent list in your SDK kernel)?
>
> dsa@0 {
> compatible = "marvell,dsa";
> #address-cells = <2>;
> #size-cells = <0>;
>
> interrupts = <3>;
This interrupts property needs to be four cells rather than one, if MPIC
is the parent -- assuming you have #interrupt-cells = <4> and not some
old device tree with #interrupt-cells = <2>, but in any case you need
more than one cell.
-Scott
^ permalink raw reply
* Re: power and percpu: Could we move the paca into the percpu area?
From: Benjamin Herrenschmidt @ 2014-06-12 21:57 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Tejun Heo, linuxppc-dev, Christoph Lameter
In-Reply-To: <20140612122639.GA17838@gate.crashing.org>
On Thu, 2014-06-12 at 07:26 -0500, Segher Boessenkool wrote:
> But, indeed, it does look like GCC doesn't use it. It seems to me
> that
> some ABI forbade userland (or non-libraries or whatever) from using
> it.
> I'll see what I can find out.
I can still use -ffixed-cr5 for safety no ?
Cheers,
Ben.
^ permalink raw reply
* Re: powerpc/ppc64: Allow allmodconfig to build (finally !)
From: Benjamin Herrenschmidt @ 2014-06-12 21:57 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linuxppc-dev
In-Reply-To: <20140612122644.GA17249@roeck-us.net>
On Thu, 2014-06-12 at 05:26 -0700, Guenter Roeck wrote:
> what happened with this patch ?
Well it breaks with that binutils version of yours ... I'm trying to fix
it in a better way but it's a mess... still working on it.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
From: Benjamin Herrenschmidt @ 2014-06-12 22:03 UTC (permalink / raw)
To: Steve Munroe
Cc: linuxppc-dev, Adhemerval Zanella, Michael J Wolf,
Hanns-Joachim Uhl
In-Reply-To: <OF26AC1193.59958340-ON85257CF5.00528030-86257CF5.0053A37D@us.ibm.com>
On Thu, 2014-06-12 at 10:13 -0500, Steve Munroe wrote:
> The precedent we have used is that features that refer to ISA Categories include _HAS_ following the PPC_FEATURE[2]. So GLIBC specifies in hwcap.h:
>
> /* Feature definitions in AT_HWCAP2. */
> #define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */
> #define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional
> Memory */
> #define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control
> Register */
> #define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */
> #define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */
> #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */
>
> This was carried from the original AT_HWCAP defines.
Off, they don't have the "HAS" in the kernel definitions...
> $ grep _HAS_ ./sysdeps/powerpc/bits/hwcap.h
> #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 /* SIMD/Vector Unit. */
> #define PPC_FEATURE_HAS_FPU 0x08000000 /* Floating Point Unit. */
> #define PPC_FEATURE_HAS_MMU 0x04000000 /* Memory Management Unit. */
> #define PPC_FEATURE_HAS_4xxMAC 0x02000000 /* 4xx Multiply Accumulator. */
> #define PPC_FEATURE_HAS_SPE 0x00800000 /* Signal Processing ext. */
> #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */
> #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
> #define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
> #define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
>
> So could we agree on PPC_FEATURE2_HAS_VEC_CRYPTO or the shorter PPC_FEATURE2_HAS_VCRYPTO?
Well, I made it consistent with the other HWCAP2 bits exposed by the
kernel which seem to differ from the glibc versions :-(
In any case, I've merged it but I can do a follow up patch that adds
the _HAS_ everywhere, hopefully nobody in userspace use the kernel
definition and they use the glibc one instead.
In that case, go for VCRYPTO.
Cheers,
Ben.
> Steven J. Munroe
> Linux on Power Toolchain Architect
> IBM Corporation, Linux Technology Center
>
>
> Inactive hide details for Benjamin Herrenschmidt ---06/10/2014 12:05:07 AM---The Vector Crypto category instructions are supporBenjamin Herrenschmidt ---06/10/2014 12:05:07 AM---The Vector Crypto category instructions are supported by current POWER8 chips, advertise them to use
>
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> To: linuxppc-dev@ozlabs.org
> Cc: Steve Munroe/Rochester/IBM@IBMUS, Hanns-Joachim Uhl <hannsj_uhl@de.ibm.com>, Diane Brent/Poughkeepsie/IBM@IBMUS, Jeffrey Scheel/Rochester/IBM@IBMUS, Adhemerval Zanella <azanella@linux.vnet.ibm.com>
> Date: 06/10/2014 12:05 AM
> Subject: [PATCH] powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
>
>
>
> ______________________________________________________________________
>
>
>
> The Vector Crypto category instructions are supported by current POWER8
> chips, advertise them to userspace using a specific bit to properly
> differentiate with chips of the same architecture level that might not
> have them.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: <stable@vger.kernel.org> [v3.10+]
> --
>
> diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h
> index 5b76579..de2c0e4 100644
> --- a/arch/powerpc/include/uapi/asm/cputable.h
> +++ b/arch/powerpc/include/uapi/asm/cputable.h
> @@ -41,5 +41,6 @@
> #define PPC_FEATURE2_EBB 0x10000000
> #define PPC_FEATURE2_ISEL 0x08000000
> #define PPC_FEATURE2_TAR 0x04000000
> +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
>
> #endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index c1faade..11da04a 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -109,7 +109,8 @@ extern void __restore_cpu_e6500(void);
> PPC_FEATURE_PSERIES_PERFMON_COMPAT)
> #define COMMON_USER2_POWER8 (PPC_FEATURE2_ARCH_2_07 | \
> PPC_FEATURE2_HTM_COMP | PPC_FEATURE2_DSCR | \
> - PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR)
> + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \
> + PPC_FEATURE2_VEC_CRYPTO)
> #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
> PPC_FEATURE_TRUE_LE | \
> PPC_FEATURE_HAS_ALTIVEC_COMP)
>
>
>
^ permalink raw reply
* Re: power and percpu: Could we move the paca into the percpu area?
From: Segher Boessenkool @ 2014-06-12 22:15 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Tejun Heo, linuxppc-dev, Christoph Lameter
In-Reply-To: <1402610228.14780.84.camel@pasglop>
On Fri, Jun 13, 2014 at 07:57:08AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2014-06-12 at 07:26 -0500, Segher Boessenkool wrote:
> > But, indeed, it does look like GCC doesn't use it. It seems to me
> > that
> > some ABI forbade userland (or non-libraries or whatever) from using
> > it.
> > I'll see what I can find out.
>
> I can still use -ffixed-cr5 for safety no ?
Yes, definitely, and in fact you have to if GCC changes to not have cr5
fixed by default (which may or may not happen). It will be good
documentation in either case :-)
Segher
^ permalink raw reply
* Re: powerpc/ppc64: Allow allmodconfig to build (finally !)
From: Guenter Roeck @ 2014-06-12 22:17 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1402610268.14780.85.camel@pasglop>
On 06/12/2014 02:57 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2014-06-12 at 05:26 -0700, Guenter Roeck wrote:
>> what happened with this patch ?
>
> Well it breaks with that binutils version of yours ... I'm trying to fix
> it in a better way but it's a mess... still working on it.
>
I updated my binutils since then, though, and the other problem I encountered
(with the changed ABI) has been fixed. As it is, I'd prefer to have the patch
applied, but I can understand if you don't want to apply it in case others
hit the problem I had.
Guenter
^ permalink raw reply
* [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2014-06-13 0:55 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, Linux Kernel list
Hi Linus !
Here are the remaining bits I was mentioning earlier. Mostly bug fixes
and new selftests from Michael (yay !). He also removed the WSP platform
and A2 core support which were dead before release, so less clutter.
One little "feature" I snuck in is the doorbell IPI support for
non-virtualized P8 which speeds up IPIs significantly between threads
of a core.
Cheers,
Ben.
The following changes since commit dfb945473ae8528fd885607b6fa843c676745e0c:
Merge git://www.linux-watchdog.org/linux-watchdog (2014-06-10 19:16:36 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next
for you to fetch changes up to ad718622ab6d500c870772b1b8dda46fa2195e6d:
powerpc/book3s: Fix some ABIv2 issues in machine check code (2014-06-12 09:41:33 +1000)
----------------------------------------------------------------
Anton Blanchard (4):
powernv: Fix permissions on sysparam sysfs entries
crypto/nx: disable NX on little endian builds
powerpc/powernv: Reduce panic timeout from 180s to 10s
powerpc/book3s: Fix some ABIv2 issues in machine check code
Benjamin Herrenschmidt (1):
powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
Dan Carpenter (2):
powerpc/cpm: Remove duplicate FCC_GFMR_TTX define
powerpc/spufs: Remove duplicate SPUFS_CNTL_MAP_SIZE define
Gavin Shan (5):
powerpc/eeh: Clear frozen state for child PE
powerpc/eeh: Report frozen parent PE prior to child PE
powerpc/powernv: Don't escalate non-existing frozen PE
powerpc/powernv: Fix killed EEH event
powerpc/eeh: Dump PE location code
Guo Chao (1):
powerpc/powernv: Fix endianness problems in EEH
Joel Stanley (1):
powerpc/powernv: Fix reading of OPAL msglog
Kees Cook (1):
powerpc/xmon: avoid format string leaking to printk
Mahesh Salgaonkar (4):
powerpc/book3s: Fix machine check handling for unhandled errors
powerpc/book3s: Add stack overflow check in machine check handler.
powerpc/book3s: Increment the mce counter during machine_check_early call.
powerpc/book3s: Fix guest MC delivery mechanism to avoid soft lockups in guest.
Michael Ellerman (6):
powerpc: Remove platforms/wsp and associated pieces
powerpc/perf: Ensure all EBB register state is cleared on fork()
selftests/powerpc: Fix instruction loop for ABIv2 (LE)
selftests/powerpc: Put the test in a separate process group
selftests/powerpc: Add support for skipping tests
selftests/powerpc: Add tests of PMU EBBs
Michael Neuling (3):
powerpc: Don't setup CPUs with bad status
powerpc/cpuidle: Only clear LPCR decrementer wakeup bit on fast sleep entry
powerpc/powernv: Enable POWER8 doorbell IPIs
Paul Bolle (3):
powerpc: Remove check for CONFIG_SERIAL_TEXT_DEBUG
powerpc: fix typo 'CONFIG_PPC_CPU'
powerpc: fix typo 'CONFIG_PMAC'
Sam bobroff (1):
powerpc: Correct DSCR during TM context switch
Shreyas B. Prabhu (2):
powerpc/powernv: Include asm/smp.h to fix UP build failure
powerpc/powernv : Disable subcore for UP configs
arch/powerpc/Kconfig.debug | 5 -
arch/powerpc/configs/chroma_defconfig | 307 ------
arch/powerpc/include/asm/cpm2.h | 1 -
arch/powerpc/include/asm/eeh.h | 1 +
arch/powerpc/include/asm/eeh_event.h | 2 +-
arch/powerpc/include/asm/mmu-book3e.h | 4 -
arch/powerpc/include/asm/opal.h | 102 +-
arch/powerpc/include/asm/reg_a2.h | 9 -
arch/powerpc/include/asm/switch_to.h | 8 +-
arch/powerpc/include/asm/wsp.h | 14 -
arch/powerpc/include/uapi/asm/cputable.h | 1 +
arch/powerpc/kernel/Makefile | 1 -
arch/powerpc/kernel/cpu_setup_a2.S | 120 ---
arch/powerpc/kernel/cpu_setup_power.S | 2 +
arch/powerpc/kernel/cputable.c | 41 +-
arch/powerpc/kernel/eeh.c | 38 +-
arch/powerpc/kernel/eeh_driver.c | 24 +-
arch/powerpc/kernel/eeh_event.c | 21 +-
arch/powerpc/kernel/eeh_pe.c | 60 ++
arch/powerpc/kernel/entry_64.S | 6 -
arch/powerpc/kernel/exceptions-64e.S | 16 -
arch/powerpc/kernel/exceptions-64s.S | 64 +-
arch/powerpc/kernel/head_40x.S | 19 -
arch/powerpc/kernel/process.c | 8 +-
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/kernel/time.c | 2 +-
arch/powerpc/kernel/traps.c | 2 +
arch/powerpc/kernel/udbg.c | 2 -
arch/powerpc/kernel/udbg_16550.c | 11 -
arch/powerpc/kvm/book3s_hv_ras.c | 15 +-
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 19 +-
arch/powerpc/lib/sstep.c | 2 +-
arch/powerpc/platforms/Kconfig | 1 -
arch/powerpc/platforms/Kconfig.cputype | 6 +-
arch/powerpc/platforms/Makefile | 1 -
arch/powerpc/platforms/cell/spufs/spufs.h | 1 -
arch/powerpc/platforms/powernv/Kconfig | 1 +
arch/powerpc/platforms/powernv/Makefile | 4 +-
arch/powerpc/platforms/powernv/eeh-ioda.c | 109 +-
arch/powerpc/platforms/powernv/opal-msglog.c | 6 +-
arch/powerpc/platforms/powernv/opal-sysparam.c | 4 +-
arch/powerpc/platforms/powernv/pci.c | 81 +-
arch/powerpc/platforms/powernv/setup.c | 3 +
arch/powerpc/platforms/powernv/smp.c | 6 +
arch/powerpc/platforms/pseries/Kconfig | 1 +
arch/powerpc/platforms/wsp/Kconfig | 30 -
arch/powerpc/platforms/wsp/Makefile | 10 -
arch/powerpc/platforms/wsp/chroma.c | 56 -
arch/powerpc/platforms/wsp/h8.c | 135 ---
arch/powerpc/platforms/wsp/ics.c | 762 -------------
arch/powerpc/platforms/wsp/ics.h | 25 -
arch/powerpc/platforms/wsp/msi.c | 102 --
arch/powerpc/platforms/wsp/msi.h | 19 -
arch/powerpc/platforms/wsp/opb_pic.c | 321 ------
arch/powerpc/platforms/wsp/psr2.c | 67 --
arch/powerpc/platforms/wsp/scom_smp.c | 435 --------
arch/powerpc/platforms/wsp/scom_wsp.c | 82 --
arch/powerpc/platforms/wsp/setup.c | 36 -
arch/powerpc/platforms/wsp/smp.c | 88 --
arch/powerpc/platforms/wsp/wsp.c | 117 --
arch/powerpc/platforms/wsp/wsp.h | 29 -
arch/powerpc/platforms/wsp/wsp_pci.c | 1134 --------------------
arch/powerpc/platforms/wsp/wsp_pci.h | 268 -----
arch/powerpc/sysdev/xics/icp-native.c | 9 +-
arch/powerpc/xmon/nonstdio.c | 2 +-
drivers/cpuidle/cpuidle-powernv.c | 8 +-
drivers/crypto/Kconfig | 2 +-
tools/testing/selftests/powerpc/Makefile | 2 +-
tools/testing/selftests/powerpc/harness.c | 15 +-
tools/testing/selftests/powerpc/pmu/Makefile | 26 +-
tools/testing/selftests/powerpc/pmu/ebb/Makefile | 32 +
.../powerpc/pmu/ebb/back_to_back_ebbs_test.c | 106 ++
.../powerpc/pmu/ebb/close_clears_pmcc_test.c | 59 +
.../powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test.c | 93 ++
.../powerpc/pmu/ebb/cpu_event_vs_ebb_test.c | 89 ++
.../selftests/powerpc/pmu/ebb/cycles_test.c | 58 +
.../powerpc/pmu/ebb/cycles_with_freeze_test.c | 117 ++
tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 727 +++++++++++++
tools/testing/selftests/powerpc/pmu/ebb/ebb.h | 78 ++
.../selftests/powerpc/pmu/ebb/ebb_handler.S | 365 +++++++
.../selftests/powerpc/pmu/ebb/ebb_on_child_test.c | 86 ++
.../powerpc/pmu/ebb/ebb_on_willing_child_test.c | 92 ++
.../powerpc/pmu/ebb/ebb_vs_cpu_event_test.c | 86 ++
.../powerpc/pmu/ebb/event_attributes_test.c | 131 +++
.../powerpc/pmu/ebb/fixed_instruction_loop.S | 43 +
.../selftests/powerpc/pmu/ebb/fork_cleanup_test.c | 79 ++
.../powerpc/pmu/ebb/instruction_count_test.c | 164 +++
.../powerpc/pmu/ebb/lost_exception_test.c | 100 ++
.../selftests/powerpc/pmu/ebb/multi_counter_test.c | 91 ++
.../powerpc/pmu/ebb/multi_ebb_procs_test.c | 109 ++
.../selftests/powerpc/pmu/ebb/no_handler_test.c | 61 ++
.../selftests/powerpc/pmu/ebb/pmae_handling_test.c | 106 ++
.../powerpc/pmu/ebb/pmc56_overflow_test.c | 93 ++
tools/testing/selftests/powerpc/pmu/ebb/reg.h | 49 +
.../selftests/powerpc/pmu/ebb/reg_access_test.c | 39 +
.../pmu/ebb/task_event_pinned_vs_ebb_test.c | 91 ++
.../powerpc/pmu/ebb/task_event_vs_ebb_test.c | 83 ++
tools/testing/selftests/powerpc/pmu/ebb/trace.c | 300 ++++++
tools/testing/selftests/powerpc/pmu/ebb/trace.h | 41 +
tools/testing/selftests/powerpc/pmu/event.c | 26 +
tools/testing/selftests/powerpc/pmu/event.h | 4 +
tools/testing/selftests/powerpc/pmu/lib.c | 252 +++++
tools/testing/selftests/powerpc/pmu/lib.h | 41 +
tools/testing/selftests/powerpc/pmu/loop.S | 73 +-
tools/testing/selftests/powerpc/subunit.h | 5 +
tools/testing/selftests/powerpc/tm/Makefile | 15 +
.../testing/selftests/powerpc/tm/tm-resched-dscr.c | 90 ++
tools/testing/selftests/powerpc/utils.h | 12 +
108 files changed, 4514 insertions(+), 4505 deletions(-)
delete mode 100644 arch/powerpc/configs/chroma_defconfig
delete mode 100644 arch/powerpc/include/asm/wsp.h
delete mode 100644 arch/powerpc/kernel/cpu_setup_a2.S
delete mode 100644 arch/powerpc/platforms/wsp/Kconfig
delete mode 100644 arch/powerpc/platforms/wsp/Makefile
delete mode 100644 arch/powerpc/platforms/wsp/chroma.c
delete mode 100644 arch/powerpc/platforms/wsp/h8.c
delete mode 100644 arch/powerpc/platforms/wsp/ics.c
delete mode 100644 arch/powerpc/platforms/wsp/ics.h
delete mode 100644 arch/powerpc/platforms/wsp/msi.c
delete mode 100644 arch/powerpc/platforms/wsp/msi.h
delete mode 100644 arch/powerpc/platforms/wsp/opb_pic.c
delete mode 100644 arch/powerpc/platforms/wsp/psr2.c
delete mode 100644 arch/powerpc/platforms/wsp/scom_smp.c
delete mode 100644 arch/powerpc/platforms/wsp/scom_wsp.c
delete mode 100644 arch/powerpc/platforms/wsp/setup.c
delete mode 100644 arch/powerpc/platforms/wsp/smp.c
delete mode 100644 arch/powerpc/platforms/wsp/wsp.c
delete mode 100644 arch/powerpc/platforms/wsp/wsp.h
delete mode 100644 arch/powerpc/platforms/wsp/wsp_pci.c
delete mode 100644 arch/powerpc/platforms/wsp/wsp_pci.h
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/Makefile
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/back_to_back_ebbs_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/close_clears_pmcc_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cpu_event_vs_ebb_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cycles_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cycles_with_freeze_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb.h
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_handler.S
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_on_child_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_on_willing_child_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_vs_cpu_event_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/event_attributes_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/fixed_instruction_loop.S
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/fork_cleanup_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/lost_exception_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/multi_counter_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/multi_ebb_procs_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/pmae_handling_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/reg.h
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/reg_access_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/task_event_pinned_vs_ebb_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/task_event_vs_ebb_test.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/trace.c
create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/trace.h
create mode 100644 tools/testing/selftests/powerpc/pmu/lib.c
create mode 100644 tools/testing/selftests/powerpc/pmu/lib.h
create mode 100644 tools/testing/selftests/powerpc/tm/Makefile
create mode 100644 tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2014-06-13 0:56 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, Linux Kernel list
In-Reply-To: <1402620918.14780.102.camel@pasglop>
On Fri, 2014-06-13 at 10:55 +1000, Benjamin Herrenschmidt wrote:
> Hi Linus !
Sending a copy via IBM just in case gmail has an issue with pull
requests :-) If it goes through fine I'll stop doing it.
Cheers,
Ben.
> Here are the remaining bits I was mentioning earlier. Mostly bug fixes
> and new selftests from Michael (yay !). He also removed the WSP platform
> and A2 core support which were dead before release, so less clutter.
>
> One little "feature" I snuck in is the doorbell IPI support for
> non-virtualized P8 which speeds up IPIs significantly between threads
> of a core.
>
> Cheers,
> Ben.
>
> The following changes since commit dfb945473ae8528fd885607b6fa843c676745e0c:
>
> Merge git://www.linux-watchdog.org/linux-watchdog (2014-06-10 19:16:36 -0700)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next
>
> for you to fetch changes up to ad718622ab6d500c870772b1b8dda46fa2195e6d:
>
> powerpc/book3s: Fix some ABIv2 issues in machine check code (2014-06-12 09:41:33 +1000)
>
> ----------------------------------------------------------------
> Anton Blanchard (4):
> powernv: Fix permissions on sysparam sysfs entries
> crypto/nx: disable NX on little endian builds
> powerpc/powernv: Reduce panic timeout from 180s to 10s
> powerpc/book3s: Fix some ABIv2 issues in machine check code
>
> Benjamin Herrenschmidt (1):
> powerpc: Add AT_HWCAP2 to indicate V.CRYPTO category support
>
> Dan Carpenter (2):
> powerpc/cpm: Remove duplicate FCC_GFMR_TTX define
> powerpc/spufs: Remove duplicate SPUFS_CNTL_MAP_SIZE define
>
> Gavin Shan (5):
> powerpc/eeh: Clear frozen state for child PE
> powerpc/eeh: Report frozen parent PE prior to child PE
> powerpc/powernv: Don't escalate non-existing frozen PE
> powerpc/powernv: Fix killed EEH event
> powerpc/eeh: Dump PE location code
>
> Guo Chao (1):
> powerpc/powernv: Fix endianness problems in EEH
>
> Joel Stanley (1):
> powerpc/powernv: Fix reading of OPAL msglog
>
> Kees Cook (1):
> powerpc/xmon: avoid format string leaking to printk
>
> Mahesh Salgaonkar (4):
> powerpc/book3s: Fix machine check handling for unhandled errors
> powerpc/book3s: Add stack overflow check in machine check handler.
> powerpc/book3s: Increment the mce counter during machine_check_early call.
> powerpc/book3s: Fix guest MC delivery mechanism to avoid soft lockups in guest.
>
> Michael Ellerman (6):
> powerpc: Remove platforms/wsp and associated pieces
> powerpc/perf: Ensure all EBB register state is cleared on fork()
> selftests/powerpc: Fix instruction loop for ABIv2 (LE)
> selftests/powerpc: Put the test in a separate process group
> selftests/powerpc: Add support for skipping tests
> selftests/powerpc: Add tests of PMU EBBs
>
> Michael Neuling (3):
> powerpc: Don't setup CPUs with bad status
> powerpc/cpuidle: Only clear LPCR decrementer wakeup bit on fast sleep entry
> powerpc/powernv: Enable POWER8 doorbell IPIs
>
> Paul Bolle (3):
> powerpc: Remove check for CONFIG_SERIAL_TEXT_DEBUG
> powerpc: fix typo 'CONFIG_PPC_CPU'
> powerpc: fix typo 'CONFIG_PMAC'
>
> Sam bobroff (1):
> powerpc: Correct DSCR during TM context switch
>
> Shreyas B. Prabhu (2):
> powerpc/powernv: Include asm/smp.h to fix UP build failure
> powerpc/powernv : Disable subcore for UP configs
>
> arch/powerpc/Kconfig.debug | 5 -
> arch/powerpc/configs/chroma_defconfig | 307 ------
> arch/powerpc/include/asm/cpm2.h | 1 -
> arch/powerpc/include/asm/eeh.h | 1 +
> arch/powerpc/include/asm/eeh_event.h | 2 +-
> arch/powerpc/include/asm/mmu-book3e.h | 4 -
> arch/powerpc/include/asm/opal.h | 102 +-
> arch/powerpc/include/asm/reg_a2.h | 9 -
> arch/powerpc/include/asm/switch_to.h | 8 +-
> arch/powerpc/include/asm/wsp.h | 14 -
> arch/powerpc/include/uapi/asm/cputable.h | 1 +
> arch/powerpc/kernel/Makefile | 1 -
> arch/powerpc/kernel/cpu_setup_a2.S | 120 ---
> arch/powerpc/kernel/cpu_setup_power.S | 2 +
> arch/powerpc/kernel/cputable.c | 41 +-
> arch/powerpc/kernel/eeh.c | 38 +-
> arch/powerpc/kernel/eeh_driver.c | 24 +-
> arch/powerpc/kernel/eeh_event.c | 21 +-
> arch/powerpc/kernel/eeh_pe.c | 60 ++
> arch/powerpc/kernel/entry_64.S | 6 -
> arch/powerpc/kernel/exceptions-64e.S | 16 -
> arch/powerpc/kernel/exceptions-64s.S | 64 +-
> arch/powerpc/kernel/head_40x.S | 19 -
> arch/powerpc/kernel/process.c | 8 +-
> arch/powerpc/kernel/setup-common.c | 2 +-
> arch/powerpc/kernel/time.c | 2 +-
> arch/powerpc/kernel/traps.c | 2 +
> arch/powerpc/kernel/udbg.c | 2 -
> arch/powerpc/kernel/udbg_16550.c | 11 -
> arch/powerpc/kvm/book3s_hv_ras.c | 15 +-
> arch/powerpc/kvm/book3s_hv_rmhandlers.S | 19 +-
> arch/powerpc/lib/sstep.c | 2 +-
> arch/powerpc/platforms/Kconfig | 1 -
> arch/powerpc/platforms/Kconfig.cputype | 6 +-
> arch/powerpc/platforms/Makefile | 1 -
> arch/powerpc/platforms/cell/spufs/spufs.h | 1 -
> arch/powerpc/platforms/powernv/Kconfig | 1 +
> arch/powerpc/platforms/powernv/Makefile | 4 +-
> arch/powerpc/platforms/powernv/eeh-ioda.c | 109 +-
> arch/powerpc/platforms/powernv/opal-msglog.c | 6 +-
> arch/powerpc/platforms/powernv/opal-sysparam.c | 4 +-
> arch/powerpc/platforms/powernv/pci.c | 81 +-
> arch/powerpc/platforms/powernv/setup.c | 3 +
> arch/powerpc/platforms/powernv/smp.c | 6 +
> arch/powerpc/platforms/pseries/Kconfig | 1 +
> arch/powerpc/platforms/wsp/Kconfig | 30 -
> arch/powerpc/platforms/wsp/Makefile | 10 -
> arch/powerpc/platforms/wsp/chroma.c | 56 -
> arch/powerpc/platforms/wsp/h8.c | 135 ---
> arch/powerpc/platforms/wsp/ics.c | 762 -------------
> arch/powerpc/platforms/wsp/ics.h | 25 -
> arch/powerpc/platforms/wsp/msi.c | 102 --
> arch/powerpc/platforms/wsp/msi.h | 19 -
> arch/powerpc/platforms/wsp/opb_pic.c | 321 ------
> arch/powerpc/platforms/wsp/psr2.c | 67 --
> arch/powerpc/platforms/wsp/scom_smp.c | 435 --------
> arch/powerpc/platforms/wsp/scom_wsp.c | 82 --
> arch/powerpc/platforms/wsp/setup.c | 36 -
> arch/powerpc/platforms/wsp/smp.c | 88 --
> arch/powerpc/platforms/wsp/wsp.c | 117 --
> arch/powerpc/platforms/wsp/wsp.h | 29 -
> arch/powerpc/platforms/wsp/wsp_pci.c | 1134 --------------------
> arch/powerpc/platforms/wsp/wsp_pci.h | 268 -----
> arch/powerpc/sysdev/xics/icp-native.c | 9 +-
> arch/powerpc/xmon/nonstdio.c | 2 +-
> drivers/cpuidle/cpuidle-powernv.c | 8 +-
> drivers/crypto/Kconfig | 2 +-
> tools/testing/selftests/powerpc/Makefile | 2 +-
> tools/testing/selftests/powerpc/harness.c | 15 +-
> tools/testing/selftests/powerpc/pmu/Makefile | 26 +-
> tools/testing/selftests/powerpc/pmu/ebb/Makefile | 32 +
> .../powerpc/pmu/ebb/back_to_back_ebbs_test.c | 106 ++
> .../powerpc/pmu/ebb/close_clears_pmcc_test.c | 59 +
> .../powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test.c | 93 ++
> .../powerpc/pmu/ebb/cpu_event_vs_ebb_test.c | 89 ++
> .../selftests/powerpc/pmu/ebb/cycles_test.c | 58 +
> .../powerpc/pmu/ebb/cycles_with_freeze_test.c | 117 ++
> tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 727 +++++++++++++
> tools/testing/selftests/powerpc/pmu/ebb/ebb.h | 78 ++
> .../selftests/powerpc/pmu/ebb/ebb_handler.S | 365 +++++++
> .../selftests/powerpc/pmu/ebb/ebb_on_child_test.c | 86 ++
> .../powerpc/pmu/ebb/ebb_on_willing_child_test.c | 92 ++
> .../powerpc/pmu/ebb/ebb_vs_cpu_event_test.c | 86 ++
> .../powerpc/pmu/ebb/event_attributes_test.c | 131 +++
> .../powerpc/pmu/ebb/fixed_instruction_loop.S | 43 +
> .../selftests/powerpc/pmu/ebb/fork_cleanup_test.c | 79 ++
> .../powerpc/pmu/ebb/instruction_count_test.c | 164 +++
> .../powerpc/pmu/ebb/lost_exception_test.c | 100 ++
> .../selftests/powerpc/pmu/ebb/multi_counter_test.c | 91 ++
> .../powerpc/pmu/ebb/multi_ebb_procs_test.c | 109 ++
> .../selftests/powerpc/pmu/ebb/no_handler_test.c | 61 ++
> .../selftests/powerpc/pmu/ebb/pmae_handling_test.c | 106 ++
> .../powerpc/pmu/ebb/pmc56_overflow_test.c | 93 ++
> tools/testing/selftests/powerpc/pmu/ebb/reg.h | 49 +
> .../selftests/powerpc/pmu/ebb/reg_access_test.c | 39 +
> .../pmu/ebb/task_event_pinned_vs_ebb_test.c | 91 ++
> .../powerpc/pmu/ebb/task_event_vs_ebb_test.c | 83 ++
> tools/testing/selftests/powerpc/pmu/ebb/trace.c | 300 ++++++
> tools/testing/selftests/powerpc/pmu/ebb/trace.h | 41 +
> tools/testing/selftests/powerpc/pmu/event.c | 26 +
> tools/testing/selftests/powerpc/pmu/event.h | 4 +
> tools/testing/selftests/powerpc/pmu/lib.c | 252 +++++
> tools/testing/selftests/powerpc/pmu/lib.h | 41 +
> tools/testing/selftests/powerpc/pmu/loop.S | 73 +-
> tools/testing/selftests/powerpc/subunit.h | 5 +
> tools/testing/selftests/powerpc/tm/Makefile | 15 +
> .../testing/selftests/powerpc/tm/tm-resched-dscr.c | 90 ++
> tools/testing/selftests/powerpc/utils.h | 12 +
> 108 files changed, 4514 insertions(+), 4505 deletions(-)
> delete mode 100644 arch/powerpc/configs/chroma_defconfig
> delete mode 100644 arch/powerpc/include/asm/wsp.h
> delete mode 100644 arch/powerpc/kernel/cpu_setup_a2.S
> delete mode 100644 arch/powerpc/platforms/wsp/Kconfig
> delete mode 100644 arch/powerpc/platforms/wsp/Makefile
> delete mode 100644 arch/powerpc/platforms/wsp/chroma.c
> delete mode 100644 arch/powerpc/platforms/wsp/h8.c
> delete mode 100644 arch/powerpc/platforms/wsp/ics.c
> delete mode 100644 arch/powerpc/platforms/wsp/ics.h
> delete mode 100644 arch/powerpc/platforms/wsp/msi.c
> delete mode 100644 arch/powerpc/platforms/wsp/msi.h
> delete mode 100644 arch/powerpc/platforms/wsp/opb_pic.c
> delete mode 100644 arch/powerpc/platforms/wsp/psr2.c
> delete mode 100644 arch/powerpc/platforms/wsp/scom_smp.c
> delete mode 100644 arch/powerpc/platforms/wsp/scom_wsp.c
> delete mode 100644 arch/powerpc/platforms/wsp/setup.c
> delete mode 100644 arch/powerpc/platforms/wsp/smp.c
> delete mode 100644 arch/powerpc/platforms/wsp/wsp.c
> delete mode 100644 arch/powerpc/platforms/wsp/wsp.h
> delete mode 100644 arch/powerpc/platforms/wsp/wsp_pci.c
> delete mode 100644 arch/powerpc/platforms/wsp/wsp_pci.h
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/Makefile
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/back_to_back_ebbs_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/close_clears_pmcc_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cpu_event_vs_ebb_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cycles_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/cycles_with_freeze_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb.h
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_handler.S
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_on_child_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_on_willing_child_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/ebb_vs_cpu_event_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/event_attributes_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/fixed_instruction_loop.S
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/fork_cleanup_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/lost_exception_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/multi_counter_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/multi_ebb_procs_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/pmae_handling_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/reg.h
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/reg_access_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/task_event_pinned_vs_ebb_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/task_event_vs_ebb_test.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/trace.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/ebb/trace.h
> create mode 100644 tools/testing/selftests/powerpc/pmu/lib.c
> create mode 100644 tools/testing/selftests/powerpc/pmu/lib.h
> create mode 100644 tools/testing/selftests/powerpc/tm/Makefile
> create mode 100644 tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
>
^ permalink raw reply
* RE: Kernel build issues after yesterdays merge by Linus
From: Christoph Lameter @ 2014-06-13 1:56 UTC (permalink / raw)
To: David Laight
Cc: Rusty Russell, linuxppc-dev@lists.ozlabs.org,
'Anton Blanchard'
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1725BABB@AcuExch.aculab.com>
Goobledieguy due to missing Mime header.
On Thu, 12 Jun 2014, David Laight wrote:
> RnJvbTogQW50b24gQmxhbmNoYXJkDQouLi4NCj4gZGlmZiAtLWdpdCBhL2FyY2gvcG93ZXJwYy9i
> b290L2luc3RhbGwuc2ggYi9hcmNoL3Bvd2VycGMvYm9vdC9pbnN0YWxsLnNoDQo+IGluZGV4IGI2
> YTI1NmIuLmUwOTZlNWEgMTAwNjQ0DQo+IC0tLSBhL2FyY2gvcG93ZXJwYy9ib290L2luc3RhbGwu
> c2gNCj4gKysrIGIvYXJjaC9wb3dlcnBjL2Jvb3QvaW5zdGFsbC5zaA0KPiBAQCAtMjMsOCArMjMs
> OCBAQCBzZXQgLWUNCj4gDQo+ICAjIFVzZXIgbWF5IGhhdmUgYSBjdXN0b20gaW5zdGFsbCBzY3Jp
> cHQNCj4gDQo+IC1pZiBbIC14IH4vYmluLyR7SU5TVEFMTEtFUk5FTH0gXTsgdGhlbiBleGVjIH4v
> YmluLyR7SU5TVEFMTEtFUk5FTH0gIiRAIjsgZmkNCj4gLWlmIFsgLXggL3NiaW4vJHtJTlNUQUxM
> S0VSTkVMfSBdOyB0aGVuIGV4ZWMgL3NiaW4vJHtJTlNUQUxMS0VSTkVMfSAiJEAiOyBmaQ0KPiAr
> aWYgWyAteCB+L2Jpbi8ke0lOU1RBTExLRVJORUx9IF07IHRoZW4gZXhlYyB+L2Jpbi8ke0lOU1RB
> TExLRVJORUx9ICQxICQyICQzICQ0OyBmaQ0KPiAraWYgWyAteCAvc2Jpbi8ke0lOU1RBTExLRVJO
> RUx9IF07IHRoZW4gZXhlYyAvc2Jpbi8ke0lOU1RBTExLRVJORUx9ICQxICQyICQzICQ0OyBmaQ0K
> DQpZb3UgcHJvYmFibHkgd2FudCB0byBlbmNsb3NlIHRoZSAkMSBpbiAiIGFzOg0KDQo+ICtpZiBb
> IC14IC9zYmluLyR7SU5TVEFMTEtFUk5FTH0gXTsgdGhlbiBleGVjIC9zYmluLyR7SU5TVEFMTEtF
> Uk5FTH0gIiQxIiAiJDIiICIkMyIgIiQ0IjsgZmkNCg0KCURhdmlkDQoNCg==
>
^ permalink raw reply
* Re: [alsa-devel] [RFC][PATCH v1] ASoC: fsl_ssi: Add DAI master mode support for SSI on i.MX series
From: Timur Tabi @ 2014-06-13 3:24 UTC (permalink / raw)
To: Nicolin Chen
Cc: Takashi Iwai, alsa-devel mailing list, Mark Brown,
linuxppc-dev@lists.ozlabs.org, Liam Girdwood
In-Reply-To: <1386845085-21682-1-git-send-email-Guangyu.Chen@freescale.com>
On Thu, Dec 12, 2013 at 4:44 AM, Nicolin Chen
<Guangyu.Chen@freescale.com> wrote:
>
> +static int fsl_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
> + int clk_id, unsigned int freq, int dir)
> +{
> + struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai);
> + struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
> + int synchronous = ssi_private->cpu_dai_drv.symmetric_rates, ret;
> + u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i;
> + unsigned long flags, clkrate, baudrate, tmprate;
> + u64 sub, savesub = 100000;
> +
> + /* Don't apply it to any non-baudclk circumstance */
> + if (IS_ERR(ssi_private->baudclk))
> + return -EINVAL;
> +
> + /* It should be already enough to divide clock by setting pm alone */
> + psr = 0;
> + div2 = 0;
> +
> + factor = (div2 + 1) * (7 * psr + 1) * 2;
> +
> + for (i = 0; i < 255; i++) {
> + /* The bclk rate must be smaller than 1/5 sysclk rate */
> + if (factor * (i + 1) < 5)
> + continue;
> +
> + tmprate = freq * factor * (i + 2);
> + clkrate = clk_round_rate(ssi_private->baudclk, tmprate);
> +
> + do_div(clkrate, factor);
This do_div() call causes this warning on PowerPC:
CC sound/soc/fsl/fsl_ssi.o
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':
sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer
types lacks a cast
sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type
sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of
'__div64_32' from incompatible pointer type
include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but
argument is of type 'long unsigned int *'
The comments in do_div() say that clkrate should be 64-bits. Changing
clkrate to a u64 does fix this problem, but I'm wondering if anyone
else has seen this. This code has been around for months.
^ permalink raw reply
* Re: [alsa-devel] [RFC][PATCH v1] ASoC: fsl_ssi: Add DAI master mode support for SSI on i.MX series
From: Nicolin Chen @ 2014-06-13 3:21 UTC (permalink / raw)
To: Timur Tabi
Cc: Takashi Iwai, alsa-devel mailing list, Mark Brown,
linuxppc-dev@lists.ozlabs.org, Liam Girdwood
In-Reply-To: <CAOZdJXWsxMq19-wNTKv6d45K4d79ASpMbSbofM+DMoTOKW2JJA@mail.gmail.com>
Sir,
On Thu, Jun 12, 2014 at 10:24:55PM -0500, Timur Tabi wrote:
> On Thu, Dec 12, 2013 at 4:44 AM, Nicolin Chen
> <Guangyu.Chen@freescale.com> wrote:
> >
> > +static int fsl_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
> > + int clk_id, unsigned int freq, int dir)
> > +{
> > + struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai);
> > + struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
> > + int synchronous = ssi_private->cpu_dai_drv.symmetric_rates, ret;
> > + u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i;
> > + unsigned long flags, clkrate, baudrate, tmprate;
> > + u64 sub, savesub = 100000;
> > +
> > + /* Don't apply it to any non-baudclk circumstance */
> > + if (IS_ERR(ssi_private->baudclk))
> > + return -EINVAL;
> > +
> > + /* It should be already enough to divide clock by setting pm alone */
> > + psr = 0;
> > + div2 = 0;
> > +
> > + factor = (div2 + 1) * (7 * psr + 1) * 2;
> > +
> > + for (i = 0; i < 255; i++) {
> > + /* The bclk rate must be smaller than 1/5 sysclk rate */
> > + if (factor * (i + 1) < 5)
> > + continue;
> > +
> > + tmprate = freq * factor * (i + 2);
> > + clkrate = clk_round_rate(ssi_private->baudclk, tmprate);
> > +
> > + do_div(clkrate, factor);
>
> This do_div() call causes this warning on PowerPC:
>
> CC sound/soc/fsl/fsl_ssi.o
> sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':
> sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer
> types lacks a cast
> sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type
> sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of
> '__div64_32' from incompatible pointer type
> include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but
> argument is of type 'long unsigned int *'
>
> The comments in do_div() say that clkrate should be 64-bits. Changing
> clkrate to a u64 does fix this problem, but I'm wondering if anyone
> else has seen this. This code has been around for months.
It compiles well with my ARM cross compiler. I guess it might be related
to the compiler's version? But we should fix it anyway. Would you mind if
I submit a patch? Or you do it directly?
Thank you,
Nicolin
^ permalink raw reply
* Re: [alsa-devel] [RFC][PATCH v1] ASoC: fsl_ssi: Add DAI master mode support for SSI on i.MX series
From: Timur Tabi @ 2014-06-13 3:44 UTC (permalink / raw)
To: Nicolin Chen
Cc: alsa-devel mailing list, Takashi Iwai, Timur Tabi, Liam Girdwood,
Mark Brown, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140613032119.GA15609@MrMyself>
On Thu, Jun 12, 2014 at 10:21 PM, Nicolin Chen
<Guangyu.Chen@freescale.com> wrote:
> It compiles well with my ARM cross compiler. I guess it might be related
> to the compiler's version? But we should fix it anyway. Would you mind if
> I submit a patch? Or you do it directly?
I just submitted a patch, but I can't test the code since I don't have
any boards that configure the SSI into master mode, so this function
is never called.
^ permalink raw reply
* Re: [alsa-devel] [RFC][PATCH v1] ASoC: fsl_ssi: Add DAI master mode support for SSI on i.MX series
From: Nicolin Chen @ 2014-06-13 3:50 UTC (permalink / raw)
To: Timur Tabi
Cc: Takashi Iwai, alsa-devel mailing list, Mark Brown,
linuxppc-dev@lists.ozlabs.org, Liam Girdwood
In-Reply-To: <CAOZdJXUUz2bufcYmt9U-x0bic6XU68VHLOiPPsHoEdSZmnisZw@mail.gmail.com>
On Thu, Jun 12, 2014 at 10:44:48PM -0500, Timur Tabi wrote:
> On Thu, Jun 12, 2014 at 10:21 PM, Nicolin Chen
> <Guangyu.Chen@freescale.com> wrote:
>
> > It compiles well with my ARM cross compiler. I guess it might be related
> > to the compiler's version? But we should fix it anyway. Would you mind if
> > I submit a patch? Or you do it directly?
>
> I just submitted a patch, but I can't test the code since I don't have
> any boards that configure the SSI into master mode, so this function
> is never called.
I just tested it with i.MX platform. It still works.
Thank you,
Nicolin
^ permalink raw reply
* Re: Kernel build issues after yesterdays merge by Linus
From: Tony Breeds @ 2014-06-13 5:15 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Rusty Russell, linuxppc-dev, Christoph Lameter
In-Reply-To: <20140612220912.3447677f@kryten>
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
On Thu, Jun 12, 2014 at 10:09:12PM +1000, Anton Blanchard wrote:
> The TOC symbol export is special and I think we might need to get our
> script to ignore it.
Try this (untested) patch. If it's good I'll send it to Ben.
diff --git a/arch/powerpc/relocs_check.pl b/arch/powerpc/relocs_check.pl
index 3f46e8b..34e3f25 100755
--- a/arch/powerpc/relocs_check.pl
+++ b/arch/powerpc/relocs_check.pl
@@ -45,6 +45,9 @@ while (<FD>) {
/\bR_PPC_ADDR16_HA\b/ or /\bR_PPC_RELATIVE\b/ or
/\bR_PPC_NONE\b/);
+ # The TOC is "special" so let's ignore it.
+ next if (/__crc_TOC\./);
+
# If we see this type of relocation it's an idication that
# we /may/ be using an old version of binutils.
if (/R_PPC64_UADDR64/) {
<snip>
> Shows how much we use make install :) Below is a quick hack to get you going
> but we should look at either fixing the Ubuntu installkernel to handle
> extra optional args, or stop passing them from the ppc64 kernel
> install.sh script.
It seems like passign the zImage files is probably wrong. How about:
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index ccc25ed..146d898 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -390,7 +390,7 @@ $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
@rm -f $@; ln $< $@
install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
- sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
+ sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
# anything not in $(targets)
clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox