Re: [kvm-devel] split ioapic reset API
Avi Kivity wrote: Dong, Eddie wrote: This one is a preparation for kernel devices reset support. Split ioapic reset API and export PIC reset API Please split into two patches, I need to fold them into the pic patch and the ioapic patch. Splited, please check in. It is too small now :-) thx, eddie commit f0cd5e0f99b8ac46f23f786de23a905680f0496e Author: root [EMAIL PROTECTED](none) Date: Wed Oct 10 13:14:13 2007 +0800 export PIC reset API for kernel RESET. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] diff --git a/drivers/kvm/i8259.c b/drivers/kvm/i8259.c index a679157..f0dc2ee 100644 --- a/drivers/kvm/i8259.c +++ b/drivers/kvm/i8259.c @@ -181,10 +181,8 @@ int kvm_pic_read_irq(struct kvm_pic *s) return intno; } -static void pic_reset(void *opaque) +void kvm_pic_reset(struct kvm_kpic_state *s) { - struct kvm_kpic_state *s = opaque; - s-last_irr = 0; s-irr = 0; s-imr = 0; @@ -209,7 +207,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val) addr = 1; if (addr == 0) { if (val 0x10) { - pic_reset(s); /* init */ + kvm_pic_reset(s); /* init */ /* * deassert a pending interrupt */ diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 508280e..e08ae10 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -139,6 +139,7 @@ int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu); int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); int kvm_create_lapic(struct kvm_vcpu *vcpu); void kvm_lapic_reset(struct kvm_vcpu *vcpu); +void kvm_pic_reset(struct kvm_kpic_state *s); void kvm_free_lapic(struct kvm_vcpu *vcpu); u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu); void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8); commit 6a42a10221ddb4248937d7aacc0a3420dab79598 Author: root [EMAIL PROTECTED](none) Date: Wed Oct 10 13:15:41 2007 +0800 Split IOAPIC reset function and export for kernel RESET. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c index c7992e6..3b69541 100644 --- a/drivers/kvm/ioapic.c +++ b/drivers/kvm/ioapic.c @@ -366,18 +366,27 @@ static void ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, } } +void kvm_ioapic_reset(struct kvm_ioapic *ioapic) +{ + int i; + + for (i = 0; i IOAPIC_NUM_PINS; i++) + ioapic-redirtbl[i].fields.mask = 1; + ioapic-base_address = IOAPIC_DEFAULT_BASE_ADDRESS; + ioapic-ioregsel = 0; + ioapic-irr = 0; + ioapic-id = 0; +} + int kvm_ioapic_init(struct kvm *kvm) { struct kvm_ioapic *ioapic; - int i; ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL); if (!ioapic) return -ENOMEM; kvm-vioapic = ioapic; - for (i = 0; i IOAPIC_NUM_PINS; i++) - ioapic-redirtbl[i].fields.mask = 1; - ioapic-base_address = IOAPIC_DEFAULT_BASE_ADDRESS; + kvm_ioapic_reset(ioapic); ioapic-dev.read = ioapic_mmio_read; ioapic-dev.write = ioapic_mmio_write; ioapic-dev.in_range = ioapic_in_range; diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index e08ae10..5ad3cfd 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -140,6 +140,7 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); int kvm_create_lapic(struct kvm_vcpu *vcpu); void kvm_lapic_reset(struct kvm_vcpu *vcpu); void kvm_pic_reset(struct kvm_kpic_state *s); +void kvm_ioapic_reset(struct kvm_ioapic *ioapic); void kvm_free_lapic(struct kvm_vcpu *vcpu); u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu); void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8); rbt-k1.patch Description: rbt-k1.patch rbt-k2.patch Description: rbt-k2.patch - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] kernel device reset support
Avi Kivity wrote: Dong, Eddie wrote: Avi Kivity wrote: But, for an ungraceful reset, nothing prevents an AP from issuing a reset? Mmm, Yes, but I think current architecture can't handle this. The thread where AP issues RESET will continue run, which means it becomes BSP now and wake up other APs later on. Or We can block that AP first and then inform BSP to do RESET job. Here we need to block the AP in kernel so that we can wake up. It should call vcpu_halt() immediately after reset. ?? Can user level be able to enter kernel HALT state. It can be a future task which is not that high priority IMO. I will focus on SMP boot 1st. Your opnion? Agree. But let's make it close to the complete solution. Yes, halt all APs and let BSP do reset ops in user level. Will post patch to Qemu to support SMP reboot some time later. The test for vcpu-requests already exists (and is needed for tlb flushes) so there is no additional performance hit. OK, that makes sense. changed. please verify. User level is split into libkvm and qemu. thx,eddie commit a0aed7040befe198491254d3459aeb5897f5f2c1 Author: root [EMAIL PROTECTED](none) Date: Wed Oct 10 13:45:58 2007 +0800 Add VM reset support in kernel side to reset the kernel devices and force APs to enter wait for INIT/SIPI state. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 4ab487c..81c9af1 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -68,6 +68,7 @@ * vcpu-requests bit members */ #define KVM_TLB_FLUSH 0 +#define KVM_FROZEN 1 /* * Address types: diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 0b2894a..33f16bd 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -2189,9 +2189,17 @@ again: vcpu-guest_mode = 1; - if (vcpu-requests) + if (vcpu-requests) { if (test_and_clear_bit(KVM_TLB_FLUSH, vcpu-requests)) kvm_x86_ops-tlb_flush(vcpu); + if (test_and_clear_bit(KVM_FROZEN, vcpu-requests)) { + local_irq_enable(); + preempt_enable(); + r = -EINTR; + kvm_run-exit_reason = KVM_EXIT_FROZEN; + goto out; + } + } kvm_x86_ops-run(vcpu, kvm_run); @@ -2245,6 +2253,8 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) vcpu_load(vcpu); if (unlikely(vcpu-mp_state == VCPU_MP_STATE_UNINITIALIZED)) { + if (irqchip_in_kernel(vcpu-kvm) vcpu-apic) + kvm_lapic_reset(vcpu); kvm_vcpu_block(vcpu); vcpu_put(vcpu); return -EAGAIN; @@ -3143,6 +3153,54 @@ out: return r; } +/* + * Reset kernel devices. + */ +void kvm_reset_devices(struct kvm *kvm) +{ + kvm_pic_reset(pic_irqchip(kvm)-pics[1]); + kvm_pic_reset(pic_irqchip(kvm)-pics[0]); + pic_irqchip(kvm)-output = 0; + kvm_ioapic_reset(kvm-vioapic); +} + +/* + * Kernel side VM Reset. + * NOTE here: User level code must guarantee only the BSP + * thread can do this call. + * + */ +int kvm_vm_reset(struct kvm *kvm) +{ + struct kvm_vcpu *vcpu; + int i; + + for (i = 0; i KVM_MAX_VCPUS; i++) { + vcpu = kvm-vcpus[i]; + if (!vcpu) + continue; + /* active VCPU */ + if (vcpu-vcpu_id) { + vcpu-mp_state = VCPU_MP_STATE_UNINITIALIZED; + set_bit(KVM_FROZEN, vcpu-requests); + kvm_vcpu_kick(vcpu); + /* +* Wait till the AP entered waiting for +* INIT/SIPI state +*/ + while (test_bit(KVM_FROZEN, vcpu-requests)) + schedule(); + } + else { + vcpu-mp_state = VCPU_MP_STATE_RUNNABLE; + kvm_lapic_reset(vcpu); + } + } + /* Now only BSP is running... */ + kvm_reset_devices(kvm); + return 0; +} + static long kvm_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { @@ -3228,6 +3286,12 @@ static long kvm_vm_ioctl(struct file *filp, } else goto out; break; + case KVM_RESET: + r = -EINVAL; + if (!irqchip_in_kernel(kvm)) + goto out; + r = kvm_vm_reset(kvm); + break; case KVM_IRQ_LINE: { struct kvm_irq_level irq_event; diff --git a/include/linux/kvm.h b/include/linux/kvm.h index cd4ac12..ea9c004 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -127,7 +127,8 @@ enum kvm_exit_reason {
[kvm-devel] SMP reboot issue
SMP reboot failed with various phenomena such as user level unhandled vm exit: 0x8021 ... when rebooting SMP RHEL5U or execption 8 (0)... when rebooting XP etc. The reason is that we are not correctly reset VCPU. create_vcpu does some initialization work which should be part of reset job. So reset_vcpu can't do full VCPU reset and thus cause AP reboot failure. The best approach is to re-org above 2 functions to make it clear that everything will be re-initialized in vcpu_reset. create_vcpu probably only allocate memory and do initialization only for those communicating with user level data structure. while leave others including MMU reset to vcpu_reset. For now, let us use this small patch to fix current issue: GUEST_CR3 in VMCS is not correctly reseted due to enter_rmode issue. With this I get XPSP2 acpi SMP guest reboot successfully and also SMP Linux RHEL5U. thanks, eddie commit 60da97b6de0324a5be1c958b749b33b77cd2b68f Author: root [EMAIL PROTECTED](none) Date: Wed Oct 10 14:09:19 2007 +0800 Reset a SMP guest will force AP enter real mode (RESET) probably from paging enabled protect mode. While current enter_rmode can only handle mode switch from nonpaging mode to real mode which leads to SMP reboot failure. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 382bd6a..ece0aa4 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -1142,6 +1142,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) destroy_kvm_mmu(vcpu); return init_kvm_mmu(vcpu); } +EXPORT_SYMBOL_GPL(kvm_mmu_reset_context); int kvm_mmu_load(struct kvm_vcpu *vcpu) { diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 0537695..2d75599 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1156,6 +1156,7 @@ static void enter_rmode(struct kvm_vcpu *vcpu) fix_rmode_seg(VCPU_SREG_GS, vcpu-rmode.gs); fix_rmode_seg(VCPU_SREG_FS, vcpu-rmode.fs); + kvm_mmu_reset_context(vcpu); init_rmode_tss(vcpu-kvm); } - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] Windows XP Pro 64 installation issues with kvm-45 onIntel host
[EMAIL PROTECTED] wrote: Hello, Trying to install Windows XP Pro 64bits, the first phase goes quite well (except that it uses 100% of host's cpu), but crashes when trying to reboot with the following message: unhandled vm exit: 0x8021 rax 0095b9e5 rbx 0095b9c0 rcx 0095b9e5 rdx 0600 rsi f883f200 rdi f800011a6960 rsp rbp fadfeb886a10 r8 r9 0100 r10 0095b9e5 r11 0080 r12 r13 r14 r15 rip rflags 00023002 cs 1000 (0001/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ds (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ss (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) fs (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) gs (/ p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) tr (30c0/2088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) ldt (/ p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) gdt 0/ idt 0/ cr0 6010 cr2 fadfead016a0 cr3 2f941000 cr4 0 cr8 0 efer 0 ./bin/install_windowsxp64.sh: line 12: 6486 Aborted sudo nice -n -5 qemu-system-x86_64 -smp 2 -m 768 -localtime -net nic -net user -hda $DISC -cdrom $CDROM -boot d -usb --usbdevice tablet It then hangs (no host cpu usage, no mouse movement in guest) after a while on second installation phase after a manual reboot. Trying from zero with -no-kvm-irqchip, it gives a windows blue screen (host cpu at 100%) when trying to reboot with the following message for if anyone understands those windows things: STOP: 0x001E (0xC096,0xF80001071924,0x,0xFFF FFADFEB5BD450) After manual reboot, installation also hangs at some point Host: debian lenny, kernel 2.6.21-6 Processor: Intel(R) Pentium(R) D CPU 3.00GHz KVM: 45 If you want further debug information, I'd be pleased to help. Can u try with my latest post? I fixed same error when I do reboot. thx,eddie - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
On Tue, 2007-10-09 at 16:40 -0500, Anthony Liguori wrote: This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. It introduces a io dispatch mechanism. This mechanism supports subpage granularity but is optimized to efficiently cover regions of pages too. It's a 64-bit address space that's structured as a 5-level table. For x86, we'll have two tables, a pio_table and an mmio_table. For PPC we can just have a single table. The IO functions can support accesses of up to 8 bytes and can handle input/output in the same function. I tried to keep this nice and simple so as to not add too much complexity to kvmctl. I'm having a hard time seeing how this range stuff is useful. Other than that, a 5-level table sounds like overcomplicating something where a plain old hash table would do just fine, but it's only one function so I guess I can't complain much. -- Hollis Blanchard IBM Linux Technology Center - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Anthony Liguori wrote: This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. It introduces a io dispatch mechanism. This mechanism supports subpage granularity but is optimized to efficiently cover regions of pages too. It's a 64-bit address space that's structured as a 5-level table. Why not use a simple array? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Jim Paris wrote: If I stop KVM in the monitor with stop, wait a minute, and do cont, a Linux guest gives me a BUG: soft lockup detected on CPU#0. Is that expected behavior? No. What isn't virtualized that allows it to detect that? The host is a core 2 duo. It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] soft lockup after stop/cont
If I stop KVM in the monitor with stop, wait a minute, and do cont, a Linux guest gives me a BUG: soft lockup detected on CPU#0. Is that expected behavior? What isn't virtualized that allows it to detect that? The host is a core 2 duo. I have bigger problems in the guest after migrating to a file and restoring from that, but this seems like a good place to start.. -jim - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [ANNOUNCE] kvm-46 release
We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Changes since kvm-45: - fix host oops on bad guest ioapic accesses - handle NMIs before enabling host interrupts - add general guest memory accessors (Izik Eidus) - allow user control over shadow cache size (Izik Eidus) - auto tune shadow cache size with guest memory (Izik Eidus) - allocate guest memory in userspace instead of in kernel (Izik Eidus) - code style fixes (Mike Day, Anthony Liguori) - lapic cleanups (Rusty Russell) - fix acpi interrupt reporting for FreeBSD - fix color problems on certain displays - Red Hat 7.1 support - vmmouse support (Dan Kenigsberg) - fix sdl window caption when keyboard is captured (Dan Kenigsberg) - improve libkvm configure script (Jerone Young) - improve bios compilation support on x86_64 hosts (Laurent Vivier) - fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) Notes: If you use the modules bundled with kvm-46, you can use any version of Linux from 2.6.9 upwards. If you use the modules bundled with Linux 2.6.20, you need to use kvm-12. If you use the modules bundled with Linux 2.6.21, you need to use kvm-17. Modules from Linux 2.6.22 and up will work with any kvm version from kvm-22. Some features may only be available in newer releases. For best performance, use Linux 2.6.23-rc2 or later as the host. http://kvm.qumranet.com - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] RFC/patch: a very trivial patch towards portability
Avi Kivity wrote: Small, reviewable, posted patches are definitely the best way forward. Very well, will go that direction. -case KVM_CHECK_EXTENSION: { -int ext = (long)argp; - -switch (ext) { -case KVM_CAP_IRQCHIP: -case KVM_CAP_HLT: -case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: -r = 1; -break; -default: -r = 0; -break; -} -break; -} CHECK_EXTENSION is hopefully a generic mechanism (even if the some of the actual extensions are not). So there should be a switch in common code for the common extensions, and the default: target should call kvm_arch_check_extension() for further processing. Agreed, the call itself should be generic. But the result is arch dependent. Will fix it. -case KVM_GET_VCPU_MMAP_SIZE: -r = -EINVAL; -if (arg) -goto out; -r = 2 * PAGE_SIZE; -break; I would think this is generic too? Isn't s390 interested in passing information to userspace via a mmap()ed region? Yes, same as above: call is generic - result value not. Will fix this too. Note that mmio data is passed via that region. Yes, I've seen that. Thanks for the heads-up. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] RFC/patch: a very trivial patch towards portability
Avi Kivity wrote: What's the motivation for the new header? So we have a list of arch-dependent functions? Compiler-wise it could just as well remain in kvm.h. The motivation for a new header, is that it contains definitions specific to an architecture. These prototypes should go to kvm.h, they are common for all archs. Will fix it. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) Thanks, Jun - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Jun Koi wrote: Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) It's not exposed by qemu, but you can now mmap() some file (or use SysV shared memory) and use that as guest memory. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
[EMAIL PROTECTED] wrote: It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? In Xen, we decide to froze the guest time after save/restore. In this way the guest see contiguous timer and thus avoid this issue. Probably we should do similar here, comments? thx,eddie - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] Firewire Support for KVM Guest?
Calin Brabandt wrote: I'm a KVM newb and can't find any information or associated FAQ about KVM guest firewire support Unfourtantly kvm have no firewire support - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) It's not exposed by qemu, but you can now mmap() some file (or use SysV shared memory) and use that as guest memory. OK, lets say we have 2 guest VMs share a memory, like mmap() a tmpfs file (which is actually in memory). Now one writes to the memory (shared file). Can we guarantee that the memory immediately updated, so other will see the change immediately? Or the data might be cached for a while, befere being flushed to the shared memory? Thanks, Jun - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Jun Koi wrote: On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) It's not exposed by qemu, but you can now mmap() some file (or use SysV shared memory) and use that as guest memory. OK, lets say we have 2 guest VMs share a memory, like mmap() a tmpfs file (which is actually in memory). Now one writes to the memory (shared file). Can we guarantee that the memory immediately updated, so other will see the change immediately? Or the data might be cached for a while, befere being flushed to the shared memory? Changes are visible immediately. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Dong, Eddie wrote: [EMAIL PROTECTED] wrote: It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? In Xen, we decide to froze the guest time after save/restore. In this way the guest see contiguous timer and thus avoid this issue. Probably we should do similar here, comments? This is pause/resume, not save/restore. I think save/restore now has contiguous lapic timer and discontiguous real time. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Avi Kivity wrote: Dong, Eddie wrote: [EMAIL PROTECTED] wrote: It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? In Xen, we decide to froze the guest time after save/restore. In this way the guest see contiguous timer and thus avoid this issue. Probably we should do similar here, comments? This is pause/resume, not save/restore. I think save/restore now has contiguous lapic timer and discontiguous real time. If save/restore means live migration here, yes you are right. save to file and later resume from file will have this issue. thx,eddie - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Dong, Eddie wrote: Avi Kivity wrote: Dong, Eddie wrote: [EMAIL PROTECTED] wrote: It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? In Xen, we decide to froze the guest time after save/restore. In this way the guest see contiguous timer and thus avoid this issue. Probably we should do similar here, comments? This is pause/resume, not save/restore. I think save/restore now has contiguous lapic timer and discontiguous real time. If save/restore means live migration here, yes you are right. No, I didn't mean that. save to file and later resume from file will have this issue. Why? after saving to a file, the local apic in the kernel is destroyed when qemu quits. Or is the timer saved in absolute time? if so you are right, and yes, your solution is needed. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Changes since kvm-45: - fix host oops on bad guest ioapic accesses - handle NMIs before enabling host interrupts - add general guest memory accessors (Izik Eidus) - allow user control over shadow cache size (Izik Eidus) - auto tune shadow cache size with guest memory (Izik Eidus) - allocate guest memory in userspace instead of in kernel (Izik Eidus) - code style fixes (Mike Day, Anthony Liguori) - lapic cleanups (Rusty Russell) - fix acpi interrupt reporting for FreeBSD - fix color problems on certain displays - Red Hat 7.1 support - vmmouse support (Dan Kenigsberg) - fix sdl window caption when keyboard is captured (Dan Kenigsberg) - improve libkvm configure script (Jerone Young) - improve bios compilation support on x86_64 hosts (Laurent Vivier) - fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) when i try to compile it on centos i've got this error (which is not happend in kvm-45) : -- iasl -tc -p acpi-dsdt.hex acpi-dsdt.dsl make[1]: iasl: Command not found -- where this iasl comes from? and where can i found it? i can't found in any package even in external repos. -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Dong, Eddie wrote: Or is the timer saved in absolute time? if so you are right, and yes, your solution is needed. Looks like current live migration, also save/restore, doesn't migrate guest time. (do I miss something?) So the new guest will see a totally different TSC and OS feel stranger or many lost ticks etc. Should we add this one? thx,eddie cpu_save (qemu/hw/pc.c) has this: #ifdef USE_KVM if (kvm_allowed) { for (i = 0; i NR_IRQ_WORDS ; i++) { qemu_put_be32s(f, env-kvm_interrupt_bitmap[i]); } qemu_put_be64s(f, env-tsc); } #endif And I think the apic code saves the timer? -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] split ioapic reset API
Dong, Eddie wrote: Avi Kivity wrote: Dong, Eddie wrote: This one is a preparation for kernel devices reset support. Split ioapic reset API and export PIC reset API Please split into two patches, I need to fold them into the pic patch and the ioapic patch. Splited, please check in. Applied, thank. It is too small now :-) Small is good! -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Farkas Levente wrote: Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Changes since kvm-45: - fix host oops on bad guest ioapic accesses - handle NMIs before enabling host interrupts - add general guest memory accessors (Izik Eidus) - allow user control over shadow cache size (Izik Eidus) - auto tune shadow cache size with guest memory (Izik Eidus) - allocate guest memory in userspace instead of in kernel (Izik Eidus) - code style fixes (Mike Day, Anthony Liguori) - lapic cleanups (Rusty Russell) - fix acpi interrupt reporting for FreeBSD - fix color problems on certain displays - Red Hat 7.1 support - vmmouse support (Dan Kenigsberg) - fix sdl window caption when keyboard is captured (Dan Kenigsberg) - improve libkvm configure script (Jerone Young) - improve bios compilation support on x86_64 hosts (Laurent Vivier) - fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) when i try to compile it on centos i've got this error (which is not happend in kvm-45) : -- iasl -tc -p acpi-dsdt.hex acpi-dsdt.dsl make[1]: iasl: Command not found -- where this iasl comes from? and where can i found it? i can't found in any package even in external repos. How did you get this? Normal 'make' doesn't try to compile the bios. You can download the iasl compiler from http://www.intel.com/technology/iapc/acpi/downloads.htm. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] Firewire Support for KVM Guest?
2007/10/10, Calin Brabandt [EMAIL PROTECTED]: I'm a KVM newb and can't find any information or associated FAQ about KVM guest firewire support. If there's no KVM support, I'm seeking alternative recommendations, if KVM list members are so inclined. My goal is to boot a dedicated and proprietary Linux 2.4 kernel based AVX1 LiveCD under KVM. See http://www.169time.com/ for details, if interested. Unfortunately, the AVX1 CD source is not available. (Is this a GPL violation, perhaps?) Possibily, but IANAL. You can report this to the GPL Violations Mailing Lists if you think this might be the case (http://gpl-violations.org/) Normally the AVX1 CD must run on a standalone PC equipped with two firewire ports for I/O. The sole function of AVX1 is to process firewire HDTV video data but it can't decode, render, or record the video data in any manner. I'd like to run the AVX1 CD under a KVM on my Fedora 7 Mythtv system and loop the AVX1 firewire output back into a third firewire port that's assigned to the Mythtv host for capture. I've booted both the AVX1 CD disc and an iso image under KVM, but it hangs when it tries to load the AVX1 guest firewire driver modules. I have an Intel G965OT mobo with 2GB of DDR-2 and a 6600 Core 2 Duo. I'll soon upgrade to 4GB of DDR-2 and a Q6600 quad CPU. I don't believe the AVX1 CD supports the TI firewire chip on my mobo so I installed an AVX1 supported VIA chip firewire PCI card that previously functioned correctly in my standalone AVX1 system. Any ideas, encouragement (or discouragement ;)) are much appreciated. If I can get this to work, there are many 169time/AVX1 users at www.avsforum.com who would be interested. The 169time developer has promised integrated support for years but, in reality, I suspect he's completely abandoned the project. Thanks for everyone's patience, given that knowledgeable KVM list readers may immediately identify my goal as unrealistic folly. -Cal At the moment it seems that there's no support in qemu hence no support in kvm. You can try the qemu mailing list and ask if someone is working on this/if this is feasible. HTH Gildas - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Farkas Levente wrote: Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Changes since kvm-45: - fix host oops on bad guest ioapic accesses - handle NMIs before enabling host interrupts - add general guest memory accessors (Izik Eidus) - allow user control over shadow cache size (Izik Eidus) - auto tune shadow cache size with guest memory (Izik Eidus) - allocate guest memory in userspace instead of in kernel (Izik Eidus) - code style fixes (Mike Day, Anthony Liguori) - lapic cleanups (Rusty Russell) - fix acpi interrupt reporting for FreeBSD - fix color problems on certain displays - Red Hat 7.1 support - vmmouse support (Dan Kenigsberg) - fix sdl window caption when keyboard is captured (Dan Kenigsberg) - improve libkvm configure script (Jerone Young) - improve bios compilation support on x86_64 hosts (Laurent Vivier) - fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) when i try to compile it on centos i've got this error (which is not happend in kvm-45) : -- iasl -tc -p acpi-dsdt.hex acpi-dsdt.dsl make[1]: iasl: Command not found -- where this iasl comes from? and where can i found it? i can't found in any package even in external repos. ok i find it for fedora and recompile it from there. -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Avi Kivity wrote: Farkas Levente wrote: Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Changes since kvm-45: - fix host oops on bad guest ioapic accesses - handle NMIs before enabling host interrupts - add general guest memory accessors (Izik Eidus) - allow user control over shadow cache size (Izik Eidus) - auto tune shadow cache size with guest memory (Izik Eidus) - allocate guest memory in userspace instead of in kernel (Izik Eidus) - code style fixes (Mike Day, Anthony Liguori) - lapic cleanups (Rusty Russell) - fix acpi interrupt reporting for FreeBSD - fix color problems on certain displays - Red Hat 7.1 support - vmmouse support (Dan Kenigsberg) - fix sdl window caption when keyboard is captured (Dan Kenigsberg) - improve libkvm configure script (Jerone Young) - improve bios compilation support on x86_64 hosts (Laurent Vivier) - fix acpi processor reporting for Windows 2000 with the ACPI HAL (Sheng Yang) when i try to compile it on centos i've got this error (which is not happend in kvm-45) : -- iasl -tc -p acpi-dsdt.hex acpi-dsdt.dsl make[1]: iasl: Command not found -- where this iasl comes from? and where can i found it? i can't found in any package even in external repos. How did you get this? Normal 'make' doesn't try to compile the bios. yes, but my spec based on fedora spec which use Jeremy Katz's patch to bios boot menu, that's way i need it. -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] kernel device reset support
Dong, Eddie wrote: Avi Kivity wrote: Dong, Eddie wrote: Avi Kivity wrote: But, for an ungraceful reset, nothing prevents an AP from issuing a reset? Mmm, Yes, but I think current architecture can't handle this. The thread where AP issues RESET will continue run, which means it becomes BSP now and wake up other APs later on. Or We can block that AP first and then inform BSP to do RESET job. Here we need to block the AP in kernel so that we can wake up. It should call vcpu_halt() immediately after reset. ?? Can user level be able to enter kernel HALT state. It's just like the guest kernel executing hlt. Why is there a difference? It can be a future task which is not that high priority IMO. I will focus on SMP boot 1st. Your opnion? Agree. But let's make it close to the complete solution. Yes, halt all APs and let BSP do reset ops in user level. Will post patch to Qemu to support SMP reboot some time later. Wait, that's a big change. Need to think about this... The test for vcpu-requests already exists (and is needed for tlb flushes) so there is no additional performance hit. OK, that makes sense. changed. please verify. User level is split into libkvm and qemu. /* * Address types: diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 0b2894a..33f16bd 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -2189,9 +2189,17 @@ again: vcpu-guest_mode = 1; - if (vcpu-requests) + if (vcpu-requests) { if (test_and_clear_bit(KVM_TLB_FLUSH, vcpu-requests)) kvm_x86_ops-tlb_flush(vcpu); + if (test_and_clear_bit(KVM_FROZEN, vcpu-requests)) { + local_irq_enable(); + preempt_enable(); + r = -EINTR; + kvm_run-exit_reason = KVM_EXIT_FROZEN; + goto out; + } + } Why not just call vcpu_reset() here, then call vcpu_halt() if we're an AP? +/* + * Kernel side VM Reset. + * NOTE here: User level code must guarantee only the BSP + * thread can do this call. + * + */ +int kvm_vm_reset(struct kvm *kvm) +{ + struct kvm_vcpu *vcpu; + int i; + + for (i = 0; i KVM_MAX_VCPUS; i++) { + vcpu = kvm-vcpus[i]; + if (!vcpu) + continue; + /* active VCPU */ + if (vcpu-vcpu_id) { + vcpu-mp_state = VCPU_MP_STATE_UNINITIALIZED; + set_bit(KVM_FROZEN, vcpu-requests); + kvm_vcpu_kick(vcpu); + /* + * Wait till the AP entered waiting for + * INIT/SIPI state + */ + while (test_bit(KVM_FROZEN, vcpu-requests)) + schedule(); I don't think we need to wait here. + } + else { + vcpu-mp_state = VCPU_MP_STATE_RUNNABLE; + kvm_lapic_reset(vcpu); + } + } + /* Now only BSP is running... */ + kvm_reset_devices(kvm); But now you're reseting the devices while vcpu 0 may be running. If in the first stage you halt all vcpus, and then restart vcpu 0 after the reset, you avoid the race. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] SMP reboot issue
Dong, Eddie wrote: SMP reboot failed with various phenomena such as user level unhandled vm exit: 0x8021 ... when rebooting SMP RHEL5U or execption 8 (0)... when rebooting XP etc. The reason is that we are not correctly reset VCPU. create_vcpu does some initialization work which should be part of reset job. So reset_vcpu can't do full VCPU reset and thus cause AP reboot failure. The best approach is to re-org above 2 functions to make it clear that everything will be re-initialized in vcpu_reset. create_vcpu probably only allocate memory and do initialization only for those communicating with user level data structure. while leave others including MMU reset to vcpu_reset. For now, let us use this small patch to fix current issue: GUEST_CR3 in VMCS is not correctly reseted due to enter_rmode issue. With this I get XPSP2 acpi SMP guest reboot successfully and also SMP Linux RHEL5U. thanks, eddie Applied, thanks, -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] kvm: disabled by bios
Hi, is there any option to reenable virtualisation support (AMD-CPU) if it is disabled by bios (and Bios does not show an option to enable virtualisation support)? Elmar - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] OpenBSD 4.1 failes with kvm-45
Oliver Kowalke wrote: Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 can you try runing it with -no-kvm? - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. If I pass either -no-kvm or -no-kvm-irqchip, the problem disappear. I have just got the problem with -no-kvm-irqchip, though it seems to happen less often. The data corruption seems to come from the userspace part, as I am not able to reproduce it with the kvm-45 module, and the kvm-44 userspace. Does it occur with -no-kvm? -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] OpenBSD 4.1 failes with kvm-45
Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 It was started with: /opt/kvm/bin/kvm \ -hda /srv/openbsd_4.1_32.qcow \ -full-screen \ -boot c \ -localtime \ -m 1024 \ -no-acpi \ -soundhw es1370 \ -usb -usbdevice tablet \ -net nic,vlan=0 \ -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup Any hint to solve this problem?! kind regards, Oliver - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] kvm-45 problems
Avi Kivity wrote: Zhao, Yunfeng wrote: This fix cannot resolve this issue. Against latest kvm commits, SMP linux with 4 vcpus still cannot boot up. But the issue will not happen , if adding -smp4 -no-acpi. Can you try the attached patch? diff --git a/kernel/kvm_main.c b/kernel/kvm_main.c index 0b2894a..61d931e 100644 --- a/kernel/kvm_main.c +++ b/kernel/kvm_main.c @@ -235,11 +235,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) * to complete. */ for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus)) - smp_call_function_single(cpu, ack_flush, completed, 1, 0); - while (atomic_read(completed) != needed) { - cpu_relax(); - barrier(); - } + smp_call_function_single(cpu, ack_flush, completed, 1, 1); } int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) This part will be obsolete as soon as linux will export smp_call_function_mask(). This is already in mm tree: ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc8/2.6.23-rc8-mm2/broken-out/x86_64-mm-export-i386-smp_call_function_mask-to-modules.patch ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc8/2.6.23-rc8-mm2/broken-out/x86_64-mm-implement-missing-x86_64-function-smp_call_function_mask.patch Apply these patches and try the attached patch for KVM. Laurent -- [EMAIL PROTECTED] - Given enough eyeballs, all bugs are shallow E. S. Raymond Index: kvm/drivers/kvm/kvm_main.c === --- kvm.orig/drivers/kvm/kvm_main.c 2007-09-12 17:49:51.0 +0200 +++ kvm/drivers/kvm/kvm_main.c 2007-09-12 17:58:18.0 +0200 @@ -198,21 +198,15 @@ static void vcpu_put(struct kvm_vcpu *vc static void ack_flush(void *_completed) { - atomic_t *completed = _completed; - - atomic_inc(completed); } void kvm_flush_remote_tlbs(struct kvm *kvm) { - int i, cpu, needed; + int i, cpu; cpumask_t cpus; struct kvm_vcpu *vcpu; - atomic_t completed; - atomic_set(completed, 0); cpus_clear(cpus); - needed = 0; for (i = 0; i KVM_MAX_VCPUS; ++i) { vcpu = kvm-vcpus[i]; if (!vcpu) @@ -221,23 +215,9 @@ void kvm_flush_remote_tlbs(struct kvm *k continue; cpu = vcpu-cpu; if (cpu != -1 cpu != raw_smp_processor_id()) - if (!cpu_isset(cpu, cpus)) { - cpu_set(cpu, cpus); - ++needed; - } - } - - /* -* We really want smp_call_function_mask() here. But that's not -* available, so ipi all cpus in parallel and wait for them -* to complete. -*/ - for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus)) - smp_call_function_single(cpu, ack_flush, completed, 1, 0); - while (atomic_read(completed) != needed) { - cpu_relax(); - barrier(); + cpu_set(cpu, cpus); } + smp_call_function_mask(cpus, ack_flush, NULL, 1); } int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) signature.asc Description: OpenPGP digital signature - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. we did a quick test against this version and it's turn out the smp guests are still not working. even if we start only one linux guest with 4cpu on 4cpu host the guest kernel hangs at random stages of the kernel loading process (if we run more smp guests then they hang earlier, but different random stage), but it's never reach the end of the kernel so hang somewhere inside the kernel. and the cpu usage of these process goes up to until the qemu-kvm processes eat all cpus (ie. 100%). the strange thing is that the host is running no error on console just these and similar are in dmesg: --- Ignoring de-assert INIT to vcpu 1 SIPI to vcpu 1 vector 0x03 SIPI to vcpu 1 vector 0x03 Ignoring de-assert INIT to vcpu 2 SIPI to vcpu 2 vector 0x03 --- but the good news that if we run more single cpu guests (both linux and windows) than it seems to working (at least in the last half an hour:-). which means that kvm-46 is as usable as kvm-36 for us (which was not the case with all previous version), but of course this's a very subjective 'fact':-) -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
Avi Kivity a écrit : Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. If I pass either -no-kvm or -no-kvm-irqchip, the problem disappear. I have just got the problem with -no-kvm-irqchip, though it seems to happen less often. The data corruption seems to come from the userspace part, as I am not able to reproduce it with the kvm-45 module, and the kvm-44 userspace. Does it occur with -no-kvm? With kvm 45 it does not occurs with -no-kvm. With kvm 46 the problem is still there, but I haven't tried with -no-kvm yet. I am currently building a small test image, otherwise I spend all my time copying a 15GB image. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Farkas Levente wrote: Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. we did a quick test against this version and it's turn out the smp guests are still not working. even if we start only one linux guest with 4cpu on 4cpu host the guest kernel hangs at random stages of the kernel loading process (if we run more smp guests then they hang earlier, but different random stage), but it's never reach the end of the kernel so hang somewhere inside the kernel. and the cpu usage of these process goes up to until the qemu-kvm processes eat all cpus (ie. 100%). t What host cpu are you using? What guest kernel version? 32-bit or 64-bit? I have no problems running a 4-way Linux guest here. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
Aurelien Jarno wrote: Avi Kivity a écrit : Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. If I pass either -no-kvm or -no-kvm-irqchip, the problem disappear. I have just got the problem with -no-kvm-irqchip, though it seems to happen less often. The data corruption seems to come from the userspace part, as I am not able to reproduce it with the kvm-45 module, and the kvm-44 userspace. Does it occur with -no-kvm? With kvm 45 it does not occurs with -no-kvm. With kvm 46 the problem is still there, but I haven't tried with -no-kvm yet. I am currently building a small test image, otherwise I spend all my time copying a 15GB image. Maybe snapshots can help here... -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] kvm-45 problems
Zhao, Yunfeng wrote: This fix cannot resolve this issue. Against latest kvm commits, SMP linux with 4 vcpus still cannot boot up. But the issue will not happen , if adding -smp4 -no-acpi. Can you try the attached patch? -- error compiling committee.c: too many arguments to function diff --git a/kernel/kvm_main.c b/kernel/kvm_main.c index 0b2894a..61d931e 100644 --- a/kernel/kvm_main.c +++ b/kernel/kvm_main.c @@ -235,11 +235,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) * to complete. */ for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus)) - smp_call_function_single(cpu, ack_flush, completed, 1, 0); - while (atomic_read(completed) != needed) { - cpu_relax(); - barrier(); - } + smp_call_function_single(cpu, ack_flush, completed, 1, 1); } int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Avi Kivity wrote: Farkas Levente wrote: Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. we did a quick test against this version and it's turn out the smp guests are still not working. even if we start only one linux guest with 4cpu on 4cpu host the guest kernel hangs at random stages of the kernel loading process (if we run more smp guests then they hang earlier, but different random stage), but it's never reach the end of the kernel so hang somewhere inside the kernel. and the cpu usage of these process goes up to until the qemu-kvm processes eat all cpus (ie. 100%). t What host cpu are you using? What guest kernel version? 32-bit or 64-bit? I have no problems running a 4-way Linux guest here. - host: - Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - Intel S3000AHV - 8GB RAM - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-1: - CentOS-5 - kernel-2.6.18-8.1.14.el5 i386 32bit - guest-2: - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-3: - Mandrake-9 - kernel-2.4.19.16mdk-1-1mdk 32bit - guest-4: - Windows XP Professional 32bit start the first guest-1 with 4cpu produce the above hang. (and of course using kvm-46:-) -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] OpenBSD 4.1 failes with kvm-45
On 10/10/07, Izik Eidus [EMAIL PROTECTED] wrote: Oliver Kowalke wrote: Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 This is strange, because I have OpenBSD running fine on KVM-45. Which CPU ? Intel or AMD? please do: modinfo kvm_intel modinfo kvm_amd -- -Alexey Eremenko Technologov - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Farkas Levente wrote: we did a quick test against this version and it's turn out the smp guests are still not working. even if we start only one linux guest with 4cpu on 4cpu host the guest kernel hangs at random stages of the kernel loading process (if we run more smp guests then they hang earlier, but different random stage), but it's never reach the end of the kernel so hang somewhere inside the kernel. and the cpu usage of these process goes up to until the qemu-kvm processes eat all cpus (ie. 100%). t What host cpu are you using? What guest kernel version? 32-bit or 64-bit? I have no problems running a 4-way Linux guest here. - host: - Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - Intel S3000AHV - 8GB RAM - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-1: - CentOS-5 - kernel-2.6.18-8.1.14.el5 i386 32bit - guest-2: - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-3: - Mandrake-9 - kernel-2.4.19.16mdk-1-1mdk 32bit - guest-4: - Windows XP Professional 32bit start the first guest-1 with 4cpu produce the above hang. (and of course using kvm-46:-) Is it the only guest that hangs with -smp 4? Or all of them? -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] RFC/patch: a very trivial patch towards portability V2
Thanks to Avis review, this is an updated version of the patch that splits kvm_dev_ioctl into architecture dependent and architecture independent parts. I've changed everything Avi noted in his review feedback. It is also rebased to fit on today's git with all that reindentation. KVM_CHECK_EXTENSION and KVM_GET_VCPU_MMAP_SIZE are now implemented in the common part. For now, kvm_main.c includes x86.h. After the split, I think we should move that file into include/asm-arch/ so that kvm_main.c automagically includes the correct header. Until we've actually got another arch merged upstream, I think it is more convenient to have the file in drivers/kvm so that we only need to convince Avi when changing it. signed-off-by: Carsten Otte [EMAIL PROTECTED] --- Index: kvm/drivers/kvm/kvm_x86.h === --- /dev/null 1970-01-01 00:00:00.0 + +++ kvm/drivers/kvm/kvm_x86.h 2007-10-10 14:16:47.0 +0200 @@ -0,0 +1,15 @@ +/* + * Kernel-based Virtual Machine driver for Linux + * + * This header defines architecture specific interfaces, x86 version + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef KVM_X86_H +#define KVM_X86_H + +#define KVM_ARCH_VCPU_MMAP_SIZE (2 * PAGE_SIZE) +#endif Index: kvm/drivers/kvm/kvm.h === --- kvm.orig/drivers/kvm/kvm.h 2007-10-10 12:42:21.0 +0200 +++ kvm/drivers/kvm/kvm.h 2007-10-10 14:12:30.0 +0200 @@ -653,6 +653,11 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); +long kvm_arch_dev_ioctl(struct file *, + unsigned int, unsigned long); +__init void kvm_arch_init(void); +long kvm_arch_check_extension(int); + static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code) { Index: kvm/drivers/kvm/Makefile === --- kvm.orig/drivers/kvm/Makefile 2007-10-10 11:35:01.0 +0200 +++ kvm/drivers/kvm/Makefile2007-10-10 13:44:02.0 +0200 @@ -2,7 +2,7 @@ # Makefile for Kernel-based Virtual Machine module # -kvm-objs := kvm_main.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o +kvm-objs := kvm_main.o kvm_x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o obj-$(CONFIG_KVM) += kvm.o kvm-intel-objs = vmx.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o Index: kvm/drivers/kvm/kvm_main.c === --- kvm.orig/drivers/kvm/kvm_main.c 2007-10-10 11:34:07.0 +0200 +++ kvm/drivers/kvm/kvm_main.c 2007-10-10 14:17:08.0 +0200 @@ -16,6 +16,7 @@ */ #include kvm.h +#include kvm_x86.h #include x86_emulate.h #include segment_descriptor.h #include irq.h @@ -45,7 +46,6 @@ #include asm/processor.h #include asm/msr.h #include asm/io.h -#include asm/uaccess.h #include asm/desc.h MODULE_AUTHOR(Qumranet); @@ -2518,43 +2518,6 @@ EXPORT_SYMBOL_GPL(kvm_get_cs_db_l_bits); /* - * List of msr numbers which we expose to userspace through KVM_GET_MSRS - * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. - * - * This list is modified at module load time to reflect the - * capabilities of the host cpu. - */ -static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, - MSR_K6_STAR, -#ifdef CONFIG_X86_64 - MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, -#endif - MSR_IA32_TIME_STAMP_COUNTER, -}; - -static unsigned num_msrs_to_save; - -static u32 emulated_msrs[] = { - MSR_IA32_MISC_ENABLE, -}; - -static __init void kvm_init_msr_list(void) -{ - u32 dummy[2]; - unsigned i, j; - - for (i = j = 0; i ARRAY_SIZE(msrs_to_save); i++) { - if (rdmsr_safe(msrs_to_save[i], dummy[0], dummy[1]) 0) - continue; - if (j i) - msrs_to_save[j] = msrs_to_save[i]; - j++; - } - num_msrs_to_save = j; -} - -/* * Adapt set_msr() to msr_io()'s calling convention */ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data) @@ -3366,57 +3329,20 @@ goto out; r = kvm_dev_ioctl_create_vm(); break; - case KVM_GET_MSR_INDEX_LIST: { - struct kvm_msr_list __user *user_msr_list = argp; - struct kvm_msr_list msr_list; - unsigned n; - - r = -EFAULT; - if (copy_from_user(msr_list, user_msr_list, sizeof msr_list)) - goto out; - n = msr_list.nmsrs; - msr_list.nmsrs = num_msrs_to_save + ARRAY_SIZE(emulated_msrs); - if (copy_to_user(user_msr_list, msr_list, sizeof msr_list)) - goto out; - r = -E2BIG; -
[kvm-devel] RFC/patch: a very trivial patch towards portability V2.1
Christian Borntraeger pointed out that Avi requested to rename kvm_x86.c to x86.c. The patch below is the same as V2, but the files kvm_x86.[ch] have been renamed to x86.[ch], and the #includes have been updated. signed-off-by: Carsten Otte [EMAIL PROTECTED] --- Index: kvm/drivers/kvm/kvm.h === --- kvm.orig/drivers/kvm/kvm.h 2007-10-10 12:42:21.0 +0200 +++ kvm/drivers/kvm/kvm.h 2007-10-10 14:12:30.0 +0200 @@ -653,6 +653,11 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); +long kvm_arch_dev_ioctl(struct file *, + unsigned int, unsigned long); +__init void kvm_arch_init(void); +long kvm_arch_check_extension(int); + static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code) { Index: kvm/drivers/kvm/Makefile === --- kvm.orig/drivers/kvm/Makefile 2007-10-10 11:35:01.0 +0200 +++ kvm/drivers/kvm/Makefile2007-10-10 14:36:36.0 +0200 @@ -2,7 +2,7 @@ # Makefile for Kernel-based Virtual Machine module # -kvm-objs := kvm_main.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o +kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o obj-$(CONFIG_KVM) += kvm.o kvm-intel-objs = vmx.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o Index: kvm/drivers/kvm/kvm_main.c === --- kvm.orig/drivers/kvm/kvm_main.c 2007-10-10 11:34:07.0 +0200 +++ kvm/drivers/kvm/kvm_main.c 2007-10-10 14:36:28.0 +0200 @@ -16,6 +16,7 @@ */ #include kvm.h +#include x86.h #include x86_emulate.h #include segment_descriptor.h #include irq.h @@ -45,7 +46,6 @@ #include asm/processor.h #include asm/msr.h #include asm/io.h -#include asm/uaccess.h #include asm/desc.h MODULE_AUTHOR(Qumranet); @@ -2518,43 +2518,6 @@ EXPORT_SYMBOL_GPL(kvm_get_cs_db_l_bits); /* - * List of msr numbers which we expose to userspace through KVM_GET_MSRS - * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. - * - * This list is modified at module load time to reflect the - * capabilities of the host cpu. - */ -static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, - MSR_K6_STAR, -#ifdef CONFIG_X86_64 - MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, -#endif - MSR_IA32_TIME_STAMP_COUNTER, -}; - -static unsigned num_msrs_to_save; - -static u32 emulated_msrs[] = { - MSR_IA32_MISC_ENABLE, -}; - -static __init void kvm_init_msr_list(void) -{ - u32 dummy[2]; - unsigned i, j; - - for (i = j = 0; i ARRAY_SIZE(msrs_to_save); i++) { - if (rdmsr_safe(msrs_to_save[i], dummy[0], dummy[1]) 0) - continue; - if (j i) - msrs_to_save[j] = msrs_to_save[i]; - j++; - } - num_msrs_to_save = j; -} - -/* * Adapt set_msr() to msr_io()'s calling convention */ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data) @@ -3366,57 +3329,20 @@ goto out; r = kvm_dev_ioctl_create_vm(); break; - case KVM_GET_MSR_INDEX_LIST: { - struct kvm_msr_list __user *user_msr_list = argp; - struct kvm_msr_list msr_list; - unsigned n; - - r = -EFAULT; - if (copy_from_user(msr_list, user_msr_list, sizeof msr_list)) - goto out; - n = msr_list.nmsrs; - msr_list.nmsrs = num_msrs_to_save + ARRAY_SIZE(emulated_msrs); - if (copy_to_user(user_msr_list, msr_list, sizeof msr_list)) - goto out; - r = -E2BIG; - if (n num_msrs_to_save) - goto out; - r = -EFAULT; - if (copy_to_user(user_msr_list-indices, msrs_to_save, -num_msrs_to_save * sizeof(u32))) - goto out; - if (copy_to_user(user_msr_list-indices -+ num_msrs_to_save * sizeof(u32), -emulated_msrs, -ARRAY_SIZE(emulated_msrs) * sizeof(u32))) - goto out; - r = 0; - break; - } case KVM_CHECK_EXTENSION: { int ext = (long)argp; - switch (ext) { - case KVM_CAP_IRQCHIP: - case KVM_CAP_HLT: - case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: - case KVM_CAP_USER_MEMORY: - r = 1; - break; - default: - r = 0; - break; - } + r = kvm_arch_check_extension(ext);
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Avi Kivity wrote: Farkas Levente wrote: we did a quick test against this version and it's turn out the smp guests are still not working. even if we start only one linux guest with 4cpu on 4cpu host the guest kernel hangs at random stages of the kernel loading process (if we run more smp guests then they hang earlier, but different random stage), but it's never reach the end of the kernel so hang somewhere inside the kernel. and the cpu usage of these process goes up to until the qemu-kvm processes eat all cpus (ie. 100%). t What host cpu are you using? What guest kernel version? 32-bit or 64-bit? I have no problems running a 4-way Linux guest here. - host: - Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz - Intel S3000AHV - 8GB RAM - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-1: - CentOS-5 - kernel-2.6.18-8.1.14.el5 i386 32bit - guest-2: - CentOS-5 - kernel-2.6.18-8.1.14.el5 x86_64 64bit - guest-3: - Mandrake-9 - kernel-2.4.19.16mdk-1-1mdk 32bit - guest-4: - Windows XP Professional 32bit start the first guest-1 with 4cpu produce the above hang. (and of course using kvm-46:-) Is it the only guest that hangs with -smp 4? Or all of them? if i start this guest alone it's hang. if i start all guest-{1,2,3,4} than all linux guest hangs expect windows which runs but see only one cpu. ok now i try it for you:-) so: - host + guest-1 - hang - host + guest-2 - hang in this case i've got a stack trace too on the host, and the host working 2 more minutes (!?) so i see the top part of the stack (shift-pageup) but when i try to take a picture the host crash and i can only see the end:-( but next time i bale to catch it: --- BUG: soft lockup detected on CPU#0! Call Trace: IRQ [800b2c30] softlockup_tick+0xdb/0xed [800933ec] update_process_times+0x42/0x68 [80073d61] smp_local_timer_interrupt+0x23/0x47 [80074423] smp_apic_timer_interrupt+0x41/0x47 [8005bcc2] apic_timer_interrupt+0x66/0x6c EOI [88208aa6] :kvm:kvm_flush_remote_tlbs+0xfb/0x109 [88208a95] :kvm:kvm_flush_remote_tlbs+0xea/0x109 [8820e0a7] :kvm:kvm_mmu_pte_write+0x1fc/0x330 [88207657] :kvm:kvm_write_guest_page+0x98/0xa3 [882093fd] :kvm:emulator_write_emulated_onepage+0x6e/0xce [88211a91] :kvm:x86_emulate_insn+0x2b99/0x3e58 [8005fc15] __memset+0x39/0xc0 [88229404] :kvm_intel:vmcs_readl+0x17/0x1c [88209251] :kvm:emulate_instruction+0x152/0x290 [8822bb85] :kvm_intel:handle_exception+0x170/0x250 [88209945] :kvm:kvm_vcpu_ioctl+0x34b/0x10ba [88213082] :kvm:kvm_vcpu_kick+0x34/0x8e [8820ae33] :kvm:kvm_vm_ioctl+0x48a/0x6af [800bea1e] zone_statistics+0x3e/0x6d [8000a778] get_page_from_freelist+0x35d/0x3cf [800bea1e] zone_statistics+0x3e/0x6d [8000a778] get_page_from_freelist+0x35d/0x3cf [8000ee4e] __alloc_pages+0x65/0x2b2 [8013b1b2] __next_cpu+0x19/0x28 [800857cf] find_busiest_group+0x20d/0x621 [8013b1b2] __next_cpu+0x19/0x28 [80072a51] smp_send_reschedule+0x4e/0x53 [80086458] enqueue_task+0x41/0x56 [80086494] __activate_task+0x27/0x39 [80044d32] try_to_wake_up+0x407/0x418 [800850b5] __wake_up_common+0x3e/0x68 [8002dd9c] __wake_up+0x38/0x4f [80021b8a] __up_read+0x19/0x7f [8011735a] avc_has_perm+0x43/0x55 [80117e91] inode_has_perm+0x56/0x63 [80086c37] default_wake_function+0x0/0xe [80117f32] file_has_perm+0x94/0xa3 [8003fc5b] do_ioctl+0x21/0x6b [8002fa61] vfs_ioctl+0x248/0x261 [8004a267] sys_ioctl+0x59/0x78 [8005b2c1] tracesys+0xd1/0xdc --- i hope shouldn't have to test all other guests:-( but if i can help you in something more specific let me know:-) -- Levente Si vis pacem para bellum! - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] OpenBSD 4.1 failes with kvm-45
On Wed, Oct 10, 2007 at 12:56:18PM +0200, Izik Eidus wrote: Oliver Kowalke wrote: Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 can you try runing it with -no-kvm? It might also be useful to try the following patch, that lets you choose the cpu that is exposed to your guest. (try the option -cpu pentium2 ) == diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index 4d0bb93..bf4d35a 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -683,7 +683,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, int boot_device, DisplayState *ds, const char **fd_filename, int snapshot, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, - int pci_enabled) + int pci_enabled, const char *cpu_model) { char buf[1024]; int ret, linux_boot, i; @@ -705,6 +705,13 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, int boot_device, linux_boot = (kernel_filename != NULL); /* init CPUs */ +if (cpu_model == NULL) +cpu_model = basic; + +if (x86_find_cpu_by_name(cpu_model)) { +fprintf(stderr, Unable to find x86 CPU definition\n); +exit(1); +} for(i = 0; i smp_cpus; i++) { env = cpu_init(); if (i != 0) @@ -1008,7 +1015,7 @@ static void pc_init_pci(ram_addr_t ram_size, int vga_ram_size, int boot_device, pc_init1(ram_size, vga_ram_size, boot_device, ds, fd_filename, snapshot, kernel_filename, kernel_cmdline, - initrd_filename, 1); + initrd_filename, 1, cpu_model); } static void pc_init_isa(ram_addr_t ram_size, int vga_ram_size, int boot_device, @@ -1022,7 +1029,7 @@ static void pc_init_isa(ram_addr_t ram_size, int vga_ram_size, int boot_device, pc_init1(ram_size, vga_ram_size, boot_device, ds, fd_filename, snapshot, kernel_filename, kernel_cmdline, - initrd_filename, 0); + initrd_filename, 0, cpu_model); } QEMUMachine pc_machine = { diff --git a/qemu/target-i386/cpu.h b/qemu/target-i386/cpu.h index de2669e..7517699 100644 --- a/qemu/target-i386/cpu.h +++ b/qemu/target-i386/cpu.h @@ -280,21 +280,56 @@ #define CPUID_CMOV (1 15) #define CPUID_PAT (1 16) #define CPUID_PSE36 (1 17) +#define CPUID_PN (1 18) #define CPUID_CLFLUSH (1 19) -/* ... */ +#define CPUID_DTS (1 21) +#define CPUID_ACPI (1 22) #define CPUID_MMX (1 23) #define CPUID_FXSR (1 24) #define CPUID_SSE (1 25) #define CPUID_SSE2 (1 26) +#define CPUID_SS (1 27) +#define CPUID_HT (1 28) +#define CPUID_TM (1 29) +#define CPUID_IA64 (1 30) +#define CPUID_PBE (1 31) #define CPUID_EXT_SSE3 (1 0) #define CPUID_EXT_MONITOR (1 3) +#define CPUID_EXT_DSCPL(1 4) +#define CPUID_EXT_VMX (1 5) +#define CPUID_EXT_SMX (1 6) +#define CPUID_EXT_EST (1 7) +#define CPUID_EXT_TM2 (1 8) +#define CPUID_EXT_SSSE3(1 9) +#define CPUID_EXT_CID (1 10) #define CPUID_EXT_CX16 (1 13) +#define CPUID_EXT_XTPR (1 14) +#define CPUID_EXT_DCA (1 17) +#define CPUID_EXT_POPCNT (1 22) #define CPUID_EXT2_SYSCALL (1 11) +#define CPUID_EXT2_MP (1 19) #define CPUID_EXT2_NX (1 20) +#define CPUID_EXT2_MMXEXT (1 22) #define CPUID_EXT2_FFXSR (1 25) +#define CPUID_EXT2_PDPE1GB (1 26) +#define CPUID_EXT2_RDTSCP (1 27) #define CPUID_EXT2_LM (1 29) +#define CPUID_EXT2_3DNOWEXT (1 30) +#define CPUID_EXT2_3DNOW (1 31) + +#define CPUID_EXT3_LAHF_LM (1 0) +#define CPUID_EXT3_CMP_LEG (1 1) +#define CPUID_EXT3_SVM (1 2) +#define CPUID_EXT3_EXTAPIC (1 3) +#define CPUID_EXT3_CR8LEG (1 4) +#define CPUID_EXT3_ABM (1 5) +#define CPUID_EXT3_SSE4A (1 6) +#define CPUID_EXT3_MISALIGNSSE (1 7) +#define CPUID_EXT3_3DNOWPREFETCH (1 8) +#define CPUID_EXT3_OSVW(1 9) +#define CPUID_EXT3_IBS (1 10) #define CPUID_EXT3_SVM (1 2) @@ -581,6 +616,9 @@ typedef struct CPUX86State { CPUX86State *cpu_x86_init(void); int cpu_x86_exec(CPUX86State *s); void cpu_x86_close(CPUX86State *s); +int x86_find_cpu_by_name (const unsigned char *name); +void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, + ...)); int cpu_get_pic_interrupt(CPUX86State *s); /* MSDOS compatibility mode FPU exception support */ void cpu_set_ferr(CPUX86State *s); diff --git a/qemu/target-i386/helper2.c b/qemu/target-i386/helper2.c index b0e9692..ca8d5ed 100644 --- a/qemu/target-i386/helper2.c
Re: [kvm-devel] FreeBSD image hangs during boot
Avi Kivity a écrit : Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. If I pass either -no-kvm or -no-kvm-irqchip, the problem disappear. I have just got the problem with -no-kvm-irqchip, though it seems to happen less often. The data corruption seems to come from the userspace part, as I am not able to reproduce it with the kvm-45 module, and the kvm-44 userspace. Does it occur with -no-kvm? After a few more tests, I have been able to reproduce it with the current CVS version of QEMU. I conclude this is a QEMU or a BIOS problem, and not a KVM one. Sorry for the noise. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] RFC/patch: a very trivial patch towards portability V2.1
Carsten Otte wrote: Christian Borntraeger pointed out that Avi requested to rename kvm_x86.c to x86.c. The patch below is the same as V2, but the files kvm_x86.[ch] have been renamed to x86.[ch], and the #includes have been updated. signed-off-by: Carsten Otte [EMAIL PROTECTED] --- Index: kvm/drivers/kvm/kvm.h === --- kvm.orig/drivers/kvm/kvm.h2007-10-10 12:42:21.0 +0200 +++ kvm/drivers/kvm/kvm.h 2007-10-10 14:12:30.0 +0200 @@ -653,6 +653,11 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); +long kvm_arch_dev_ioctl(struct file *, + unsigned int, unsigned long); +__init void kvm_arch_init(void); +long kvm_arch_check_extension(int); Argument names in prototypes please. case KVM_CHECK_EXTENSION: { int ext = (long)argp; - switch (ext) { - case KVM_CAP_IRQCHIP: - case KVM_CAP_HLT: - case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: - case KVM_CAP_USER_MEMORY: - r = 1; - break; - default: - r = 0; - break; - } + r = kvm_arch_check_extension(ext); break; Reflecting some more, do we want different API availablility for different archs? We can make this generic, and ignore arch-specific extensions. But on the other hand, things like KVM_CAP_IRQCHIP _are_ applicable to powerpc, but may not be implemented from day 1... should we do case KVM_CAP_IRQCHIP: return KVM_ARCH_HAS_IRQCHIP; ? -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
On Wed, Oct 10, 2007 at 10:28:24AM +0200, Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Is the memory allocation swappable by default, or still pinned in RAM by default ? Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Daniel P. Berrange wrote: On Wed, Oct 10, 2007 at 10:28:24AM +0200, Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Is the memory allocation swappable by default, or still pinned in RAM by default ? It's still not swappable. That will come in a future release. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Avi Kivity wrote: Anthony Liguori wrote: Avi Kivity wrote: Anthony Liguori wrote: This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. It introduces a io dispatch mechanism. This mechanism supports subpage granularity but is optimized to efficiently cover regions of pages too. It's a 64-bit address space that's structured as a 5-level table. Why not use a simple array? For MMIO too? Yes. QEMU uses an array for PIO but a table for MMIO. I figured it would be best to just use the same table. Or the same array? Indexed by the address or just sorted and searchable? MMIO addresses are rather sparse so the former seems like the only sane thing. It also has to support subpage granularity. Regards, Anthony Liguori - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
Avi Kivity a écrit : Aurelien Jarno wrote: Avi Kivity a écrit : Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. [snip] After a few more tests, I have been able to reproduce it with the current CVS version of QEMU. I conclude this is a QEMU or a BIOS problem, and not a KVM one. Sorry for the noise. Well, it still needs to be fixed. I think there's a git import of qemu available somewhere, that can be used for bisecting. Well the IDE code hasn't changed a lot recently, so I checked the CVS history and easily (first test) found the commit that causes the problem: Last AIO patch, by Vladimir N. Oleynik. http://cvs.savannah.nongnu.org/viewvc/qemu/hw/ide.c?root=qemur1=1.64r2=1.65 -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Anthony Liguori wrote: QEMU uses an array for PIO but a table for MMIO. I figured it would be best to just use the same table. Or the same array? Indexed by the address or just sorted and searchable? MMIO addresses are rather sparse so the former seems like the only sane thing. I'm betting that a plain unsorted array will beat anything else with less than 50 entries. Also that the difference will be swamped by vmexit costs and by the actual emulation costs. It also has to support subpage granularity. My patent pending unsorted array supports that out of the box. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Should we be seeing a mmap file when running guests now or do we have to use a special flag when running kvm? On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Daniel P. Berrange wrote: On Wed, Oct 10, 2007 at 10:28:24AM +0200, Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Is the memory allocation swappable by default, or still pinned in RAM by default ? It's still not swappable. That will come in a future release. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Avi Kivity wrote: Anthony Liguori wrote: This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. It introduces a io dispatch mechanism. This mechanism supports subpage granularity but is optimized to efficiently cover regions of pages too. It's a 64-bit address space that's structured as a 5-level table. Why not use a simple array? For MMIO too? QEMU uses an array for PIO but a table for MMIO. I figured it would be best to just use the same table. Regards, Anthony Liguori - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
Aurelien Jarno wrote: Avi Kivity a écrit : Aurelien Jarno wrote: I also confirm that using -no-acpi fixes the problem. However, I have seen strange data corruption, even on Intel. Basically, booting a recently installed FreeBSD leads to the following message from the bootloader: No kernel found. And the next time, I get from the *BIOS*: Boot from Hard Disk failed: not a bootable disk. Looking at the disk image, the partition table (and maybe more?) has disappeared. This is with a raw image disk. If I pass either -no-kvm or -no-kvm-irqchip, the problem disappear. I have just got the problem with -no-kvm-irqchip, though it seems to happen less often. The data corruption seems to come from the userspace part, as I am not able to reproduce it with the kvm-45 module, and the kvm-44 userspace. Does it occur with -no-kvm? After a few more tests, I have been able to reproduce it with the current CVS version of QEMU. I conclude this is a QEMU or a BIOS problem, and not a KVM one. Sorry for the noise. Well, it still needs to be fixed. I think there's a git import of qemu available somewhere, that can be used for bisecting. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Anthony Liguori wrote: Avi Kivity wrote: Anthony Liguori wrote: This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. It introduces a io dispatch mechanism. This mechanism supports subpage granularity but is optimized to efficiently cover regions of pages too. It's a 64-bit address space that's structured as a 5-level table. Why not use a simple array? For MMIO too? Yes. QEMU uses an array for PIO but a table for MMIO. I figured it would be best to just use the same table. Or the same array? -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] OpenSolaris 09/2007 (Sun Solaris Express)
Hi list, you I always report OS that do not start with kvm :)) Sun Solaris Express(9/07), does not detect the hard disk..I attach an screenshot. Kernel:2.6.23 kvm: 45 and 46 CPU: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz attachment: Pantallazo-QEMU-KVM-Solaris.png- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Use a table to dispatch IO requests in kvmctl
Avi Kivity wrote: Anthony Liguori wrote: QEMU uses an array for PIO but a table for MMIO. I figured it would be best to just use the same table. Or the same array? Indexed by the address or just sorted and searchable? MMIO addresses are rather sparse so the former seems like the only sane thing. I'm betting that a plain unsorted array will beat anything else with less than 50 entries. Also that the difference will be swamped by vmexit costs and by the actual emulation costs. It also has to support subpage granularity. My patent pending unsorted array supports that out of the box. heh :-) Okay, I'll make the change. Regards, Anthony LIguori - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] RFC/patch: a very trivial patch towards portability V2.1
Avi Kivity wrote: Argument names in prototypes please. Will do that. case KVM_CHECK_EXTENSION: { int ext = (long)argp; -switch (ext) { -case KVM_CAP_IRQCHIP: -case KVM_CAP_HLT: -case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: -case KVM_CAP_USER_MEMORY: -r = 1; -break; -default: -r = 0; -break; -} +r = kvm_arch_check_extension(ext); break; Reflecting some more, do we want different API availablility for different archs? We can make this generic, and ignore arch-specific extensions. But on the other hand, things like KVM_CAP_IRQCHIP _are_ applicable to powerpc, but may not be implemented from day 1... should we do case KVM_CAP_IRQCHIP: return KVM_ARCH_HAS_IRQCHIP; ? Will do that too. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Haydn Solomon wrote: Should we be seeing a mmap file when running guests now or do we have to use a special flag when running kvm? Nope, the default is user space allocation were a regular malloc is used for allocating the guest ram from userspace. The mmap is for future shared memory implementations for parts of the guest memory space. On 10/10/07, *Avi Kivity* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Daniel P. Berrange wrote: On Wed, Oct 10, 2007 at 10:28:24AM +0200, Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Is the memory allocation swappable by default, or still pinned in RAM by default ? It's still not swappable. That will come in a future release. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net mailto:kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] RFC/patch: a very trivial patch towards portability V3
Thanks to Avi's continued review, we've got even more common code this time: KVM_CHECK_EXTENSION ioctl is now completely handled in kvm_main.c instead of having arch callbacks to check extensions. The architectures are expected to setup a bit mask named KVM_ARCH_EXTENSIONS with information about capabilities they support. Possible valus for the bit masks are defined in drivers/kvm/kvm.h (KVM_ARCH_HAS_*), which rely on KVM_CAP_* definitions in include/linux/kvm.h. Function prototypes in drivers/kvm/kvm.h have been fixed: they have argument names now. signed-off-by: Carsten Otte [EMAIL PROTECTED] --- Index: kvm/drivers/kvm/kvm.h === --- kvm.orig/drivers/kvm/kvm.h 2007-10-10 12:42:21.0 +0200 +++ kvm/drivers/kvm/kvm.h 2007-10-10 17:00:12.0 +0200 @@ -64,6 +64,12 @@ #define KVM_PIO_PAGE_OFFSET 1 +#define KVM_ARCH_HAS_IRQCHIP (1ull KVM_CAP_IRQCHIP) +#define KVM_ARCH_HAS_HLT (1ull KVM_CAP_HLT) +#define KVM_ARCH_HAS_MMU_SHADOW_CACHE_CONTROL \ +(1ull KVM_CAP_MMU_SHADOW_CACHE_CONTROL) +#define KVM_ARCH_HAS_USER_MEMORY (1ull KVM_CAP_USER_MEMORY) + /* * vcpu-requests bit members */ @@ -653,6 +659,10 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); +long kvm_arch_dev_ioctl(struct file *filp, + unsigned int ioctl, unsigned long arg); +__init void kvm_arch_init(void); + static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code) { Index: kvm/drivers/kvm/Makefile === --- kvm.orig/drivers/kvm/Makefile 2007-10-10 11:35:01.0 +0200 +++ kvm/drivers/kvm/Makefile2007-10-10 14:36:36.0 +0200 @@ -2,7 +2,7 @@ # Makefile for Kernel-based Virtual Machine module # -kvm-objs := kvm_main.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o +kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o obj-$(CONFIG_KVM) += kvm.o kvm-intel-objs = vmx.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o Index: kvm/drivers/kvm/kvm_main.c === --- kvm.orig/drivers/kvm/kvm_main.c 2007-10-10 11:34:07.0 +0200 +++ kvm/drivers/kvm/kvm_main.c 2007-10-10 16:57:05.0 +0200 @@ -16,6 +16,7 @@ */ #include kvm.h +#include x86.h #include x86_emulate.h #include segment_descriptor.h #include irq.h @@ -45,7 +46,6 @@ #include asm/processor.h #include asm/msr.h #include asm/io.h -#include asm/uaccess.h #include asm/desc.h MODULE_AUTHOR(Qumranet); @@ -2518,43 +2518,6 @@ EXPORT_SYMBOL_GPL(kvm_get_cs_db_l_bits); /* - * List of msr numbers which we expose to userspace through KVM_GET_MSRS - * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. - * - * This list is modified at module load time to reflect the - * capabilities of the host cpu. - */ -static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, - MSR_K6_STAR, -#ifdef CONFIG_X86_64 - MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, -#endif - MSR_IA32_TIME_STAMP_COUNTER, -}; - -static unsigned num_msrs_to_save; - -static u32 emulated_msrs[] = { - MSR_IA32_MISC_ENABLE, -}; - -static __init void kvm_init_msr_list(void) -{ - u32 dummy[2]; - unsigned i, j; - - for (i = j = 0; i ARRAY_SIZE(msrs_to_save); i++) { - if (rdmsr_safe(msrs_to_save[i], dummy[0], dummy[1]) 0) - continue; - if (j i) - msrs_to_save[j] = msrs_to_save[i]; - j++; - } - num_msrs_to_save = j; -} - -/* * Adapt set_msr() to msr_io()'s calling convention */ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data) @@ -3366,57 +3329,25 @@ goto out; r = kvm_dev_ioctl_create_vm(); break; - case KVM_GET_MSR_INDEX_LIST: { - struct kvm_msr_list __user *user_msr_list = argp; - struct kvm_msr_list msr_list; - unsigned n; - - r = -EFAULT; - if (copy_from_user(msr_list, user_msr_list, sizeof msr_list)) - goto out; - n = msr_list.nmsrs; - msr_list.nmsrs = num_msrs_to_save + ARRAY_SIZE(emulated_msrs); - if (copy_to_user(user_msr_list, msr_list, sizeof msr_list)) - goto out; - r = -E2BIG; - if (n num_msrs_to_save) - goto out; - r = -EFAULT; - if (copy_to_user(user_msr_list-indices, msrs_to_save, -num_msrs_to_save * sizeof(u32))) - goto out; - if (copy_to_user(user_msr_list-indices -+ num_msrs_to_save *
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Thanks for clearing that up. On 10/10/07, Dor Laor [EMAIL PROTECTED] wrote: Haydn Solomon wrote: Should we be seeing a mmap file when running guests now or do we have to use a special flag when running kvm? Nope, the default is user space allocation were a regular malloc is used for allocating the guest ram from userspace. The mmap is for future shared memory implementations for parts of the guest memory space. On 10/10/07, *Avi Kivity* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Daniel P. Berrange wrote: On Wed, Oct 10, 2007 at 10:28:24AM +0200, Avi Kivity wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. Is the memory allocation swappable by default, or still pinned in RAM by default ? It's still not swappable. That will come in a future release. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net mailto:kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] OpenBSD 4.1 failes with kvm-45
Am Mittwoch, 10. Oktober 2007 14:17:56 schrieb Alexey Eremenko: On 10/10/07, Izik Eidus [EMAIL PROTECTED] wrote: Oliver Kowalke wrote: Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 This is strange, because I have OpenBSD running fine on KVM-45. Which CPU ? Intel or AMD? please do: modinfo kvm_intel modinfo kvm_amd Hi, I'm using Intel c2d 6600 and I've compiled the kvm spport into the kernel (so no modules). regards, Oliver - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] OpenBSD 4.1 failes with kvm-45
Oliver Kowalke wrote: Am Mittwoch, 10. Oktober 2007 14:17:56 schrieb Alexey Eremenko: On 10/10/07, Izik Eidus [EMAIL PROTECTED] wrote: Oliver Kowalke wrote: Hi, I've Debian/Lenny (amd64) with kernel 2.6.22-9 (kvm-support build in) with kvm-45 running. WinXP, FreeBSD-6.2 (i386) and NetBSD-3.1 (i386) are working. I've only a problem running OpenBSD-4.1 (i386). The installation succeeded, but if I start OpenBSD I get following error: cpu0: QEMU Virtual CPU version 0.9.0 cpu0: unknown i686 model 2, can't get bus clockkernel: protection fault trap, code=0 This is strange, because I have OpenBSD running fine on KVM-45. Which CPU ? Intel or AMD? please do: modinfo kvm_intel modinfo kvm_amd Hi, I'm using Intel c2d 6600 and I've compiled the kvm spport into the kernel (so no modules). That means you're using a fairly old version of the kvm kernel components. Perhaps a bug that openbsd hit was fixed later on. I suggest you try with the kvm-45 modules to be sure. -- error compiling committee.c: too many arguments to function - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] Working on an entry-level project
Hi, I'm interested in working on one of the entry-level projects on the TODO list to get my feet wet with the code. My preference is allowing CPU features to be passed to the guest. So I two things: I want to check if anyone is working on these already and if not can someone please expand a little on what is wanted? Any feedback or pointers on what features would be most useful is also welcome. Thanks, Cam - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] Working on an entry-level project
Cam Macdonell wrote: Hi, I'm interested in working on one of the entry-level projects on the TODO list to get my feet wet with the code. My preference is allowing CPU features to be passed to the guest. So I two things: I want to check if anyone is working on these already and if not can someone please expand a little on what is wanted? Any feedback or pointers on what features would be most useful is also welcome. Thanks, Cam sorry, but patch for that feature was already wrote by someone. but you are more than welcome to try/ask about something else. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] Working on an entry-level project
Izik Eidus wrote: Cam Macdonell wrote: Hi, sorry, but patch for that feature was already wrote by someone. but you are more than welcome to try/ask about something else. Ah, I should've searched the list. Is there another project of similar scope that would be of use? Thanks, Cam - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [ kvm-Bugs-1811073 ] XP guest unstable, clamav crashes it
Bugs item #1811073, was opened at 2007-10-10 18:19 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=1811073group_id=180599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Marco Menardi (mmenaz) Assigned to: Nobody/Anonymous (nobody) Summary: XP guest unstable, clamav crashes it Initial Comment: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ kvm 45 and 46 host: uname -r: 2.6.22-2-amd64 Debian GNU/Linux unstable for AMD 64 Guest: WinXP pro 32bit /opt/kvm/bin/qemu-system-x86_64 -boot c -hda winXP_01_TEST.img -m 1024 -localtime -std-vga With KVM-36 everything works fine With KVM-45 and 46, I have the following problems: a) clamav with memory test: kvm-45 reboots XP abruptly during the test; kvm-46 once seemd not to start (like in a forever loop), second time (after exit, re-run XP) run well, 3 time run well but rebooted the OS when I closed the program b) using Paltalk and opening some videos (is streaming video got from their server) works fine with kvm-36, while with kvm 45 and 46 crashes paltalk after 10 minutes or so. Often after the crash XP reboots multiple times, and I briefly see a message by XP boot process (before entering in graphical mode) with something like IRQ_NOT_LESS_OR_EQUAL, but I could be wrong with the spell. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=1811073group_id=180599 - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] soft lockup after stop/cont
Avi Kivity wrote: Jim Paris wrote: If I stop KVM in the monitor with stop, wait a minute, and do cont, a Linux guest gives me a BUG: soft lockup detected on CPU#0. Is that expected behavior? No. What isn't virtualized that allows it to detect that? The host is a core 2 duo. It may be that the timer correction code detects that zillions of timer interrupts have not been serviced by the guest so it floods the guest with these interrupts. Does -no-kvm-irqchip help? I can't seem to reproduce the soft lockup at the moment, but there's a clocksource tsc unstable that happens pretty reliably when I pause the VM using stop/cont for about 15 seconds: $ kvm -M pc -m 256 -smp 1 -boot c -hda test -net none stop/cont, guest reports: Clocksource tsc unstable (delta = 15877929568 ns) Time: acpi_pm clocksource has been installed. $ kvm -no-kvm-irqchip -M pc -m 256 -smp 1 -boot c -hda test -net none stop/cont, guest seems not to notice. (Host is 2.6.20.4, kvm-45 modules userspace, guest 2.6.21) -jim - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH 3/3] Use a table to dispatch IO requests in kvmctl (v2)
This patch attempts to clean up kvmctl so that it can be more easily made to work for multiple architectures and to support more emulation. For dispatch, it's using a simple array as suggested by Avi. For x86, we'll have two tables, a pio_table and an mmio_table. For PPC we can just have a single table. The IO functions can support accesses of up to 8 bytes and can handle input/output in the same function. I tried to keep this nice and simple so as to not add too much complexity to kvmctl. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/user/main.c b/user/main.c index a08e0a7..b718cc8 100644 --- a/user/main.c +++ b/user/main.c @@ -51,6 +51,24 @@ kvm_context_t kvm; #define IPI_SIGNAL (SIGRTMIN + 4) +#define MAX_IO_TABLE 50 + +typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *); + +struct io_table_entry +{ + uint64_t start; + uint64_t end; + io_table_handler_t *handler; + void *opaque; +}; + +struct io_table +{ + int nr_entries; + struct io_table_entry entries[MAX_IO_TABLE]; +}; + static int ncpus = 1; static sem_t init_sem; static __thread int vcpu; @@ -59,6 +77,8 @@ static sigset_t kernel_sigmask; static sigset_t ipi_sigmask; static uint64_t memory_size = 128 * 1024 * 1024; +static struct io_table pio_table; + struct vcpu_info { pid_t tid; sem_t sipi_sem; @@ -68,9 +88,36 @@ struct vcpu_info *vcpus; static uint32_t apic_sipi_addr; -static int apic_range(unsigned addr) +struct io_table_entry *io_table_lookup(struct io_table *io_table, uint64_t addr) { - return (addr = APIC_BASE) (addr APIC_BASE + APIC_SIZE); + int i; + + for (i = 0; i io_table-nr_entries; i++) { + if (io_table-entries[i].start = addr + addr io_table-entries[i].end) + return io_table-entries[i]; + } + + return NULL; +} + +int io_table_register(struct io_table *io_table, uint64_t start, uint64_t size, + io_table_handler_t *handler, void *opaque) +{ + struct io_table_entry *entry; + + if (io_table-nr_entries == MAX_IO_TABLE) + return -ENOSPC; + + entry = io_table-entries[io_table-nr_entries]; + io_table-nr_entries++; + + entry-start = start; + entry-end = start + size; + entry-handler = handler; + entry-opaque = opaque; + + return 0; } static void apic_send_sipi(int vcpu) @@ -88,11 +135,9 @@ static void apic_send_ipi(int vcpu) tkill(v-tid, IPI_SIGNAL); } -static int apic_io(unsigned addr, int is_write, uint32_t *value) +static int apic_io(void *opaque, int size, int is_write, + uint64_t addr, uint64_t *value) { - if (!apic_range(addr)) - return 0; - if (!is_write) *value = -1u; @@ -126,69 +171,153 @@ static int apic_io(unsigned addr, int is_write, uint32_t *value) apic_send_ipi(*value); break; } - return 1; + + return 0; +} + +static int apic_init(void) +{ + return io_table_register(pio_table, APIC_BASE, +APIC_SIZE, apic_io, NULL); +} + +static int misc_io(void *opaque, int size, int is_write, + uint64_t addr, uint64_t *value) +{ + static int newline = 1; + + if (!is_write) + *value = -1; + + switch (addr) { + case 0xff: // irq injector + if (is_write) { + printf(injecting interrupt 0x%x\n, (uint8_t)*value); + kvm_inject_irq(kvm, 0, *value); + } + break; + case 0xf1: // serial + if (is_write) { + if (newline) + fputs(GUEST: , stdout); + putchar(*value); + newline = *value == '\n'; + } + break; + case 0xd1: + if (!is_write) + *value = memory_size; + break; + } + + return 0; +} + +static int misc_init(void) +{ + int err; + + err = io_table_register(pio_table, 0xff, 1, misc_io, NULL); + if (err 0) + return err; + + err = io_table_register(pio_table, 0xf1, 1, misc_io, NULL); + if (err 0) + return err; + + return io_table_register(pio_table, 0xd1, 1, misc_io, NULL); } static int test_inb(void *opaque, uint16_t addr, uint8_t *value) { - printf(inb 0x%x\n, addr); + struct io_table_entry *entry; + + entry = io_table_lookup(pio_table, addr); + if (entry) { + uint64_t val; + entry-handler(entry-opaque, 1, 0, addr, val); + *value = val; + } else { + *value = -1; + printf(inb 0x%x\n, addr); + } + return 0; } static int test_inw(void *opaque, uint16_t addr,
[kvm-devel] [PATCH 1/3] Remove memory size from linker script (v2)
The memory size is currently hardcoded into the linker script (end_of_memory). This prevents the memory size from being specified dynamically in kvmctl. This patch adds a PIO port that can be used to query the memory size in the tests. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/user/flat.lds b/user/flat.lds index 7dd922c..61f1057 100644 --- a/user/flat.lds +++ b/user/flat.lds @@ -13,6 +13,5 @@ SECTIONS .bss : { *(.bss) } . = ALIGN(4K); edata = .; -end_of_memory = 128M; } diff --git a/user/main.c b/user/main.c index 3eb8dea..9a57a24 100644 --- a/user/main.c +++ b/user/main.c @@ -144,7 +144,15 @@ static int test_inl(void *opaque, uint16_t addr, uint32_t *value) { if (apic_io(addr, 0, value)) return 0; - printf(inl 0x%x\n, addr); + + switch (addr) { + case 0xd1: + *value = 128 * 1024 * 1024; + break; + default: + printf(inl 0x%x\n, addr); + break; + } return 0; } diff --git a/user/test/vm.c b/user/test/vm.c index 2eb8d96..e0e78d7 100644 --- a/user/test/vm.c +++ b/user/test/vm.c @@ -58,7 +58,8 @@ void free_page(void *page) free = page; } -extern char edata, end_of_memory; +extern char edata; +static unsigned long end_of_memory; #define PTE_PRESENT (1ull 0) #define PTE_PSE (1ull 7) @@ -202,10 +203,18 @@ static void setup_mmu(unsigned long len) print(paging enabled\n); } +static unsigned int inl(unsigned short port) +{ +unsigned int val; +asm volatile(inl %w1, %0 : =a(val) : Nd(port)); +return val; +} + void setup_vm() { -free_memory(edata, end_of_memory - edata); -setup_mmu((long)end_of_memory); +end_of_memory = inl(0xd1); +free_memory(edata, end_of_memory - (unsigned long)edata); +setup_mmu(end_of_memory); } void *vmalloc(unsigned long size) - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH 2/3] Allow memory to be specified in kvmctl (v2)
This patch adds a --memory option to kvmctl to allow the memory size of the guest to be specified. Since v1, I added more checks for bad input as suggested by Muli. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/user/main.c b/user/main.c index 9a57a24..a08e0a7 100644 --- a/user/main.c +++ b/user/main.c @@ -57,6 +57,7 @@ static __thread int vcpu; static int apic_ipi_vector = 0xff; static sigset_t kernel_sigmask; static sigset_t ipi_sigmask; +static uint64_t memory_size = 128 * 1024 * 1024; struct vcpu_info { pid_t tid; @@ -147,7 +148,7 @@ static int test_inl(void *opaque, uint16_t addr, uint32_t *value) switch (addr) { case 0xd1: - *value = 128 * 1024 * 1024; + *value = memory_size; break; default: printf(inl 0x%x\n, addr); @@ -328,14 +329,16 @@ static void start_vcpu(int n) static void usage(const char *progname) { fprintf(stderr, - Usage: %s [OPTIONS] [bootstrap] flatfile\n - KVM test harness.\n - \n - -s, --smp=NUM create a VM with NUM virtual CPUs\n - -p, --protected-mode start VM in protected mode\n - -h, --help display this help screen and exit\n - \n - Report bugs to kvm-devel@lists.sourceforge.net.\n +Usage: %s [OPTIONS] [bootstrap] flatfile\n +KVM test harness.\n +\n + -s, --smp=NUM create a VM with NUM virtual CPUs\n + -p, --protected-mode start VM in protected mode\n + -m, --memory=NUM[GMKB] allocate NUM memory for virtual machine. A suffix\n + can be used to change the unit (default: `M')\n + -h, --help display this help screen and exit\n +\n +Report bugs to kvm-devel@lists.sourceforge.net.\n , progname); } @@ -348,16 +351,18 @@ int main(int argc, char **argv) { void *vm_mem; int i; - const char *sopts = s:ph; + const char *sopts = s:phm:; struct option lopts[] = { { smp, 1, 0, 's' }, { protected-mode, 0, 0, 'p' }, + { memory, 1, 0, 'm' }, { help, 0, 0, 'h' }, { 0 }, }; int opt_ind, ch; bool enter_protected_mode = false; int nb_args; + char *endptr; while ((ch = getopt_long(argc, argv, sopts, lopts, opt_ind)) != -1) { switch (ch) { @@ -367,6 +372,31 @@ int main(int argc, char **argv) case 'p': enter_protected_mode = true; break; + case 'm': + memory_size = strtoull(optarg, endptr, 0); + switch (*endptr) { + case 'G': case 'g': + memory_size = 30; + break; + case '\0': + case 'M': case 'm': + memory_size = 20; + break; + case 'K': case 'k': + memory_size = 10; + break; + default: + fprintf(stderr, + Unrecongized memory suffix: %c\n, + *endptr); + exit(1); + } + if (memory_size == 0) { + fprintf(stderr, + Invalid memory size: 0\n); + exit(1); + } + break; case 'h': usage(argv[0]); exit(0); @@ -401,7 +431,7 @@ int main(int argc, char **argv) fprintf(stderr, kvm_init failed\n); return 1; } - if (kvm_create(kvm, 128 * 1024 * 1024, vm_mem) 0) { + if (kvm_create(kvm, memory_size, vm_mem) 0) { kvm_finalize(kvm); fprintf(stderr, kvm_create failed\n); return 1; - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] FreeBSD image hangs during boot
On Tue, Oct 02, 2007 at 02:38:19PM +0200, Avi Kivity wrote: Aurelien Jarno wrote: Avi Kivity a écrit : Aurelien Jarno wrote: Hi all, That's not something new, but I never seen the problem mentioned here. FreeBSD does not work on KVM, approximately since the lapic merge. However, that does not seem related to lapic, as using -no-kvm-irqchip does not help. With -no-kvm I get a page fault in kernel mode, while the normal QEMU (0.9.0 or CVS) does not have this problem. This can be easily reproduced with the latest installation CD: ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/6.2/6.2-RELEASE-i386-bootonly.iso It complains about the RSDT checksum. Running with -no-acpi works around the problem (it gets to some country selection screen). So it looks like the ACPI tables are messed up. The RSDT checksum problem is not new, but it was harmless on previous versions (like kvm-37). Using -no-acpi, I am able to boot the machine with -no-kvm, but the guest still hang with -no-acpi and with -no-kvm-irqchip or lapic enabled. At least on AMD64, I haven't tested yet on an Intel machine. Hangs on AMD here as well; works on intel (with -no-acpi). I have finally found time to bisect the problem. The commit that has broken FreeBSD on AMD is already a bit old: commit aa38840d3d2e0a804e628077df8d8879b496d741 Author: Rusty Russell [EMAIL PROTECTED] Date: Sun Sep 9 14:12:54 2007 +0300 KVM: Clean up unloved invlpg emulation invlpg shouldn't fetch the src address, since it may not be valid, however SVM's solution which neuters emulation of all group 7 instruction is horrible and breaks kvm-lite. The simplest fix is to put a special check in for invlpg. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH] Clean up MMU functions to take struct kvm when appropriate
Some of the MMU functions take a struct kvm_vcpu even though they effect all VCPUs. This patch cleans up some of them to instead take a struct kvm. This makes things a bit more clear. The main thing that was confusing me was whether certain functions need to be called on all VCPUs. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index ece0aa4..c260642 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -606,7 +606,7 @@ static void mmu_page_remove_parent_pte(struct kvm_mmu_page *page, BUG(); } -static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm_vcpu *vcpu, +static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn) { unsigned index; @@ -616,7 +616,7 @@ static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm_vcpu *vcpu, pgprintk(%s: looking for gfn %lx\n, __FUNCTION__, gfn); index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; - bucket = vcpu-kvm-mmu_page_hash[index]; + bucket = kvm-mmu_page_hash[index]; hlist_for_each_entry(page, node, bucket, hash_link) if (page-gfn == gfn !page-role.metaphysical) { pgprintk(%s: found role %x\n, @@ -782,7 +782,7 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages) kvm-n_alloc_mmu_pages = kvm_nr_mmu_pages; } -static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) +static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) { unsigned index; struct hlist_head *bucket; @@ -793,25 +793,25 @@ static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) pgprintk(%s: looking for gfn %lx\n, __FUNCTION__, gfn); r = 0; index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; - bucket = vcpu-kvm-mmu_page_hash[index]; + bucket = kvm-mmu_page_hash[index]; hlist_for_each_entry_safe(page, node, n, bucket, hash_link) if (page-gfn == gfn !page-role.metaphysical) { pgprintk(%s: gfn %lx role %x\n, __FUNCTION__, gfn, page-role.word); - kvm_mmu_zap_page(vcpu-kvm, page); + kvm_mmu_zap_page(kvm, page); r = 1; } return r; } -static void mmu_unshadow(struct kvm_vcpu *vcpu, gfn_t gfn) +static void mmu_unshadow(struct kvm *kvm, gfn_t gfn) { struct kvm_mmu_page *page; - while ((page = kvm_mmu_lookup_page(vcpu, gfn)) != NULL) { + while ((page = kvm_mmu_lookup_page(kvm, gfn)) != NULL) { pgprintk(%s: zap %lx %x\n, __FUNCTION__, gfn, page-role.word); - kvm_mmu_zap_page(vcpu-kvm, page); + kvm_mmu_zap_page(kvm, page); } } diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 447d2c3..4f6edf8 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -268,11 +268,11 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, spte |= PT_WRITABLE_MASK; if (user_fault) { - mmu_unshadow(vcpu, gfn); + mmu_unshadow(vcpu-kvm, gfn); goto unshadowed; } - shadow = kvm_mmu_lookup_page(vcpu, gfn); + shadow = kvm_mmu_lookup_page(vcpu-kvm, gfn); if (shadow) { pgprintk(%s: found shadow page for %lx, marking ro\n, __FUNCTION__, gfn); - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH] Clean up MMU functions to take struct kvm when appropriate (v2)
Sorry, I didn't guilt refresh before sending. I'll have to modify my patchbomb script to check for that to avoid this in the future. Some of the MMU functions take a struct kvm_vcpu even though they effect all VCPUs. This patch cleans up some of them to instead take a struct kvm. This makes things a bit more clear. The main thing that was confusing me was whether certain functions need to be called on all VCPUs. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index ece0aa4..a5ca945 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -606,7 +606,7 @@ static void mmu_page_remove_parent_pte(struct kvm_mmu_page *page, BUG(); } -static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm_vcpu *vcpu, +static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn) { unsigned index; @@ -616,7 +616,7 @@ static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm_vcpu *vcpu, pgprintk(%s: looking for gfn %lx\n, __FUNCTION__, gfn); index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; - bucket = vcpu-kvm-mmu_page_hash[index]; + bucket = kvm-mmu_page_hash[index]; hlist_for_each_entry(page, node, bucket, hash_link) if (page-gfn == gfn !page-role.metaphysical) { pgprintk(%s: found role %x\n, @@ -782,7 +782,7 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages) kvm-n_alloc_mmu_pages = kvm_nr_mmu_pages; } -static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) +static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) { unsigned index; struct hlist_head *bucket; @@ -793,25 +793,25 @@ static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) pgprintk(%s: looking for gfn %lx\n, __FUNCTION__, gfn); r = 0; index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; - bucket = vcpu-kvm-mmu_page_hash[index]; + bucket = kvm-mmu_page_hash[index]; hlist_for_each_entry_safe(page, node, n, bucket, hash_link) if (page-gfn == gfn !page-role.metaphysical) { pgprintk(%s: gfn %lx role %x\n, __FUNCTION__, gfn, page-role.word); - kvm_mmu_zap_page(vcpu-kvm, page); + kvm_mmu_zap_page(kvm, page); r = 1; } return r; } -static void mmu_unshadow(struct kvm_vcpu *vcpu, gfn_t gfn) +static void mmu_unshadow(struct kvm *kvm, gfn_t gfn) { struct kvm_mmu_page *page; - while ((page = kvm_mmu_lookup_page(vcpu, gfn)) != NULL) { + while ((page = kvm_mmu_lookup_page(kvm, gfn)) != NULL) { pgprintk(%s: zap %lx %x\n, __FUNCTION__, gfn, page-role.word); - kvm_mmu_zap_page(vcpu-kvm, page); + kvm_mmu_zap_page(kvm, page); } } @@ -1299,7 +1299,7 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva) { gpa_t gpa = vcpu-mmu.gva_to_gpa(vcpu, gva); - return kvm_mmu_unprotect_page(vcpu, gpa PAGE_SHIFT); + return kvm_mmu_unprotect_page(vcpu-kvm, gpa PAGE_SHIFT); } void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 447d2c3..4f6edf8 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -268,11 +268,11 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, spte |= PT_WRITABLE_MASK; if (user_fault) { - mmu_unshadow(vcpu, gfn); + mmu_unshadow(vcpu-kvm, gfn); goto unshadowed; } - shadow = kvm_mmu_lookup_page(vcpu, gfn); + shadow = kvm_mmu_lookup_page(vcpu-kvm, gfn); if (shadow) { pgprintk(%s: found shadow page for %lx, marking ro\n, __FUNCTION__, gfn); - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] [PATCH] More struct page cleanups
This time, the biggest change is gpa_to_hpa. The translation of GPA to HPA does not depend on the VCPU state unlike GVA to GPA so there's no need to pass in the kvm_vcpu. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 4ab487c..8859a92 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -554,7 +554,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); void kvm_mmu_zap_all(struct kvm *kvm); void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages); -hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa); +hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa); #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) #define HPA_ERR_MASK ((hpa_t)1 HPA_MSB) static inline int is_error_hpa(hpa_t hpa) { return hpa HPA_MSB; } diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index a5ca945..d046ba8 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -451,14 +451,14 @@ static void rmap_remove(struct kvm *kvm, u64 *spte) } } -static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) +static void rmap_write_protect(struct kvm *kvm, u64 gfn) { struct kvm_rmap_desc *desc; unsigned long *rmapp; u64 *spte; - gfn = unalias_gfn(vcpu-kvm, gfn); - rmapp = gfn_to_rmap(vcpu-kvm, gfn); + gfn = unalias_gfn(kvm, gfn); + rmapp = gfn_to_rmap(kvm, gfn); while (*rmapp) { if (!(*rmapp 1)) @@ -471,9 +471,9 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) BUG_ON(!(*spte PT_PRESENT_MASK)); BUG_ON(!(*spte PT_WRITABLE_MASK)); rmap_printk(rmap_write_protect: spte %p %llx\n, spte, *spte); - rmap_remove(vcpu-kvm, spte); + rmap_remove(kvm, spte); set_shadow_pte(spte, *spte ~PT_WRITABLE_MASK); - kvm_flush_remote_tlbs(vcpu-kvm); + kvm_flush_remote_tlbs(kvm); } } @@ -670,7 +670,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, hlist_add_head(page-hash_link, bucket); vcpu-mmu.prefetch_page(vcpu, page); if (!metaphysical) - rmap_write_protect(vcpu, gfn); + rmap_write_protect(vcpu-kvm, gfn); return page; } @@ -823,19 +823,19 @@ static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) __set_bit(slot, page_head-slot_bitmap); } -hpa_t safe_gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) +hpa_t safe_gpa_to_hpa(struct kvm *kvm, gpa_t gpa) { - hpa_t hpa = gpa_to_hpa(vcpu, gpa); + hpa_t hpa = gpa_to_hpa(kvm, gpa); return is_error_hpa(hpa) ? bad_page_address | (gpa ~PAGE_MASK): hpa; } -hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) +hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa) { struct page *page; ASSERT((gpa HPA_ERR_MASK) == 0); - page = gfn_to_page(vcpu-kvm, gpa PAGE_SHIFT); + page = gfn_to_page(kvm, gpa PAGE_SHIFT); if (!page) return gpa | HPA_ERR_MASK; return ((hpa_t)page_to_pfn(page) PAGE_SHIFT) @@ -848,7 +848,7 @@ hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva) if (gpa == UNMAPPED_GVA) return UNMAPPED_GVA; - return gpa_to_hpa(vcpu, gpa); + return gpa_to_hpa(vcpu-kvm, gpa); } struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva) @@ -857,7 +857,7 @@ struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva) if (gpa == UNMAPPED_GVA) return NULL; - return pfn_to_page(gpa_to_hpa(vcpu, gpa) PAGE_SHIFT); + return pfn_to_page(gpa_to_hpa(vcpu-kvm, gpa) PAGE_SHIFT); } static void nonpaging_new_cr3(struct kvm_vcpu *vcpu) @@ -1012,7 +1012,7 @@ static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gva_t gva, ASSERT(VALID_PAGE(vcpu-mmu.root_hpa)); - paddr = gpa_to_hpa(vcpu , addr PT64_BASE_ADDR_MASK); + paddr = gpa_to_hpa(vcpu-kvm, addr PT64_BASE_ADDR_MASK); if (is_error_hpa(paddr)) return 1; diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 4f6edf8..8e1e4ca 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -103,7 +103,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker, pgprintk(%s: table_gfn[%d] %lx\n, __FUNCTION__, walker-level - 1, table_gfn); slot = gfn_to_memslot(vcpu-kvm, table_gfn); - hpa = safe_gpa_to_hpa(vcpu, root PT64_BASE_ADDR_MASK); + hpa = safe_gpa_to_hpa(vcpu-kvm, root PT64_BASE_ADDR_MASK); walker-page = pfn_to_page(hpa PAGE_SHIFT); walker-table = kmap_atomic(walker-page, KM_USER0); @@ -159,7 +159,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker, walker-inherited_ar = walker-table[index]; table_gfn = (*ptep PT_BASE_ADDR_MASK) PAGE_SHIFT; kunmap_atomic(walker-table, KM_USER0); -
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
Jun Koi wrote: On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) It's not exposed by qemu, but you can now mmap() some file (or use SysV shared memory) and use that as guest memory. OK, lets say we have 2 guest VMs share a memory, like mmap() a tmpfs file (which is actually in memory). Now one writes to the memory (shared file). Can we guarantee that the memory immediately updated, so other will see the change immediately? Or the data might be cached for a while, befere being flushed to the shared memory? Changes are visible immediately. OK, that is about sharing memory file. How about a shared file in which a file is a real physical file on the host? As far as I remember, there is a caution about sharing a file using mmap() between 2 processes, that is: if the first process modifies the shared file, it might take a while for the changes to be flushed from cache to the file. That means the other process doesnt see the change immediately. Changes to a mmap() file may not be flushed to the disk until an msync or munmap but if you've got it opened with MAP_SHARED, then everyone mapping will have access to the same physical memory IIUC. You still need to use barriers to take into account SMP. There may be some weird interactions if the area isn't mlocked but I'm not totally sure on that. Regards, Anthony Liguori I guess this problem affects us in this case, when we use a real (physical) file to share between 2 VMs, correct? Thanks, Jun - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [ANNOUNCE] kvm-46 release
On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: Jun Koi wrote: Hi, On 10/10/07, Avi Kivity [EMAIL PROTECTED] wrote: We've now switched to allocating guest memory in userspace rather than in the kernel. This is important if you have a mainframe, but also if you want to share memory between guests and implement nice features like swapping. This is interesting! But how can we do that now? (share memory between guests) It's not exposed by qemu, but you can now mmap() some file (or use SysV shared memory) and use that as guest memory. OK, lets say we have 2 guest VMs share a memory, like mmap() a tmpfs file (which is actually in memory). Now one writes to the memory (shared file). Can we guarantee that the memory immediately updated, so other will see the change immediately? Or the data might be cached for a while, befere being flushed to the shared memory? Changes are visible immediately. OK, that is about sharing memory file. How about a shared file in which a file is a real physical file on the host? As far as I remember, there is a caution about sharing a file using mmap() between 2 processes, that is: if the first process modifies the shared file, it might take a while for the changes to be flushed from cache to the file. That means the other process doesnt see the change immediately. I guess this problem affects us in this case, when we use a real (physical) file to share between 2 VMs, correct? Thanks, Jun - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] [PATCH] Clean up MMU functions to take struct kvm when appropriate
Anthony Liguori wrote: Some of the MMU functions take a struct kvm_vcpu even though they effect all VCPUs. This patch cleans up some of them to instead take a struct kvm. This makes things a bit more clear. The main thing that was confusing me was whether certain functions need to be called on all VCPUs. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] Please ignore this version of the patch. It breaks the build b/c I forgot to guilt refresh before sending. v2 is the right version of the patch to apply which should already be on the list. Sorry for the noise. Regards, Anthony Liguori - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
Re: [kvm-devel] kernel device reset support
Avi Kivity wrote: Dong, Eddie wrote: Avi Kivity wrote: It's just like the guest kernel executing hlt. Why is there a difference? Current VP wake up logic thru INIT/SIPI doesn't support this when irqchip in kernel. Yes, halt all APs and let BSP do reset ops in user level. Will post patch to Qemu to support SMP reboot some time later. Wait, that's a big change. Need to think about this... Like talked in previous, we either let BSP do this, or let an AP become BSP. Current Qemu doesn't support this. -if (vcpu-requests) +if (vcpu-requests) { if (test_and_clear_bit(KVM_TLB_FLUSH, vcpu-requests)) kvm_x86_ops-tlb_flush(vcpu); +if (test_and_clear_bit(KVM_FROZEN, vcpu-requests)) { +local_irq_enable(); + preempt_enable(); +r = -EINTR; +kvm_run-exit_reason = KVM_EXIT_FROZEN; +goto out; +} +} Why not just call vcpu_reset() here, then call vcpu_halt() if we're an AP? Then you need to duplicate following code, which may bring extra issue such as GUEST_CR3 update (kvm_mmu_reload) which is done after this code but before vcpu-requests test. BTW, switch back to user level to retry is cleaner IMO. if (unlikely(vcpu-mp_state == VCPU_MP_STATE_UNINITIALIZED)) { if (irqchip_in_kernel(vcpu-kvm) vcpu-apic) kvm_lapic_reset(vcpu); kvm_vcpu_block(vcpu); vcpu_put(vcpu); return -EAGAIN; } +while (test_bit(KVM_FROZEN, vcpu-requests)) +schedule(); I don't think we need to wait here. The VCPU may be executing in kernel still, which may modify kernel device state. E.g. A VCPU may be doing PIO emulating. If BSP reset the kernel devices earlier than the VCPU modify the device state, we are in trouble. +} +else { +vcpu-mp_state = VCPU_MP_STATE_RUNNABLE; +kvm_lapic_reset(vcpu); +} +} +/* Now only BSP is running... */ +kvm_reset_devices(kvm); But now you're reseting the devices while vcpu 0 may be running. If in No, VCPU0 (BSP) is current VCPU (though you don't have the current vcpu parameter explicitly) like mentioned in previous mail and as pre-requirement of user level change. Please refer my abswer above of this mail. the first stage you halt all vcpus, and then restart vcpu 0 after the reset, you avoid the race. No race here. The code is executing in VCPU0 context. thx,eddie - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel
[kvm-devel] build error
I meet following error while compile latest kvm source code. .. make -C qemu make[1]: Entering directory `/workspace/ia32e/nightly/kvm-master-2.6.22-rc4-20071010190122210/kvm-us erspace/qemu' Makefile:3: config-host.mak: No such file or directory make[1]: *** No rule to make target `config-host.mak'. Stop. make[1]: Leaving directory `/workspace/ia32e/nightly/kvm-master-2.6.22-rc4-20071010190122210/kvm-us erspace/qemu' make: *** [qemu] Error 2 . If run ./qemu/configure, it turns: [EMAIL PROTECTED] qemu]# ./configure ./configure: line 415: /tmp/qemu-conf-28011-8352-8345.c: No such file or directory ERROR: gcc either does not exist or does not work How can I resolve this issue? I am using RHEL5 x86_64, gcc version 4.1.1 Thanks Yunfeng - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel