[PATCH -V2 12/14] kvm: Add struct kvm arg to memslot APIs

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We will use that in the later patch to find the kvm ops handler Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/arm/kvm/arm.c | 5 +++-- arch/ia64/kvm/kvm-ia64.c | 5 +++-- arch/mips/kvm

[PATCH -V2 13/14] kvm: powerpc: book3s: Allow the HV and PR selection per virtual machine

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This moves the kvmppc_ops callbacks to be a per VM entity. This enables us to select HV and PR mode when creating a VM. We also allow both kvm-hv and kvm-pr kernel module to be loaded. To achieve this we move /dev/kvm ownership to kvm.ko

[PATCH -V2 14/14] kvm: powerpc: book3s: drop is_hv_enabled

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com drop is_hv_enabled, because that should not be a callback property Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_ppc.h | 6 +- arch/powerpc/kvm/book3s.c | 6 +++--- arch

[PATCH -V2 06/14] kvm: powerpc: booke: Convert BOOKE to use kvmppc_ops callbacks

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Make required changes to get BOOKE configs to build with the introduction of kvmppc_ops callback Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_ppc.h | 4 +-- arch/powerpc/kvm/44x.c

[PATCH -V2 09/14] kvm: powerpc: book3s: pr: move PR related tracepoints to a separate header

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch moves PR related tracepoints to a separate header. This enables in converting PR to a kernel module which will be done in later patches Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm

[PATCH -V2 08/14] kvm: powerpc: book3s: Add is_hv_enabled to kvmppc_ops

2013-10-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This help us to identify whether we are running with hypervisor mode KVM enabled. The change is needed so that we can have both HV and PR kvm enabled in the same kernel. If both HV and PR KVM are included, interrupts come in to the HV

Re: [PATCH -V2 1/2] powerpc: Use HPTE constants when updating hpte bits

2013-10-07 Thread Aneesh Kumar K.V
Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com writes: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Even though we have same value for linux PTE bits and hash PTE pits use the hash pte bits wen updating hash pte ... diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch

Re: [PATCH -V2 00/14] Allow PR and HV KVM to coexist in one kernel

2013-10-15 Thread Aneesh Kumar K.V
Hi Alex, Any update on this ? -aneesh Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com writes: Hi All, This patch series support enabling HV and PR KVM together in the same kernel. We extend machine property with new property kvm_type. A value of HV will force HV KVM and PR PR KVM

Re: [PATCH -V2 11/14] kvm: powerpc: book3s: Support building HV and PR KVM as module

