Re: [Qemu-devel] [PATCH v5 10/12] hw/mips: malta: Add KVM support

2014-06-19 Thread Sanjay Lal
On Jun 19, 2014, at 9:27 AM, Aurelien Jarno wrote: > On Tue, Jun 17, 2014 at 11:10:35PM +0100, James Hogan wrote: >> In KVM mode the bootrom is loaded and executed from the last 1MB of >> DRAM. > > What is the reason for that? I am not opposed to that, but if it is > really needed, it means tha

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread Sanjay Lal
On Jun 7, 2013, at 4:03 PM, David Daney wrote: > From: David Daney > > These patches take a somewhat different approach to MIPS > virtualization via the MIPS-VZ extensions than the patches previously > sent by Sanjay Lal. > > Several facts about the code: > >

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread Sanjay Lal
> Come to think of it, Emulating SGI hardware might be an interesting case. > There may be old IRIX systems and applications that could be running low on > real hardware. Some of those systems take up a whole room and draw a lot of > power. They might run faster and at much l

Re: [PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context.

2013-05-30 Thread Sanjay Lal
On May 30, 2013, at 1:11 PM, Paolo Bonzini wrote: > Il 30/05/2013 20:35, Sanjay Lal ha scritto: >>>>>> +#endif >>>>>> +local_irq_save(flags); >>>>>> +if (kvm_mips_handle_vz_root_tlb_fault(badvaddr,

Re: [PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context.

2013-05-30 Thread Sanjay Lal
On May 28, 2013, at 9:14 AM, Paolo Bonzini wrote: > Il 19/05/2013 07:47, Sanjay Lal ha scritto: >> +#endif >> +local_irq_save(flags); >> +if (kvm_mips_handle_vz_root_tlb_fault(badvaddr, vcpu) < 0) { >> +run->exit

Re: [PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context.

2013-05-30 Thread Sanjay Lal
On May 28, 2013, at 8:04 AM, Paolo Bonzini wrote: > Il 19/05/2013 07:47, Sanjay Lal ha scritto: >> +static int kvm_vz_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs >> *regs) >> +{ >> +struct mips_coproc *cop0 = vcpu->arch.cop0; >> + >&g

Re: [PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-30 Thread Sanjay Lal
On May 30, 2013, at 10:07 AM, David Daney wrote: > On 05/28/2013 09:34 AM, Paolo Bonzini wrote: >> Il 19/05/2013 07:47, Sanjay Lal ha scritto: >>> - Add API to allow clients (QEMU etc.) to check whether the H/W >>> supports the MIPS VZ-ASE. >> >> Why

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Sanjay Lal
--- > arch/mips/kvm/kvm_trap_emul.c| 50 --- > 4 files changed, 367 insertions(+), 102 deletions(-) > > -- > 1.7.11.7 Acked-by: Sanjay Lal Regards Sanjay -- To unsubscribe from this list: send the line "unsubscribe kvm" in t

Re: [PATCH v4 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-05-22 Thread Sanjay Lal
On May 21, 2013, at 1:54 PM, David Daney wrote: > From: David Daney > > Because not all 256 CP0 registers are ever implemented, we need a > different method of manipulating them. Use the > KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. > > Code related to implementing KVM_SET_ONE_REG/KVM_GET_ONE_

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Sanjay Lal
On May 22, 2013, at 5:54 AM, Gleb Natapov wrote: > On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: >> From: David Daney >> >> The initial patch set implementing MIPS KVM does not handle 64-bit >> guests or use of the FPU. This patch set corrects these ABI issues, >> and does some

Re: [PATCH 2/4] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-21 Thread Sanjay Lal
On May 21, 2013, at 1:00 AM, Gleb Natapov wrote: > On Sun, May 19, 2013 at 10:36:32AM -0400, Sanjay Lal wrote: >> >> On May 19, 2013, at 8:52 AM, Gleb Natapov wrote: >> >>> On Sat, May 18, 2013 at 06:54:24AM -0700, Sanjay Lal wrote: >>>> - As suggeste

Re: [PATCH 00/18] KVM/MIPS32: Support for the new Virtualization ASE (VZ-ASE)

2013-05-20 Thread Sanjay Lal
On May 20, 2013, at 10:29 AM, David Daney wrote: > On 05/20/2013 09:58 AM, Sanjay Lal wrote: >> >> On May 20, 2013, at 8:50 AM, David Daney wrote: >> >>> On 05/18/2013 10:47 PM, Sanjay Lal wrote: >>>> The following patch set adds support for t

Re: [PATCH 00/18] KVM/MIPS32: Support for the new Virtualization ASE (VZ-ASE)

2013-05-20 Thread Sanjay Lal
On May 20, 2013, at 8:50 AM, David Daney wrote: > On 05/18/2013 10:47 PM, Sanjay Lal wrote: >> The following patch set adds support for the recently announced >> virtualization >> extensions for the MIPS32 architecture and allows running unmodified kernels >> in >

Re: [PATCH 2/4] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-19 Thread Sanjay Lal
On May 19, 2013, at 8:52 AM, Gleb Natapov wrote: > On Sat, May 18, 2013 at 06:54:24AM -0700, Sanjay Lal wrote: >> - As suggested by Gleb, wrap calls to gfn_to_pfn() with >> srcu_read_lock/unlock(). >> Memory slots should be acccessed from a SRCU read section. >>

[PATCH 18/18] KVM/MIPS32-VZ: Dump out additional info about VZ features as part of /proc/cpuinfo

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kernel/proc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index a3e4614..308e042 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c @@ -99,6 +99,17 @@ static int

[PATCH 16/18] KVM/MIPS32-VZ: Add VZ-ASE support to KVM/MIPS data structures.

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm_host.h | 244 ++- 1 file changed, 191 insertions(+), 53 deletions(-) diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index e68781e..c92e297 100644 --- a/arch/mips

[PATCH 15/18] KVM/MIPS32: Add dummy trap handler to catch unexpected exceptions and dump out useful info

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_trap_emul.c | 68 --- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/arch/mips/kvm/kvm_trap_emul.c b/arch/mips/kvm/kvm_trap_emul.c index 466aeef..19b32a1 100644 --- a/arch/mips/kvm

[PATCH 14/18] KVM/MIPS32-VZ: Guest exception batching support.

2013-05-18 Thread Sanjay Lal
f-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_int.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/kvm/kvm_mips_int.h b/arch/mips/kvm/kvm_mips_int.h index 20da7d2..7eac28e 100644 --- a/arch/mips/kvm/kvm_mips_int.h +++ b/arch/mips/kvm/kvm_mips_int.h @@ -29,8 +29,13 @@ #define

[PATCH 12/18] KVM/MIPS32-VZ: VM Exit Stats, add VZ exit reasons.

2013-05-18 Thread Sanjay Lal
- Additional VZ related exit reasons, used in the trace logs. Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_stats.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/mips/kvm/kvm_mips_stats.c b/arch/mips/kvm/kvm_mips_stats.c index 075904b..c0d0c0f

[PATCH 11/18] KVM/MIPS32-VZ: VZ: Handle Guest TLB faults that are handled in Root context

2013-05-18 Thread Sanjay Lal
- Guest physical addresses need to be mapped by the Root TLB. Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_tlb.c | 444 +++- 1 file changed, 359 insertions(+), 85 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index

[PATCH 10/18] KVM/MIPS32-VZ: Add API for VZ-ASE Capability

2013-05-18 Thread Sanjay Lal
- Add API to allow clients (QEMU etc.) to check whether the H/W supports the MIPS VZ-ASE. Signed-off-by: Sanjay Lal --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index a5c86fc..5889e976 100644 --- a/include

[PATCH 09/18] KVM/MIPS32-VZ: Add support for CONFIG_KVM_MIPS_VZ option

2013-05-18 Thread Sanjay Lal
- Add config option for KVM/MIPS with VZ support. Signed-off-by: Sanjay Lal --- arch/mips/kvm/Kconfig | 14 +- arch/mips/kvm/Makefile | 14 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig index 2c15590

[PATCH 17/18] KVM/MIPS32: Revert to older method for accessing ASID parameters

2013-05-18 Thread Sanjay Lal
- Now that commit d532f3d26 has been reverted in the MIPS tree, revert back to the older method of using the ASID_MASK. - Trivial cleanup: s/unsigned long/long Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_dyntrans.c | 24 ++-- arch/mips/kvm/kvm_mips_emul.c | 236

[PATCH 08/18] KVM/MIPS32-VZ: Entry point for trampolining to the guest and trap handlers.

2013-05-18 Thread Sanjay Lal
- Add support for the MIPS VZ-ASE - Whitespace fixes Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_locore.S | 1088 +++- 1 file changed, 573 insertions(+), 515 deletions(-) diff --git a/arch/mips/kvm/kvm_locore.S b/arch/mips/kvm/kvm_locore.S index

[PATCH 06/18] KVM/MIPS32-VZ: VZ-ASE related callbacks to handle guest exceptions that trap to the Root context.

2013-05-18 Thread Sanjay Lal
The VZ-ASE provices the Guest with its own COP0 context, so the types of exceptions that will trap to the root a lot fewer than in the trap and emulate case. - Root level TLB miss handlers that map GPAs to RPAs. - Guest Exits Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_vz.c | 786

[PATCH 13/18] KVM/MIPS32-VZ: Top level handler for Guest faults

2013-05-18 Thread Sanjay Lal
- Add VZ specific VM Exit reasons to the traces. - Add top level handler for Guest Exit exceptions. Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips.c | 73 +++- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/arch/mips/kvm

[PATCH 04/18] KVM/MIPS32-VZ: MIPS VZ-ASE related register defines and helper macros.

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/mipsvzregs.h | 494 + 1 file changed, 494 insertions(+) create mode 100644 arch/mips/include/asm/mipsvzregs.h diff --git a/arch/mips/include/asm/mipsvzregs.h b/arch/mips/include/asm/mipsvzregs.h new file

[PATCH 07/18] KVM/MIPS32: VZ-ASE related CPU feature flags and options.

2013-05-18 Thread Sanjay Lal
- GuestIDs and Virtual IRQs are optional - New TLBINV instruction is also optional Signed-off-by: Sanjay Lal --- arch/mips/include/asm/cpu-features.h | 36 arch/mips/include/asm/cpu-info.h | 21 + arch/mips/include/asm/cpu.h

[PATCH 03/18] KVM/MIPS32: Export min_low_pfn.

2013-05-18 Thread Sanjay Lal
The KVM module uses the standard MIPS cache management routines, which use min_low_pfn. This creates and indirect dependency, requiring min_low_pfn to be exported. Signed-off-by: Sanjay Lal --- arch/mips/kernel/mips_ksyms.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/mips

[PATCH 05/18] KVM/MIPS32-VZ: VZ-ASE assembler wrapper functions to set GuestIDs

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_vz_locore.S | 74 +++ 1 file changed, 74 insertions(+) create mode 100644 arch/mips/kvm/kvm_vz_locore.S diff --git a/arch/mips/kvm/kvm_vz_locore.S b/arch/mips/kvm/kvm_vz_locore.S new file mode 100644 index

[PATCH 01/18] Revert "MIPS: microMIPS: Support dynamic ASID sizing."

2013-05-18 Thread Sanjay Lal
This reverts commit f6b06d9361a008afb93b97fb3683a6e92d69d0f4. Signed-off-by: Sanjay Lal --- arch/mips/mm/tlbex.c | 34 ++ 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 4d46d37..2ad41e9 100644

[PATCH 02/18] Revert "MIPS: Allow ASID size to be determined at boot time."

2013-05-18 Thread Sanjay Lal
This reverts commit d532f3d26716a39dfd4b88d687bd344fbe77e390. Conflicts: arch/mips/mm/tlbex.c Signed-off-by: Sanjay Lal --- arch/mips/include/asm/mmu_context.h | 95 ++--- arch/mips/kernel/genex.S| 2 +- arch/mips/kernel/smtc.c

[PATCH 00/18] KVM/MIPS32: Support for the new Virtualization ASE (VZ-ASE)

2013-05-18 Thread Sanjay Lal
Guest mode. This greatly reduces VM exits. (2) Trap and Emulate: Runs minimally modified guest kernels in UM and uses binary patching to minimize the number of traps and improve performance. This is used for processors that do not support the VZ-ASE. -- Sanjay Lal (18): Revert "

[PATCH 4/4] KVM/MIPS32: Bring in patch from David Daney with new 64 bit compatible ABI.

2013-05-18 Thread Sanjay Lal
function pointers as appropriate. Signed-off-by: David Daney Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm_host.h | 4 - arch/mips/include/uapi/asm/kvm.h | 106 ++--- arch/mips/kvm/kvm_mips.c | 102 +--- arch/mips/kvm/kvm_trap_emul.c| 330

[PATCH 3/4] KVM/MIPS32: Export min_low_pfn.

2013-05-18 Thread Sanjay Lal
The KVM module uses the standard MIPS cache management routines, which use min_low_pfn. This creates and indirect dependency, requiring min_low_pfn to be exported. Signed-off-by: Sanjay Lal --- arch/mips/kernel/mips_ksyms.c | 6 ++ arch/mips/kvm/kvm_tlb.c | 1 - 2 files changed, 6

[PATCH 2/4] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-18 Thread Sanjay Lal
d-off-by: Sanjay Lal --- arch/mips/kvm/kvm_tlb.c | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index 89511a9..ab2e9b0 100644 --- a/arch/mips/kvm/kvm_tlb.c +++ b/arch/mips/kvm/kvm_tlb.c @@

[PATCH v3 0/4] KVM/MIPS32: Fixes for Linux 3.10

2013-05-18 Thread Sanjay Lal
KVM/MIPS ABI defined by David Daney @ Cavium. -- Sanjay Lal (4): KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API. KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock() KVM/MIPS32: Export min_low_pfn. KVM/MIPS32: Bring in pa

[PATCH 1/4] KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API.

2013-05-18 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm.h | 55 arch/mips/include/uapi/asm/kvm.h | 55 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 arch/mips/include/asm/kvm.h

[PATCH 3/3] KVM/MIPS32: Fix up KVM breakage caused by d532f3d26716a39dfd4b88d687bd344fbe77e390 which allows ASID mask and increment to be determined @ runtime.

2013-05-17 Thread Sanjay Lal
ue on the MIPS mailing list and until a solution is found, For now define KVM_ASID_MASK as 0xFF to fix this issue up for Linux 3.10. Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm_host.h | 5 + arch/mips/kvm/kvm_mips_emul.c| 22 +++--- arch/mips/kvm/kvm_

[PATCH 2/3] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-17 Thread Sanjay Lal
d-off-by: Sanjay Lal --- arch/mips/kvm/kvm_tlb.c | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index 89511a9..ab2e9b0 100644 --- a/arch/mips/kvm/kvm_tlb.c +++ b/arch/mips/kvm/kvm_tlb.c @@

[PATCH v2 0/3] KVM/MIPS32: Fixes for Linux 3.10

2013-05-17 Thread Sanjay Lal
The following patch set fixes a few issues with KVM/MIPS32 in Linux 3.10. -- Sanjay Lal (3): KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API. KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock() KVM/MIPS32: Fix up KVM break

[PATCH 1/3] KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API.

2013-05-17 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm.h | 55 arch/mips/include/uapi/asm/kvm.h | 55 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 arch/mips/include/asm/kvm.h

[PATCH] KVM/MIPS32: Export min_low_pfn.

2013-05-17 Thread Sanjay Lal
The KVM module uses the standard MIPS cache management routines, which use min_low_pfn. This creates and indirect dependency, requiring min_low_pfn to be exported. Signed-off-by: Sanjay Lal --- arch/mips/kernel/mips_ksyms.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/mips

Re: [PATCH 2/2] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-15 Thread Sanjay Lal
On May 15, 2013, at 10:30 AM, Gleb Natapov wrote: > On Wed, May 15, 2013 at 09:54:24AM -0700, David Daney wrote: >> On 05/15/2013 08:54 AM, Sanjay Lal wrote: >>> >>> On May 14, 2013, at 2:27 AM, Gleb Natapov wrote: >>> >>>>> >>

Re: [PATCH 2/2] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-15 Thread Sanjay Lal
On May 14, 2013, at 2:27 AM, Gleb Natapov wrote: >> >> >> +EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported >> by generic code */ >> + > What you need this for? It is not used anywhere in this patch and by > mips/kvm code in general. I did some digging around myself,

Re: [PATCH 0/2] KVM/MIPS32: Fixes for Linux 3.10

2013-05-13 Thread Sanjay Lal
On May 13, 2013, at 2:07 PM, David Daney wrote: > Sanjay, > > Have you looked at: > > http://www.linux-mips.org/archives/linux-mips/2013-05/msg00049.html > > We should start working toward unifying the KVM interface. > > David Daney. > Hey David, I am currently in the process of integrating

[PATCH 1/2] KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API.

2013-05-13 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm.h | 55 arch/mips/include/uapi/asm/kvm.h | 55 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 arch/mips/include/asm/kvm.h

[PATCH 2/2] KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock()

2013-05-13 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_tlb.c | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index 89511a9..218075f 100644 --- a/arch/mips/kvm/kvm_tlb.c +++ b/arch/mips/kvm

[PATCH 0/2] KVM/MIPS32: Fixes for Linux 3.10

2013-05-13 Thread Sanjay Lal
for a particular gfn. - Follow the latest convention and move the kvm.h API file under uapi/... -- Sanjay Lal (2): KVM/MIPS32: Move include/asm/kvm.h => include/uapi/asm/kvm.h since it is a user visible API. KVM/MIPS32: Wrap calls to gfn_to_pfn() with srcu_read_lock/unlock() arch/mips/inc

Re: [PATCH] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-06 Thread Sanjay Lal
On May 6, 2013, at 3:39 PM, David Daney wrote: > > /* for KVM_GET_REGS and KVM_SET_REGS */ > +/* > + * If Config[AT] is zero (32-bit CPU), the register contents are > + * stored in the lower 32-bits of the struct kvm_regs fields and sign > + * extended to 64-bits. > + */ > struct kvm_regs { > -

Re: [PATCH] KVM/MIPS32: Sync up with latest KVM API changes

2013-03-18 Thread Sanjay Lal
On Mar 18, 2013, at 12:04 PM, Jonas Gorski wrote: > On 15 March 2013 03:09, Sanjay Lal wrote: >> - Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS >> - Fix kvm_arch_{prepare,commit}_memory_region() >> - Also remove kvm_arch_set_memory_region which was unused. > >

[PATCH] KVM/MIPS32: Sync up with latest KVM API changes

2013-03-14 Thread Sanjay Lal
- Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS - Fix kvm_arch_{prepare,commit}_memory_region() - Also remove kvm_arch_set_memory_region which was unused. Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm_host.h | 2 +- arch/mips/kvm/kvm_mips.c | 12 ++-- 2 files chan

[PATCH] KVM/MIPS32: define KVM_USER_MEM_SLOTS

2013-03-14 Thread Sanjay Lal
function) Reported-by: Andrew Morton Cc: Alex Williamson Cc: Marcelo Tosatti Cc: Gleb Natapov Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm_host.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN arch/mips/include/asm/kvm_hos

Re: [Qemu-devel] [PATCH 03/12] KVM/MIPS: Add save/restore state APIs for saving/restoring KVM guests.

2013-03-06 Thread Sanjay Lal
On Mar 2, 2013, at 7:27 AM, Peter Maydell wrote: > 2013/3/2 Sanjay Lal : >> +static void gt64xxx_save(QEMUFile *f, void *opaque) >> +{ >> +GT64120State *s = opaque; >> + >> +/* CPU Configuration */ >> +qemu_put_be32s(f, &s->regs[GT_CPU]

Re: [Qemu-devel] [PATCH 01/12] KVM/MIPS: Bootcode for MIPS SMP configurations with a GCMP

2013-03-06 Thread Sanjay Lal
On Mar 2, 2013, at 12:03 PM, Peter Maydell wrote: > On 2 March 2013 15:18, Sanjay Lal wrote: >> --- /dev/null >> +++ b/hw/mips_cps_bootcode.h >> @@ -0,0 +1,310 @@ >> +/* Sample boot code for 1004K CPS (Coherent Processing System.) >> + * Not Generic for all Rel

Re: [Qemu-devel] [PATCH 11/12] KVM/MIPS: MIPS specfic APIs for KVM.

2013-03-06 Thread Sanjay Lal
On Mar 2, 2013, at 7:45 AM, Peter Maydell wrote: > On 2 March 2013 15:18, Sanjay Lal wrote: >> +/* If we have an interrupt but the guest is not ready to receive an >> + * interrupt, request an interrupt window exit. This will >> + * cause a return to userspace

[Qemu-devel][PATCH 11/12] KVM/MIPS: MIPS specfic APIs for KVM.

2013-03-02 Thread Sanjay Lal
MIPS: MIPS specific KVM APIs + * + * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. + * Authors: Sanjay Lal +*/ + +#include +#include +#include + +#include + +#include "qemu-common.h" +#include "qemu/timer.h" +#include "sysemu/sysemu.h" +#include &q

[Qemu-devel][PATCH 10/12] KVM/MIPS: Set page size to 16K in KVM mode.

2013-03-02 Thread Sanjay Lal
--- target-mips/mips-defs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h index bf094a3..473ddf8 100644 --- a/target-mips/mips-defs.h +++ b/target-mips/mips-defs.h @@ -5,7 +5,12 @@ //#define USE_HOST_FLOAT_REGS /* Real pages are vari

[Qemu-devel][PATCH 09/12] KVM/MIPS: set sigmask length to 16 for MIPS targets.

2013-03-02 Thread Sanjay Lal
--- kvm-all.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index 4decfdc..2ac9e88 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1966,7 +1966,12 @@ int kvm_set_signal_mask(CPUArchState *env, const sigset_t *sigset) sigmask = g_malloc(sizeof(*sigmask) + sizeof(

[Qemu-devel][PATCH 08/12] KVM/MIPS: Enable KVM/MIPS for MIPS targets. Add MIPS GIC code to the build.

2013-03-02 Thread Sanjay Lal
--- configure | 17 +++-- hw/mips/Makefile.objs | 2 +- target-mips/Makefile.objs | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/configure b/configure index bf5970f..5447661 100755 --- a/configure +++ b/configure @@ -1370,7 +1370,12 @@ case

[Qemu-devel][PATCH 07/12] KVM/MIPS: QEMU <-> Kernel interface for KVM/MIPS

2013-03-02 Thread Sanjay Lal
rectory of this archive + * for more details. + * + * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. + * Authors: Sanjay Lal + */ + +#ifndef __LINUX_KVM_MIPS_H +#define __LINUX_KVM_MIPS_H + +#include + +#define __KVM_MIPS + +#define N_MIPS_COPROC_REGS 32 +#define N_MIPS_

[Qemu-devel][PATCH 12/12] KVM/MIPS: General KVM support and support for SMP Guests

2013-03-02 Thread Sanjay Lal
- In KVM mode the bootrom is loaded and executed from the last 1MB of DRAM. - Use the CPS bootrom from MIPS in KVM mode. This allows bootstrapping of multiple cores. - Add suport for MIPS GIC emulation for SMP Guests. --- hw/mips_malta.c | 192 +

[Qemu-devel][PATCH 04/12] KVM/MIPS: Do not start the periodic timer in KVM mode. Compare/Count timer interrupts are handled in-kernel.

2013-03-02 Thread Sanjay Lal
--- hw/mips_timer.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/mips_timer.c b/hw/mips_timer.c index 83c400c..0c86a3b 100644 --- a/hw/mips_timer.c +++ b/hw/mips_timer.c @@ -19,11 +19,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DE

[Qemu-devel][PATCH 06/12] KVM/MIPS: Define APIs to convert Guest KSEG0 <-> Guest Physical addresses.

2013-03-02 Thread Sanjay Lal
In trap and emulate mode both the guest kernel and guest userspace execute in UM: Guest User address space: 0x -> 0x4000 Guest Kernel Unmapped: 0x4000 -> 0x6000 Guest Kernel Mapped:0x6000 -> 0x8000 --- hw/mips_addr.c| 14 ++ h

[Qemu-devel][PATCH 03/12] KVM/MIPS: Add save/restore state APIs for saving/restoring KVM guests.

2013-03-02 Thread Sanjay Lal
--- hw/gt64xxx.c | 317 +++ 1 file changed, 317 insertions(+) diff --git a/hw/gt64xxx.c b/hw/gt64xxx.c index 977a2c5..3583ca8 100644 --- a/hw/gt64xxx.c +++ b/hw/gt64xxx.c @@ -31,6 +31,8 @@ //#define DEBUG +#define GT64XXX_VM_VERSION

[Qemu-devel][PATCH 05/12] KVM/MIPS: In KVM mode, inject IRQ2 (I/O) interupts via ioctls(). COP0 emulation is in-kernel

2013-03-02 Thread Sanjay Lal
--- hw/mips_int.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/mips_int.c b/hw/mips_int.c index 6423fd0..6c655af 100644 --- a/hw/mips_int.c +++ b/hw/mips_int.c @@ -23,6 +23,8 @@ #include "hw.h" #include "mips_cpudevs.h" #include "cpu.h" +#include "sysemu/kvm.h" +#incl

[Qemu-devel][PATCH 02/12] KVM/MIPS: GIC emulation for SMP guests.

2013-03-02 Thread Sanjay Lal
--- hw/mips_gcmpregs.h | 122 hw/mips_gic.c | 418 + hw/mips_gic.h | 378 3 files changed, 918 insertions(+) create mode 100644 hw/mips_gcmpregs.h create mode 100644 hw

[Qemu-devel][PATCH 01/12] MIPS: Bootcode for MIPS SMP configurations with a GCMP

2013-03-02 Thread Sanjay Lal
--- hw/mips_cps_bootcode.h | 310 + 1 file changed, 310 insertions(+) create mode 100644 hw/mips_cps_bootcode.h diff --git a/hw/mips_cps_bootcode.h b/hw/mips_cps_bootcode.h new file mode 100644 index 000..40289a4 --- /dev/null +++ b/hw/mips_cps

[Qemu-devel][PATCH 01/12] KVM/MIPS: Bootcode for MIPS SMP configurations with a GCMP

2013-03-02 Thread Sanjay Lal
--- hw/mips_cps_bootcode.h | 310 + 1 file changed, 310 insertions(+) create mode 100644 hw/mips_cps_bootcode.h diff --git a/hw/mips_cps_bootcode.h b/hw/mips_cps_bootcode.h new file mode 100644 index 000..40289a4 --- /dev/null +++ b/hw/mips_cps

[Qemu-devel][PATCH 00/12] KVM Support for MIPS32 Processors

2013-03-02 Thread Sanjay Lal
a cluster of MIPS32R2 cpus. There is a companion kernel patchset for KVM that has been posted on the KVM/MIPS mailing lists. -- Sanjay Lal (12): KVM/MIPS: Bootcode for MIPS SMP configurations with a GCMP KVM/MIPS: GIC emulation for SMP guests. KVM/MIPS: Add save/restore state APIs for sav

Re: [PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.

2013-02-18 Thread Sanjay Lal
On Feb 18, 2013, at 1:44 AM, Gleb Natapov wrote: > On Fri, Feb 15, 2013 at 11:10:46AM -0500, Sanjay Lal wrote: >> >> On Feb 6, 2013, at 8:20 AM, Gleb Natapov wrote: >> >>> On Wed, Nov 21, 2012 at 06:34:09PM -0800, Sanjay Lal wrote: >>>> +static g

Re: [PATCH v2 07/18] KVM/MIPS32: MMU/TLB operations for the Guest.

2013-02-16 Thread Sanjay Lal
On Feb 15, 2013, at 1:41 PM, Gleb Natapov wrote: > On Fri, Feb 15, 2013 at 01:19:29PM -0500, Sanjay Lal wrote: >> >> On Feb 6, 2013, at 7:08 AM, Gleb Natapov wrote: >> >>>> >>>> +static void kvm_mips_map_page(struct kvm *kvm, gfn_t gfn) >

Re: [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.

2013-02-15 Thread Sanjay Lal
On Feb 6, 2013, at 8:17 AM, Gleb Natapov wrote: > On Wed, Nov 21, 2012 at 06:34:07PM -0800, Sanjay Lal wrote: >> >> +int kvm_mips_dump_stats(struct kvm_vcpu *vcpu) >> +{ >> +int i, j __unused; >> +#ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS >> +pri

Re: [PATCH v2 07/18] KVM/MIPS32: MMU/TLB operations for the Guest.

2013-02-15 Thread Sanjay Lal
On Feb 6, 2013, at 7:08 AM, Gleb Natapov wrote: >> >> +static void kvm_mips_map_page(struct kvm *kvm, gfn_t gfn) >> +{ >> +pfn_t pfn; >> + >> +if (kvm->arch.guest_pmap[gfn] != KVM_INVALID_PAGE) >> +return; >> + >> +pfn =kvm_mips_gfn_to_pfn(kvm, gfn); > This call should be

Re: [PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.

2013-02-15 Thread Sanjay Lal
On Feb 6, 2013, at 8:20 AM, Gleb Natapov wrote: > On Wed, Nov 21, 2012 at 06:34:09PM -0800, Sanjay Lal wrote: >> +static gpa_t kvm_trap_emul_gva_to_gpa_cb(gva_t gva) >> +{ >> +gpa_t gpa; >> +uint32_t kseg = KSEGX(gva); >> + >> +if ((kseg == CKSE

Re: [PATCH v2 00/18] KVM for MIPS32 Processors

2013-01-24 Thread Sanjay Lal
On Jan 24, 2013, at 10:05 AM, Ralf Baechle wrote: > On Wed, Nov 21, 2012 at 06:33:58PM -0800, Sanjay Lal wrote: > > I've queued the patch set. I've done a few stylistic changes such as > getting rid of all use of ulong and u_long data types in favor of > unsigned l

Re: [PATCH v2 00/18] KVM for MIPS32 Processors

2012-11-27 Thread Sanjay Lal
On Nov 26, 2012, at 1:53 PM, David Daney wrote: > > I have several general questions about this patch... > > On 11/21/2012 06:33 PM, Sanjay Lal wrote: >> The following patchset implements KVM support for MIPS32R2 processors, >> using Trap & Emulate, with basic r

[PATCH v2 03/18] KVM/MIPS32: Entry point for trampolining to the guest and trap handlers.

2012-11-22 Thread Sanjay Lal
while in guest context. Save guest context, restore some kernel context and jump to main 'C' handler: kvm_mips_handle_exit() Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_locore.S | 651 + 1 file changed, 651 insertions(+) create m

[PATCH v2 13/18] MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/mmu_context.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index 9b02cfb..10a3fd2 100644 --- a/arch/mips/include/asm/mmu_context.h +++ b/arch/mips/include

[PATCH v2 05/18] KVM/MIPS32: KVM Guest kernel support.

2012-11-22 Thread Sanjay Lal
ed to 1GB. Signed-off-by: Sanjay Lal --- arch/mips/include/asm/mach-generic/spaces.h | 9 - arch/mips/include/asm/processor.h | 5 + arch/mips/include/asm/uaccess.h | 11 ++- arch/mips/kernel/binfmt_elfo32.c| 4 arch/mips/kernel/c

[PATCH v2 04/18] KVM/MIPS32: MIPS arch specific APIs for KVM

2012-11-22 Thread Sanjay Lal
- Implements the arch specific APIs for KVM, some are stubs for MIPS - kvm_mips_handle_exit(): Main 'C' distpatch routine for handling exceptions while in "Guest" mode. - Also implements in-kernel timer interrupt support for the guest. Signed-off-by: Sanjay Lal --- arch

[PATCH v2 06/18] KVM/MIPS32: Privileged instruction/target branch emulation.

2012-11-22 Thread Sanjay Lal
- The Guest kernel is run in UM and privileged instructions cause a trap. - If the instruction causing the trap is in a branch delay slot, the branch needs to be emulated to figure out the PC @ which the guest will resume execution. Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_emul.c

[PATCH v2 17/18] KVM/MIPS32: Do not call vcpu_load when injecting interrupts.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index be70035..ecd96ce 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1880,7 +1880,7 @@ static long kvm_vcpu_ioctl

[PATCH v2 15/18] MIPS: Pull in MIPS fix: fix endless loop when processing signals for kernel tasks.

2012-11-22 Thread Sanjay Lal
This bug is discussed in: http://lkml.indiana.edu/hypermail/linux/kernel/1205.2/00719.html Signed-off-by: Sanjay Lal --- arch/mips/kernel/entry.S | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index a6c1332..9b00362

[PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_cb.c| 14 ++ arch/mips/kvm/kvm_trap_emul.c | 482 ++ 2 files changed, 496 insertions(+) create mode 100644 arch/mips/kvm/kvm_cb.c create mode 100644 arch/mips/kvm/kvm_trap_emul.c diff --git a

[PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_stats.c | 81 ++ 1 file changed, 81 insertions(+) create mode 100644 arch/mips/kvm/kvm_mips_stats.c diff --git a/arch/mips/kvm/kvm_mips_stats.c b/arch/mips/kvm/kvm_mips_stats.c new file mode 100644

[PATCH v2 10/18] KVM/MIPS32: Guest interrupt delivery.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_int.c | 243 +++ arch/mips/kvm/kvm_mips_int.h | 49 + 2 files changed, 292 insertions(+) create mode 100644 arch/mips/kvm/kvm_mips_int.c create mode 100644 arch/mips/kvm/kvm_mips_int.h diff

[PATCH v2 16/18] MIPS: Export symbols used by KVM/MIPS module

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kernel/smp.c | 1 + mm/bootmem.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 9005bf9..60ea489 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -83,6 +83,7

[PATCH v2 08/18] KVM/MIPS32: Release notes and KVM module Makefile

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kvm/00README.txt | 31 +++ arch/mips/kvm/Makefile | 17 + 2 files changed, 48 insertions(+) create mode 100644 arch/mips/kvm/00README.txt create mode 100644 arch/mips/kvm/Makefile diff --git a/arch/mips

[PATCH v2 07/18] KVM/MIPS32: MMU/TLB operations for the Guest.

2012-11-22 Thread Sanjay Lal
eption to the guest If entry does exist in the Guest TLB and is VALID Inject the TLB entry into the Shadow TLB Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_tlb.c | 932 1 file changed, 932 insertions(+) create mode 10

[PATCH v2 12/18] MIPS: Export routines needed by the KVM module.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/mm/c-r4k.c | 6 -- arch/mips/mm/cache.c | 1 + arch/mips/mm/tlb-r4k.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 2b61462..1923063 100644 --- a/arch/mips/mm/c-r4k.c +++ b

[PATCH v2 14/18] MIPS: ASM offsets for VCPU arch specific fields.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/kernel/asm-offsets.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 0c4bce4..66895de 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b

[PATCH v2 18/18] KVM/MIPS32: Binary patching of select privileged instructions.

2012-11-22 Thread Sanjay Lal
mapped into the guest kernel address space @ VA 0x0. mfc0/mtc0 operations are transformed to load/stores. Signed-off-by: Sanjay Lal --- arch/mips/kvm/kvm_mips_comm.h | 23 ++ arch/mips/kvm/kvm_mips_commpage.c | 37 ++ arch/mips/kvm/kvm_mips_dyntrans.c | 149

[PATCH v2 00/18] KVM for MIPS32 Processors

2012-11-22 Thread Sanjay Lal
infinite loop. As a workaround, make sure that CONFIG_SMP is disabled for Guest kernels. This will be fixed in a future release. (4) FPU support: Currently KVM/MIPS emulates a 24K CPU without a FPU. This will be fixed in a future release -- Sanjay Lal (18): KVM/MIPS32: Infrastructur

[PATCH v2 02/18] KVM/MIPS32: Arch specific KVM data structures.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal --- arch/mips/include/asm/kvm.h | 55 arch/mips/include/asm/kvm_host.h | 669 +++ 2 files changed, 724 insertions(+) create mode 100644 arch/mips/include/asm/kvm.h create mode 100644 arch/mips/include/asm/kvm_host.h

Re: [PATCH 04/20] KVM/MIPS32: MIPS arch specific APIs for KVM

2012-11-14 Thread Sanjay Lal
On Nov 1, 2012, at 11:18 AM, Avi Kivity wrote: >> + >> +/* Set the appropriate status bits based on host CPU features, before >> we hit the scheduler */ >> +kvm_mips_set_c0_status(); >> + >> +local_irq_enable(); > > Ah, so you handle exits with interrupts enabled. But that's not ho

Re: [PATCH 00/20] KVM for MIPS32 Processors

2012-11-02 Thread Sanjay Lal
On Nov 1, 2012, at 10:51 AM, Avi Kivity wrote: > On 10/31/2012 05:17 PM, Sanjay Lal wrote: >> The following patchset implements KVM support for MIPS32R2 processors, >> using Trap & Emulate, with basic runtime binary translation to improve >> performance. The goal h

Re: [PATCH 02/20] KVM/MIPS32: Arch specific KVM data structures.

2012-11-02 Thread Sanjay Lal
On Nov 1, 2012, at 11:04 AM, Avi Kivity wrote: > On 10/31/2012 05:18 PM, Sanjay Lal wrote: > >> + >> +/* Special address that contains the comm page, used for reducing # of >> traps */ >> +#define KVM_GUEST_COMMPAGE_ADDR 0x0 >> + >> +struct kvm

Re: [PATCH 07/20] KVM/MIPS32: Dynamic binary translation of select privileged instructions.

2012-11-02 Thread Sanjay Lal
On Nov 1, 2012, at 11:24 AM, Avi Kivity wrote: > On 10/31/2012 05:19 PM, Sanjay Lal wrote: >> Currently, the following instructions are translated: >> - CACHE (indexed) >> - CACHE (va based): translated to a synci, overkill on D-CACHE operations, >> but still much fa

Re: [PATCH 07/20] KVM/MIPS32: Dynamic binary translation of select privileged instructions.

2012-11-02 Thread Sanjay Lal
On Nov 1, 2012, at 11:24 AM, Avi Kivity wrote: > On 10/31/2012 05:19 PM, Sanjay Lal wrote: >> Currently, the following instructions are translated: >> - CACHE (indexed) >> - CACHE (va based): translated to a synci, overkill on D-CACHE operations, >> but still much fa

  1   2   >