[PATCH] powerpc: e500mc: Fix: use CONFIG_PPC_E500MC in idle_e500.S

2011-10-11 Thread Bharat Bhushan
It is wrongly using undefined CONFIG_E500MC. Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/idle_e500.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S index 3e2b95c..4f0ab85 100644 --- a/arch

[PATCH] powerpc: e500mc: Fix: use CONFIG_PPC_E500MC in idle_e500.S

2011-10-12 Thread Bharat Bhushan
It is wrongly using undefined CONFIG_E500MC. Tested on custom p4080DS board. Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/idle_e500.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S index

[PATCH v2] KVM: PPC: Use clockevent multiplier and shifter for decrementer

2012-04-08 Thread Bharat Bhushan
. Signed-off-by: Bharat Bhushan --- v2: - decrementer_clockevent is made non-static rather than a seprate API to get mult/shift arch/powerpc/include/asm/time.h |1 + arch/powerpc/kernel/time.c |2 +- arch/powerpc/kvm/emulate.c |5 +++-- 3 files changed, 5 inserti

[PATCH v3]KVM: PPC: Use clockevent multiplier and shifter for decrementer

2012-04-16 Thread Bharat Bhushan
. Signed-off-by: Bharat Bhushan --- v3: - decrementer_clockevent symbol exported. arch/powerpc/include/asm/time.h |1 + arch/powerpc/kernel/time.c |3 ++- arch/powerpc/kvm/emulate.c |5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/in

[PATCH v4] KVM: PPC Use clockevent multiplier and shifter for decrementer

2012-04-18 Thread Bharat Bhushan
. Signed-off-by: Bharat Bhushan --- v4: - Added comment in emulate.c arch/powerpc/include/asm/time.h |1 + arch/powerpc/kernel/time.c |3 ++- arch/powerpc/kvm/emulate.c |9 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH] powerpc: Fix assmption of end_of_DRAM() returns end address

2012-06-05 Thread Bharat Bhushan
memblock_end_of_DRAM() returns end_address + 1, not end address. While some code assumes that it returns end address. Signed-off-by: Bharat Bhushan --- This patch is based on next branch of https://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git arch/powerpc/platforms/44x/currituck.c

[PATCH] Using alloc_coherent for caam job rings

2012-06-26 Thread Bharat Bhushan
From: Bharat Bhushan The caam job rings (input/output job ring) are allocated using dma_map_single(). These job rings can be visualized as the ring buffers in which the jobs are en-queued/de-queued. The s/w enqueues the jobs in input job ring which h/w dequeues and after processing it copies the

[PATCH] [RFC] bookehv: Handle debug exception on guest exit

2013-03-20 Thread Bharat Bhushan
either be handled by KVM. This is tested on e500mc in 32 bit mode Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/exceptions-64e.S | 54 ++ arch/powerpc/kernel/head_booke.h | 35 ++ 2 files changed, 89 insertions(+), 0 deletions

[PATCH] bookehv: Handle debug exception on guest exit

2013-03-20 Thread Bharat Bhushan
either be handled by KVM. This is tested on e500mc in 32 bit mode Signed-off-by: Bharat Bhushan --- v0: - Do not apply this change for debug_crit as we do not know those chips have issue or not. - corrected 64bit case branching arch/powerpc/kernel/exceptions-64e.S | 29

[PATCH] powerpc: Fix interrupt range check on debug exception

2013-04-30 Thread Bharat Bhushan
check interrupt_base to interrupt_end range for not handling debug exception in kernel exception entry. Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/head_44x.S |2 ++ arch/powerpc/kernel/head_booke.h | 16 arch/powerpc/kernel/head_fsl_booke.S |2 ++ 3

[PATCH] powerpc: Make ptrace work reliably

2013-05-15 Thread Bharat Bhushan
From: Bharat Bhushan Bharat Bhushan (2): powerpc: debug control and status registers are 32bit => This patch makes debug control and status registers as 32bit as they are. This does not fix anything powerpc: restore dbcr0 on user space exit => This patch fixes the ptrace relia

[PATCH] powerpc: debug control and status registers are 32bit

2013-05-15 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/processor.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index d7e67ca..5213577 100644 --- a/arch/powerpc/include/asm

[PATCH] powerpc: restore dbcr0 on user space exit

