[PATCH 10/13] KVM: PPC: Implement MMIO emulation support for Book3S HV guests

2011-12-05 Thread Paul Mackerras
This provides the low-level support for MMIO emulation in Book3S HV guests. When the guest tries to map a page which is not covered by any memslot, that page is taken to be an MMIO emulation page. Instead of inserting a valid HPTE, we insert an HPTE that has the valid bit clear but another hyperv

[PATCH 05/13] KVM: PPC: Make the H_ENTER hcall more reliable

2011-12-05 Thread Paul Mackerras
At present, our implementation of H_ENTER only makes one try at locking each slot that it looks at, and doesn't even retry the ldarx/stdcx. atomic update sequence that it uses to attempt to lock the slot. Thus it can return the H_PTEG_FULL error unnecessarily, particularly when the H_EXACT flag is

[PATCH 02/13] KVM: PPC: Keep a record of HV guest view of hashed page table entries

2011-12-05 Thread Paul Mackerras
This adds an array that parallels the guest hashed page table (HPT), that is, it has one entry per HPTE, used to store the guest's view of the second doubleword of the corresponding HPTE. The first doubleword in the HPTE is the same as the guest's idea of it, so we don't need to store a copy, but

[PATCH 0/13] KVM: PPC: Update Book3S HV memory handling

2011-12-05 Thread Paul Mackerras
This series of patches updates the Book3S-HV KVM code that manages the guest hashed page table (HPT) to enable several things: * MMIO emulation and MMIO pass-through * Use of small pages (4kB or 64kB, depending on config) to back the guest memory * Pageable guest memory - i.e. backing pages ca

[PATCH 06/13] KVM: PPC: Only get pages when actually needed, not in prepare_memory_region()

2011-12-05 Thread Paul Mackerras
This removes the code from kvmppc_core_prepare_memory_region() that looked up the VMA for the region being added and called hva_to_page to get the pfns for the memory. We have no guarantee that there will be anything mapped there at the time of the KVM_SET_USER_MEMORY_REGION ioctl call; userspace

[PATCH 03/13] KVM: PPC: Keep page physical addresses in per-slot arrays

2011-12-05 Thread Paul Mackerras
This allocates an array for each memory slot that is added to store the physical addresses of the pages in the slot. This array is vmalloc'd and accessed in kvmppc_h_enter using real_vmalloc_addr(). This allows us to remove the ram_pginfo field from the kvm_arch struct, and removes the 64GB guest

[PATCH 09/13] KVM: PPC: Maintain a doubly-linked list of guest HPTEs for each gfn

2011-12-05 Thread Paul Mackerras
This expands the reverse mapping array to contain two links for each HPTE which are used to link together HPTEs that correspond to the same guest logical page. Each circular list of HPTEs is pointed to by the rmap array entry for the guest logical page, pointed to by the relevant memslot. Links a

[PATCH 04/13] KVM: PPC: Add an interface for pinning guest pages in Book3s HV guests

2011-12-05 Thread Paul Mackerras
This adds two new functions, kvmppc_pin_guest_page() and kvmppc_unpin_guest_page(), and uses them to pin the guest pages where the guest has registered areas of memory for the hypervisor to update, (i.e. the per-cpu virtual processor areas, SLB shadow buffers and dispatch trace logs) and then unpin

[PATCH 11/13] KVM: Add barriers to allow mmu_notifier_retry to be used locklessly

2011-12-05 Thread Paul Mackerras
This adds an smp_wmb in kvm_mmu_notifier_invalidate_range_end() and an smp_rmb in mmu_notifier_retry() so that mmu_notifier_retry() will give the correct answer when called without kvm->mmu_lock being held. PowerPC Book3S HV KVM wants to use a bitlock per guest page rather than a single global spin

[PATCH 08/13] KVM: PPC: Allow I/O mappings in memory slots

