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 has been to keep the Guest kernel changes to a
 minimum.
 
 The patch is against Linux 3.7-rc2.  
 
 There is a companion patchset for QEMU that adds KVM support for the 
 MIPS target.
 
 KVM/MIPS should support MIPS32-R2 processors and beyond.
 It has been tested on the following platforms:
  - Malta Board with FPGA based 34K (Little Endian).
  - Sigma Designs TangoX board with a 24K based 8654 SoC (Little Endian).
  - Malta Board with 74K @ 1GHz (Little Endian).
  - OVPSim MIPS simulator from Imperas emulating a Malta board with 
24Kc and 1074Kc cores (Little Endian).
 
 Both Guest kernel and Guest Userspace execute in UM. The Guest address space 
 is
 as folows:
 Guest User address space:   0x - 0x4000
 Guest Kernel Unmapped:  0x4000 - 0x6000
 Guest Kernel Mapped:0x6000 - 0x8000
 
 As a result, Guest Usermode virtual memory is limited to 1GB.
 
 Relase Notes
 
 (1) 16K Page Size:
Both Host Kernel and Guest Kernel should have the same page size, 
currently at least 16K.  Note that due to cache aliasing issues, 
4K page sizes are NOT supported.
 
 (2) No HugeTLB/Large Page Support:
Both the host kernel and Guest kernel should have the page size 
set to at least 16K.
This will be implemented in a future release.
 
 (3) SMP Guests to not work
Linux-3.7-rc2 based SMP guest hangs due to the following code sequence 
in the generated TLB handlers:
 LL/TLBP/SC
Since the TLBP instruction causes a trap the reservation gets cleared
when we ERET back to the guest. This causes the guest to hang in an 
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
 
 
 Thanks for posting this, new architectures are always a welcome addition.
 
 Some general notes:
 - please read and follow Documentation/CodingStyle.  In general the
 patches are okay except for indentation (use tabs, not spaces, and set
 your editor tab width to 8).

I'll definitely be re-formatting the code based on the recommended coding style 
and running the patches through checkpatch.pl for v2 of the patch set.

Regards
Sanjay

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2012-11-01 Thread Avi Kivity
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 has been to keep the Guest kernel changes to a
 minimum.
 
 The patch is against Linux 3.7-rc2.  
 
 There is a companion patchset for QEMU that adds KVM support for the 
 MIPS target.
 
 KVM/MIPS should support MIPS32-R2 processors and beyond.
 It has been tested on the following platforms:
   - Malta Board with FPGA based 34K (Little Endian).
   - Sigma Designs TangoX board with a 24K based 8654 SoC (Little Endian).
   - Malta Board with 74K @ 1GHz (Little Endian).
   - OVPSim MIPS simulator from Imperas emulating a Malta board with 
 24Kc and 1074Kc cores (Little Endian).
 
 Both Guest kernel and Guest Userspace execute in UM. The Guest address space 
 is
 as folows:
  Guest User address space:   0x - 0x4000
  Guest Kernel Unmapped:  0x4000 - 0x6000
  Guest Kernel Mapped:0x6000 - 0x8000
 
 As a result, Guest Usermode virtual memory is limited to 1GB.
 
 Relase Notes
 
 (1) 16K Page Size:
 Both Host Kernel and Guest Kernel should have the same page size, 
 currently at least 16K.  Note that due to cache aliasing issues, 
 4K page sizes are NOT supported.
 
 (2) No HugeTLB/Large Page Support:
 Both the host kernel and Guest kernel should have the page size 
 set to at least 16K.
 This will be implemented in a future release.
 
 (3) SMP Guests to not work
 Linux-3.7-rc2 based SMP guest hangs due to the following code sequence 
 in the generated TLB handlers:
  LL/TLBP/SC
 Since the TLBP instruction causes a trap the reservation gets cleared
 when we ERET back to the guest. This causes the guest to hang in an 
 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
 

Thanks for posting this, new architectures are always a welcome addition.

Some general notes:
- please read and follow Documentation/CodingStyle.  In general the
patches are okay except for indentation (use tabs, not spaces, and set
your editor tab width to 8).
- please use 'git send-email' to send the entire patchset, this keeps
all the patches in a single thread which is easier to follow.
- please add a general architecture document to Documentation/virtual/kvm
- Update Documentation/virtual/kvm/api.txt as needed.

What is the intended use case?

-- 
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/20] KVM for MIPS32 Processors

2012-10-31 Thread Sanjay Lal
The following patchset implements KVM support for MIPS32R2 processors,
using Trap  Emulate, with basic runtime binary translation to improve
performance.  The goal has been to keep the Guest kernel changes to a
minimum.

The patch is against Linux 3.7-rc2.  

There is a companion patchset for QEMU that adds KVM support for the 
MIPS target.