2013-05-15 Thread Bharat Bhushan
ot happen. This fixes using ptrace reliably on BookE-PowerPC Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/asm-offsets.c |1 + arch/powerpc/kernel/entry_64.S| 24 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/asm-off

[PATCH 0/2 v2] powerpc: Make ptrace work reliably

2013-05-15 Thread Bharat Bhushan
From: Bharat Bhushan v1->v2 - Subject line was missing 0/2, 1/2, 2/2 Bharat Bhushan (2): powerpc: debug control and status registers are 32bit => This patch makes debug control and status registers as 32bit as they are. This does not fix anything powerpc: restore dbcr0 on user

[PATCH 1/2 v2] powerpc: debug control and status registers are 32bit

2013-05-15 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- v1->v2 - Subject line was not having 1/2 arch/powerpc/include/asm/processor.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index d7e67ca..5213

[PATCH 2/2 v2] powerpc: restore dbcr0 on user space exit

2013-05-15 Thread Bharat Bhushan
ot happen. This fixes using ptrace reliably on BookE-PowerPC Signed-off-by: Bharat Bhushan --- v1->v2 - Subject line was not having 2/2 arch/powerpc/kernel/asm-offsets.c |1 + arch/powerpc/kernel/entry_64.S| 24 2 files changed, 21 insertions(+), 4 deleti

[PATCH 0/2 v3] powerpc: Make ptrace work reliably

2013-05-21 Thread Bharat Bhushan
From: Bharat Bhushan v2->v3 - Load PACACURRENT immediately after _MSR(r1), and load DBCR0 just after "beq resume_kernel - Added lat_sysycal results before and after the patch v1->v2 - Subject line was missing 0/2, 1/2, 2/2 Bharat Bhushan (2): powerpc: debug control

[PATCH 1/2 v3] powerpc: debug control and status registers are 32bit

2013-05-21 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- v2->v3 - No change v1->v2 - Subject line was not having 1/2 arch/powerpc/include/asm/processor.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/proce

[PATCH 2/2 v3] powerpc: restore dbcr0 on user space exit

2013-05-21 Thread Bharat Bhushan
: 3.8580 0.2017 0.2851 1.6955 0.2255 0.0856 1) ./lat_syscall -P 2 -N 10 /dev/shm/uImage action: Openreadwrite statfstat null Before: 4.1388 0.2238 0.3066 1.7106 0.2256 0.0856 After: 4.1413 0.2236 0.3062 1.7107 0.2256 0.0856 Signed-off-by: Bharat Bhushan --- v2-&g

[PATCH] using get/put_user64 apis on 64bit machine

2012-07-23 Thread Bharat Bhushan
On powerpc64 machine get/put_user64() is same as get/put_user() while on powerpc32 machine get_user64 is different. With this patch we can use get_user64() and put_user64() on 32 and 64 bit machines. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/uaccess.h |7 +++ 1 files

[PATCH] Remove unused __get_user64() and __put_user64()

2012-09-11 Thread Bharat Bhushan
__get_user64() and __put_user64() are not used. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/uaccess.h | 11 --- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 17bb40c

[PATCH]powerpc: Corrected include header path in kvm_para.h

2012-12-18 Thread Bharat Bhushan
The include/uapi/asm/kvm_para.h includes but the correct reference should be as this is the place where make install_header installs the header files for userspace. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/uapi/asm/kvm_para.h |2 +- 1 files changed, 1 insertions(+), 1

[PATCH 0/6 v5] KVM :PPC: Userspace Debug support

2013-06-25 Thread Bharat Bhushan
From: Bharat Bhushan Note: These patches are based on http://github.com/agraf/linux-2.6.git queue This patchset adds the userspace debug support for booke/bookehv. this is tested on powerpc e500v2/e500mc devices. We are now assuming that debug resource will not be used by kernel for its own

[PATCH 1/6 v5] powerpc: remove unnecessary line continuations

2013-06-25 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/process.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ceb4e7b..639a8de 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel

[PATCH 2/6 v5] powerpc: move debug registers in a structure

2013-06-25 Thread Bharat Bhushan
This way we can use same data type struct with KVM and also help in using other debug related function. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/processor.h | 38 + arch/powerpc/include/asm/reg_booke.h |8 +- arch/powerpc/kernel/asm-offsets.c|2 +- arch

[PATCH 3/6 v5] powerpc: export debug registers save function for KVM

2013-06-25 Thread Bharat Bhushan
KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/switch_to.h |4 arch/powerpc/kernel/process.c|3 ++- 2 files changed, 6 insertions(+), 1 deletions

[PATCH 4/6 v5] KVM: PPC: exit to user space on "ehpriv" instruction

2013-06-25 Thread Bharat Bhushan
"ehpriv" instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with "run->debug" have relevant information. As this is the first point we are using run->debug, also defined the run->debug structure.

[PATCH 5/6 v5] KVM: PPC: Using "struct debug_reg"

2013-06-25 Thread Bharat Bhushan
For KVM also use the "struct debug_reg" defined in asm/processor.h Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/kvm_host.h | 13 + arch/powerpc/kvm/booke.c| 34 -- 2 files changed, 25 insertions(+), 22 deletion

[PATCH 6/6 v5] KVM: PPC: Add userspace debug stub support

2013-06-25 Thread Bharat Bhushan
eption, always exit to user space irrespective of user space is expecting the debug exception or not. If this is unexpected exception (breakpoint/watchpoint event not set by userspace) then let us leave the action on user space. This is similar to what it was before, only thing is that now we have proper exi

[PATCH 0/2] powerpc: allow kvm to use kerel debug framework

2013-07-03 Thread Bharat Bhushan
From: Bharat Bhushan This patchset moves the debug registers in a structure, which allows kvm to use same structure for debug emulation. Note: Earilier a patchset "https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-June/108132.html"; was sent which is a bunch of six patches. That p

[PATCH 1/2] powerpc: remove unnecessary line continuations

2013-07-03 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/process.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index c517dbe..19b8733 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel

[PATCH 2/2] powerpc: move debug registers in a structure

2013-07-03 Thread Bharat Bhushan
This way we can use same data type struct with KVM and also help in using other debug related function. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/processor.h | 38 + arch/powerpc/include/asm/reg_booke.h |8 +- arch/powerpc/kernel/asm-offsets.c|2 +- arch

[PATCH 2/4 v6] KVM: PPC: exit to user space on "ehpriv 1" instruction

2013-07-04 Thread Bharat Bhushan
"ehpriv 1" instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with "run->debug" have relevant information. As this is the first point we are using run->debug, also defined the run->debug structure.

[PATCH 1/4 v6] powerpc: export debug registers save function for KVM

2013-07-04 Thread Bharat Bhushan
KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan --- v5->v6 - switch_booke_debug_regs() not guarded by the compiler switch arch/powerpc/include/asm/switch_to.h |1 + arch/powerpc/ker

[PATCH 3/4 v6] KVM: PPC: Using "struct debug_reg"

2013-07-04 Thread Bharat Bhushan
For KVM also use the "struct debug_reg" defined in asm/processor.h Signed-off-by: Bharat Bhushan --- v5->v6 - no changes arch/powerpc/include/asm/kvm_host.h | 13 + arch/powerpc/kvm/booke.c| 34 -- 2 files changed,

[PATCH 4/4 v6] KVM: PPC: Add userspace debug stub support

2013-07-04 Thread Bharat Bhushan
eption, always exit to user space irrespective of user space is expecting the debug exception or not. If this is unexpected exception (breakpoint/watchpoint event not set by userspace) then let us leave the action on user space. This is similar to what it was before, only thing is that now we have proper exi

[PATCH 0/4 v6] KVM :PPC: Userspace Debug support

2013-07-04 Thread Bharat Bhushan
From: Bharat Bhushan Note: These patches depends on https://lkml.org/lkml/2013/7/4/49. This patchset adds the userspace debug support for booke/bookehv. this is tested on powerpc e500v2/e500mc devices. We are now assuming that debug resource will not be used by kernel for its own debugging. It

[PATCH 1/4] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-07-25 Thread Bharat Bhushan
For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is "_PAGE_LENDIAN" which is wrong and that should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined anywhere. Signed-off-by: Bhar

[PATCH 3/4] kvm: powerpc: allow guest control "G" attribute in mas2