2011-12-05 Thread Paul Mackerras
This provides for the case where userspace maps an I/O device into the address range of a memory slot using a VM_PFNMAP mapping. In that case, we work out the pfn from vma->vm_pgoff, and record the cache enable bits from vma->vm_page_prot in two low-order bits in the slot_phys array entries. Then

[PATCH 13/13] KVM: PPC: Allow for read-only pages backing a Book3S HV guest

2011-12-05 Thread Paul Mackerras
With this, if a guest does an H_ENTER with a read/write HPTE on a page which is currently read-only, we make the actual HPTE inserted be a read-only version of the HPTE. We now intercept protection faults as well as HPTE not found faults, and for a protection fault we work out whether it should be

[PATCH 01/13] KVM: PPC: Move kvm_vcpu_ioctl_[gs]et_one_reg down to platform-specific code

2011-12-05 Thread Paul Mackerras
This moves the get/set_one_reg implementation down from powerpc.c into booke.c, book3s_pr.c and book3s_hv.c. This avoids #ifdefs in C code, but more importantly, it fixes a bug on Book3s HV where we were accessing beyond the end of the kvm_vcpu struct (via the to_book3s() macro) and corrupting mem

[PATCH 12/13] KVM: PPC: Implement MMU notifiers for Book3S HV guests

2011-12-05 Thread Paul Mackerras
This adds the infrastructure to enable us to page out pages underneath a Book3S HV guest, on processors that support virtualized partition memory, that is, POWER7. Instead of pinning all the guest's pages, we now look in the host userspace Linux page tables to find the mapping for a given guest pa

[PATCH 07/13] KVM: PPC: Allow use of small pages to back Book3S HV guests

2011-12-05 Thread Paul Mackerras
This relaxes the requirement that the guest memory be provided as 16MB huge pages, allowing it to be provided as normal memory, i.e. in pages of PAGE_SIZE bytes (4k or 64k). To allow this, we index the kvm->arch.slot_phys[] arrays with a small page index, even if huge pages are being used, and use

[PATCH] powerpc/powernv: Fix problems in onlining CPUs

2011-12-05 Thread Paul Mackerras
At present, on the powernv platform, if you off-line a CPU that was online, and then try to on-line it again, the kernel generates a warning message "OPAL Error -1 starting CPU n". Furthermore, if the CPU is a secondary thread that was used by KVM while it was off-line, the CPU fails to come onlin

[PATCH] powerpc: Provide a way for KVM to indicate that NV GPR values are lost

2011-12-05 Thread Paul Mackerras
This fixes a problem where a CPU thread coming out of nap mode can think it has valid values in the nonvolatile GPRs (r14 - r31) as saved away in power7_idle, but in fact the values have been trashed because the thread was used for KVM in the mean time. The result is that the thread crashes becaus

"KVM: PPC: booke: Improve timer register emulation" breaks Book3s HV

2011-12-05 Thread Paul Mackerras
I'm not sure why yet, but commit 8a97c432 ("KVM: PPC: booke: Improve timer register emulation") in Alex's kvm-ppc-next branch is breaking Book3S HV KVM on POWER7. Guest cpus fail to spin up, and even with just one cpu, the guest stalls every so often. If I stop the guest and inspect the state wit

next BUG: using smp_processor_id() in preemptible

2011-12-05 Thread Hugh Dickins
3.2.0-rc3-next-20111202 with CONFIG_DEBUG_PREEMPT=y gives me lots of Dec 4 20:03:19 thorn kernel: BUG: using smp_processor_id() in preemptible [] code: startpar/1365 Dec 4 20:03:19 thorn kernel: caller is .arch_local_irq_restore+0x44/0x90 Dec 4 20:03:19 thorn kernel: Call Trace: Dec 4

Re: [PATCH 2/2] powerpc/85xx: add a 32-bit P1022DS device tree

