[PATCH] powerpc: Add VDSO version of getcpu

2012-07-04 Thread Anton Blanchard
We have a request for a fast method of getting CPU and NUMA node IDs from userspace. This patch implements a getcpu VDSO function, similar to x86. Ben suggested we use SPRG3 which is userspace readable. SPRG3 can be modified by a KVM guest, so we save the SPRG3 value in the paca and restore it wh

Re: linux-next: build failure after merge of the kvm-ppc tree

2012-07-04 Thread Alexander Graf
On 05.07.2012, at 07:49, Stephen Rothwell wrote: > Hi Alexander, > > After merging the kvm-ppc tree, today's linux-next build (powerpc > ppc64_defconfig) failed like this: > > arch/powerpc/kernel/exceptions-64s.S: Assembler messages: > arch/powerpc/kernel/exceptions-64s.S:479: Error: wrong numb

linux-next: build failure after merge of the kvm-ppc tree

2012-07-04 Thread Stephen Rothwell
Hi Alexander, After merging the kvm-ppc tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: arch/powerpc/kernel/exceptions-64s.S: Assembler messages: arch/powerpc/kernel/exceptions-64s.S:479: Error: wrong number of operands arch/powerpc/kernel/exceptions-64s.S:486: Error: w

linux-next: manual merge of the kvm-ppc tree with Linus' tree

2012-07-04 Thread Stephen Rothwell
Hi Alexander, Today's linux-next merge of the kvm-ppc tree got a conflict in arch/powerpc/kernel/entry_64.S between commit c58ce2b1e3c7 ("ppc64: fix missing to check all bits of _TIF_USER_WORK_MASK in preempt") from Linus' tree and commit bc8cc4993e19 ("PPC: use CURRENT_THREAD_INFO instead of open

Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used

2012-07-04 Thread Li Zhong
On Wed, 2012-07-04 at 16:40 +0400, Glauber Costa wrote: > On 07/04/2012 01:00 PM, Li Zhong wrote: > > On Tue, 2012-07-03 at 15:36 -0500, Christoph Lameter wrote: > >> > Looking through the emails it seems that there is an issue with alias > >> > strings. > > To be more precise, there seems no big

Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-04 Thread Benjamin Herrenschmidt
On Wed, 2012-07-04 at 16:29 +0200, Alexander Graf wrote: > > +#ifdef CONFIG_KVM_BOOKE_HV > > +#define KVM_BOOKE_HV_MFSPR(reg, spr) \ > > + BEGIN_FTR_SECTION \ > > + mfspr reg, spr; \ >

Re: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest

2012-07-04 Thread Benjamin Herrenschmidt
On Wed, 2012-07-04 at 16:14 +0200, Alexander Graf wrote: > > +#ifdef CONFIG_64BIT > > +#define _hard_irq_disable() hard_irq_disable() > > +#else > > +#define _hard_irq_disable() local_irq_disable() > > +#endif > > So you only swap out the disable bit, but not the enable one? Ben, > would this work

RE: [Qemu-ppc] [RFC PATCH 15/17] KVM: PPC64: bookehv: Add support for interrupt handling

2012-07-04 Thread Caraman Mihai Claudiu-B02008
>On 04.07.2012, at 17:37, Caraman Mihai Claudiu-B02008 wrote: > >>> -Original Message- >>> From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- >>> ow...@vger.kernel.org] On Behalf Of Alexander Graf >>> Sent: Wednesday, July 04, 2012 6:14 PM >>> To: Caraman Mihai Claudiu-B02008 >>> Cc: kvm-

RE: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-04 Thread Caraman Mihai Claudiu-B02008
> >From: Alexander Graf [ag...@suse.de] >Sent: Wednesday, July 04, 2012 6:45 PM >To: Caraman Mihai Claudiu-B02008 >Cc: ; KVM list; linuxppc-dev; qemu-...@nongnu.org >List; Benjamin Herrenschmidt >Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Ad

Re: [Qemu-ppc] [RFC PATCH 15/17] KVM: PPC64: bookehv: Add support for interrupt handling

2012-07-04 Thread Alexander Graf
On 04.07.2012, at 17:37, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- >> ow...@vger.kernel.org] On Behalf Of Alexander Graf >> Sent: Wednesday, July 04, 2012 6:14 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: kvm-...@vge

Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-04 Thread Alexander Graf
On 04.07.2012, at 17:27, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Wednesday, July 04, 2012 5:30 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: ; KVM list; linuxppc-dev; qemu- >> p...@nongnu.org List; Benjamin Herrensc

RE: [Qemu-ppc] [RFC PATCH 15/17] KVM: PPC64: bookehv: Add support for interrupt handling

2012-07-04 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- > ow...@vger.kernel.org] On Behalf Of Alexander Graf > Sent: Wednesday, July 04, 2012 6:14 PM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; k...@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org

RE: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-04 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Wednesday, July 04, 2012 5:30 PM > To: Caraman Mihai Claudiu-B02008 > Cc: ; KVM list; linuxppc-dev; qemu- > p...@nongnu.org List; Benjamin Herrenschmidt > Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: A