2013-07-25 Thread Bharat Bhushan
"G" bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting "G", so allow him. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/e500.h b/a

[PATCH 2/4] kvm: powerpc: allow guest control "E" attribute in mas2

2013-07-25 Thread Bharat Bhushan
"E" bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting "E", so allow him." Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 d

[PATCH 4/4] kvm: powerpc: set cache coherency only for RAM pages

2013-07-25 Thread Bharat Bhushan
re cacheable mapping, which is not yet supported. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/e500_mmu_host.c | 24 +++- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index 1c6a9d7..

[PATCH 0/6 v2] kvm: powerpc: use cache attributes from linux pte

2013-08-01 Thread Bharat Bhushan
From: Bharat Bhushan First patch is a typo fix where book3e define _PAGE_LENDIAN while it should be defined as _PAGE_ENDIAN. This seems to show that this is never exercised :-) Second and third patch is to allow guest controlling "G"-Guarded and "E"-Endiany TLB attributes re

[PATCH 1/6 v2] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-08-01 Thread Bharat Bhushan
For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is "_PAGE_LENDIAN" which is wrong and should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined anywhere. Signed-off-by: Bharat Bhushan

[PATCH 2/6 v2] kvm: powerpc: allow guest control "E" attribute in mas2

2013-08-01 Thread Bharat Bhushan
"E" bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting "E", so allow him." Signed-off-by: Bharat Bhushan --- v1->v2 - no change arch/powerpc/kvm/e500.h |2 +- 1 files

[PATCH 3/6 v2] kvm: powerpc: allow guest control "G" attribute in mas2

2013-08-01 Thread Bharat Bhushan
"G" bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting "E", so allow him. Signed-off-by: Bharat Bhushan --- v1->v2 - no change arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ar

[PATCH 4/6 v2] powerpc: move linux pte/hugepte search to more generic file

2013-08-01 Thread Bharat Bhushan
Linux pte search functions find_linux_pte_or_hugepte() and find_linux_pte() have nothing specific to 64bit anymore. So they are move from pgtable-ppc64.h to asm/pgtable.h Signed-off-by: Bharat Bhushan --- v1->v2 - This is a new change in this version arch/powerpc/include/asm/pgtable-ppc6

[PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s

2013-08-01 Thread Bharat Bhushan
KVM need to lookup linux pte for getting TLB attributes (WIMGE). This is similar to how book3s does. This will be used in follow-up patches. Signed-off-by: Bharat Bhushan --- v1->v2 - This is a new change in this version arch/powerpc/include/asm/kvm_booke.h |

[PATCH 6/6 v2] kvm: powerpc: use caching attributes as per linux pte

2013-08-01 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan --- v1->v2 - Use Linux pte for wimge rather than RAM/no-RAM mechanism a

[PATCH 2/6 v3] kvm: powerpc: allow guest control "E" attribute in mas2

2013-08-06 Thread Bharat Bhushan
"E" bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting "E", so allow him." Signed-off-by: Bharat Bhushan --- v2->v3 - no change v1->v2 - no change arch/powerpc/kvm/e500.

[PATCH 1/6 v3] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-08-06 Thread Bharat Bhushan
For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is "_PAGE_LENDIAN" which is wrong and should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined anywhere. Signed-off-by: Bharat Bhushan

[PATCH 0/6 v3] kvm: powerpc: use cache attributes from linux pte

2013-08-06 Thread Bharat Bhushan
From: Bharat Bhushan First patch is a typo fix where book3e define _PAGE_LENDIAN while it should be defined as _PAGE_ENDIAN. This seems to show that this is never exercised :-) Second and third patch is to allow guest controlling "G"-Guarded and "E"-Endian TLB attributes r

[PATCH 3/6 v3] kvm: powerpc: allow guest control "G" attribute in mas2

2013-08-06 Thread Bharat Bhushan
"G" bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting "G", so allow him. Signed-off-by: Bharat Bhushan --- v2->v3 - no change v1->v2 - no change arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 delet

[PATCH 4/6 v3] powerpc: move linux pte/hugepte search to more generic file

2013-08-06 Thread Bharat Bhushan
Linux pte search functions find_linux_pte_or_hugepte() and find_linux_pte() have nothing specific to 64bit anymore. So they are move from pgtable-ppc64.h to asm/pgtable.h Signed-off-by: Bharat Bhushan --- v2->v3 - no change v1->v2 - This is a new change in this version arch/powerpc/i