KVM/MIPS should support MIPS32-R2 processors and beyond.
It has been tested on the following platforms:
  - Malta Board with FPGA based 34K (Little Endian).
  - Sigma Designs TangoX board with a 24K based 8654 SoC (Little Endian).
  - Malta Board with 74K @ 1GHz (Little Endian).
  - OVPSim MIPS simulator from Imperas emulating a Malta board with 
24Kc and 1074Kc cores (Little Endian).

Both Guest kernel and Guest Userspace execute in UM. The Guest address space is
as folows:
 Guest User address space:   0x - 0x4000
 Guest Kernel Unmapped:  0x4000 - 0x6000
 Guest Kernel Mapped:0x6000 - 0x8000

As a result, Guest Usermode virtual memory is limited to 1GB.

Relase Notes

(1) 16K Page Size:
Both Host Kernel and Guest Kernel should have the same page size, 
currently at least 16K.  Note that due to cache aliasing issues, 
4K page sizes are NOT supported.

(2) No HugeTLB/Large Page Support:
Both the host kernel and Guest kernel should have the page size 
set to at least 16K.
This will be implemented in a future release.

(3) SMP Guests to not work
Linux-3.7-rc2 based SMP guest hangs due to the following code sequence 
in the generated TLB handlers:
 LL/TLBP/SC
Since the TLBP instruction causes a trap the reservation gets cleared
when we ERET back to the guest. This causes the guest to hang in an 
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 (20):
  KVM/MIPS32: Infrastructure/build files.
  KVM/MIPS32: Arch specific KVM data structures.
  KVM/MIPS32: Entry point for trampolining to the guest and trap
handlers.
  KVM/MIPS32: MIPS arch specific APIs for KVM
  KVM/MIPS32: KVM Guest kernel support.
  KVM/MIPS32: Privileged instruction/target branch emulation.
  KVM/MIPS32: Dynamic binary translation of select privileged
instructions.
  KVM/MIPS32: MMU/TLB operations for the Guest.
  KVM/MIPS32: Release notes and KVM module Makefile
  KVM/MIPS32: Keep track of VM exits and a historgram of COP0 accesses.
  KVM/MIPS32: Guest interrupt delivery.
  KVM/MIPS32: Routines to handle specific traps/exceptions while
executing the guest.
  MIPS: Export routines needed by the KVM module.
  MIPS: Use the UM bit instead of the CU0 enable bit in the status
register to figure out the stack for saving regs.
  MIPS: If KVM is enabled then use the KVM specific routine to flush
the TLBs on a ASID wrap
  MIPS: ASM offsets for VCPU arch specific fields.
  MIPS: Pull in MIPS fix: fix endless loop when processing signals for
kernel tasks.
  MIPS: Export symbols used by KVM/MIPS module
  KVM/MIPS32: Do not call vcpu_load when injecting interrupts.
  KVM/MIPS32: Malta config files for KVM host and guest kernels.

 arch/mips/Kbuild|4 +
 arch/mips/Kconfig   |   20 +
 arch/mips/configs/malta_kvm_defconfig   | 2244 +++
 arch/mips/configs/malta_kvm_guest_defconfig | 2237 ++
 arch/mips/include/asm/kvm.h |   58 +
 arch/mips/include/asm/kvm_host.h|  672 
 arch/mips/include/asm/mach-generic/spaces.h |9 +-
 arch/mips/include/asm/mmu_context.h |6 +
 arch/mips/include/asm/processor.h   |5 +
 arch/mips/include/asm/stackframe.h  |6 +-
 arch/mips/include/asm/uaccess.h |   15 +-
 arch/mips/kernel/asm-offsets.c  |   67 +
 arch/mips/kernel/binfmt_elfo32.c|6 +-
 arch/mips/kernel/cevt-r4k.c |4 +
 arch/mips/kernel/entry.S|7 +-
 arch/mips/kernel/smp.c  |1 +
 arch/mips/kernel/traps.c|7 +-
 arch/mips/kvm/00README.txt  |   31 +
 arch/mips/kvm/Kconfig   |   49 +
 arch/mips/kvm/Makefile  |   13 +
 arch/mips/kvm/kvm_cb.c  |   16 +
 arch/mips/kvm/kvm_locore.S  |  646 
 arch/mips/kvm/kvm_mips.c| 1016 
 arch/mips/kvm/kvm_mips_comm.h   |   24 +
 arch/mips/kvm/kvm_mips_commpage.c   |   38 +
 arch/mips/kvm/kvm_mips_dyntrans.c   |  142 ++
 arch/mips/kvm/kvm_mips_emul.c   | 1786 +
 arch/mips/kvm/kvm_mips_int.c|  251 +++
 arch/mips/kvm/kvm_mips_int.h|   49 +