Re: [PATCH -next] ia64, metag: Do not export min_low_pfn in arch-specific code

2013-04-28 Thread James Hogan
. Previous export was in vmlinux Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org This has been pointed out several times and needs fixing in the mips tree where the warning was introduced. Acked-by: James Hogan james.ho...@imgtec.com Cheers James -- To unsubscribe from this list: send

[PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-05-22 Thread James Hogan
According to include/uapi/linux/kvm_para.h architectures should define kvm_para_available, so add an implementation to asm-generic/kvm_para.h which just returns false. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Gleb Natapov g...@redhat.com Cc

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-04 Thread James Hogan
On 4 June 2013 10:05, Gleb Natapov g...@redhat.com wrote: On Wed, May 22, 2013 at 12:29:22PM +0100, James Hogan wrote: According to include/uapi/linux/kvm_para.h architectures should define kvm_para_available, so add an implementation to asm-generic/kvm_para.h which just returns false. What

[PATCH] MIPS: mark KVM_GUEST (TE KVM) as BROKEN_ON_SMP

2013-07-12 Thread James Hogan
and the eret to return to the guest code clears the LLbit which makes the sc instruction always fail. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Sanjay Lal sanj...@kymasys.com Cc: Ralf Baechle r...@linux-mips.org Cc: David Daney david.da...@cavium.com Cc: linux-m...@linux-mips.org Cc: kvm

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread James Hogan
could have it's indentation fixed too Otherwise, for all 3 patches: Reviewed-by: James Hogan james.ho...@imgtec.com Thanks James -- 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

[PATCH] kvm: sync cpu state on internal error before dump

2013-08-23 Thread James Hogan
does a sync in its kvm_arch_stop_on_emulation_error() function so at least for emulation errors is unaffected. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: kvm@vger.kernel.org --- kvm-all.c | 2 ++ 1 file changed, 2

Re: [PATCH] kvm: sync cpu state on internal error before dump

2013-08-23 Thread James Hogan
On 23/08/13 13:58, Gleb Natapov wrote: On Fri, Aug 23, 2013 at 01:26:00PM +0100, James Hogan wrote: When a KVM internal error occurs QEMU dumps the CPU state, however it doesn't synchronise the state from KVM first so the dumped state is out of date. Add the synchronisation calls before

[PATCH v2] cpu: Move cpu state syncs up into cpu_dump_state()

2013-08-27 Thread James Hogan
MIPS) can take advantage of it. This requires kvm_cpu_synchronize_state() and cpu_synchronize_state() to be moved out of the #ifdef NEED_CPU_H in sysemu/kvm.h so that they're accessible to qom/cpu.c. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Andreas Färber afaer...@suse.de Cc

Re: [PATCH 15/31] mips/kvm: Exception handling to leave and reenter guest mode.

2013-10-11 Thread James Hogan
Hi David, I know it's been a while since you posted this patchset, but thought you might appreciate the feedback anyway. Some of my comments/suggestions relate to portability with MIPS32. I don't object if you respond to those by just adding depends on 64BIT so that I others can fix it up in

[PATCH v2 03/10] target-mips: get_physical_address: Add defines for segment bases

2013-12-16 Thread James Hogan
Add preprocessor definitions for 32bit segment bases for use in get_physical_address(). These will also be taken advantage of in the next patch which adds KVM awareness. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c | 18

[PATCH v2 00/10] KVM Support for MIPS32 Processors

2013-12-16 Thread James Hogan
of target_name = cpu = mips - Remove mipsel cross compilation fix, which is now fixed by commit 61cc919f73ea (configure: detect endian via compile test) - Add translation of guest kernel segments to allow an attached gdb to see kernel memory correctly James Hogan (3): target-mips

[PATCH v2 01/10] hw/mips/cputimer: Don't start periodic timer in KVM mode

2013-12-16 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Compare/Count timer interrupts are handled in-kernel for KVM, so don't bother starting it in QEMU. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- Changes in v2

[PATCH v2 09/10] hw/mips: malta: Add KVM support

2013-12-16 Thread James Hogan
In KVM mode the bootrom is loaded and executed from the last 1MB of DRAM. Based on [PATCH 12/12] KVM/MIPS: General KVM support and support for SMP Guests by Sanjay Lal sanj...@kymasys.com. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- Changes in v2

[PATCH v2 05/10] kvm: Set sigmask length to 16 for MIPS targets

2013-12-16 Thread James Hogan
sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com --- Changes in v2: - Expand commit message - Reword comment --- kvm-all.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index

[PATCH v2 06/10] target-mips: Set target page size to 16K in KVM mode

2013-12-16 Thread James Hogan
-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- Changes in v2: - Expand commit message --- target-mips/mips-defs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/target-mips/mips-defs.h b/target-mips/mips

[PATCH v2 08/10] hw/mips: In KVM mode, inject IRQ2 (I/O) interupts via ioctls

2013-12-16 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com COP0 emulation is in-kernel for KVM, so inject IRQ2 (I/O) interrupts via ioctls. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- Changes in v2: - Expand commit

[PATCH v2 07/10] target-mips: kvm: Add main KVM support for MIPS

2013-12-16 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Implement the main KVM arch API for MIPS. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com

[PATCH v2 10/10] target-mips: Enable KVM support in build system

2013-12-16 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Enable KVM support for MIPS in the build system. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- Changes in v2: - Expand commit message - Remove GIC code - Create

[PATCH v2 04/10] target-mips: get_physical_address: Add KVM awareness

2013-12-16 Thread James Hogan
kseg0 or kseg2 address before doing the normal address translation. The real virtual address is still used for TLB lookups. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c | 33 ++--- 1 file changed, 26

[PATCH v2 02/10] hw/mips: Add API to convert KVM guest KSEG0 - GPA

2013-12-16 Thread James Hogan
: Guest User address space: 0x..0x3fff Guest Kernel Unmapped: 0x4000..0x5fff Guest Kernel Mapped:0x6000..0x7fff Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32

Re: [Qemu-devel] [PATCH v2 10/10] target-mips: Enable KVM support in build system