2011-12-05 Thread Timur Tabi
Kumar Gala wrote: > look at how mpc8572ds handles 36b.dts we put common definitions in a shared > file. Ok, I've made those changes, but when I boot the kernel, I'm seeing this. Can you give me a clue as to what's wrong? PCI: Probing PCI hardware

[PATCH] rapidio/tsi721: switch to dma_zalloc_coherent

2011-12-05 Thread Alexandre Bounine
Replaces pair dma_alloc_coherent()+memset() with new dma_zalloc_coherent() added by Andrew Morton for kernel version 3.2 Signed-off-by: Alexandre Bounine --- drivers/rapidio/devices/tsi721.c | 17 - 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/rapidio

Re: Problem with eLBC?

2011-12-05 Thread Scott Wood
On 12/05/2011 08:02 AM, Alexander Lyasin wrote: > In reply to your Service Request SR 1-807899446: > > Yes, due to several design peculiarities in local bus nand controller, > simultaneous accesses to nand flash and to other local bus memory > controller may cause nand flash controller access fail

Powerbook G4 and sound

2011-12-05 Thread Петр метель
Hello, I've got problem with sound on my Powerbook G4 Titanium (PowerBook3,5). Sound always cranks and skips when I moving my touchpad, regardless of the source of sound. It happens in all my programs, including vlc, mplayer, e-uae and ioquake3 - they show in the log messeges like "underrun occure