2013-10-16 Thread Aneesh Kumar K.V
The below patch fix a compile issue with KVM_XICS. Please fold diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index cef3de9..c3c832b 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c @@ -840,6 +840,7 @@ int kvmppc_xics_hcall(struct

Re: [PATCH] powerpc: Fix 64K page size support for PPC44x

2013-10-16 Thread Aneesh Kumar K.V
: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com powerpc: Reduce PTE table memory wastage The above patch only implements the new layout for PPC64 so it doesn't compile for PPC32 with a 64K page size. Ideally we should implement the same layout for PPC32 however for the meantime this patch

Re: [PATCH -V2 06/14] kvm: powerpc: booke: Convert BOOKE to use kvmppc_ops callbacks

2013-10-17 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 07.10.2013, at 18:47, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Make required changes to get BOOKE configs to build with the introduction of kvmppc_ops callback Signed-off

[RFC PATCH 0/9] powerpc: mm: Numa faults support for ppc64

2013-10-22 Thread Aneesh Kumar K.V
Hi, This patch series add support for numa faults on ppc64 architecture. We steal the _PAGE_COHERENCE bit and use that for indicating _PAGE_NUMA. We clear the _PAGE_PRESENT bit and also invalidate the hpte entry on setting _PAGE_NUMA. The next fault on that page will be considered a numa fault.

[RFC PATCH 4/9] powerpc: mm: Only check for _PAGE_PRESENT in set_pte/pmd functions

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We want to make sure we don't use these function when updating a pte or pmd entry that have a valid hpte entry, because these functions don't invalidate them. So limit the check to _PAGE_PRESENT bit. Numafault core changes use these functions

[RFC PATCH 1/9] powerpc: Use HPTE constants when updating hpte bits

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Even though we have same value for linux PTE bits and hash PTE pits use the hash pte bits wen updating hash pte Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/platforms/cell/beat_htab.c | 4 ++-- arch

[RFC PATCH 3/9] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE. On archs like ppc64 that don't use _PAGE_PROTNONE and also have a separate page table outside linux pagetable, we just need to make sure that when calling change_prot_numa we

[RFC PATCH 8/9] powerpc: mm: Support setting _PAGE_NUMA bit on pmd entry which are pointer to PTE page

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable-ppc64.h | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b

[RFC PATCH 9/9] powerpc: mm: Enable numa faulting for hugepages

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Provide numa related functions for updating pmd entries. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch

[RFC PATCH 7/9] mm: numafaults: Use change_pmd_protnuma for updating _PAGE_NUMA for regular pmds

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Archs like ppc64 have different layout for pmd entries pointing to PTE page. Hence add a separate function for modifying them Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable.h | 17

[RFC PATCH 6/9] powerpc: mm: book3s: Disable hugepaged pmd format for book3s

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com After commit e2b3d202d1dba8f3546ed28224ce485bc50010be we have the below possible formats for pmd entry (1) invalid (all zeroes) (2) pointer to next table, as normal; bottom 6 bits == 0 (3) leaf pte for huge page, bottom two bits != 00 (4

[RFC PATCH 5/9] powerpc: mm: book3s: Enable _PAGE_NUMA for book3s

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We steal the _PAGE_COHERENCE bit and use that for indicating NUMA ptes. This patch still disables the numa hinting using pmd entries. That require further changes to pmd entry format which is done in later patches. Signed-off-by: Aneesh

[RFC PATCH 2/9] powerpc: Free up _PAGE_COHERENCE for numa fault use later

2013-10-22 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Set memory coherence always on hash64 config. If a platform cannot have memory coherence always set they can infer that from _PAGE_NO_CACHE and _PAGE_WRITETHRU like in lpar. So we dont' really need a separate bit for tracking _PAGE_COHERENCE

[PATCH] powerpc: book3s: kvm: Don't abuse host r2 in exit path

2013-11-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We don't use PACATOC for PR. Avoid updating HOST_R2 with PR KVM mode when both HV and PR are enabled in the kernel. Without this we get the below crash (qemu) Unable to handle kernel paging request for data at address 0x8310

[PATCH] powerpc: book3s: kvm: Use the saved dsisr and dar values

2013-11-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Don't try to compute these values. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- NOTE: I am not sure why we were originally computing dsisr and dar. So may be we need a variant of this patch

[PATCH] powerpc: book3s: PR: Enable Little Endian PR guest

2013-11-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch make sure we inherit the LE bit correctly in different case so that we can run Little Endian distro in PR mode Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- This patch depends on the below two changes 1

[PATCH] powerpc: booke: Fix build failures

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com arch/powerpc/platforms/wsp/wsp.c: In function ‘wsp_probe_devices’: arch/powerpc/platforms/wsp/wsp.c:76:3: error: implicit declaration of function ‘of_address_to_resource’ [-Werror=implicit-function-declaration] Signed-off-by: Aneesh Kumar

[PATCH -V2 1/5] powerpc: Use HPTE constants when updating hpte bits

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Even though we have same value for linux PTE bits and hash PTE pits use the hash pte bits wen updating hash pte Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/platforms/cell/beat_htab.c | 4 ++-- arch

[PATCH -V2 4/5] powerpc: mm: Only check for _PAGE_PRESENT in set_pte/pmd functions

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We want to make sure we don't use these function when updating a pte or pmd entry that have a valid hpte entry, because these functions don't invalidate them. So limit the check to _PAGE_PRESENT bit. Numafault core changes use these functions

[PATCH -V2 3/5] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE. On archs like ppc64 that don't use _PAGE_PROTNONE and also have a separate page table outside linux pagetable, we just need to make sure that when calling change_prot_numa we

[PATCH -V2 2/5] powerpc: Free up _PAGE_COHERENCE for numa fault use later

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Set memory coherence always on hash64 config. If a platform cannot have memory coherence always set they can infer that from _PAGE_NO_CACHE and _PAGE_WRITETHRU like in lpar. So we dont' really need a separate bit for tracking _PAGE_COHERENCE

[PATCH -V2 0/5] powerpc: mm: Numa faults support for ppc64

2013-11-18 Thread Aneesh Kumar K.V
Hi, This patch series add support for numa faults on ppc64 architecture. We steal the _PAGE_COHERENCE bit and use that for indicating _PAGE_NUMA. We clear the _PAGE_PRESENT bit and also invalidate the hpte entry on setting _PAGE_NUMA. The next fault on that page will be considered a numa fault.

[PATCH -V2 5/5] powerpc: mm: book3s: Enable _PAGE_NUMA for book3s

2013-11-18 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We steal the _PAGE_COHERENCE bit and use that for indicating NUMA ptes. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable.h | 66 +- arch/powerpc/include

[PATCH -V2] powerpc: book3s: PR: Enable Little Endian PR guest

2013-11-28 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch make sure we inherit the LE bit correctly in different case so that we can run Little Endian distro in PR mode Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- Changes from V1: * Use LPCR bit to find whether

Re: [PATCH -V2 3/5] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE

2013-12-04 Thread Aneesh Kumar K.V
Adding Mel and Rik to cc: Benjamin Herrenschmidt b...@au1.ibm.com writes: On Mon, 2013-11-18 at 14:58 +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE. On archs like ppc64 that don't use

Re: [PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-05 Thread Aneesh Kumar K.V
Liu Ping Fan kernelf...@gmail.com writes: To enable the do_numa_page(), we should not fix _PAGE_NUMA in hash_page(), so bail out for the case of pte_numa(). Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH 3/3] powerpc: mm: optimize for the correctly placed page

2013-12-05 Thread Aneesh Kumar K.V
Liu Ping Fan kernelf...@gmail.com writes: The period check of _PAGE_NUMA can probably trigger the check on the correctly placed page. For this case, we can just insert hpte and do fast exception return. I still don't understand why we need to handle numa faults in hash page ? Are you trying

[PATCH -V3] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE

2013-12-05 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE. On archs like ppc64 that don't use _PAGE_PROTNONE and also have a separate page table outside linux pagetable, we just need to make sure that when calling change_prot_numa we

Re: [PATCH] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor

2013-12-06 Thread Aneesh Kumar K.V
Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: linux-stable sta...@vger.kernel.org # v3.10+ Signed-off-by: Hong H. Pham hong.p...@windriver.com --- arch/powerpc/include/asm/pgalloc-32.h | 2 +- arch/powerpc/include/asm/pgalloc-64.h

Re: [PATCH v3] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor

2013-12-09 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Sat, 2013-12-07 at 09:06 -0500, Hong H. Pham wrote: diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h index 27b2386..842846c 100644 --- a/arch/powerpc/include/asm/pgalloc-32.h +++

Re: [PATCH v3] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor

2013-12-09 Thread Aneesh Kumar K.V
from common header Cc: Paul Mackerras pau...@samba.org Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: linux-stable sta...@vger.kernel.org # v3.10+ Signed-off-by: Hong H. Pham hong.p...@windriver.com Reviewed-by: Aneesh Kumar K.V

[PATCH] KVM: PPC: Use schedule instead of cond_resched

2013-12-10 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We already checked need_resched. So we can call schedule directly Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- NOTE: This patch also work around a regression upstream w.r.t PR KVM BUG: soft lockup - CPU#0 stuck

Re: [PATCH] KVM: PPC: Use schedule instead of cond_resched

2013-12-10 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 10.12.2013, at 15:21, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We already checked need_resched. So we can call schedule directly Signed-off-by: Aneesh Kumar K.V aneesh.ku

Re: [PATCH] powerpc: book3s: kvm: Don't abuse host r2 in exit path

2013-12-17 Thread Aneesh Kumar K.V
Hi Alex, Any update on this ? We need this to got into 3.13. -aneesh Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com writes: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We don't use PACATOC for PR. Avoid updating HOST_R2 with PR KVM mode when both HV and PR are enabled

Re: [PATCH] powerpc: book3s: kvm: Use the saved dsisr and dar values

2013-12-18 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 11.11.2013, at 15:02, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Don't try to compute these values. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- NOTE

Re: [PATCH] powerpc: book3s: kvm: Use the saved dsisr and dar values

2013-12-19 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: Am 19.12.2013 um 08:02 schrieb Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com: Alexander Graf ag...@suse.de writes: On 11.11.2013, at 15:02, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku

[PATCH -V2] POWERPC: BOOK3S: KVM: Use the saved dsisr and dar values on book3s 64

2013-12-29 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Although it's optional IBM POWER cpus always had DAR value set on alignment interrupt. So don't try to compute these values. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 28

[PATCH] powerpc: thp: Fix crash on mremap

2014-01-01 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

[PATCH -V2] powerpc: thp: Fix crash on mremap

2014-01-02 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

RE: [PATCH -V2] powerpc: thp: Fix crash on mremap

2014-01-02 Thread Aneesh Kumar K.V
Kirill A. Shutemov kirill.shute...@linux.intel.com writes: Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace

Re: [PATCH -V2] powerpc: thp: Fix crash on mremap

2014-01-02 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Thu, 2014-01-02 at 16:22 +0530, Aneesh Kumar K.V wrote: Just use config option directly: if (new_ptl != old_ptl || IS_ENABLED(CONFIG_ARCH_THP_MOVE_PMD_ALWAYS_WITHDRAW)) I didn't like that. I found

[PATCH -V3 2/2] powerpc: thp: Fix crash on mremap

2014-01-06 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

[PATCH -V3 1/2] powerpc: mm: Move ppc64 page table range definitions to separate header

2014-01-06 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This avoid mmu-hash64.h including pagetable-ppc64.h. That inclusion cause issues like CC arch/powerpc/kernel/asm-offsets.s In file included from /home/aneesh/linus/arch/powerpc/include/asm/mmu-hash64.h:23:0, from

Re: [PATCH -V3 1/2] powerpc: mm: Move ppc64 page table range definitions to separate header

2014-01-06 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Mon, 2014-01-06 at 14:33 +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This avoid mmu-hash64.h including pagetable-ppc64.h. That inclusion cause issues like I don't like this. We have

[PATCH V4] powerpc: thp: Fix crash on mremap

2014-01-12 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

Re: [PATCH V4] powerpc: thp: Fix crash on mremap

2014-01-13 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Mon, 2014-01-13 at 11:34 +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash Andrea, can you ack the generic bit please ? Thanks ! Kirill A. Shutemov did ack

Re: [RFC PATCH powerpc] Fix compile error of pgtable-ppc64.h

2014-01-16 Thread Aneesh Kumar K.V
Li Zhong zh...@linux.vnet.ibm.com writes: It seems that forward declaration couldn't work well with typedef, use struct spinlock directly to avoiding following build errors: In file included from include/linux/spinlock.h:81, from include/linux/seqlock.h:35,

Re: [PATCH 2/4] powernv: kvm: make _PAGE_NUMA take effect

2014-01-20 Thread Aneesh Kumar K.V
Liu Ping Fan kernelf...@gmail.com writes: To make _PAGE_NUMA take effect, we should force the checking when guest uses hypercall to setup hpte. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-20 Thread Aneesh Kumar K.V
Liu ping fan kernelf...@gmail.com writes: On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf ag...@suse.de wrote: On 11.12.2013, at 09:47, Liu Ping Fan kernelf...@gmail.com wrote: This series is based on Aneesh's series [PATCH -V2 0/5] powerpc: mm: Numa faults support for ppc64 For this

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-20 Thread Aneesh Kumar K.V
Liu ping fan kernelf...@gmail.com writes: On Mon, Jan 20, 2014 at 11:45 PM, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: Liu ping fan kernelf...@gmail.com writes: On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf ag...@suse.de wrote: On 11.12.2013, at 09:47, Liu Ping Fan kernelf

Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-01-21 Thread Aneesh Kumar K.V
Kumar K.V aneesh.ku...@linux.vnet.ibm.com When we mark pte with _PAGE_NUMA we already call mmu_notifier_invalidate_range_start and mmu_notifier_invalidate_range_end, which will mark existing guest hpte entry as HPTE_V_ABSENT. Now we need to do that when we are inserting new guest hpte entries

Re: [PATCH 0/4] powernv: kvm: numa fault improvement

2014-01-21 Thread Aneesh Kumar K.V
Paul Mackerras pau...@samba.org writes: On Mon, Jan 20, 2014 at 03:48:36PM +0100, Alexander Graf wrote: On 15.01.2014, at 07:36, Liu ping fan kernelf...@gmail.com wrote: On Thu, Jan 9, 2014 at 8:08 PM, Alexander Graf ag...@suse.de wrote: On 11.12.2013, at 09:47, Liu Ping Fan

Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-01-27 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 21.01.2014, at 10:42, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: Liu Ping Fan kernelf...@gmail.com writes: To make sure that on host, the pages marked with _PAGE_NUMA result in a fault when guest access them, we should force

Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect

2014-01-27 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 27.01.2014, at 11:28, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: Alexander Graf ag...@suse.de writes: On 21.01.2014, at 10:42, Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: Liu Ping Fan kernelf...@gmail.com writes

[PATCH V3] POWERPC: BOOK3S: KVM: Use the saved dsisr and dar values on book3s 64

2014-01-27 Thread Aneesh Kumar K.V
Although it's optional IBM POWER cpus always had DAR value set on alignment interrupt. So don't try to compute these values. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- Changes from V2: * Depend on cpu feature flag to decide whether to use fault_dsir or not arch/powerpc

[PATCH V3] KVM: PPC: BOOK3S: PR: Enable Little Endian PR guest

2014-01-27 Thread Aneesh Kumar K.V
This patch make sure we inherit the LE bit correctly in different case so that we can run Little Endian distro in PR mode Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- Changes from V2: * Move H_SET_MODE to qemu arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc

[PATCH] powerpc: thp: Fix crash on mremap

2014-01-28 Thread Aneesh Kumar K.V
: b3084f4db3aeb991c507ca774337c7e7893ed04f for 3.11 stable series Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/Kconfig | 3 +++ arch/powerpc/platforms/Kconfig.cputype | 1 + mm/huge_memory.c | 12 3 files changed, 16 insertions(+) diff --git

[PATCH] powerpc: thp: Fix crash on mremap

2014-01-28 Thread Aneesh Kumar K.V
: b3084f4db3aeb991c507ca774337c7e7893ed04f for 3.12 stable series Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/Kconfig | 3 +++ arch/powerpc/platforms/Kconfig.cputype | 1 + mm/huge_memory.c | 12 3 files changed, 16 insertions(+) diff --git

[PATCH 2/2] Fix compile error of pgtable-ppc64.h

2014-01-28 Thread Aneesh Kumar K.V
'spinlock_t' /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here build fix for upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f for 3.13 stable series Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar

[PATCH 1/2] powerpc/thp: Fix crash on mremap

2014-01-28 Thread Aneesh Kumar K.V
for 3.13 stable series Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Acked-by: Kirill A. Shutemov kirill.shute...@linux.intel.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/include/asm/pgtable-ppc64.h | 14 ++ include/asm-generic

[RFC PATCH 01/10] KVM: PPC: BOOK3S: PR: Add POWER8 support

2014-01-28 Thread Aneesh Kumar K.V
Hello, This patch series implements PR KVM support for POWER8 platform -aneesh ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC PATCH 01/10] KVM: PPC: BOOK3S: PR: Fix PURR and SPURR emulation

2014-01-28 Thread Aneesh Kumar K.V
We definitely don't need to emulate mtspr, because both the registers are hypervisor resource. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 2 -- arch/powerpc/include/asm/kvm_host.h | 4 ++-- arch/powerpc/kvm/book3s_emulate.c

[RFC PATCH 02/10] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-01-28 Thread Aneesh Kumar K.V
virtual time base register is a per vm register and need to saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/asm

[RFC PATCH 04/10] KVM: PPC: BOOK3S: PR: Emulate Thread identification register

2014-01-28 Thread Aneesh Kumar K.V
Since PR KVM doesn't support SMT yet, we always return 0. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index

[RFC PATCH 05/10] KVM: PPC: BOOK3S: PR: Doorbell support

2014-01-28 Thread Aneesh Kumar K.V
We don't have SMT support yet, hence we should not find a doorbell message generated Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/powerpc/kvm/book3s_emulate.c b

[RFC PATCH 06/10] KVM: PPC: BOOK3S: PR: Emulate DPDES register

2014-01-28 Thread Aneesh Kumar K.V
Since we don't support SMT yet, we should always find zero in Directed privileged doorbell exception state register. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kvm

[RFC PATCH 08/10] KVM: PPC: BOOK3S: PR: Add support for facility unavailable interrupt

2014-01-28 Thread Aneesh Kumar K.V
At this point we allow all the supported facilities except EBB. So forward the interrupt to guest as illegal instruction. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_asm.h | 4 +++- arch/powerpc/kvm/book3s.c | 4 arch/powerpc

[RFC PATCH 07/10] KVM: PPC: BOOK3S: PR: Emulate facility status and control register

2014-01-28 Thread Aneesh Kumar K.V
to emulate the support. Currently all but EBB is disabled. We still don't support performance monitoring in PR guest. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_book3s_asm.h | 1 + arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kernel

[RFC PATCH 10/10] PPC: BOOK3S: Disable/Enable TM looking at the ibm, pa-features device tree entry

2014-01-28 Thread Aneesh Kumar K.V
Runtime disable transactional memory feature looking at pa-features device tree entry. We need to do this so that we can run a kernel built with TM config in PR mode. For PR guest we provide a device tree entry with TM feature disabled in pa-features Signed-off-by: Aneesh Kumar K.V aneesh.ku

[RFC PATCH 09/10] KVM: PPC: BOOK3S: PR: Ignore write to monitor mode control register

2014-01-28 Thread Aneesh Kumar K.V
We ignore write to these registers now Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_emulate.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index bf6b11021250

[RFC PATCH 03/10] KVM: PPC: BOOK3S: PR: Emulate instruction counter

2014-01-28 Thread Aneesh Kumar K.V
Writing to IC is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kvm/book3s_emulate.c | 3 +++ arch/powerpc/kvm/book3s_pr.c| 2 ++ 3 files changed, 6 insertions(+) diff

Re: [PATCH] powerpc: don't re-issue spinlock typedef that breaks older gcc

2014-01-28 Thread Aneesh Kumar K.V
header from within !ASSEMBLY seems to fix it up in an acceptable way. Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Kirill A. Shutemov kirill.shute...@linux.intel.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Paul Gortmaker paul.gortma...@windriver.com

Re: [PATCH] powerpc: don't re-issue spinlock typedef that breaks older gcc

2014-01-28 Thread Aneesh Kumar K.V
Paul Gortmaker paul.gortma...@windriver.com writes: On 14-01-28 12:28 PM, Aneesh Kumar K.V wrote: Paul Gortmaker paul.gortma...@windriver.com writes: Commit b3084f4db3aeb991c507ca774337c7e7893ed04f (powerpc/thp: Fix crash on mremap) added a typedef struct spinlock spinlock_t; which on gcc

Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h

2014-01-30 Thread Aneesh Kumar K.V
Greg KH g...@kroah.com writes: On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote: On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote: On Tue, Jan 28, 2014 at 05:52:42PM +0530, Aneesh Kumar K.V wrote: From: Li Zhong zh...@linux.vnet.ibm.com It seems that forward

Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h

2014-01-30 Thread Aneesh Kumar K.V
Greg KH g...@kroah.com writes: On Thu, Jan 30, 2014 at 11:08:52PM +0530, Aneesh Kumar K.V wrote: Greg KH g...@kroah.com writes: On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote: On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote: On Tue, Jan 28, 2014 at 05:52:42PM

[PATCH V2 1/2] powerpc/thp: Fix crash on mremap

2014-01-31 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

[PATCH V2 2/2] powerpc/mm: Fix compile error of pgtable-ppc64.h

2014-01-31 Thread Aneesh Kumar K.V
'spinlock_t' /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here upstream sha1:fd120dc2e205d2318a8b47d6d8098b789e3af67d for 3.13 stable series Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku

Re: [RFC PATCH 01/10] KVM: PPC: BOOK3S: PR: Fix PURR and SPURR emulation

2014-01-31 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 01/28/2014 05:44 PM, Aneesh Kumar K.V wrote: We definitely don't need to emulate mtspr, because both the registers are hypervisor resource. This patch description doesn't cover what the patch actually does. It changes the implementation from always

Re: [RFC PATCH 02/10] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register

2014-01-31 Thread Aneesh Kumar K.V
Paul Mackerras pau...@samba.org writes: On Tue, Jan 28, 2014 at 10:14:07PM +0530, Aneesh Kumar K.V wrote: virtual time base register is a per vm register and need to saved and restored on vm exit and entry. Writing to VTB is not allowed in the privileged mode. ... +#ifdef

Re: [RFC PATCH 03/10] KVM: PPC: BOOK3S: PR: Emulate instruction counter

2014-01-31 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 01/28/2014 05:44 PM, Aneesh Kumar K.V wrote: Writing to IC is not allowed in the privileged mode. This is not a patch description. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 1

Re: [RFC PATCH 07/10] KVM: PPC: BOOK3S: PR: Emulate facility status and control register

2014-01-31 Thread Aneesh Kumar K.V
Paul Mackerras pau...@samba.org writes: On Tue, Jan 28, 2014 at 10:14:12PM +0530, Aneesh Kumar K.V wrote: We allow priv-mode update of this. The guest value is saved in fscr, and the value actually used is saved in shadow_fscr. shadow_fscr only contains values that are allowed by the host

Re: [RFC PATCH 08/10] KVM: PPC: BOOK3S: PR: Add support for facility unavailable interrupt

2014-01-31 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes: On 01/28/2014 05:44 PM, Aneesh Kumar K.V wrote: At this point we allow all the supported facilities except EBB. So forward the interrupt to guest as illegal instruction. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc

[PATCH V2] powerpc: thp: Fix crash on mremap

2014-02-07 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c/0x5e0 ... Call Trace: [c00736103c40] [1b00] 0x1b00(unreliable) [437908.479693

[PATCH 1/3] powerpc: mm: Add new set flag argument to pte/pmd update function

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We will use this later to set the _PAGE_NUMA bit. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/pgtable-ppc64.h | 26

[PATCH 2/3] mm: dirty accountable change only apply to non prot numa case

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com So move it within the if loop Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- mm/mprotect.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index

[PATCH 3/3] mm: Use ptep/pmdp_set_numa for updating _PAGE_NUMA bit

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Archs like ppc64 doesn't do tlb flush in set_pte/pmd functions. ppc64 also doesn't implement flush_tlb_range. ppc64 require the tlb flushing to be batched within ptl locks. The reason to do that is to ensure that the hash page table

[PATCH 0/3] powerpc: Fix random application crashes with NUMA_BALANCING enabled

2014-02-11 Thread Aneesh Kumar K.V
Hello, This patch series fix random application crashes observed on ppc64 with numa balancing enabled. Without the patch we see crashes like anacron[14551]: unhandled signal 11 at 0041 nip 3cfd54b4 lr 3cfd5464 code 30001 anacron[14599]: unhandled signal 11 at

Re: [PATCH V2] powerpc: thp: Fix crash on mremap

2014-02-11 Thread Aneesh Kumar K.V
Greg KH gre...@linuxfoundation.org writes: On Fri, Feb 07, 2014 at 07:21:57PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4] .__hash_page_thp+0x2a4/0x440 LR [c00439ac] .hash_page+0x18c

Re: [PATCH V2] powerpc: thp: Fix crash on mremap

2014-02-11 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Tue, 2014-02-11 at 09:31 -0800, Greg KH wrote: On Fri, Feb 07, 2014 at 07:21:57PM +0530, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch fix the below crash NIP [c004cee4

[PATCH V2 1/3] powerpc: mm: Add new set flag argument to pte/pmd update function

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We will use this later to set the _PAGE_NUMA bit. Acked-by: Mel Gorman mgor...@suse.de Acked-by: Rik van Riel r...@redhat.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/hugetlb.h | 2

[PATCH V2 0/3] powerpc: Fix random application crashes with NUMA_BALANCING enabled

2014-02-11 Thread Aneesh Kumar K.V
Hello, This patch series fix random application crashes observed on ppc64 with numa balancing enabled. Without the patch we see crashes like anacron[14551]: unhandled signal 11 at 0041 nip 3cfd54b4 lr 3cfd5464 code 30001 anacron[14599]: unhandled signal 11 at

[PATCH V2 2/3] mm: dirty accountable change only apply to non prot numa case

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com So move it within the if loop Acked-by: Mel Gorman mgor...@suse.de Reviewed-by: Rik van Riel r...@redhat.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- mm/mprotect.c | 21 +++-- 1 file changed, 7

<    3   4   5   6   7   8   9   10   11   12   >