[PATCH 6/6 v3] kvm: powerpc: use caching attributes as per linux pte

2013-08-06 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan --- v2->v3 - setting pgdir before kvmppc_fix_ee_before_entry() on vcpu_

[PATCH 5/6 v3] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-08-06 Thread Bharat Bhushan
-by: Bharat Bhushan --- v2->v3 - New change arch/powerpc/include/asm/pgtable.h | 23 + arch/powerpc/kvm/book3s_hv_rm_mmu.c | 38 +++--- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable.h b/a

[PATCH 6/6 v4] kvm: powerpc: use caching attributes as per linux pte

2013-08-15 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan --- v3->v4 - s/printk/printk_ratelimited till we return machine check in mmu se

[PATCH 0/6 v5] kvm: powerpc: use cache attributes from linux pte

2013-09-18 Thread Bharat Bhushan
From: Bharat Bhushan First patch is a typo fix where book3e define _PAGE_LENDIAN while it should be defined as _PAGE_ENDIAN. This seems to show that this is never exercised :-) Second and third patch is to allow guest controlling "G"-Guarded and "E"-Endian TLB attributes r

[PATCH 1/6 v5] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-09-18 Thread Bharat Bhushan
For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is "_PAGE_LENDIAN" which is wrong and that should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined anywhere. Signed-off-by: Bhar

[PATCH 3/6 v5] kvm: powerpc: allow guest control "G" attribute in mas2

2013-09-18 Thread Bharat Bhushan
"G" bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting "G", so allow him. Signed-off-by: Bharat Bhushan --- v1->v5 - no change arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ar

[PATCH 2/6 v5] kvm: powerpc: allow guest control "E" attribute in mas2

2013-09-18 Thread Bharat Bhushan
"E" bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting "E", so allow him." Signed-off-by: Bharat Bhushan --- v1->v5 - no change arch/powerpc/kvm/e500.h |2 +- 1 files

[PATCH 5/6 v5] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-09-18 Thread Bharat Bhushan
we do both - Clear "flags" when invalidating; - Clear "flags" when reusing same entry later Signed-off-by: Bharat Bhushan --- v3-> v5 - New patch (found this issue when doing vfio-pci development) arch/powerpc/kvm/e500_mmu_host.c | 12 +++- 1 files c

[PATCH 4/6 v5] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-09-18 Thread Bharat Bhushan
-by: Bharat Bhushan --- v4->v5 - No change arch/powerpc/include/asm/pgtable.h | 24 +++ arch/powerpc/kvm/book3s_hv_rm_mmu.c | 36 +++--- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable.h b/a

[PATCH 6/6 v5] kvm: powerpc: use caching attributes as per linux pte

2013-09-18 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan --- v4->v5 - No change arch/powerpc/include/asm/kvm_host.h |2 +- a

[PATCH 1/7] powerpc: Add interface to get msi region information

2013-09-19 Thread Bharat Bhushan
create IOMMU (Freescale PAMU) mapping for devices which are directly assigned using VFIO. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/machdep.h |8 +++ arch/powerpc/include/asm/pci.h |2 + arch/powerpc/kernel/msi.c | 18 arch/powerpc/sysdev

[PATCH 3/7] fsl iommu: add get_dev_iommu_domain

2013-09-19 Thread Bharat Bhushan
From: Bharat Bhushan returns the iommu_domain of the requested device for fsl pamu. Use PCI controller dev struct for pci devices as current LIODN schema assign LIODN to PCI controller not PCI device. This will be corrected with proper LIODN schema. Signed-off-by: Bharat Bhushan --- drivers

[PATCH 2/7] iommu: add api to get iommu_domain of a device

2013-09-19 Thread Bharat Bhushan
This api return the iommu domain to which the device is attached. The iommu_domain is required for making API calls related to iommu. Follow up patches which use this API to know iommu maping. Signed-off-by: Bharat Bhushan --- drivers/iommu/iommu.c | 10 ++ include/linux/iommu.h