Re: [PATCH 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip

2011-12-05 Thread Scott Wood
On 12/05/2011 12:47 AM, Artem Bityutskiy wrote: > On Sun, 2011-12-04 at 12:31 +0800, shuo@freescale.com wrote: >> +/* >> + * Freescale FCM controller has a 2K size limitation of buffer >> + * RAM, so elbc_fcm_ctrl->buffer have to be used if writesize >> +

Re: [PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale NAND controller

2011-12-05 Thread Scott Wood
On 12/05/2011 04:54 AM, Shengzhou Liu wrote: > There was a bug for fmr initialization, which lead to fmr was always 0x100 > in fsl_elbc_chip_init() and caused FCM command timeout before calling > fsl_elbc_chip_init_tail(). > > Signed-off-by: Shengzhou Liu > --- > drivers/mtd/nand/fsl_elbc_nand.

Re: [PATCH v3 02/10] powerpc: Consolidate mpic_alloc() OF address translation

2011-12-05 Thread Kumar Gala
On Dec 5, 2011, at 12:41 PM, Moffett, Kyle D wrote: > On Dec 03, 2011, at 10:53, Kumar Gala wrote: >> On Dec 2, 2011, at 10:27 AM, Kyle Moffett wrote: >>> Instead of using the open-coded "reg" property lookup and address >>> translation in mpic_alloc(), directly call of_address_to_resource(). >>>

Re: [PATCH v3 02/10] powerpc: Consolidate mpic_alloc() OF address translation

2011-12-05 Thread Moffett, Kyle D
On Dec 03, 2011, at 10:53, Kumar Gala wrote: > On Dec 2, 2011, at 10:27 AM, Kyle Moffett wrote: >> Instead of using the open-coded "reg" property lookup and address >> translation in mpic_alloc(), directly call of_address_to_resource(). >> This includes various workarounds for special cases which t

[PATCH] sbc834x: put full compat string in board match check

2011-12-05 Thread Paul Gortmaker
The commit 883c2cfc8bcc0fd00c5d9f596fb8870f481b5bda: "fix of_flat_dt_is_compatible() to match the full compatible string" causes silent boot death on the sbc8349 board because it was just looking for 8349 and not 8349E -- as originally there were non-E (no SEC/encryption) chips available. Just

Problem with eLBC?

2011-12-05 Thread Alexander Lyasin
Dear Kumar Gala! Our company is a client Freescale company, we use mpc8308, mpc8321 and other microprocessors. I have a board on the mpc8308 chip. This board runs the Linux kernel. On this board there is NAND flash and DSP proc. on the Local Bus. Chunk from DTS-file is below: localbus@e

Re: [PATCH 0/6] RFCv2 Fix Fsl 8250 BRK bug

2011-12-05 Thread Alan Cox
> Anyway, have a look and see if this version of things is acceptable > to all. (Again, the dts update from Kumar isn't shown here). > > Thanks to all who provided the feedback on v1. Looks good to me Acked-by: Alan Cox ___ Linuxppc-dev mailing list

RE: Re: [PATCHv5] atomic: add *_dec_not_zero

2011-12-05 Thread David Laight
Looking at this: > #ifndef atomic_inc_unless_negative > static inline int atomic_inc_unless_negative(atomic_t *p) > { > int v, v1; > for (v = 0; v >= 0; v = v1) { > v1 = atomic_cmpxchg(p, v, v + 1); > if (likely(v1 == v)) > re

[PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale NAND controller

2011-12-05 Thread Shengzhou Liu
There was a bug for fmr initialization, which lead to fmr was always 0x100 in fsl_elbc_chip_init() and caused FCM command timeout before calling fsl_elbc_chip_init_tail(). Signed-off-by: Shengzhou Liu --- drivers/mtd/nand/fsl_elbc_nand.c |8 +++- 1 files changed, 3 insertions(+), 5 dele

[PATCH 2/2] mtd/nand: Add ONFI support for FSL NAND controller

2011-12-05 Thread Shengzhou Liu
- fix NAND_CMD_READID command for ONFI detect. - add NAND_CMD_PARAM command to read the ONFI parameter page. Signed-off-by: Shengzhou Liu --- drivers/mtd/nand/fsl_elbc_nand.c | 19 --- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/fsl_elbc_nan

Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization.

2011-12-05 Thread Amit Shah
On (Tue) 29 Nov 2011 [09:50:41], Miche Baker-Harvey wrote: > Good grief! Sorry for the spacing mess-up! Here's a resend with > reformatting. > > Amit, > We aren't using either QEMU or kvmtool, but we are using KVM. All So it's a different userspace? Any chance this different userspace is cau

[PATCH] mmc: sdhci-pltfm: Added sdhci-adjust-timeout quirk

2011-12-05 Thread Xie Xiaobo
Some controller provides an incorrect timeout value for transfers, So it need the quirk to adjust timeout value to 0xE. E.g. eSDHC of MPC8536, P1010, and P2020. Signed-off-by: Xie Xiaobo --- drivers/mmc/host/sdhci-pltfm.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

Re: oprofile callgraph support missing for common cpus

2011-12-05 Thread Benjamin Herrenschmidt
On Mon, 2011-12-05 at 09:50 +0100, Joakim Tjernlund wrote: > Benjamin Herrenschmidt wrote on 2011/11/25 > 06:24:32: > > > > On Fri, 2011-11-18 at 09:22 +0100, Joakim Tjernlund wrote: > > > > > I forgot to ask, oprofile mentions setting -no-omit-framepointer to get > > > correct backtrace but I ca

Re: oprofile callgraph support missing for common cpus

2011-12-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 2011/11/25 06:24:32: > > On Fri, 2011-11-18 at 09:22 +0100, Joakim Tjernlund wrote: > > > I forgot to ask, oprofile mentions setting -no-omit-framepointer to get > > correct backtrace but I cannot turn on frame pointers for the ppc kernel. > > Isn't frame pointers n

Re: Re: Re: [PATCHv5] atomic: add *_dec_not_zero

2011-12-05 Thread Benjamin Herrenschmidt
On Mon, 2011-12-05 at 08:57 +0100, Sven Eckelmann wrote: > On Monday 05 December 2011 09:41:55 Benjamin Herrenschmidt wrote: > > On Sun, 2011-12-04 at 22:18 +, Russell King - ARM Linux wrote: > > > > .../... > > > > > And really, I believe it would be a good cleanup if all the standard > > >