Re: [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync

2012-07-04 Thread Tabi Timur-B04825
Zhao Chenhui wrote: > On Tue, Jul 03, 2012 at 10:17:12PM -0500, Tabi Timur-B04825 wrote: >> Zhao Chenhui wrote: >>> If the guts variable is NULL, it indicates there is error in dts or kernel. >>> We should fix the error, rather than ignore it. >> >> And that's why there's a warning message. Crashi

Re: [Qemu-ppc] [RFC PATCH 15/17] KVM: PPC64: bookehv: Add support for interrupt handling

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Add bookehv interrupt handling support for 64-bit hosts. Change common stack > layout to refer PPC_LR_STKOFF kernel constant. Dispatch the 64-bit execution > flow to the existing kvm_handler_common asm macro. Update input register > values documenta

Re: [RFC PATCH 02/17] KVM: PPC64: booke: Add EPCR support in mtspr/mfspr emulation

2012-07-04 Thread Alexander Graf
On 04.07.2012, at 16:14, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- >> ow...@vger.kernel.org] On Behalf Of Alexander Graf >> Sent: Wednesday, July 04, 2012 4:22 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: kvm-...@vge

Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Hook DO_KVM macro to 64-bit booke in a optimal way similar to 32-bit booke > see head_fsl_booke.S file. Extend interrupt handlers' parameter list with > interrupt vector numbers to accomodate the macro. Rework Guest Doorbell > handler to use the pro

Re: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > 64-bit host runs with lazy interrupt disabling, so local_irq_disable() does > not disable interrupts right away and does not protect against preemption > required by __kvmppc_vcpu_run(). Define a macro for 64-bit to use > hard_irq_disable(). > > Si

RE: [RFC PATCH 02/17] KVM: PPC64: booke: Add EPCR support in mtspr/mfspr emulation

2012-07-04 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- > ow...@vger.kernel.org] On Behalf Of Alexander Graf > Sent: Wednesday, July 04, 2012 4:22 PM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; k...@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org

Re: [Qemu-ppc] [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation

2012-07-04 Thread Alexander Graf
On 04.07.2012, at 16:00, Alexander Graf wrote: > > On 25.06.2012, at 14:26, Mihai Caraman wrote: > >> Mask high 32 bits of effective address in emulation layer, for guests running >> in 32-bit mode. >> MAS2's high-order 32 bits represents the upper 32 bits of the effective >> address >> of the

Re: [Qemu-ppc] [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Mask high 32 bits of effective address in emulation layer, for guests running > in 32-bit mode. > MAS2's high-order 32 bits represents the upper 32 bits of the effective > address > of the page. Mask it too for tlbwe instruction emulation. Ah, the

Re: [RFC PATCH 06/17] KVM: PPC: e500: Add emulation helper for getting instruction ea

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Add emulation helper for getting instruction ea and refactor tlb instruction > emulation to use it. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/e500.h |6 +++--- > arch/powerpc/kvm/e500_emulate.c | 21 ++-

Re: [Qemu-ppc] [RFC PATCH 05/17] KVM: PPC: booke: Extend MAS2 EPN mask for 64-bit

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Extend MAS2 EPN mask for 64-bit hosts, to retain most significant bits. > Change get tlb eaddr to use this mask. Please see section 6.11.4.8 in the PowerISA 2.06b: MMU behavior is largely unaffected by whether the thread is in 32-bit computation

Re: [Qemu-ppc] [RFC PATCH 04/17] KVM: PPC64: booke: Add guest computation mode for irq delivery

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > When delivering guest IRQs, update MSR computaion computation > mode according to guest > interrupt computation mode found in EPCR. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/booke.c |8 +++- > 1 files changed, 7 insertions

Re: [Qemu-ppc] [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs > for 64-bit hosts. Please also implement a ONE_REG interface while at it. Over time, I'd like to move towards ONE_REG instead of the messy regs/sregs API. Alex __

Re: [RFC PATCH 01/17] KVM: PPC64: booke: Set interrupt computation mode for 64-bit host

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > 64-bit host needs to remain in 64-bit mode when an exception take place. > Set interrupt computaion mode in EPCR register. > > Signed-off-by: Mihai Caraman Thanks, applied to kvm-ppc-next. Alex ___ L

Re: [RFC PATCH 02/17] KVM: PPC64: booke: Add EPCR support in mtspr/mfspr emulation

2012-07-04 Thread Alexander Graf
On 25.06.2012, at 14:26, Mihai Caraman wrote: > Add EPCR support in booke mtspr/mfspr emulation. EPCR register is defined > only for 64-bit and HV categories, so it shoud be available only on 64-bit > virtual processors. Undefine the support for 32-bit builds. > Define a reusable setter function

Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used

2012-07-04 Thread Glauber Costa
On 07/04/2012 01:00 PM, Li Zhong wrote: > On Tue, 2012-07-03 at 15:36 -0500, Christoph Lameter wrote: >> > Looking through the emails it seems that there is an issue with alias >> > strings. > To be more precise, there seems no big issue currently. I just wanted to > make following usage of kmem_c

Re: [PATCH -v5 0/6] notifier error injection

2012-07-04 Thread Akinobu Mita
2012/7/4 Andrew Morton : > On Sat, 30 Jun 2012 14:59:24 +0900 > Akinobu Mita wrote: > >> This provides kernel modules that can be used to test the error handling >> of notifier call chain failures by injecting artifical errors to the >> following notifier chain callbacks. > > No updates to Documen

Re: [RFC PATCH v2 4/13] memory-hotplug : remove /sys/firmware/memmap/X sysfs

2012-07-04 Thread Wen Congyang
At 07/04/2012 01:52 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/04 14:08, Wen Congyang wrote: >> At 07/04/2012 12:45 PM, Yasuaki Ishimatsu Wrote: >>> Hi Wen, >>> >>> 2012/07/03 15:35, Wen Congyang wrote: At 07/03/2012 01:56 PM, Yasuaki Ishimatsu Wrote: > When (hot)adding memory int

Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used

2012-07-04 Thread Li Zhong
On Tue, 2012-07-03 at 15:36 -0500, Christoph Lameter wrote: > Looking through the emails it seems that there is an issue with alias > strings. To be more precise, there seems no big issue currently. I just wanted to make following usage of kmem_cache_create (SLUB) possible: name = some s