[PATCH 0/7] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-09-19 Thread Bharat Bhushan
From: Bharat Bhushan This patchset adds support for vfio-pci with Freescale IOMMU (PAMU- Peripheral Access Management Unit) The Freescale PAMU is an aperture-based IOMMU with the following characteristics. Each device has an entry in a table in memory describing the iova->phys mapping.

[PATCH 5/7] iommu: supress loff_t compilation error on powerpc

2013-09-19 Thread Bharat Bhushan
Signed-off-by: Bharat Bhushan --- drivers/vfio/pci/vfio_pci_rdwr.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index 210db24..8a8156a 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers

[PATCH 4/7] powerpc: translate msi addr to iova if iommu is in use

2013-09-19 Thread Bharat Bhushan
If the device is attached with iommu domain then set MSI address to the iova configured in PAMU. Signed-off-by: Bharat Bhushan --- arch/powerpc/sysdev/fsl_msi.c | 56 +++- 1 files changed, 54 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev

[PATCH 6/7] vfio: moving some functions in common file

2013-09-19 Thread Bharat Bhushan
Some function defined in vfio_iommu_type1.c were common and we want to use these for FSL IOMMU (PAMU) and iommu-none driver. So some of them are moved to vfio_iommu_common.c I think we can do more of that but we will take this step by step. Signed-off-by: Bharat Bhushan --- drivers/vfio

[PATCH 7/7] vfio pci: Add vfio iommu implementation for FSL_PAMU

2013-09-19 Thread Bharat Bhushan
ned-off-by: Bharat Bhushan --- drivers/vfio/Kconfig |6 + drivers/vfio/Makefile |1 + drivers/vfio/vfio_iommu_fsl_pamu.c | 952 include/uapi/linux/vfio.h | 100 4 files changed, 1059 insertions(+), 0 deleti

[PATCH 5/6 v6] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-09-19 Thread Bharat Bhushan
we do both - Clear "flags" when invalidating; - Clear "flags" when reusing same entry later Signed-off-by: Bharat Bhushan --- v5->v6 - Fix flag clearing comment arch/powerpc/kvm/e500_mmu_host.c | 16 1 files changed, 8 insertions(+), 8 d

[PATCH 5/6 v7] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-09-22 Thread Bharat Bhushan
we do both - Clear "flags" when invalidating; - Clear "flags" when reusing same entry later Signed-off-by: Bharat Bhushan --- v6->7 - Comment re-phrased v5->v6 - Reordered the flag clearing steps as per comment on v5 v4->v5 - New change arch/powerpc/

[PATCH 1/4] powerpc: Added __cmpdi2 for signed 64bit comparision

2013-10-08 Thread Bharat Bhushan
This was missing on powerpc and I am getting compilation error drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2' drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2' Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/misc_32.

[PATCH] powerpc: Added __cmpdi2 for signed 64bit comparision

2013-10-08 Thread Bharat Bhushan
This was missing on powerpc and I am getting compilation error drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2' drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2' Signed-off-by: Bharat Bhushan --- arch/powerpc/kernel/misc_32.

[PATCH 1/5 RFC] pci:msi: add weak function for returning msi region info

2013-10-29 Thread Bharat Bhushan
In Aperture type of IOMMU (like FSL PAMU), VFIO-iommu system need to know the MSI region to map its window in h/w. This patch just defines the required weak functions only and will be used by followup patches. Signed-off-by: Bharat Bhushan --- drivers/pci/msi.c | 22

[PATCH 4/5 RFC] pci: msi: expose msi region information functions

2013-10-29 Thread Bharat Bhushan
So by now we have defined all the interfaces for getting the msi region, this patch expose the interface to linux subsystem. These will be used by vfio subsystem for setting up iommu for MSI interrupt of direct assignment devices. Signed-off-by: Bharat Bhushan --- include/linux/pci.h | 13

[PATCH 2/5 RFC] powerpc: pci: Add arch specific msi region interface

2013-10-29 Thread Bharat Bhushan
This patch adds the interface to get the msi region information from arch specific code. The machine spicific code is not yet defined. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/machdep.h |8 arch/powerpc/kernel/msi.c | 18 ++ 2 files

[PATCH 3/5 RFC] powerpc: msi: Extend the msi region interface to get info from fsl_msi