2013-12-23 Thread James Hogan
Hi Peter, On 21/12/13 18:59, Peter Maydell wrote: @@ -4526,6 +4529,7 @@ case $target_name in \( $target_name = ppc64 -a $cpu = ppc \) -o \ \( $target_name = ppc-a $cpu = ppc64 \) -o \ \( $target_name = ppcemb -a $cpu = ppc64 \) -o \ + \( $target_name = mipsel

[PATCH 2/2] MIPS: KVM: remove shadow_tlb code

2014-01-15 Thread James Hogan
overwritten which causes a lock up. The shadow host TLB is actually disabled at present as it is not necessary, so lets remove that code entirely. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Gleb Natapov g...@redhat.com Cc: Paolo

[PATCH 1/2] MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI

2014-01-15 Thread James Hogan
make kvm_tlb.c use the EHINV aware UNIQUE_ENTRYHI implementation in asm/tlb.h too. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: kvm@vger.kernel.org Cc

[PATCH 0/2] MIPS: KVM: fixes for KVM on ProAptiv cores

2014-01-15 Thread James Hogan
consider applying these for v3.14 too. Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: kvm@vger.kernel.org Cc: Markos Chandras markos.chand...@imgtec.com Cc: Sanjay Lal sanj...@kymasys.com James Hogan (2

[PATCH v2 0/2] MIPS: KVM: fixes for KVM on ProAptiv cores

2014-01-17 Thread James Hogan
pbonz...@redhat.com Cc: kvm@vger.kernel.org Cc: Markos Chandras markos.chand...@imgtec.com Cc: Sanjay Lal sanj...@kymasys.com James Hogan (2): MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI MIPS: KVM: remove shadow_tlb code arch/mips/include/asm/kvm_host.h | 7 -- arch/mips/kvm/kvm_mips.c

[PATCH v2 1/2] MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI

2014-01-17 Thread James Hogan
make kvm_tlb.c use the EHINV aware UNIQUE_ENTRYHI implementation in asm/tlb.h too. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf Baechle r...@linux-mips.org Cc: John Crispin blo...@openwrt.org Cc: linux-m...@linux-mips.org Cc: Gleb Natapov g...@redhat.com Cc: kvm@vger.kernel.org Cc

[PATCH v2 2/2] MIPS: KVM: remove shadow_tlb code

2014-01-17 Thread James Hogan
of fixing the shadow_tlb initialisation code, lets just remove the shadow_tlb[64] array and the above functions entirely. The only functional change here is the removal of broken shadow_tlb initialisation. The rest just deletes dead code. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf

Re: [Qemu-devel] [PATCH v2 07/10] target-mips: kvm: Add main KVM support for MIPS

2014-02-11 Thread James Hogan
Hi Andreas, On 10/02/14 14:07, Andreas Färber wrote: +#define dprintf(fmt, ...) \ dprintf is the name of a stdio.h function, so DPRINTF may be a better name. Okay. +int kvm_arch_init_vcpu(CPUState *env) Please use env only for CPUMIPSState, use cpu or cs here. The usual convention is

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

2014-02-12 Thread James Hogan
On 21/12/13 20:42, Peter Maydell wrote: On 16 December 2013 14:12, James Hogan james.ho...@imgtec.com wrote: +#include linux/kvm.h You can't include linux/kvm.h like this -- on Linux this will pull in whatever the host's system kvm.h happens to be, and on non-Linux it won't compile

[PATCH v3 3/9] target-mips: get_physical_address: Add defines for segment bases

2014-03-06 Thread James Hogan
Add preprocessor definitions for 32bit segment bases for use in get_physical_address(). These will also be taken advantage of in the next patch which adds KVM awareness. Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c

[PATCH v3 7/9] hw/mips: In KVM mode, inject IRQ2 (I/O) interupts via ioctls

2014-03-06 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com COP0 emulation is in-kernel for KVM, so inject IRQ2 (I/O) interrupts via ioctls. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net Cc: Andreas Färber afaer

[PATCH v3 1/9] hw/mips/cputimer: Don't start periodic timer in KVM mode

2014-03-06 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Compare/Count timer interrupts are handled in-kernel for KVM, so don't bother starting it in QEMU. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- Changes

[PATCH v3 9/9] target-mips: Enable KVM support in build system

2014-03-06 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Enable KVM support for MIPS in the build system. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- Changes in v2: - Expand commit message - Remove GIC code

[PATCH v3 4/9] target-mips: get_physical_address: Add KVM awareness

2014-03-06 Thread James Hogan
kseg0 or kseg2 address before doing the normal address translation. The real virtual address is still used for TLB lookups. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c | 33 ++--- 1 file changed, 26

[PATCH v3 0/9] KVM Support for MIPS32 Processors

2014-03-06 Thread James Hogan
Maydell) - Remove redundant check of target_name = cpu = mips - Remove mipsel cross compilation fix, which is now fixed by commit 61cc919f73ea (configure: detect endian via compile test) - Add translation of guest kernel segments to allow an attached gdb to see kernel memory correctly James

[PATCH v3 2/9] hw/mips: Add API to convert KVM guest KSEG0 - GPA

2014-03-06 Thread James Hogan
: Guest User address space: 0x..0x3fff Guest Kernel Unmapped: 0x4000..0x5fff Guest Kernel Mapped:0x6000..0x7fff Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel

[PATCH v3 8/9] hw/mips: malta: Add KVM support

2014-03-06 Thread James Hogan
In KVM mode the bootrom is loaded and executed from the last 1MB of DRAM. Based on [PATCH 12/12] KVM/MIPS: General KVM support and support for SMP Guests by Sanjay Lal sanj...@kymasys.com. Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net Cc

[PATCH v3 6/9] target-mips: kvm: Add main KVM support for MIPS

2014-03-06 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Implement the main KVM arch API for MIPS. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc

Re: [Qemu-devel] [PATCH v3 6/9] target-mips: kvm: Add main KVM support for MIPS

2014-03-14 Thread James Hogan
Hi Andreas, On 13/03/14 21:28, Andreas Färber wrote: diff --git a/target-mips/kvm.c b/target-mips/kvm.c new file mode 100644 index 000..0ec343d --- /dev/null +++ b/target-mips/kvm.c [...] +static inline int kvm_mips_put_one_reg(CPUState *cs, int reg_id, int32 *addr) Did you mean

Re: [Qemu-devel] [PATCH v3 6/9] target-mips: kvm: Add main KVM support for MIPS

2014-03-14 Thread James Hogan
On 13/03/14 22:35, Peter Maydell wrote: On 13 March 2014 21:28, Andreas Färber afaer...@suse.de wrote: I'm not sure if we have a policy about __u64 etc. in KVM code. Since it'll be Linux-only I don't see problems currently; for cross-platform parts we prefer uint64_t. Suggest to leave as is

[PATCH v4 01/10] hw/mips/cputimer: Don't start periodic timer in KVM mode

2014-03-14 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Compare/Count timer interrupts are handled in-kernel for KVM, so don't bother starting it in QEMU. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- Changes

[PATCH v4 07/10] hw/mips: In KVM mode, inject IRQ2 (I/O) interupts via ioctls

2014-03-14 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com COP0 emulation is in-kernel for KVM, so inject IRQ2 (I/O) interrupts via ioctls. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net Reviewed-by: Andreas Färber afaer

[PATCH v4 09/10] target-mips: Enable KVM support in build system

2014-03-14 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Enable KVM support for MIPS in the build system. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- Changes in v2: - Expand commit message - Remove GIC code

[PATCH v4 00/10] KVM Support for MIPS32 Processors

2014-03-14 Thread James Hogan
- Remove mipsel cross compilation fix, which is now fixed by commit 61cc919f73ea (configure: detect endian via compile test) - Add translation of guest kernel segments to allow an attached gdb to see kernel memory correctly James Hogan (5): target-mips: get_physical_address: Add defines

[PATCH v4 03/10] target-mips: get_physical_address: Add defines for segment bases

2014-03-14 Thread James Hogan
Add preprocessor definitions for 32bit segment bases for use in get_physical_address(). These will also be taken advantage of in the next patch which adds KVM awareness. Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c

[PATCH v4 05/10] kvm: Allow arch to set sigmask length

2014-03-14 Thread James Hogan
kvm_arch_init(). Otherwise default to 8 bytes. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net Cc: Sanjay Lal sanj...@kymasys.com Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Peter Maydell peter.mayd...@linaro.org --- Changes

[PATCH v4 08/10] hw/mips: malta: Add KVM support

2014-03-14 Thread James Hogan
In KVM mode the bootrom is loaded and executed from the last 1MB of DRAM. Based on [PATCH 12/12] KVM/MIPS: General KVM support and support for SMP Guests by Sanjay Lal sanj...@kymasys.com. Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel...@aurel32.net Cc

[PATCH v4 06/10] target-mips: kvm: Add main KVM support for MIPS

2014-03-14 Thread James Hogan
From: Sanjay Lal sanj...@kymasys.com Implement the main KVM arch API for MIPS. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc

[PATCH v4 02/10] hw/mips: Add API to convert KVM guest KSEG0 - GPA

2014-03-14 Thread James Hogan
: Guest User address space: 0x..0x3fff Guest Kernel Unmapped: 0x4000..0x5fff Guest Kernel Mapped:0x6000..0x7fff Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James Hogan james.ho...@imgtec.com Reviewed-by: Aurelien Jarno aurel

[PATCH v4 10/10] MAINTAINERS: Add entry for MIPS KVM

2014-03-14 Thread James Hogan
Add MAINTAINERS entry for MIPS KVM. Signed-off-by: James Hogan james.ho...@imgtec.com --- Changes in v4: - Add MAINTAINERS entry for MIPS KVM. --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7d17f83..cefe1a1 100644 --- a/MAINTAINERS +++ b

[PATCH v4 04/10] target-mips: get_physical_address: Add KVM awareness

2014-03-14 Thread James Hogan
kseg0 or kseg2 address before doing the normal address translation. The real virtual address is still used for TLB lookups. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Aurelien Jarno aurel...@aurel32.net --- target-mips/helper.c | 33 ++--- 1 file changed, 26

[PATCH 1/4] MIPS: KVM: Pass reserved instruction exceptions to guest

2014-03-14 Thread James Hogan
in a branch delay slot in which case the PC will already point to the branch target. Also turn the printk messages relating to these cases into kvm_debug messages so that they aren't usually visible. This allows crashme to run in the guest without killing the entire VM. Signed-off-by: James Hogan

[PATCH 0/4] MIPS: KVM: RI + RDHWR handling fixes

2014-03-14 Thread James Hogan
with HWREna anyway. Patch 2 and 4 are cleanups that I noticed while writing patch 3. Cc: Ralf Baechle r...@linux-mips.org Cc: Gleb Natapov g...@kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Cc: Sanjay Lal sanj...@kymasys.com Cc: linux-m...@linux-mips.org Cc: kvm@vger.kernel.org James Hogan (4

[PATCH 4/4] MIPS: KVM: Remove dead code in CP0 emulation

2014-03-14 Thread James Hogan
The code to check whether rd MIPS_CP0_DESAVE is dead code, since MIPS_CP0_DESAVE = 31 and rd is already masked with 0x1f. Remove it. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf Baechle r...@linux-mips.org Cc: Gleb Natapov g...@kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Cc

[PATCH 2/4] MIPS: KVM: asm/kvm_host.h: Clean up whitespace

2014-03-14 Thread James Hogan
The whitespace in asm/kvm_host.h is quite inconsistent in places. Clean up the whole file to use tabs more consistently. When you use the --ignore-space-change argument to git diff this patch only changes line wrapping in TLB_IS_GLOBAL and TLB_IS_VALID macros. Signed-off-by: James Hogan james.ho

[PATCH 3/4] MIPS: KVM: Consult HWREna before emulating RDHWR

2014-03-14 Thread James Hogan
now that the guest can control whether it causes a guest exception. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Ralf Baechle r...@linux-mips.org Cc: Gleb Natapov g...@kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Cc: Sanjay Lal sanj...@kymasys.com Cc: linux-m...@linux-mips.org Cc: kvm

Re: [Qemu-devel] [PATCH v4 00/10] KVM Support for MIPS32 Processors

2014-03-14 Thread James Hogan
On 14/03/14 13:27, Peter Maydell wrote: On 14 March 2014 12:47, James Hogan james.ho...@imgtec.com wrote: I'd like to have this squeezed into 2.0 (if at all possible), so any final review from KVM people would be much appreciated. Unfortunately we're already in hardfreeze, which means bug

Re: [PATCH v4 04/10] target-mips: get_physical_address: Add KVM awareness

2014-03-20 Thread James Hogan
On 19/03/14 16:33, Paolo Bonzini wrote: Il 14/03/2014 13:47, James Hogan ha scritto: +if (kvm_enabled()) { +/* KVM TE adds guest kernel segments in useg */ +if (real_address = KVM_KSEG0_BASE) { +if (real_address KVM_KSEG2_BASE) { +/* kseg0

Re: [PATCH v4 08/10] hw/mips: malta: Add KVM support

2014-03-20 Thread James Hogan
On 19/03/14 16:39, Paolo Bonzini wrote: Il 14/03/2014 13:47, James Hogan ha scritto: int prom_index = 0; +uint64_t (*xlate_to_phys) (void *opaque, uint64_t addr); +uint64_t (*xlate_to_kseg0) (void *opaque, uint64_t addr); + #ifdef TARGET_WORDS_BIGENDIAN big_endian = 1

Re: [PATCH v4 01/10] hw/mips/cputimer: Don't start periodic timer in KVM mode

2014-03-20 Thread James Hogan
On 19/03/14 16:29, Paolo Bonzini wrote: Il 14/03/2014 13:47, James Hogan ha scritto: From: Sanjay Lal sanj...@kymasys.com Compare/Count timer interrupts are handled in-kernel for KVM, so don't bother starting it in QEMU. Signed-off-by: Sanjay Lal sanj...@kymasys.com Signed-off-by: James

Re: [PATCH v4 00/10] KVM Support for MIPS32 Processors

2014-03-20 Thread James Hogan
On 19/03/14 16:39, Paolo Bonzini wrote: Il 14/03/2014 13:47, James Hogan ha scritto: This patchset is based on Sanjay Lal's V1 patchset from 2nd March 2013: https://patchwork.kernel.org/project/kvm/list/?submitter=51991state=*q=qemu-devel I think I've addressed all the V1 feedback. The other

Re: [PATCH v4 00/10] KVM Support for MIPS32 Processors

2014-03-21 Thread James Hogan
On 20/03/14 12:44, Paolo Bonzini wrote: Il 20/03/2014 11:00, James Hogan ha scritto: Just a few comments. With what version of the kernel can this be tested? KVM support was added in v3.10, including defconfigs and a CONFIG_KVM_GUEST to ensure the kernel is linked to the different address

[PATCH 14/21] MIPS: KVM: Add nanosecond count bias KVM register

2014-04-25 Thread James Hogan
the nanosecond bias is altered via the KVM_SET_ONE_REG ioctl. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: David Daney david.da...@cavium.com

[PATCH 00/21] MIPS: KVM: Fixes and guest timer rewrite

2014-04-25 Thread James Hogan
emulation to use ktime_get(). Patches 13-15: Add KVM virtual registers for controlling guest timer, including master timer disable, nanosecond bias, and timer frequency. Patches 16-21: Cleanups. James Hogan (21): MIPS: KVM: Allocate at least 16KB for exception handlers MIPS

[PATCH 01/21] MIPS: KVM: Allocate at least 16KB for exception handlers

2014-04-25 Thread James Hogan
overwritten and infinitely recursive exceptions on the next exit from the guest. Increase the minimum size from 0x200 to 0x4000 to cover the full use of the page. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm

[PATCH 17/21] MIPS: KVM: Whitespace fixes in kvm_mips_callbacks

2014-04-25 Thread James Hogan
Fix whitespace in struct kvm_mips_callbacks function pointers. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj

[PATCH 19/21] MIPS: KVM: Remove ifdef DEBUG around kvm_debug

2014-04-25 Thread James Hogan
used. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/kvm_mips_emul.c | 2

[PATCH 20/21] MIPS: KVM: Quieten kvm_info() logging

2014-04-25 Thread James Hogan
The logging from MIPS KVM is fairly noisy with kvm_info() in places where it shouldn't be, such as on VM creation and migration to a different CPU. Replace these kvm_info() calls with kvm_debug(). Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb

[PATCH 15/21] MIPS: KVM: Add count frequency KVM register

2014-04-25 Thread James Hogan
-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: David Daney david.da...@cavium.com Cc: Sanjay Lal sanj...@kymasys.com --- arch/mips/include/asm

[PATCH 16/21] MIPS: KVM: Make kvm_mips_comparecount_{func,wakeup} static

2014-04-25 Thread James Hogan
The kvm_mips_comparecount_func() and kvm_mips_comparecount_wakeup() functions are only used within arch/mips/kvm/kvm_mips.c, so make them static. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc

[PATCH 18/21] MIPS: KVM: Fix kvm_debug bit-rottage

2014-04-25 Thread James Hogan
directly rather than using kvm_mips_get_user_asid(). Also fixed brace placement. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc

[PATCH 21/21] MIPS: KVM: Remove redundant NULL checks before kfree()

2014-04-25 Thread James Hogan
The kfree() function already NULL checks the parameter so remove the redundant NULL checks before kfree() calls in arch/mips/kvm/. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r

[PATCH 06/21] MIPS: KVM: Move KVM_{GET,SET}_ONE_REG definitions into kvm_host.h

2014-04-25 Thread James Hogan
Move the KVM_{GET,SET}_ONE_REG MIPS register id definitions out of kvm_mips.c to kvm_host.h so that they can be shared between multiple source files. This allows register access to be indirected depending on the underlying implementation (trap emulate or VZ). Signed-off-by: James Hogan james.ho

[PATCH 13/21] MIPS: KVM: Add master disable count interface

2014-04-25 Thread James Hogan
took effect. This should allow userland to atomically save the state of the timer, and later restore it. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m

[PATCH 03/21] MIPS: KVM: Use tlb_write_random

2014-04-25 Thread James Hogan
. This happens to also fix an issue with Ingenic XBurst cores where the same TLB entry is replaced each time preventing forward progress on stores due to alternating between TLB load misses for the instruction fetch and TLB store misses. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini

[PATCH 08/21] MIPS: KVM: Deliver guest interrupts after local_irq_disable()

2014-04-25 Thread James Hogan
When about to run the guest, deliver guest interrupts after disabling host interrupts. This should prevent an hrtimer interrupt from being handled after delivering guest interrupts, and therefore not delivering the guest timer interrupt until after the next guest exit. Signed-off-by: James Hogan

[PATCH 07/21] MIPS: KVM: Add CP0_Count/Compare KVM register access

2014-04-25 Thread James Hogan
patches. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: David Daney david.da...@cavium.com Cc: Sanjay Lal sanj...@kymasys.com

[PATCH 02/21] MIPS: KVM: Use local_flush_icache_range to fix RI on XBurst

2014-04-25 Thread James Hogan
more sense to use local_flush_icache_range() instead which does the same thing but is more portable. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m

[PATCH 09/21] MIPS: KVM: Fix timer race modifying guest CP0_Cause

2014-04-25 Thread James Hogan
requiring interrupts to be disabled. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj...@kymasys.com --- arch/mips

[PATCH 04/21] MIPS: KVM: Fix CP0_EBASE KVM register id

2014-04-25 Thread James Hogan
KVM_REG_MIPS_CP0_EBASE is defined as 64bit, but is a 32bit register even in MIPS64, so fix the definition. Note, this definition isn't actually used yet, so it didn't cause any problems. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g

[PATCH 05/21] MIPS: KVM: Add CP0_EPC KVM register access

2014-04-25 Thread James Hogan
Contrary to the comment, the guest CP0_EPC register cannot be set via kvm_regs, since it is distinct from the guest PC. Add the EPC register to the KVM_{GET,SET}_ONE_REG ioctl interface. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g

[PATCH 11/21] MIPS: KVM: Rewrite count/compare timer emulation

2014-04-25 Thread James Hogan
interface Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj...@kymasys.com --- arch/mips/include/asm/kvm_host.h | 21

[PATCH 12/21] MIPS: KVM: Override guest kernel timer frequency directly

2014-04-25 Thread James Hogan
(based on the emulated RTC). Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj...@kymasys.com --- arch/mips/Kconfig

[PATCH 10/21] MIPS: KVM: Migrate hrtimer to follow VCPU

2014-04-25 Thread James Hogan
interrupt not to be delivered until after the next guest exit. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Gleb Natapov g...@kernel.org Cc: kvm@vger.kernel.org Cc: Ralf Baechle r...@linux-mips.org Cc: linux-m...@linux-mips.org Cc: Sanjay Lal sanj

Re: [PATCH 04/21] MIPS: KVM: Fix CP0_EBASE KVM register id

2014-04-25 Thread James Hogan
Hi David, On Friday 25 April 2014 09:36:50 David Daney wrote: On 04/25/2014 08:19 AM, James Hogan wrote: -#define KVM_REG_MIPS_CP0_EBASE MIPS_CP0_64(15, 1) +#define KVM_REG_MIPS_CP0_EBASE MIPS_CP0_32(15, 1) According to: MIPS® Architecture Reference Manual

Re: [PATCH 05/21] MIPS: KVM: Add CP0_EPC KVM register access

2014-04-25 Thread James Hogan
Hi David, On Friday 25 April 2014 09:44:17 David Daney wrote: On 04/25/2014 08:19 AM, James Hogan wrote: Contrary to the comment, the guest CP0_EPC register cannot be set via kvm_regs, since it is distinct from the guest PC. Add the EPC register to the KVM_{GET,SET}_ONE_REG ioctl interface

Re: [PATCH 09/21] MIPS: KVM: Fix timer race modifying guest CP0_Cause

2014-04-25 Thread James Hogan
Hi David, On Friday 25 April 2014 09:55:47 David Daney wrote: On 04/25/2014 08:19 AM, James Hogan wrote: The hrtimer callback for guest timer timeouts sets the guest's CP0_Cause.TI bit to indicate to the guest that a timer interrupt is pending, however there is no mutual exclusion

Re: [PATCH 11/21] MIPS: KVM: Rewrite count/compare timer emulation

2014-04-25 Thread James Hogan
Hi David, On Friday 25 April 2014 10:00:21 David Daney wrote: + /* Frequency of timer in Hz */ + uint32_t count_hz; We are currently running with timer frequencies of over 2GHz, so the width of this variable is close to the limit. Interesting. Do you have 64-bit Count/Compare

Re: [PATCH 14/21] MIPS: KVM: Add nanosecond count bias KVM register

2014-04-25 Thread James Hogan
Hi David, On Friday 25 April 2014 10:27:17 David Daney wrote: On 04/25/2014 08:19 AM, James Hogan wrote: Expose the KVM guest CP0_Count bias (from the monotonic kernel time) to userland in nanosecond units via a new KVM_REG_MIPS_COUNT_BIAS register accessible with the KVM_{GET,SET}_ONE_REG

Re: [PATCH 14/21] MIPS: KVM: Add nanosecond count bias KVM register

2014-04-28 Thread James Hogan
Hi Paolo, On 28 April 2014 13:01, Paolo Bonzini pbonz...@redhat.com wrote: Il 25/04/2014 17:19, James Hogan ha scritto: Expose the KVM guest CP0_Count bias (from the monotonic kernel time) to userland in nanosecond units via a new KVM_REG_MIPS_COUNT_BIAS register accessible with the KVM_{GET

Re: [PATCH 05/11] kvm tools, mips: Add MIPS support

2014-05-09 Thread James Hogan
Hi Andreas, On 06/05/14 16:51, Andreas Herrmann wrote: From: David Daney david.da...@cavium.com So far this was tested with host running KVM using MIPS-VZ (on Cavium Octeon3). A paravirtualized mips kernel was used for the guest. [andreas.herrmann: * Renamed kvm__arch_periodic_poll to

Re: [PATCH 06/11] kvm tools, mips: Enable build of mips support

2014-05-09 Thread James Hogan
Hi Andreas, On 06/05/14 16:51, Andreas Herrmann wrote: From: David Daney david.da...@cavium.com Signed-off-by: David Daney david.da...@cavium.com Signed-off-by: Andreas Herrmann andreas.herrm...@caviumnetworks.com --- tools/kvm/Makefile | 11 ++- 1 file changed, 10

Re: [PATCH 07/11] kvm tools: Provide per arch macro to specify type for KVM_CREATE_VM

2014-05-09 Thread James Hogan
Hi Andreas, On 06/05/14 16:51, Andreas Herrmann wrote: This is is usually 0 for most archs. On mips we have two types. TE (type 0) and MIPS-VZ (type 1). Default to 1 on mips. Signed-off-by: Andreas Herrmann andreas.herrm...@caviumnetworks.com ---

Re: [PATCH 10/11] kvm tools: Introduce weak (default) load_bzimage function

2014-05-09 Thread James Hogan
Hi Andreas, On 06/05/14 16:51, Andreas Herrmann wrote: ... to get rid of its function definition from archs that don't support it. Maybe it makes sense to put this patch before the main mips one so that the function doesn't have to be added for mips in the first place Cheers James

Re: [PATCH 05/11] kvm tools, mips: Add MIPS support

2014-05-12 Thread James Hogan
Hi Andreas, On 12/05/14 14:01, Andreas Herrmann wrote: On Fri, May 09, 2014 at 10:15:29PM +0100, James Hogan wrote: On 06/05/14 16:51, Andreas Herrmann wrote: +static bool kvm_cpu__hypercall_write_cons(struct kvm_cpu *vcpu) +{ + int term = (int)vcpu-kvm_run-hypercall.args[0]; + u64 addr

Re: [PATCH v2 00/12] kvm tools: Misc patches (mips support)

2014-05-20 Thread James Hogan
On 19/05/14 17:53, Andreas Herrmann wrote: Hi, These patches contain changes that I am currently using on top of git://github.com/penberg/linux-kvm.git (as of v3.13-rc1-1427-gd9147fb) to run lkvm on MIPS. The core is David's work for mips support and loading elf binaries. I rebased his

Re: [PATCH v2 08/12] kvm tools: Provide per arch macro to specify type for KVM_CREATE_VM

2014-05-20 Thread James Hogan
On 19/05/14 17:53, Andreas Herrmann wrote: This is is usually 0 for most archs. On mips we have two types. TE (type 0) and MIPS-VZ (type 1). Default to 1 on mips. Minor thing I didn't spot with v1 (sorry). I think this patch should probably be moved before patch 6 with the mips part squashed

Re: [PATCH v2 00/12] kvm tools: Misc patches (mips support)

2014-05-20 Thread James Hogan
On 20/05/14 18:52, Pekka Enberg wrote: On 05/20/2014 02:20 PM, James Hogan wrote: I don't know what Pekka's policy is for kvm tools, but to avoid confusion I'd like to make clear that this patchset depends on a KVM implementation (KVM_VM_TYPE==1 for VZ) which hasn't been accepted

Re: [PATCH 03/15] MIPS: OCTEON: Move CAVIUM_OCTEON_CVMSEG_SIZE to CPU_CAVIUM_OCTEON

2014-05-20 Thread James Hogan
Hi Andreas, On Tuesday 20 May 2014 16:47:04 Andreas Herrmann wrote: From: David Daney david.da...@cavium.com CVMSEG is related to the CPU core not the SoC system. So needs to be configurable there. Signed-off-by: David Daney david.da...@cavium.com Signed-off-by: Andreas Herrmann

Re: [PATCH 13/15] MIPS: Add defconfig for mips_paravirt

2014-05-20 Thread James Hogan
Hi Andreas, On Tuesday 20 May 2014 16:47:14 Andreas Herrmann wrote: From: David Daney david.da...@cavium.com Signed-off-by: David Daney david.da...@cavium.com Signed-off-by: Andreas Herrmann andreas.herrm...@caviumnetworks.com --- arch/mips/configs/mips_paravirt_defconfig | 1524

  1   2   3   >