2013-10-29 Thread Bharat Bhushan
(Freescale PAMU) mapping for devices which are directly assigned using VFIO. Signed-off-by: Bharat Bhushan --- arch/powerpc/sysdev/fsl_msi.c | 42 +++- arch/powerpc/sysdev/fsl_msi.h | 11 - 2 files changed, 45 insertions(+), 8 deletions(-) diff

[PATCH 5/5 RFC] vfio: setup iova-base for msi interrupts for vfio assigned device

2013-10-29 Thread Bharat Bhushan
on design. I will divide this in multiple logical patches once this design is accepted. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/machdep.h |2 + arch/powerpc/kernel/msi.c | 10 ++ arch/powerpc/sysdev/fsl_msi.c | 64

[PATCH 0/5 RFC] vfio/pci: add interface to for MSI support with FSL PAMU

2013-10-29 Thread Bharat Bhushan
From: Bharat Bhushan PAMU (FSL IOMMU) has a concept of primary window and subwindows. Primary window corresponds to the complete guest iova address space (including MSI space), with respect to IOMMU_API this is termed as geometry. IOVA Base of subwindow is determined from the number of

RE: [PATCH v5 4/4] powerpc/85xx: add sysfs for pw20 state and altivec idle

2013-11-05 Thread Bharat Bhushan
> -Original Message- > From: Wang Dongsheng-B40534 > Sent: Tuesday, November 05, 2013 8:40 AM > To: Wood Scott-B07421 > Cc: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org > Subject: RE: [PATCH v5 4/4] powerpc/85xx: add sysfs for pw20 state and altivec > idle > > > > > -Origin

RE: [PATCH v4 1/4] dma: imx-sdma: Add sdma firmware version 2 support

2013-11-09 Thread Bharat Bhushan
> -Original Message- > From: Linuxppc-dev [mailto:linuxppc-dev- > bounces+bharat.bhushan=freescale@lists.ozlabs.org] On Behalf Of Nicolin > Chen > Sent: Friday, November 08, 2013 4:20 PM > To: vinod.k...@intel.com; dan.j.willi...@intel.com; s.ha...@pengutronix.de; > ti...@tabi.org; s

RE: [PATCH v5 4/4] powerpc/85xx: add sysfs for pw20 state and altivec idle

2013-11-10 Thread Bharat Bhushan
> > Those codes just for discuss with Bharat. He want to make one flow at > > "show_pw20_wait_time"/" show_altivec_idle_wait_time" function. If we > > do that, we need to initialize pw20_wt/altivec_idle_wt. > > > I will keep this stuff at "show_pw20_wait_time"/"show_altivec_idle_wait_time" > and ad

RE: [PATCH v9] PPC: POWERNV: move iommu_add_device earlier

2013-11-13 Thread Bharat Bhushan
assigned to them. > 2. moves a bus notifier to powernv code in order to avoid conflict with > the notifier from Freescale driver. > > iommu_add_device() and iommu_del_device() are public now. > > Signed-off-by: Alexey Kardashevskiy Tested-by: Bharat Bhushan > --- > Changes:

[PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-18 Thread Bharat Bhushan
From: Bharat Bhushan PAMU (FSL IOMMU) has a concept of primary window and subwindows. Primary window corresponds to the complete guest iova address space (including MSI space), with respect to IOMMU_API this is termed as geometry. IOVA Base of subwindow is determined from the number of

[PATCH 2/9 v2] pci: msi: expose msi region information functions

2013-11-18 Thread Bharat Bhushan
So by now we have defined all the interfaces for getting the msi region, this patch expose the interface to linux subsystem. These will be used by vfio subsystem for setting up iommu for MSI interrupt of direct assignment devices. Signed-off-by: Bharat Bhushan --- v1->v2 - None include/li

[PATCH 1/9 v2] pci:msi: add weak function for returning msi region info

2013-11-18 Thread Bharat Bhushan
In Aperture type of IOMMU (like FSL PAMU), VFIO-iommu system need to know the MSI region to map its window in h/w. This patch just defines the required weak functions only and will be used by followup patches. Signed-off-by: Bharat Bhushan --- v1->v2 - Added description on "struct ms

[PATCH 3/9 v2] powerpc: pci: Add arch specific msi region interface

2013-11-18 Thread Bharat Bhushan
This patch adds the interface to get the msi region information from arch specific code. The machine spicific code is not yet defined. Signed-off-by: Bharat Bhushan --- v1->v2 - None arch/powerpc/include/asm/machdep.h |8 arch/powerpc/kernel/msi.c |

[PATCH 4/9 v2] powerpc: msi: Extend the msi region interface to get info from fsl_msi

2013-11-18 Thread Bharat Bhushan
(Freescale PAMU) mapping for devices which are directly assigned using VFIO. Signed-off-by: Bharat Bhushan --- v1->v2 - Atomic increment of bank index for parallel probe of msi node arch/powerpc/sysdev/fsl_msi.c | 42 +++- arch/powerpc/sysdev/fsl_ms

[PATCH 5/9 v2] pci/msi: interface to set an iova for a msi region

2013-11-18 Thread Bharat Bhushan
This patch defines an interface by which a msi page can be mapped to a specific iova page. This is a requirement in aperture type of IOMMUs (like Freescale PAMU), where we map msi iova page just after guest memory iova address. Signed-off-by: Bharat Bhushan --- v2 - new patch drivers/pci

[PATCH 6/9 v2] powerpc: pci: Extend msi iova page setup to arch specific

2013-11-18 Thread Bharat Bhushan
This patch extend the interface to arch specific code for setting msi iova address for a msi page. Machine specific code is not yet implemented. Signed-off-by: Bharat Bhushan --- v2 - new patch arch/powerpc/include/asm/machdep.h |2 ++ arch/powerpc/kernel/msi.c | 10

[PATCH 7/9 v2] pci: msi: Extend msi iova setting interface to powerpc arch

2013-11-18 Thread Bharat Bhushan
Now we Keep track of devices which have msi page mapping to specific iova page for all msi bank. When composing MSI address and data then this list will be traversed. If device found in the list then use configured iova page otherwise iova page will be taken as before. Signed-off-by: Bharat

[PATCH 8/9 v2] vfio: moving some functions in common file

2013-11-18 Thread Bharat Bhushan
. Signed-off-by: Bharat Bhushan --- v1->v2 - removed un-necessary header file inclusion - mark static function which are internal to *common.c drivers/vfio/Makefile|4 +- drivers/vfio/vfio_iommu_common.c | 227 ++ drivers/v

[PATCH 9/9 v2] vfio pci: Add vfio iommu implementation for FSL_PAMU

2013-11-18 Thread Bharat Bhushan
1.c). Signed-off-by: Bharat Bhushan --- v1->v2 - Use lock around msi-dma list - check for overlap between dma and msi-dma pages - Some code cleanup as per various comments drivers/vfio/Kconfig |6 + drivers/vfio/Makefile |1 + drivers/vfio/vfio_iommu_fsl_

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-21 Thread Bharat Bhushan
nux-foundation.org; linux- > p...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux- > ker...@vger.kernel.org; Bhushan Bharat-R65777 > Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU) > > On Tue, 2013-11-19 at 10:47 +0530, Bharat Bhushan wrote: >

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-24 Thread Bharat Bhushan
liamson wrote: > > > On Thu, 2013-11-21 at 11:20 +, Bharat Bhushan wrote: > > > > > > > > > -Original Message- > > > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > > > > Sent: Thursday, November 21,

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-27 Thread Bharat Bhushan
ndation.org; bhelg...@google.com; linuxppc- > d...@lists.ozlabs.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU) > > On Mon, 2013-11-25 at 05:33 +, Bharat Bhushan wrote: > > > > > -Original Message- >

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-28 Thread Bharat Bhushan
g > > Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU > > (PAMU) > > > > On Mon, 2013-11-25 at 05:33 +, Bharat Bhushan wrote: > > > > > > > -Original Message- > > > > From: Alex Williamson [mailto:alex

RE: [PATCH 1/9 v2] pci:msi: add weak function for returning msi region info

2013-11-28 Thread Bharat Bhushan
o > > On Tue, Nov 19, 2013 at 10:47:05AM +0530, Bharat Bhushan wrote: > > In Aperture type of IOMMU (like FSL PAMU), VFIO-iommu system need to > > know the MSI region to map its window in h/w. This patch just defines > > the required weak functions only and will be use

  1   2   >