[kvm-devel] [PATCH] Remove a duplicated ia32e mode vm entry control

2007-08-01 Thread Li, Xin B
Remove a duplicated ia32e mode VM Entry control definition and use the
proper one.

Signed-off-by: Xin Li <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 49635c4..10abb57 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1107,7 +1107,7 @@ static void enter_lmode(struct kvm_vcpu *vcpu)
find_msr_entry(to_vmx(vcpu), MSR_EFER)->data |= EFER_LMA |
EFER_LME;
vmcs_write32(VM_ENTRY_CONTROLS,
 vmcs_read32(VM_ENTRY_CONTROLS)
-| VM_ENTRY_CONTROLS_IA32E_MASK);
+| VM_ENTRY_IA32E_MODE);
 }
 
 static void exit_lmode(struct kvm_vcpu *vcpu)
@@ -1116,7 +1116,7 @@ static void exit_lmode(struct kvm_vcpu *vcpu)
 
vmcs_write32(VM_ENTRY_CONTROLS,
 vmcs_read32(VM_ENTRY_CONTROLS)
-& ~VM_ENTRY_CONTROLS_IA32E_MASK);
+& ~VM_ENTRY_IA32E_MODE);
 }
 
 #endif
@@ -1181,13 +1181,13 @@ static void vmx_set_efer(struct kvm_vcpu *vcpu,
u64 efer)
if (efer & EFER_LMA) {
vmcs_write32(VM_ENTRY_CONTROLS,
 vmcs_read32(VM_ENTRY_CONTROLS) |
-VM_ENTRY_CONTROLS_IA32E_MASK);
+VM_ENTRY_IA32E_MODE);
msr->data = efer;
 
} else {
vmcs_write32(VM_ENTRY_CONTROLS,
 vmcs_read32(VM_ENTRY_CONTROLS) &
-~VM_ENTRY_CONTROLS_IA32E_MASK);
+~VM_ENTRY_IA32E_MODE);
 
msr->data = efer & ~EFER_LME;
}
diff --git a/drivers/kvm/vmx.h b/drivers/kvm/vmx.h
index 7e4dc12..35d0b58 100644
--- a/drivers/kvm/vmx.h
+++ b/drivers/kvm/vmx.h
@@ -268,9 +268,6 @@ enum vmcs_field {
 /* segment AR */
 #define SEGMENT_AR_L_MASK (1 << 13)
 
-/* entry controls */
-#define VM_ENTRY_CONTROLS_IA32E_MASK (1 << 9)
-
 #define AR_TYPE_ACCESSES_MASK 1
 #define AR_TYPE_READABLE_MASK (1 << 1)
 #define AR_TYPE_WRITEABLE_MASK (1 << 2)


rm_dup_ia32e_mode_control.patch
Description: rm_dup_ia32e_mode_control.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] Storing command line options in qcow2 images

2007-08-01 Thread Andrew Walrond
Jorge Lucángeli Obes wrote:
> 
> Ideas? Suggestions? I can send the patches for the functionality
> that's implemented right now.
> 

Great idea, and one I would certainly use. I guess then on Windoze I
could associate .qcow2 files with qemu and just double click to run my
VMs? It would be good to get rid of the .bat files and shortcuts I have
to use at the moment to pass args to qemu.

Of course, the ultimate dream would be a single exe file which Windows
users of the VM could just download and run. I guess the only impediment
to this would be the need to distribute the various license files.
Having said that, I wonder if it would be acceptable for them to be
available from a -licenses command line option?

But I'm getting ahead of the game here ;)

Go for it; but as has been said, don't let qemu/kvm diverge...

Andrew Walrond


-
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 1/2] Rename iova to va in vmx_init() for MSR Bitmap patch using

2007-08-01 Thread Yang, Sheng
In order to repetition using temporary variable iova in MSR Bitmap
patch, I rename iova in vmx_init() to va.

Signed-off-by: Sheng Yang <[EMAIL PROTECTED]>
---
 drivers/kvm/vmx.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 49635c4..3b901fe 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -2475,7 +2475,7 @@ static struct kvm_arch_ops vmx_arch_ops = {
 
 static int __init vmx_init(void)
 {
-   void *iova;
+   void *va;
int r;
 
vmx_io_bitmap_a = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
@@ -2492,13 +2492,13 @@ static int __init vmx_init(void)
 * Allow direct access to the PC debug port (it is often used
for I/O
 * delays, but the vmexits simply slow things down).
 */
-   iova = kmap(vmx_io_bitmap_a);
-   memset(iova, 0xff, PAGE_SIZE);
-   clear_bit(0x80, iova);
+   va = kmap(vmx_io_bitmap_a);
+   memset(va, 0xff, PAGE_SIZE);
+   clear_bit(0x80, va);
kunmap(vmx_io_bitmap_a);
 
-   iova = kmap(vmx_io_bitmap_b);
-   memset(iova, 0xff, PAGE_SIZE);
+   va = kmap(vmx_io_bitmap_b);
+   memset(va, 0xff, PAGE_SIZE);
kunmap(vmx_io_bitmap_b);
 
r = kvm_init_arch(&vmx_arch_ops, sizeof(struct vcpu_vmx),
THIS_MODULE);
-- 
1.5.2



Rename-iova-to-va.patch
Description: Rename-iova-to-va.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


[kvm-devel] [PATCH 2/2] Add MSR Bitmap support in VMX

2007-08-01 Thread Yang, Sheng
Add MSR Bitmap support in VMX so that some execution of RDMSR or WRMSR
won't cause a VM exit.

Signed-off-by: Sheng Yang <[EMAIL PROTECTED]>
Signed-off-by: Qing He <[EMAIL PROTECTED]>
---
 drivers/kvm/vmx.c |   44 +++-
 drivers/kvm/vmx.h |3 +++
 2 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 3b901fe..bebe0d4 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -71,6 +71,7 @@ static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
 
 static struct page *vmx_io_bitmap_a;
 static struct page *vmx_io_bitmap_b;
+static struct page *vmx_msr_bitmap;
 
 #define EFER_SAVE_RESTORE_BITS ((u64)EFER_SCE)
 
@@ -867,7 +868,7 @@ static __init int setup_vmcs_config(struct
vmcs_config *vmcs_conf)
  CPU_BASED_USE_IO_BITMAPS |
  CPU_BASED_MOV_DR_EXITING |
  CPU_BASED_USE_TSC_OFFSETING;
-   opt = 0;
+   opt = CPU_BASED_USE_MSR_BITMAPS;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
&_cpu_based_exec_control) < 0)
return -EIO;
@@ -1426,6 +1427,10 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
vmcs_write64(IO_BITMAP_A, page_to_phys(vmx_io_bitmap_a));
vmcs_write64(IO_BITMAP_B, page_to_phys(vmx_io_bitmap_b));
 
+   /* MSR bitmap */
+   if (cpu_has_vmx_msr_bitmap)
+   vmcs_write64(MSR_BITMAP, page_to_phys(vmx_msr_bitmap));
+
guest_write_tsc(0);
 
vmcs_write64(VMCS_LINK_POINTER, -1ull); /* 22.3.1.5 */
@@ -2424,6 +2429,19 @@ static void __init
vmx_check_processor_compat(void *rtn)
}
 }
 
+static void __init disable_intercept_for_msr(u32 msr, void
*msr_bitmap_va)
+{
+   /* See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). */
+   if (msr <= 0x1fff) { /* read and write bitmaps for low MSRs */
+   __clear_bit(msr, msr_bitmap_va + 0x000);
+   __clear_bit(msr, msr_bitmap_va + 0x800);
+   } else if ((msr >= 0xc000) && (msr <= 0xc0001fff)) {
+   msr &= 0x1fff; /* read and write bitmaps for high MSRs
*/
+   __clear_bit(msr, msr_bitmap_va + 0x400);
+   __clear_bit(msr, msr_bitmap_va + 0xc00);
+   }
+}
+
 static struct kvm_arch_ops vmx_arch_ops = {
.cpu_has_kvm_support = cpu_has_kvm_support,
.disabled_by_bios = vmx_disabled_by_bios,
@@ -2505,6 +2523,28 @@ static int __init vmx_init(void)
if (r)
goto out1;
 
+   if (cpu_has_vmx_msr_bitmap) {
+   vmx_msr_bitmap = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
+   if (!vmx_msr_bitmap) {
+   r = -ENOMEM;
+   goto out1;
+   }
+
+   printk(KERN_INFO "kvm: Enable MSR bitmap support.\n");
+
+   va = kmap(vmx_msr_bitmap);
+   memset(va, 0xff, PAGE_SIZE);
+
+   disable_intercept_for_msr(MSR_FS_BASE, va);
+   disable_intercept_for_msr(MSR_GS_BASE, va);
+
+   disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, va);
+   disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, va);
+   disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, va);
+
+   kunmap(vmx_msr_bitmap);
+   }
+
return 0;
 
 out1:
@@ -2516,6 +2556,8 @@ out:
 
 static void __exit vmx_exit(void)
 {
+   if (cpu_has_vmx_msr_bitmap)
+   __free_page(vmx_msr_bitmap);
__free_page(vmx_io_bitmap_b);
__free_page(vmx_io_bitmap_a);
 
diff --git a/drivers/kvm/vmx.h b/drivers/kvm/vmx.h
index 7e4dc12..b61c7f3 100644
--- a/drivers/kvm/vmx.h
+++ b/drivers/kvm/vmx.h
@@ -309,4 +309,7 @@ enum vmcs_field {
 #define MSR_IA32_FEATURE_CONTROL_LOCKED 0x1
 #define MSR_IA32_FEATURE_CONTROL_VMXON_ENABLED  0x4
 
+#define cpu_has_vmx_msr_bitmap \
+   (vmcs_config.cpu_based_exec_ctrl & CPU_BASED_USE_MSR_BITMAPS)
+
 #endif
-- 
1.5.2



Add-MSR-Bitmap-support-for-VMX.patch
Description: Add-MSR-Bitmap-support-for-VMX.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


[kvm-devel] [PATCH 2/5] group all prefix decoding results in a structure called x86_prefix

2007-08-01 Thread Laurent Vivier
To be able to extract easily prefix decoding from x86_emulate_memop(), group all
prefix decoding results in a structure called x86_prefix.

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/x86_emulate.h
===
--- kvm.orig/drivers/kvm/x86_emulate.h  2007-07-31 17:00:22.0 +0200
+++ kvm/drivers/kvm/x86_emulate.h   2007-07-31 17:03:26.0 +0200
@@ -141,6 +141,21 @@
 #define X86EMUL_MODE_PROT32   4/* 32-bit protected mode. */
 #define X86EMUL_MODE_PROT64   8/* 64-bit (long) mode.*/
 
+struct x86_prefix {
+   unsigned int op_bytes;
+   unsigned int ad_bytes;
+   int override_base;
+
+   u8 lock;/* LOCK prefix */
+   u8 rep; /* REP prefix */
+   u8 rex; /* REX prefix */
+
+   int index_reg;
+   int base_reg;
+   u8 modrm_reg;
+   u8 modrm_rm;
+};
+
 /* Host execution mode. */
 #if defined(__i386__)
 #define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32
Index: kvm/drivers/kvm/x86_emulate.c
===
--- kvm.orig/drivers/kvm/x86_emulate.c  2007-07-31 17:01:52.0 +0200
+++ kvm/drivers/kvm/x86_emulate.c   2007-07-31 17:07:30.0 +0200
@@ -430,18 +430,18 @@
 
 /* Access/update address held in a register, based on addressing mode. */
 #define register_address(base, reg) \
-   ((base) + ((ad_bytes == sizeof(unsigned long)) ? (reg) :\
-  ((reg) & ((1UL << (ad_bytes << 3)) - 1
+   ((base) + ((prefix.ad_bytes == sizeof(unsigned long)) ? (reg) : \
+  ((reg) & ((1UL << (prefix.ad_bytes << 3)) - 1
 
 #define register_address_increment(reg, inc)\
do {\
/* signed type ensures sign extension to long */\
int _inc = (inc);   \
-   if ( ad_bytes == sizeof(unsigned long) )\
+   if ( prefix.ad_bytes == sizeof(unsigned long) ) \
(reg) += _inc;  \
else\
-   (reg) = ((reg) & ~((1UL << (ad_bytes << 3)) - 1)) | \
-  (((reg) + _inc) & ((1UL << (ad_bytes << 3)) - 1)); \
+   (reg) = ((reg) & ~((1UL << (prefix.ad_bytes << 3)) - 
1)) | \
+  (((reg) + _inc) & ((1UL << (prefix.ad_bytes << 3)) - 
1)); \
} while (0)
 
 /*
@@ -483,18 +483,18 @@
 x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
 {
unsigned d;
-   u8 b, sib, twobyte = 0, rex_prefix = 0;
-   u8 modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0;
-   int override_base = -1;
-   unsigned int op_bytes, ad_bytes, lock_prefix = 0, rep_prefix = 0, i;
+   u8 b, sib, twobyte = 0;
+   u8 modrm, modrm_mod = 0;
+   unsigned int i;
int rc = 0;
struct operand src, dst;
unsigned long cr2 = ctxt->cr2;
int mode = ctxt->mode;
unsigned long modrm_ea;
-   int use_modrm_ea, index_reg = 0, base_reg = 0, scale, rip_relative = 0;
+   int use_modrm_ea, scale, rip_relative = 0;
int no_wb = 0;
u64 msr_data;
+   struct x86_prefix prefix;
 
/* Shadow copy of register state. Committed on successful emulation. */
unsigned long _regs[NR_VCPU_REGS];
@@ -502,19 +502,21 @@
unsigned long modrm_val = 0;
 
memcpy(_regs, ctxt->vcpu->regs, sizeof _regs);
+   memset(&prefix, 0, sizeof(prefix));
+   prefix.override_base = -1;
 
switch (mode) {
case X86EMUL_MODE_REAL:
case X86EMUL_MODE_PROT16:
-   op_bytes = ad_bytes = 2;
+   prefix.op_bytes = prefix.ad_bytes = 2;
break;
case X86EMUL_MODE_PROT32:
-   op_bytes = ad_bytes = 4;
+   prefix.op_bytes = prefix.ad_bytes = 4;
break;
 #ifdef CONFIG_X86_64
case X86EMUL_MODE_PROT64:
-   op_bytes = 4;
-   ad_bytes = 8;
+   prefix.op_bytes = 4;
+   prefix.ad_bytes = 8;
break;
 #endif
default:
@@ -525,37 +527,37 @@
for (i = 0; i < 8; i++) {
switch (b = insn_fetch(u8, 1, _eip)) {
case 0x66:  /* operand-size override */
-   op_bytes ^= 6;  /* switch between 2/4 bytes */
+   prefix.op_bytes ^= 6;   /* switch between 2/4 bytes */
break;
case 0x67:  /* address-size override */
if (mode == X86EMUL_MODE_PROT64)
- 

[kvm-devel] [PATCH 3/5] extract prefix decoding part from x86_emulate_memop() to x86_decode_prefix()

2007-08-01 Thread Laurent Vivier
Extract prefix decoding part from x86_emulate_memop() to x86_decode_prefix().

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/x86_emulate.c
===
--- kvm.orig/drivers/kvm/x86_emulate.c  2007-07-31 17:44:35.0 +0200
+++ kvm/drivers/kvm/x86_emulate.c   2007-07-31 18:23:39.0 +0200
@@ -480,43 +480,24 @@
 }
 
 int
-x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
+x86_decode_prefix(int mode, u8 *inst, struct x86_prefix *prefix)
 {
-   unsigned d;
-   u8 b, sib, twobyte = 0;
-   u8 modrm, modrm_mod = 0;
-   unsigned int i;
-   int rc = 0;
-   struct operand src, dst;
-   unsigned long cr2 = ctxt->cr2;
-   int mode = ctxt->mode;
-   unsigned long modrm_ea;
-   int use_modrm_ea, scale, rip_relative = 0;
-   int no_wb = 0;
-   u64 msr_data;
-   struct x86_prefix prefix;
-
-   /* Shadow copy of register state. Committed on successful emulation. */
-   unsigned long _regs[NR_VCPU_REGS];
-   unsigned long _eip = ctxt->vcpu->rip, _eflags = ctxt->eflags;
-   unsigned long modrm_val = 0;
-
-   memcpy(_regs, ctxt->vcpu->regs, sizeof _regs);
-   memset(&prefix, 0, sizeof(prefix));
-   prefix.override_base = -1;
+   unsigned int op_bytes, ad_bytes;
+   int i;
+   u8 b;
 
switch (mode) {
case X86EMUL_MODE_REAL:
case X86EMUL_MODE_PROT16:
-   prefix.op_bytes = prefix.ad_bytes = 2;
+   op_bytes = ad_bytes = 2;
break;
case X86EMUL_MODE_PROT32:
-   prefix.op_bytes = prefix.ad_bytes = 4;
+   op_bytes = ad_bytes = 4;
break;
 #ifdef CONFIG_X86_64
case X86EMUL_MODE_PROT64:
-   prefix.op_bytes = 4;
-   prefix.ad_bytes = 8;
+   op_bytes = 4;
+   ad_bytes = 8;
break;
 #endif
default:
@@ -525,39 +506,39 @@
 
/* Legacy prefixes. */
for (i = 0; i < 8; i++) {
-   switch (b = insn_fetch(u8, 1, _eip)) {
+   switch (b = inst[i]) {
case 0x66:  /* operand-size override */
-   prefix.op_bytes ^= 6;   /* switch between 2/4 bytes */
+   op_bytes ^= 6;  /* switch between 2/4 bytes */
break;
case 0x67:  /* address-size override */
if (mode == X86EMUL_MODE_PROT64)
-   prefix.ad_bytes ^= 12;  /* switch between 4/8 
bytes */
+   ad_bytes ^= 12; /* switch between 4/8 bytes */
else
-   prefix.ad_bytes ^= 6;   /* switch between 2/4 
bytes */
+   ad_bytes ^= 6;  /* switch between 2/4 bytes */
break;
case 0x2e:  /* CS override */
-   prefix.override_base = X86EMUL_BASE_CS;
+   prefix->override_base = X86EMUL_BASE_CS;
break;
case 0x3e:  /* DS override */
-   prefix.override_base = X86EMUL_BASE_DS;
+   prefix->override_base = X86EMUL_BASE_DS;
break;
case 0x26:  /* ES override */
-   prefix.override_base = X86EMUL_BASE_ES;
+   prefix->override_base = X86EMUL_BASE_ES;
break;
case 0x64:  /* FS override */
-   prefix.override_base = X86EMUL_BASE_FS;
+   prefix->override_base = X86EMUL_BASE_FS;
break;
case 0x65:  /* GS override */
-   prefix.override_base = X86EMUL_BASE_GS;
+   prefix->override_base = X86EMUL_BASE_GS;
break;
case 0x36:  /* SS override */
-   prefix.override_base = X86EMUL_BASE_SS;
+   prefix->override_base = X86EMUL_BASE_SS;
break;
case 0xf0:  /* LOCK */
-   prefix.lock = 1;
+   prefix->lock = 1;
break;
case 0xf3:  /* REP/REPE/REPZ */
-   prefix.rep = 1;
+   prefix->rep = 1;
break;
case 0xf2:  /* REPNE/REPNZ */
break;
@@ -570,15 +551,62 @@
 
/* REX prefix. */
if ((mode == X86EMUL_MODE_PROT64) && ((b & 0xf0) == 0x40)) {
-   prefix.rex = b;
+   prefix->rex = b;
if (b & 8)
-   prefix.op_bytes = 8;/* REX.W */
-   prefix.modrm_reg = 

[kvm-devel] [PATCH 4/5] vmx.c uses x86_decode_prefix() instead of get_io_count().

2007-08-01 Thread Laurent Vivier
vmx.c uses x86_decode_prefix() instead of get_io_count().

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/vmx.c
===
--- kvm.orig/drivers/kvm/vmx.c  2007-08-01 10:37:40.0 +0200
+++ kvm/drivers/kvm/vmx.c   2007-08-01 10:40:04.0 +0200
@@ -1761,57 +1761,6 @@
return 0;
 }
 
-static int get_io_count(struct kvm_vcpu *vcpu, unsigned long *count)
-{
-   u64 inst;
-   gva_t rip;
-   int countr_size;
-   int i;
-
-   if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_VM)) {
-   countr_size = 2;
-   } else {
-   u32 cs_ar = vmcs_read32(GUEST_CS_AR_BYTES);
-
-   countr_size = (cs_ar & AR_L_MASK) ? 8:
- (cs_ar & AR_DB_MASK) ? 4: 2;
-   }
-
-   rip =  vmcs_readl(GUEST_RIP);
-   if (countr_size != 8)
-   rip += vmcs_readl(GUEST_CS_BASE);
-
-   if (emulator_read_std(rip, &inst, sizeof(inst), vcpu) !=
-   X86EMUL_CONTINUE)
-   return 0;
-
-   for (i = 0; i < sizeof(inst); i++) {
-   switch (((u8*)&inst)[i]) {
-   case 0xf0:
-   case 0xf2:
-   case 0xf3:
-   case 0x2e:
-   case 0x36:
-   case 0x3e:
-   case 0x26:
-   case 0x64:
-   case 0x65:
-   case 0x66:
-   break;
-   case 0x67:
-   countr_size = (countr_size == 2) ? 4: (countr_size >> 
1);
-   default:
-   goto done;
-   }
-   }
-   return 0;
-done:
-   countr_size *= 8;
-   *count = vcpu->regs[VCPU_REGS_RCX] & (~0ULL >> (64 - countr_size));
-   //printk("cx: %lx\n", vcpu->regs[VCPU_REGS_RCX]);
-   return 1;
-}
-
 static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
u64 exit_qualification;
@@ -1831,8 +1780,32 @@
port = exit_qualification >> 16;
address = 0;
if (string) {
-   if (rep && !get_io_count(vcpu, &count))
+   int mode;
+   u64 inst;
+   gva_t rip;
+   struct x86_prefix prefix;
+   u32 cs_ar = vmcs_read32(GUEST_CS_AR_BYTES);
+   unsigned long addr_mask;
+
+   mode = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_VM) ?
+   X86EMUL_MODE_REAL : (cs_ar & AR_L_MASK)
+   ? X86EMUL_MODE_PROT64 : (cs_ar & AR_DB_MASK)
+   ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16;
+
+   rip = vmcs_readl(GUEST_RIP);
+   if (mode != X86EMUL_MODE_PROT64)
+   rip += vmcs_readl(GUEST_CS_BASE);
+   if (emulator_read_std(rip, &inst, sizeof(inst), vcpu)
+   != X86EMUL_CONTINUE)
+   return 1;
+
+   if (x86_decode_prefix(mode, (u8*)&inst, &prefix) == -1)
return 1;
+
+   addr_mask = (~0ULL >> (64 - (prefix.ad_bytes <<3)));
+   if (rep)
+   count = vcpu->regs[VCPU_REGS_RCX] & addr_mask;
+
address = vmcs_readl(GUEST_LINEAR_ADDRESS);
}
return kvm_setup_pio(vcpu, kvm_run, in, size, count, string, down,


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


[kvm-devel] [PATCH 1/5] change ctxt.*_base to an array ctxt.base[X86EMUL_BASE_*]

2007-08-01 Thread Laurent Vivier
To be able to extract easily prefix decoding from x86_emulate_memop(), change
ctxt.*_base to an array ctxt.base[X86EMUL_BASE_*]

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/kvm_main.c
===
--- kvm.orig/drivers/kvm/kvm_main.c 2007-07-31 15:09:01.0 +0200
+++ kvm/drivers/kvm/kvm_main.c  2007-07-31 15:12:47.0 +0200
@@ -1236,19 +1236,25 @@
? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16;
 
if (emulate_ctxt.mode == X86EMUL_MODE_PROT64) {
-   emulate_ctxt.cs_base = 0;
-   emulate_ctxt.ds_base = 0;
-   emulate_ctxt.es_base = 0;
-   emulate_ctxt.ss_base = 0;
+   emulate_ctxt.base[X86EMUL_BASE_CS] = 0;
+   emulate_ctxt.base[X86EMUL_BASE_DS] = 0;
+   emulate_ctxt.base[X86EMUL_BASE_ES] = 0;
+   emulate_ctxt.base[X86EMUL_BASE_SS] = 0;
} else {
-   emulate_ctxt.cs_base = get_segment_base(vcpu, VCPU_SREG_CS);
-   emulate_ctxt.ds_base = get_segment_base(vcpu, VCPU_SREG_DS);
-   emulate_ctxt.es_base = get_segment_base(vcpu, VCPU_SREG_ES);
-   emulate_ctxt.ss_base = get_segment_base(vcpu, VCPU_SREG_SS);
+   emulate_ctxt.base[X86EMUL_BASE_CS] =
+   get_segment_base(vcpu, VCPU_SREG_CS);
+   emulate_ctxt.base[X86EMUL_BASE_DS] =
+   get_segment_base(vcpu, VCPU_SREG_DS);
+   emulate_ctxt.base[X86EMUL_BASE_ES] =
+   get_segment_base(vcpu, VCPU_SREG_ES);
+   emulate_ctxt.base[X86EMUL_BASE_SS] =
+   get_segment_base(vcpu, VCPU_SREG_SS);
}
 
-   emulate_ctxt.gs_base = get_segment_base(vcpu, VCPU_SREG_GS);
-   emulate_ctxt.fs_base = get_segment_base(vcpu, VCPU_SREG_FS);
+   emulate_ctxt.base[X86EMUL_BASE_GS] =
+   get_segment_base(vcpu, VCPU_SREG_GS);
+   emulate_ctxt.base[X86EMUL_BASE_FS] =
+   get_segment_base(vcpu, VCPU_SREG_FS);
 
vcpu->mmio_is_write = 0;
r = x86_emulate_memop(&emulate_ctxt, &emulate_ops);
Index: kvm/drivers/kvm/x86_emulate.c
===
--- kvm.orig/drivers/kvm/x86_emulate.c  2007-07-31 15:09:01.0 +0200
+++ kvm/drivers/kvm/x86_emulate.c   2007-07-31 17:01:52.0 +0200
@@ -419,7 +419,8 @@
 /* Fetch next part of the instruction being emulated. */
 #define insn_fetch(_type, _size, _eip)  \
 ({ unsigned long _x;   \
-   rc = ops->read_std((unsigned long)(_eip) + ctxt->cs_base, &_x,  \
+   rc = ops->read_std((unsigned long)(_eip) +  \
+  ctxt->base[X86EMUL_BASE_CS], &_x,\
   (_size), ctxt->vcpu); \
if ( rc != 0 )  \
goto done;  \
@@ -484,7 +485,7 @@
unsigned d;
u8 b, sib, twobyte = 0, rex_prefix = 0;
u8 modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0;
-   unsigned long *override_base = NULL;
+   int override_base = -1;
unsigned int op_bytes, ad_bytes, lock_prefix = 0, rep_prefix = 0, i;
int rc = 0;
struct operand src, dst;
@@ -533,22 +534,22 @@
ad_bytes ^= 6;  /* switch between 2/4 bytes */
break;
case 0x2e:  /* CS override */
-   override_base = &ctxt->cs_base;
+   override_base = X86EMUL_BASE_CS;
break;
case 0x3e:  /* DS override */
-   override_base = &ctxt->ds_base;
+   override_base = X86EMUL_BASE_DS;
break;
case 0x26:  /* ES override */
-   override_base = &ctxt->es_base;
+   override_base = X86EMUL_BASE_ES;
break;
case 0x64:  /* FS override */
-   override_base = &ctxt->fs_base;
+   override_base = X86EMUL_BASE_FS;
break;
case 0x65:  /* GS override */
-   override_base = &ctxt->gs_base;
+   override_base = X86EMUL_BASE_GS;
break;
case 0x36:  /* SS override */
-   override_base = &ctxt->ss_base;
+   override_base = X86EMUL_BASE_SS;
break;
case 

Re: [kvm-devel] lapic2 branch

2007-08-01 Thread Zhao, Yunfeng
Hi,Dor
I cannot reproduce your issue on my test env.
I can boot 64bit fc6 guest against latest lapic2 branch.
My test machine is a Harwitch+paxville.
The host os is RHEL5, kernel is kvm lapic2 branch with kvm build-in.
How about yours?

Thanks
Yunfeng

>-Original Message-
>From: Dor Laor [mailto:[EMAIL PROTECTED]
>Sent: 2007年7月31日 3:10
>To: Zhao, Yunfeng; kvm-devel@lists.sourceforge.net; Dong, Eddie; He, Qing
>Subject: RE: [kvm-devel] lapic2 branch
>
>>What fedora distribution is in the guest?
>>Could you give more detailed config info?
>>Before I tried to boot 64bit RHEL4U3 against lapic2 branch, I didn't
>>meet the problem.
>>
>>Thanks
>>Yunfeng
>
>It's FC6, kernel version 2.6.20-1.2948.fc6.
>I also tried 2.6.22-rc4 without luck.
>The config file for the kernel is attached (default).
>
>>
>>>-Original Message-
>>>From: [EMAIL PROTECTED]
>>>[mailto:[EMAIL PROTECTED] On Behalf Of Dor Laor
>>>Sent: 2007年7月31日 16:18
>>>To: kvm-devel@lists.sourceforge.net; Dong, Eddie; He, Qing
>>>Subject: [kvm-devel] lapic2 branch
>>>
>>>Hello to the brave apic pioneers,
>>>While trying to use the lapic2 branch for fedora 64bit guest over Intel
>>>host 2.6.22 I got the following:
>>>===
>>>ide: Assuming 33MHz system bus speed for PIO modes; override with
>>>idebus=xx
>>>PIIX3: IDE controller at PCI slot :00:01.1
>>>PIIX3: chipset revision 0
>>>PIIX3: not 100% native mode: will probe irqs later
>>>ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:pio, hdb:pio
>>>ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:pio, hdd:pio
>>>hda: QEMU HARDDISK, ATA DISK drive
>>>irq 14: nobody cared (try booting with the "irqpoll" option)
>>>
>>>Call Trace:
>>>   [] __report_bad_irq+0x30/0x72
>>> [] note_interrupt+0x1ca/0x20f
>>> [] handle_edge_irq+0xf9/0x128
>>> [] call_softirq+0x1c/0x28
>>> [] do_IRQ+0xf1/0x160
>>> [] ret_from_intr+0x0/0xa
>>>   [] ide_outb+0x0/0x9
>>> [] _spin_unlock_irqrestore+0xc/0x31
>>> [] setup_irq+0x163/0x1a1
>>> [] ide_intr+0x0/0x200
>>> [] request_irq+0x91/0xb5
>>> [] init_irq+0x283/0x50d
>>> [] hwif_init+0x148/0x32b
>>> [] probe_hwif_init_with_fixup+0x23/0x94
>>> [] ide_setup_pci_device+0x80/0xbc
>>> [] ide_scan_pcidev+0x31/0x58
>>> [] ide_scan_pcibus+0x22/0xa5
>>> [] ide_init+0x55/0x63
>>> [] kernel_init+0x163/0x2cd
>>> [] _spin_unlock_irq+0x15/0x30
>>> [] child_rip+0xa/0x12
>>> [] acpi_ds_init_one_object+0x0/0x7c
>>> [] kernel_init+0x0/0x2cd
>>> [] child_rip+0x0/0x12
>>>
>>>handlers:
>>>[] (ide_intr+0x0/0x200)
>>>Disabling IRQ #14
>>>ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
>>>===
>>>
>>>Using nolapic in the guest's kernel worked but seems the apic is
>>broken.
>>>
>>>Also, in Gregory's original code there was qemu cmdline option of
>>>setting the pic/apic position.
>>>It is required for debugging/comparing these source of problems.
>>>Thanks, Dor.
>>>
>>>
>>>
>>>
>>>-
>>>In simplicity there is elegance.
>>>Dor Laor ;)
>>>
>>>
>>>---
>>--
>>>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] can't get usb_add to work with kvm 33. [u]

2007-08-01 Thread Andreas Jellinghaus [c]
Am Dienstag, 31. Juli 2007 schrieb Avi Kivity:
> Andreas Jellinghaus wrote:
> > follow up: works fine when I run qemu with -usbdevice host:1.5
> > but adding it while running with usb_add in the qemu console does
> > not work. shall I file a bug for this or something?
>
> Does it work with -no-kvm?  With plain qemu 0.9.0?  With qemu-cvs?

sorry, linux guest kernel crashes with "-no-kvm" and the installation has
no support for serial console so far. I could create a screenshot
from vnc, but it would be very partial at the best. shall I try?

will try qemu later.

Andreas

-
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 5/5] svm.c uses x86_decode_prefix() instead of io_address() and io_get_override().

2007-08-01 Thread Laurent Vivier
svm.c uses x86_decode_prefix() instead of io_address() and io_get_override().

*** WARNING: the SVM part has not been tested because I don't have any AMD
system. ***

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/svm.c
===
--- kvm.orig/drivers/kvm/svm.c  2007-08-01 10:10:24.0 +0200
+++ kvm/drivers/kvm/svm.c   2007-08-01 10:37:30.0 +0200
@@ -98,20 +98,6 @@
return svm_features & feat;
 }
 
-static unsigned get_addr_size(struct vcpu_svm *svm)
-{
-   struct vmcb_save_area *sa = &svm->vmcb->save;
-   u16 cs_attrib;
-
-   if (!(sa->cr0 & X86_CR0_PE) || (sa->rflags & X86_EFLAGS_VM))
-   return 2;
-
-   cs_attrib = sa->cs.attrib;
-
-   return (cs_attrib & SVM_SELECTOR_L_MASK) ? 8 :
-   (cs_attrib & SVM_SELECTOR_DB_MASK) ? 4 : 2;
-}
-
 static inline u8 pop_irq(struct kvm_vcpu *vcpu)
 {
int word_index = __ffs(vcpu->irq_summary);
@@ -996,112 +982,6 @@
return 0;
 }
 
-static int io_get_override(struct vcpu_svm *svm,
- struct vmcb_seg **seg,
- int *addr_override)
-{
-   u8 inst[MAX_INST_SIZE];
-   unsigned ins_length;
-   gva_t rip;
-   int i;
-
-   rip =  svm->vmcb->save.rip;
-   ins_length = svm->next_rip - rip;
-   rip += svm->vmcb->save.cs.base;
-
-   if (ins_length > MAX_INST_SIZE)
-   printk(KERN_DEBUG
-  "%s: inst length err, cs base 0x%llx rip 0x%llx "
-  "next rip 0x%llx ins_length %u\n",
-  __FUNCTION__,
-  svm->vmcb->save.cs.base,
-  svm->vmcb->save.rip,
-  svm->vmcb->control.exit_info_2,
-  ins_length);
-
-   if (emulator_read_std(rip, inst, ins_length, &svm->vcpu)
-   != X86EMUL_CONTINUE)
-   /* #PF */
-   return 0;
-
-   *addr_override = 0;
-   *seg = NULL;
-   for (i = 0; i < ins_length; i++)
-   switch (inst[i]) {
-   case 0xf0:
-   case 0xf2:
-   case 0xf3:
-   case 0x66:
-   continue;
-   case 0x67:
-   *addr_override = 1;
-   continue;
-   case 0x2e:
-   *seg = &svm->vmcb->save.cs;
-   continue;
-   case 0x36:
-   *seg = &svm->vmcb->save.ss;
-   continue;
-   case 0x3e:
-   *seg = &svm->vmcb->save.ds;
-   continue;
-   case 0x26:
-   *seg = &svm->vmcb->save.es;
-   continue;
-   case 0x64:
-   *seg = &svm->vmcb->save.fs;
-   continue;
-   case 0x65:
-   *seg = &svm->vmcb->save.gs;
-   continue;
-   default:
-   return 1;
-   }
-   printk(KERN_DEBUG "%s: unexpected\n", __FUNCTION__);
-   return 0;
-}
-
-static unsigned long io_address(struct vcpu_svm *svm, int ins, gva_t *address)
-{
-   unsigned long addr_mask;
-   unsigned long *reg;
-   struct vmcb_seg *seg;
-   int addr_override;
-   struct vmcb_save_area *save_area = &svm->vmcb->save;
-   u16 cs_attrib = save_area->cs.attrib;
-   unsigned addr_size = get_addr_size(svm);
-
-   if (!io_get_override(svm, &seg, &addr_override))
-   return 0;
-
-   if (addr_override)
-   addr_size = (addr_size == 2) ? 4: (addr_size >> 1);
-
-   if (ins) {
-   reg = &svm->vcpu.regs[VCPU_REGS_RDI];
-   seg = &svm->vmcb->save.es;
-   } else {
-   reg = &svm->vcpu.regs[VCPU_REGS_RSI];
-   seg = (seg) ? seg : &svm->vmcb->save.ds;
-   }
-
-   addr_mask = ~0ULL >> (64 - (addr_size * 8));
-
-   if ((cs_attrib & SVM_SELECTOR_L_MASK) &&
-   !(svm->vmcb->save.rflags & X86_EFLAGS_VM)) {
-   *address = (*reg & addr_mask);
-   return addr_mask;
-   }
-
-   if (!(seg->attrib & SVM_SELECTOR_P_SHIFT)) {
-   svm_inject_gp(&svm->vcpu, 0);
-   return 0;
-   }
-
-   *address = (*reg & addr_mask) + seg->base;
-   return addr_mask;
-}
-
 static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
 {
u32 io_info = svm->vmcb->control.exit_info_1; //address size bug?
@@ -1109,6 +989,7 @@
unsigned port;
unsigned long count;
gva_t address = 0;
+   struct vmcb_save_area *sa = &svm->vmcb->save;
 
++svm->vcpu.stat.io_exits;
 
@@ -1120,21 +1001,96 @@
string = (io_info & SVM_IOIO_STR_MASK)

[kvm-devel] PATCH 0/5] Consolidate the insb/outsb emulation into x86_emulate.c

2007-08-01 Thread Laurent Vivier
[PATCH 0/5] Consolidate the insb/outsb emulation into x86_emulate.c

From the TODO, this serie of patches consolidates the insb/outsb emulation into
x86_emulate.c.

The prefix decoding part is extracted from x86_emulate_memop() and a function
called x86_decode_prefix() is created.
Then, in vmx.c, handle_io() calls x86_decode_prefix() instead of get_io_count();
in svm.c, io_interception() calls x86_decode_prefix() instead of io_address()
and io_get_override().

*** WARNING: the SVM part has not been tested because I don't have any AMD
system. ***

[PATCH 1/5] x86_ctxt_segment_array: to be able to extract easily prefix decoding
from x86_emulate_memop(), change ctxt.*_base to an array 
ctxt.base[X86EMUL_BASE_*]

[PATCH 2/5] x86_prefix: to be able to extract easily prefix decoding from
x86_emulate_memop(), group all prefix decoding results in a structure, called
x86_prefix.

[PATCH 3/5] x86_decode_prefix: extract prefix decoding part from
x86_emulate_memop() to x86_decode_prefix().

[PATCH 4/5] vmx-decode_prefix: vmx.c uses x86_decode_prefix() instead of
get_io_count().

[PATCH 5/5] svm-decode_prefix: svm.c uses x86_decode_prefix() instead of
io_address() and io_get_override().

*** WARNING: the SVM part has not been tested because I don't have any AMD
system. ***

-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth



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] KVM hangs on start

2007-08-01 Thread Gerb Stralko
what kernel are you using?  is kvm built in kernel or as modules?
what version of userspace kvm are you using?  What is the ouput of cat
/proc/cpuinfo?

Thanks

On 7/31/07, Scott Lerman <[EMAIL PROTECTED]> wrote:
> I installed kvm from Ubuntu's 7.04 repository. When I try start kvm with
>
> kvm -m 256 -cdrom /path/to/kubuntu-7.04-dvd-i386.iso -boot d .kvm/server.img
>
> I get a BIOS screen that says Loading... (among other typical BIOS
> information), then just does nothing while using 100% of one of the cores on
> my CPU. The server.img disk image is newly created. I've been following
> https://help.ubuntu.com/community/KVM, and everything up to
> this point has worked fine. My CPU is an Athlon AM2. Anybody else seen this
> issue before and have any ideas on what the problem is?
>
> --
> Scott Lerman
> -
> 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] Guest crashes on boot

2007-08-01 Thread Nijskens Raf
Since I use kernel 2.6.22.1-27.fc7 on my Fedora 7, my guests keeps crashing.
I tried several versions of kvm, building it myself from source, 
installing it from rpm's, it's all the same.

On my previous kernel 2.6.21-1.3228.fc7, it worked just fine.

Sometimes I do get some output on crash:

[EMAIL PROTECTED] ~]# /usr/local/bin/qemu-system-x86_64 -hda 
/storage/qemu.img -cdrom /storage/FC-6-i386-DVD.iso -boot c -m 400 
-serial file:serial.log
Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a fatal
error, but for better emulation accuracy either use a 2.6 host Linux 
kernel or
type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.
exception 13 (0)
rax f001 rbx d713 rcx 0001 rdx 

rsi 004c rdi 0008f7f4 rsp ffb8 rbp 
ffcc
r8   r9   r10  r11 

r12  r13  r14  r15 

rip 0a45 rflags 00033002
cs f000 (000f/ 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 07c0 (7c00/ 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  (1985/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 fa580/30
idt 0/3ff
cr0 6010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 --> 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00
Aborted

It's not only when I install machines, also when I use pre-existing 
machines. Serial.log stays empty.
It doesn't matter if I use qemu-system-x86_64 or qemu-kvm.
When I don't get an error it just hangs and it is stressing my cpu.

My system:
[EMAIL PROTECTED] ~]# uname -a
Linux ViperL 2.6.22.1-33.fc7 #1 SMP Mon Jul 23 17:33:07 EDT 2007 i686 
i686 i386 GNU/Linux

[EMAIL PROTECTED] ~]# cat /proc/cpuinfo
model name  : Intel(R) Core(TM)2 CPU T7200  @ 2.00GHz

Anyone an idea?

Thx,

Raf

-
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 and RT

2007-08-01 Thread Gregory Haskins
On Wed, 2007-08-01 at 09:56 +0300, Avi Kivity wrote:
> Gregory Haskins wrote:
> > Hi Team,
> >   I don't know if anyone here also subscribes to linux-rt-users, but it
> > seems as though Ingo et. al. rejected my modifications which ran the
> > smp_call() in a thread (VFCIPI).  
> 
> It's not surprising.  650 lines including a custom memory allocator is
> excessive.

Well, as a tactical solution I definitely agree.  As you know, I was
going for a more broadly applicable feature going way beyond KVM.  Of
those 650 lines, a good chunk will fall away if I incorporated some of
the feedback (plist instead of custom prio_array, convert to workqueue).
And the last 150 lines are a custom allocator to work around the
regression of GFP_ATOMIC on PREEMPT_RT.  But I digress... some of the
feedback was that I was "wrong and misguided" or something like
that...ouch.  Back to the drawing board. ;)

> 
> > So FYI: KVM is still broken on RT and
> > needs to be addressed.
> >
> > In a nutshell, kvm_lock cannot be used as it us today.  It either needs
> > to be a raw_spinlock_t, or the locking needs to be done differently.
> > The code currently blows up when you shut down a VM running on top of
> > PREEMPT_RT.  Just thought you might want to know.
> >   
> 
> What about hoisting the lock outside the IPI as I suggested earlier?

I think your proposal should work fine as long as you are not atomic
when you take the lock wherever it's moved to.

-Greg




-
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] can't get usb_add to work with kvm 33. [u]

2007-08-01 Thread Andreas Jellinghaus [c]
Am Dienstag, 31. Juli 2007 schrieb Avi Kivity:
> Andreas Jellinghaus wrote:
> > follow up: works fine when I run qemu with -usbdevice host:1.5
> > but adding it while running with usb_add in the qemu console does
> > not work. shall I file a bug for this or something?
>
> Does it work with -no-kvm?  With plain qemu 0.9.0?  With qemu-cvs?

same problem with plain qemu 0.9.0. sorry for the noise, will take
the problem there.

Andreas

-
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 hangs on start

2007-08-01 Thread Scott Lerman
The kernel is the current Ubuntu version, /proc/version is Linux version
2.6.20-16-generic ([EMAIL PROTECTED]) (gcc version 4.1.2 (Ubuntu 
4.1.2-0ubuntu4))
#2 SMP Thu Jun 7 20:19:32 UTC 2007

The kvm version is also the one from the Ubuntu repository, which apt calls
1:16-1ubuntu2. Not certain if that means it's kvm version 16. Is there a way
to get the version directly from kvm? (I didn't see a -v flag in the man
page)

Here's the output for /proc/cpuinfo

processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 15
model   : 107
model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 4800+
stepping: 1
cpu MHz : 2511.631
cache size  : 512 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 2
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm
3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm
stc [6]
bogomips: 5026.97
clflush size: 64

processor   : 1
vendor_id   : AuthenticAMD
cpu family  : 15
model   : 107
model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 4800+
stepping: 1
cpu MHz : 2511.631
cache size  : 512 KB
physical id : 0
siblings: 2
core id : 1
cpu cores   : 2
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm
3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm
stc [6]
bogomips: 5023.24
clflush size: 64

Thanks for the help.

On 8/1/07, Gerb Stralko <[EMAIL PROTECTED]> wrote:
>
> what kernel are you using?  is kvm built in kernel or as modules?
> what version of userspace kvm are you using?  What is the ouput of cat
> /proc/cpuinfo?
>
> Thanks
>
> On 7/31/07, Scott Lerman <[EMAIL PROTECTED]> wrote:
> > I installed kvm from Ubuntu's 7.04 repository. When I try start kvm with
> >
> > kvm -m 256 -cdrom /path/to/kubuntu-7.04-dvd-i386.iso -boot d
> .kvm/server.img
> >
> > I get a BIOS screen that says Loading... (among other typical BIOS
> > information), then just does nothing while using 100% of one of the
> cores on
> > my CPU. The server.img disk image is newly created. I've been following
> > https://help.ubuntu.com/community/KVM, and everything up to
> > this point has worked fine. My CPU is an Athlon AM2. Anybody else seen
> this
> > issue before and have any ideas on what the problem is?
> >
> > --
> > Scott Lerman
> >
> -
> > 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
> >
> >
>



-- 
Scott Lerman
-
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] remove duplicate assignment in kvm_setup_pio()

2007-08-01 Thread Laurent Vivier
Line 1809 of kvm_main.c is useless, value is overwritten in line 1815:

1809 now = min(count, PAGE_SIZE / size);
1810
1811 if (!down)
1812 in_page = PAGE_SIZE - offset_in_page(address);
1813 else
1814 in_page = offset_in_page(address) + size;
1815 now = min(count, (unsigned long)in_page / size);
1816 if (!now) {

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
-- 
- [EMAIL PROTECTED]  --
  "Software is hard" - Donald Knuth
Index: kvm/drivers/kvm/kvm_main.c
===
--- kvm.orig/drivers/kvm/kvm_main.c 2007-08-01 14:32:29.0 +0200
+++ kvm/drivers/kvm/kvm_main.c  2007-08-01 14:32:49.0 +0200
@@ -1805,8 +1805,6 @@
return 1;
}
 
-   now = min(count, PAGE_SIZE / size);
-
if (!down)
in_page = PAGE_SIZE - offset_in_page(address);
else


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] preclean up for live migration

2007-08-01 Thread Dong, Eddie
Avi Kivity wrote:
> Dong, Eddie wrote:
>> Against lapic2
>> 
>> This is a pre-cleanup for in kernel irqchip live migration support.
>> A guest may not have APIC but still have apic_base_msr be
>> save/restored in current live migration framework.
>> 

Updated.

diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index 835a41e..700db5e 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -107,7 +107,6 @@ struct kvm_ioapic {
 struct kvm_lapic {
spinlock_t lock;/* TODO for revise */
u32 status;
-   u64 base_msr;
unsigned long base_address;
struct kvm_io_device dev;
struct {
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index fc7339f..42b0408 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -320,6 +320,7 @@ struct kvm_vcpu {
gpa_t hypercall_gpa;
unsigned long cr4;
u64 pdptrs[4]; /* pae */
+   u64 apic_base;
u64 shadow_efer;
union {
struct {/* user irqchip context */
@@ -329,7 +330,6 @@ struct kvm_vcpu {
unsigned long irq_summary;
DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS);
unsigned long cr8;
-   u64 apic_base;
};
struct {/* kernel irqchip context */
struct kvm_lapic *apic;
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index cb244f6..dae8540 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -631,7 +631,7 @@ EXPORT_SYMBOL_GPL(get_cr8);
 u64 kvm_get_apic_base(struct kvm_vcpu *vcpu)
 {
if (irqchip_in_kernel(vcpu->kvm))
-   return vcpu->apic->base_msr;
+   return vcpu->apic_base;
else
return vcpu->apic_base;
 }
diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c
index 7f60bf3..ca592b7 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -78,7 +78,7 @@ static inline void apic_clear_vector(int vec, void
*bitmap)
 
 static inline int apic_hw_enabled(struct kvm_lapic *apic)
 {
-   return (apic)->base_msr & MSR_IA32_APICBASE_ENABLE;
+   return (apic)->vcpu->apic_base & MSR_IA32_APICBASE_ENABLE;
 }
 
 static inline int  apic_sw_enabled(struct kvm_lapic *apic)
@@ -728,6 +728,8 @@ void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu,
unsigned long cr8)
 {
struct kvm_lapic *apic = (struct kvm_lapic *)vcpu->apic;
 
+   if (!apic)
+   return;
spin_lock_bh(&apic->lock);
apic_set_tpr(apic, ((cr8 & 0x0f) << 4));
spin_unlock_bh(&apic->lock);
@@ -738,6 +740,8 @@ u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu)
struct kvm_lapic *apic = (struct kvm_lapic *)vcpu->apic;
u64 tpr;
 
+   if (!apic)
+   return 0;
spin_lock_bh(&apic->lock);
tpr = (u64) apic_get_reg(apic, APIC_TASKPRI);
spin_unlock_bh(&apic->lock);
@@ -749,16 +753,22 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64
value)
 {
struct kvm_lapic *apic = (struct kvm_lapic *)vcpu->apic;
 
+   if (!apic) {
+   value |= MSR_IA32_APICBASE_BSP;
+   vcpu->apic_base = value;
+   return;
+   }
spin_lock_bh(&apic->lock);
if (apic->vcpu->vcpu_id)
value &= ~MSR_IA32_APICBASE_BSP;
 
-   apic->base_msr = value;
-   apic->base_address = apic->base_msr & MSR_IA32_APICBASE_BASE;
+   vcpu->apic_base = value;
+   apic->base_address = apic->vcpu->apic_base &
+MSR_IA32_APICBASE_BASE;
 
/* with FSB delivery interrupt, we can restart APIC
functionality */
apic_debug("apic base msr is 0x%016" PRIx64 ", and base address
is "
-  "0x%lx.\n", apic->base_msr, apic->base_address);
+  "0x%lx.\n", apic->apic_base, apic->base_address);
 
spin_unlock_bh(&apic->lock);
 }
@@ -769,7 +779,7 @@ u64 kvm_lapic_get_base(struct kvm_vcpu *vcpu)
u64 base;
 
spin_lock_bh(&apic->lock);
-   base = apic->base_msr;
+   base = vcpu->apic_base;
spin_unlock_bh(&apic->lock);
 
return base;
@@ -817,7 +827,7 @@ static void lapic_reset(struct kvm_vcpu *vcpu)
apic->timer.pending = 0;
apic->status = APIC_SW_DISABLE;
if (vcpu->vcpu_id == 0)
-   apic->base_msr |= MSR_IA32_APICBASE_BSP;
+   vcpu->apic_base |= MSR_IA32_APICBASE_BSP;
apic_update_ppr(apic);
 
spin_unlock_bh(&apic->lock);
@@ -825,7 +835,7 @@ static void lapic_reset(struct kvm_vcpu *vcpu)
apic_debug(KERN_INFO "%s: vcpu=%p, id=%d, base_msr="
   "0x%016" PRIx64 ", base_address=0x%0lx.\n",
__FUNCTION__,
   vcpu, GET_APIC_ID(apic_get_reg(apic, APIC_ID)),
-  apic->base_msr, apic->base_address);
+  vcpu->apic_base, apic->base_address);
 }
 
 int kvm_lapic_enabled(struct kvm_vcpu *vcpu)
@@ -833,6 +843,8 @@ int kvm_lapic_enabled(struct k

Re: [kvm-devel] lapic2 branch

2007-08-01 Thread Dor Laor
>Hi,Dor
>I cannot reproduce your issue on my test env.
>I can boot 64bit fc6 guest against latest lapic2 branch.
>My test machine is a Harwitch+paxville.
>The host os is RHEL5, kernel is kvm lapic2 branch with kvm build-in.
>How about yours?
>
>Thanks
>Yunfeng

My host is FC6 with latest 2.6.23-rc1 kernel + kvm modules from the lapic2 
branch.
The cpu is Intel core 2 6400.

I found out that I can run some kernels with it (.6.21-rc5) but the one below 
can't run using apic.

>
>>-Original Message-
>>From: Dor Laor [mailto:[EMAIL PROTECTED]
>>Sent: 2007年7月31日 3:10
>>To: Zhao, Yunfeng; kvm-devel@lists.sourceforge.net; Dong, Eddie; He,
>Qing
>>Subject: RE: [kvm-devel] lapic2 branch
>>
>>>What fedora distribution is in the guest?
>>>Could you give more detailed config info?
>>>Before I tried to boot 64bit RHEL4U3 against lapic2 branch, I didn't
>>>meet the problem.
>>>
>>>Thanks
>>>Yunfeng
>>
>>It's FC6, kernel version 2.6.20-1.2948.fc6.
>>I also tried 2.6.22-rc4 without luck.
>>The config file for the kernel is attached (default).
>>
>>>
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dor
>Laor
Sent: 2007年7月31日 16:18
To: kvm-devel@lists.sourceforge.net; Dong, Eddie; He, Qing
Subject: [kvm-devel] lapic2 branch

Hello to the brave apic pioneers,
While trying to use the lapic2 branch for fedora 64bit guest over
>Intel
host 2.6.22 I got the following:
===
ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
PIIX3: IDE controller at PCI slot :00:01.1
PIIX3: chipset revision 0
PIIX3: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:pio, hdd:pio
hda: QEMU HARDDISK, ATA DISK drive
irq 14: nobody cared (try booting with the "irqpoll" option)

Call Trace:
   [] __report_bad_irq+0x30/0x72
 [] note_interrupt+0x1ca/0x20f
 [] handle_edge_irq+0xf9/0x128
 [] call_softirq+0x1c/0x28
 [] do_IRQ+0xf1/0x160
 [] ret_from_intr+0x0/0xa
   [] ide_outb+0x0/0x9
 [] _spin_unlock_irqrestore+0xc/0x31
 [] setup_irq+0x163/0x1a1
 [] ide_intr+0x0/0x200
 [] request_irq+0x91/0xb5
 [] init_irq+0x283/0x50d
 [] hwif_init+0x148/0x32b
 [] probe_hwif_init_with_fixup+0x23/0x94
 [] ide_setup_pci_device+0x80/0xbc
 [] ide_scan_pcidev+0x31/0x58
 [] ide_scan_pcibus+0x22/0xa5
 [] ide_init+0x55/0x63
 [] kernel_init+0x163/0x2cd
 [] _spin_unlock_irq+0x15/0x30
 [] child_rip+0xa/0x12
 [] acpi_ds_init_one_object+0x0/0x7c
 [] kernel_init+0x0/0x2cd
 [] child_rip+0x0/0x12

handlers:
[] (ide_intr+0x0/0x200)
Disabling IRQ #14
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
===

Using nolapic in the guest's kernel worked but seems the apic is
>>>broken.

Also, in Gregory's original code there was qemu cmdline option of
setting the pic/apic position.
It is required for debugging/comparing these source of problems.
Thanks, Dor.




-
In simplicity there is elegance.
Dor Laor ;)


-
>--
>>>--
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] web interface?

2007-08-01 Thread Paul J R
Being a command line guy myself, I tend to agree and disagree. You can 
wrap up nearly all of your day-to-day tasks in a gui (be it X, web or 
other). Your gui may only provide 75% of the functionality of your 
software. The kind of thing i had in mind was more like, "hey, we got a 
new initrd//kernel, lets push that out to the pxeboot area and we'll do 
rolling reboots of the nodes" and get the cluster/web framework to 
manage live migration of hosts (or shutdown/startup) from one node to 
another. Plus things like, click, click, click - i just provisioned a 
new guest with a some disk space, a network connection and a chunk of 
memory/cpu. Of course the most important part of that is "how's the 
cluster going this morning" - *click* its all green, good.

That doesn't mean your free from the command, god no cause a gui limits 
(quite harshly at times) what your capable of doing - but it can 
simplify your life.

But why web? a while ago i was deploying a bunch of sun servers 
doing some web server work for a large corp (by AU terms, 50k 
employee's) mostly j2ee, iplanet web server and oracle. They used HP 
openview (among other things), but the op's guys jumped on and installed 
big brother agents. The guy said to me "oh yeah, we have this little 
server over here running bb for ourselves cause we can do almost 
anything and monitor almost anything with it. If its not in BB already 
its like easy enough to throw together a script of some kind to 
measure/monitor it. Basically, what i do is set the warning levels 
really low so i can just pull up my java nokia phone and go thru the wap 
portal and see if im likely to get paged before i go anywhere. If its 
yellow, OV wont alarm but I know I had best take a look before i go 
anywhere".

But, its always made me aim for a simple interface for day-to-day and 
get funky for the special cases, disaster recovery, etc. Now as the 
thing im trying to manage gets large, the better I want that interface 
to be because if i have to manage 4 machines i could ssh into them all 
and just look, but as that becomes 8 machines, 16, 32, etc the more i 
need information compressed or the harder its going to be for me to get 
to terms with it (this may come across as me sounding like im missing 
the point of kvmfs, which it inst intended to).

But, i whole-heartedly agree with kvmfs, it looks brilliant and exactly 
what vm's really do need!

Of course, prefix everything i just said with "in my humble opinion".

ron minnich wrote:
> On 7/31/07, Paul J R <[EMAIL PROTECTED]> wrote:
>
>   
>> The kind of thing I had in mind was relatively simple, it'd be a
>> miniture OS that would boot up (over pxe/usb/cdrom) into ram (its about
>> 90mb of ram so far with kvm and a full kernel + kudzu and few small
>> components such as a httpd+php). it searches for a configuration
>> partition and away you go managing the rest via the web interface. I had
>> clustering/multi-node sitting at the back of my head as well.
>> 
>
> I can tell you that for clusters web console interfaces are pretty
> useless, as scripting is hard for them, and a web interface is really
> pretty clumsy for almost anything of reasonable size. I think that
> kvmfs is really a great idea, and what I would want if I had a 128 or
> 1024 node or larger cluster. Note that we plan9 to do sims here with
> 10,000 instances of lguest on a 128-node cluster, and a web interface
> would be the worst possible way to do that.
>
> ron
>
>   



-
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] web interface?

2007-08-01 Thread Paul J R
Yeah, i did look at libvirt and it remains an option. Originally this 
was all going to be built around xen (I got xen running on two servers 
and had it changing the number of cpu's in a pv host on the fly as well 
as live-migrate guests and went oo). But then kvm got merged and so 
i went thru a phase of trying to decide which would be better suited to 
my little project. Around the same time frame, f7 came out and i had a 
good play with virt manager (as well as a few other things like the qemu 
virtualpc for webmin plugin). Libvirt was right after that and i wrote a 
bit of test code to see what i could do with it mostly because it solved 
part of the equation. After much agonizing though i settled on native 
kvm/qemu mostly for simplicity and its ability to run non-modified 
guests on non-hardware virt capable cpus.

Daniel P. Berrange wrote:
> On Wed, Aug 01, 2007 at 03:26:57AM +1000, Paul J R wrote:
>   
>> Wow, those are both pretty informative. Given both those replies, i'm 
>> wondering if i should continue?
>>
>> The kind of thing I had in mind was relatively simple, it'd be a 
>> miniture OS that would boot up (over pxe/usb/cdrom) into ram (its about 
>> 90mb of ram so far with kvm and a full kernel + kudzu and few small 
>> components such as a httpd+php). it searches for a configuration 
>> partition and away you go managing the rest via the web interface. I had 
>> clustering/multi-node sitting at the back of my head as well.
>> 
>
> FYI, libvirt also now provides secure remote access, so it can be used
> off-node from the box being managed. Access is either tunnelled over SSH,
> or directly connected using TLS + x509 certificates.
>
>   http://libvirt.org/remote.html
>
> This would enable a single web service to manage multiple hosts securely.
> http://libvirt.org/remote.html
>
> I illustrated some very simple examples here, showing the same commands
> talking to Xen, and KVM/QEMU both locally and remotely over SSH, or TLS.
>
>   http://berrange.com/personal/diary/2007/07/libvirt-remote-management-news
>
> Regards,
> Dan.
>   



-
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] web interface?

2007-08-01 Thread Daniel P. Berrange
On Thu, Aug 02, 2007 at 02:25:46AM +1000, Paul J R wrote:
> Yeah, i did look at libvirt and it remains an option. Originally this 
> was all going to be built around xen (I got xen running on two servers 
> and had it changing the number of cpu's in a pv host on the fly as well 
> as live-migrate guests and went oo). But then kvm got merged and so 
> i went thru a phase of trying to decide which would be better suited to 
> my little project. Around the same time frame, f7 came out and i had a 
> good play with virt manager (as well as a few other things like the qemu 
> virtualpc for webmin plugin). Libvirt was right after that and i wrote a 
> bit of test code to see what i could do with it mostly because it solved 
> part of the equation. After much agonizing though i settled on native 
> kvm/qemu mostly for simplicity and its ability to run non-modified 
> guests on non-hardware virt capable cpus.

libvirt could help in reference to the points elsewhere in this thread about 
some people prefering to use a Web UI, and others preferring to automate 
with command line tools. The command line virsh tool would see exactly the
same state as the Web UI & they'd each see the results of the other's changes.

We realize there are some things that libvirt doesn't support in its APIs
yet, and so welcome feedback from any users & developers about capabilites
that they need so we can adapt & prioritize future development plans.

Regards,
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Avi Kivity
Dimitry Golubovsky wrote:
> I never was able to actually _reboot_ an OS in kvm - it just hangs.
>
>   

Please follow the usual bug report procedure: what host, what cpu, what 
guest, what kvm, how to reproduce.


-- 
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Avi Kivity
Dimitry Golubovsky wrote:
> Avi,
>
> OK, I'll try to summarize that. However I'd also like to make a
> feature request: a virtual character device (sort of a virtual serial
> line) that the guest OS might use to communicate with the QEMU
> monitor. That might solve many problems.
>   

That exists now.  Look up the -monitor option --   you can redirect the 
monitor to a unix domain socket, a tcp socket, a pty, or wherever you like.

-- 
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Dimitry Golubovsky
Avi,

OK, I'll try to summarize that. However I'd also like to make a
feature request: a virtual character device (sort of a virtual serial
line) that the guest OS might use to communicate with the QEMU
monitor. That might solve many problems.

Thank you

On 8/1/07, Avi Kivity <[EMAIL PROTECTED]> wrote:
> Dimitry Golubovsky wrote:
> > I never was able to actually _reboot_ an OS in kvm - it just hangs.
> >
> >
>
> Please follow the usual bug report procedure: what host, what cpu, what
> guest, what kvm, how to reproduce.
>
>
> --
> error compiling committee.c: too many arguments to function
>
>


-- 
Dimitry Golubovsky

Anywhere on the Web

-
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 very slow

2007-08-01 Thread Avi Kivity
Ulrich Schreiner wrote:
> hi,
>
> im using a 64 bit fedora7 system with a quad-core processor to host
> multiple virtual machines.
>
> my current kernel is:
>
> Linux testserver 2.6.22.1-27.fc7 #1 SMP Tue Jul 17 17:19:58 EDT 2007
> x86_64 x86_64 x86_64 GNU/Linux
>
> (now there is a 2.6.22.1-33.fc7 to download, but i think it is not the
> point here).
>
> i installed
>
>   kvm.x86_64: 31-1.fc8
>
> because of a crash i reported as a bug with the older kvm module.
>
> this system starts a F7 image with the following command:
>
> /usr/bin/qemu-kvm 
>   -net nic,macadr=52.54.00.12.34.57 
>   -net tap,script=./ifup.py,ifname=tap0
>   -hda /var/qemu/vm_images/F7image.img 
>   -boot c: -m 512 -vnc :2 -k de
>
> inside the image there is fedora 7, but a 32bit system.
>
> almost everything works (reboot hangs), but the system is extremely
> slow! the clock inside the system is extremely slow: every *virtual*
> second in the image is about two or more seconds in the *real* world.
>   

Is there anything in dmesg?  What does 'top' report?  What does kvm_stat 
show?

-- 
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Daniel P. Berrange
On Wed, Aug 01, 2007 at 12:48:51PM -0400, Dimitry Golubovsky wrote:
> OK, I'll try to summarize that. However I'd also like to make a
> feature request: a virtual character device (sort of a virtual serial
> line) that the guest OS might use to communicate with the QEMU
> monitor. That might solve many problems.

Unless you whitelist which monitor commands it can run this would be a
significant security hole.  eg a guest could run

   'usb_add disk /some/path'

To get access to arbitrary files & disks from the host.

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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Daniel P. Berrange
On Wed, Aug 01, 2007 at 01:06:22PM -0400, Dimitry Golubovsky wrote:
> Daniel,
> 
> On 8/1/07, Daniel P. Berrange <[EMAIL PROTECTED]> wrote:
> 
> > Unless you whitelist which monitor commands it can run this would be a
> > significant security hole.  eg a guest could run
> >
> >   'usb_add disk /some/path'
> >
> > To get access to arbitrary files & disks from the host.
> >
> 
> If we assume that kvm runs under root, yes (and if kvm finds out it
> runs under root, it might disable such access to monitor). I have
> written a suid wrapper (very simple) that does whatever necessary
> under root, and then drops to user privileges, then execs kvm, so
> these actions will be limited by Linux multi-user mechanisms as usual.
> In my daily practice, I run kvm under my user privileges, and it works
> fine.

It can be a problem even if running as an unprivileged user, since the 
guest can read/write any files owned by that user - for example other 
guest disk images the user may have in their home dir.

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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Dimitry Golubovsky
Daniel,

On 8/1/07, Daniel P. Berrange <[EMAIL PROTECTED]> wrote:

> Unless you whitelist which monitor commands it can run this would be a
> significant security hole.  eg a guest could run
>
>   'usb_add disk /some/path'
>
> To get access to arbitrary files & disks from the host.
>

If we assume that kvm runs under root, yes (and if kvm finds out it
runs under root, it might disable such access to monitor). I have
written a suid wrapper (very simple) that does whatever necessary
under root, and then drops to user privileges, then execs kvm, so
these actions will be limited by Linux multi-user mechanisms as usual.
In my daily practice, I run kvm under my user privileges, and it works
fine.

See the kvmadm project (link on the kvm wiki page "Management tools").

-- 
Dimitry Golubovsky

Anywhere on the Web

-
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Anthony Liguori
Dimitry Golubovsky wrote:
> Avi,
>
> OK, I'll try to summarize that. However I'd also like to make a
> feature request: a virtual character device (sort of a virtual serial
> line) that the guest OS might use to communicate with the QEMU
> monitor. That might solve many problems.
>   

Can you provide the use-case you're looking to address with this?  As 
Dan mentioned, this would be pretty hairy from a security perspective 
since the guest could do things it's not supposed to be able to do but 
if you've got something specific in mind, there might be another way to 
achieve the same results without compromising security.

Regards,

Anthony Liguori

> Thank you
>
> On 8/1/07, Avi Kivity <[EMAIL PROTECTED]> wrote:
>   
>> Dimitry Golubovsky wrote:
>> 
>>> I never was able to actually _reboot_ an OS in kvm - it just hangs.
>>>
>>>
>>>   
>> Please follow the usual bug report procedure: what host, what cpu, what
>> guest, what kvm, how to reproduce.
>>
>>
>> --
>> 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 hangs on start

2007-08-01 Thread Avi Kivity
Scott Lerman wrote:
> The kernel is the current Ubuntu version, /proc/version is Linux 
> version 2.6.20-16-generic ([EMAIL PROTECTED]) (gcc version 4.1.2 (Ubuntu 
> 4.1.2-0ubuntu4)) #2 SMP Thu Jun 7 20:19:32 UTC 2007
>
> The kvm version is also the one from the Ubuntu repository, which apt 
> calls 1:16-1ubuntu2. Not certain if that means it's kvm version 16. Is 
> there a way to get the version directly from kvm? (I didn't see a -v 
> flag in the man page)
>


Yes, I think it's kvm-16.  It's too old to be useful.  I suggest 
downloading kvm-33.  There are a couple of AMD-related regressions in 
there, so if that doesn't work well you should try kvm-34 which will be 
released in a few days.

-- 
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] preclean up for live migration

2007-08-01 Thread Avi Kivity
Dong, Eddie wrote:
> Avi Kivity wrote:
>   
>> Dong, Eddie wrote:
>> 
>>> Against lapic2
>>>
>>> This is a pre-cleanup for in kernel irqchip live migration support.
>>> A guest may not have APIC but still have apic_base_msr be
>>> save/restored in current live migration framework.
>>>
>>>   
>
> Updated.
>
>   

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


Re: [kvm-devel] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Dimitry Golubovsky
Anthony,

On 8/1/07, Anthony Liguori <[EMAIL PROTECTED]> wrote:

> > feature request: a virtual character device (sort of a virtual serial
> > line) that the guest OS might use to communicate with the QEMU
> > monitor. That might solve many problems.
> >
>
> Can you provide the use-case you're looking to address with this?  As
> Dan mentioned, this would be pretty hairy from a security perspective
> since the guest could do things it's not supposed to be able to do but
> if you've got something specific in mind, there might be another way to
> achieve the same results without compromising security.

I am working on the project named "kvmadm" which is aimed to giving
users private VMs instead of shell accounts on the host.

This first of all means that VMs run under privileges of users who
started them (there is a suid wrapper that does the root work).
Secondly, users are limited in kvm options they are able to supply
(mainly to name disk image files and kernel file to boot from - by the
means of the same wrapper). Thirdly, power of users to harm the system
is same as if they had regular shell accounts on the host that runs
their VMs.

Possible use case for the feature I am proposing:

When guest OS completes shutdown, there should be a clear signal to
kvm to exit. One possibility is power-off via ACPI which works, but
there may be problems with acpi (some sources recommend to turn it
off; personally I personally encountered instability and hangups when
booting a guest with rtc and acpi enabled together, so I can boot
either with -no-acpi or with -no-rtc, works fine). Another possibility
would be sending a monitor command via proposed channel to exit kvm.

It may not always be possible to enter such command manually: earlier
in this thread I described the situation when the guest OS runs a X
window manager, and it is killed during shutdown, the console window
may become unaccessible for keyboard input. In the kvmadm wiki, I
described the way to switch between host's and guest's window
managers, but kvm process must exit in order for this to work as it is
not possible to know from outside if the guest OS shut down.

Thanks.

-- 
Dimitry Golubovsky

Anywhere on the Web

-
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] Hoist push_irq/pop_irq into kvm.h

2007-08-01 Thread Avi Kivity
Rusty Russell wrote:
> Everyone can use push_irq() and pop_irq(), so move them to common code.
>
>   

This area is a bit raw right now due to the lapic branch, so I'll drop 
this for now.  Sorry as it is obviously a good one.

We'll revisit this once that branch is merged.

-- 
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] Add and use pr_unimpl for standard formatting of unimplemented features.

2007-08-01 Thread Avi Kivity
Rusty Russell wrote:
> All guest-invokable printks should be ratelimited to prevent malicious
> guests from flooding logs.  This is a start.
>
>   

Applied, thanks.  I think my earlier report of a printk flood was caused 
by a different bug which was since fixed.

-- 
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] Remove unneeded kvm_dev_open and kvm_dev_release functions.

2007-08-01 Thread Avi Kivity
Rusty Russell wrote:
> Devices don't need open or release functions.
>
> Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
>
>   
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


Re: [kvm-devel] [PATCH] lmsw sets lower 16 bits of cr0, not just lower 4

2007-08-01 Thread Avi Kivity
Rusty Russell wrote:
> According to my Intel manual, although lmsw only causes an exit when
> trying to set the bottom 4 bits, it is supposed to set the bottom 16
> bits of cr0.
>
>   

Well, _my_ Intel manual (2A) says:

> Loads the source operand into the machine status word, bits 0 through 
> 15 of register CR0. The
> source operand can be a 16-bit general-purpose register or a memory 
> location. Only the low-
> order 4 bits of the source operand (which contains the PE, MP, EM, and 
> TS flags) are loaded
> into CR0. The PG, CD, NW, AM, WP, NE, and ET flags of CR0 are not 
> affected. The operand-
> size attribute has no effect on this instruction.


-- 
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] remove duplicate assignment in kvm_setup_pio()

2007-08-01 Thread Avi Kivity
Laurent Vivier wrote:
> Line 1809 of kvm_main.c is useless, value is overwritten in line 1815:
>   

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


Re: [kvm-devel] kvm-intel kernel panicing 2.6.22 on T7200

2007-08-01 Thread Magic Boiz
Hello list

I've just tried with the lastest kvm version available, 33, and now it
works. I'm also using a new kernel, this time kernel version 2.6.22.

Great job guys!!


On 6/14/07, Magicboiz <[EMAIL PROTECTED]> wrote:
>
> Hello list,
>
> My laptop is a Toshiba Tecra S4 (ntel(R) Core(TM)2 CPU T7200  @
> 2.00GHz), and I have a similar problem:
>
> I trying with KVM-28 and a vanilla kernel, 2.6.22-rc4.
>
> After upgrade my BIOS to the latest version available in Toshiba (3.20),
> now I can insert the KVM-INTEL.KO module without any problem (before the
> BIOS upgrade, I got "kvm: disabled by bios").
>
> But when I try to launch a virtual machine:
> "sudo /usr/local/kvm/bin/qemu -hda ~/vm/disk.qcow -m 128 -boot -d"
>
> my machine just hangs. No Oops. No messages. No magic-Sys-Keys. It just
> stops. I have to reboot completly the laptop.
>
>
> Any ideas?? Thx in advance.
>
>
> Some info:
>
> Toshiba Tecra S4.
>
> kvm-28
>
> uname -a: Linux linux 2.6.22-rc4 #4 SMP PREEMPT Thu Jun 14 08:48:23 CEST
> 2007 i686 GNU/Linux
>
>
> I attach my kernel config.
>
>
>
>
>
>
>
>
-
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] Remove stat_set from debugfs

2007-08-01 Thread Avi Kivity
Rusty Russell wrote:
> We shouldn't define stat_set on the debug attributes, since that will
> cause silent failure on writing: without a set argument, userspace
> will get -EACCESS.
>   

EAPPLIED, ETHANKS.

-- 
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 very slow

2007-08-01 Thread Ulrich Schreiner
dmesg|grep kvm

SELinux: initialized (dev kvmfs, type kvmfs), uses genfs_contexts
kvm: emulating exchange as write

now booting into a F7 image, after the system is ready (and in idle):

top
   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
14917 root  20   0  332m  71m  66m S6  0.9   1:17.05 qemu-kvm
14954 root  20   0 14552 1072  812 R0  0.0   0:00.01 top
 1 root  20   0 10320  680  572 S0  0.0   0:02.02 init

kvm_stat (snapshot):

kvm statistics

  exits12254399   79079
  halt_exits 3265434632
  invlpg  0   0
  io_exits  6539798   74320
  irq_exits   43523  29
  irq_window   4984   0
  mmio_exits1319016   0
  pf_fixed  3140955  56
  pf_guest   448187   6
  request_irq 0   0
  signal_exit 39728   0
  tlb_flush   29511  31

when logging into the virtual machine (via ssh) the virtual world is 
very slow: i set the time with "ntpdate" and wait exact one minute in 
reality. in the virtual image only 24sec are gone!

and everything else in the image is really slow.

Avi Kivity schrieb:
> Ulrich Schreiner wrote:
>> hi,
>>
>> im using a 64 bit fedora7 system with a quad-core processor to host
>> multiple virtual machines.
>>
>> my current kernel is:
>>
>> Linux testserver 2.6.22.1-27.fc7 #1 SMP Tue Jul 17 17:19:58 EDT 2007
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>> (now there is a 2.6.22.1-33.fc7 to download, but i think it is not the
>> point here).
>>
>> i installed
>>
>>   kvm.x86_64: 31-1.fc8
>>
>> because of a crash i reported as a bug with the older kvm module.
>>
>> this system starts a F7 image with the following command:
>>
>> /usr/bin/qemu-kvm   -net nic,macadr=52.54.00.12.34.57   -net 
>> tap,script=./ifup.py,ifname=tap0
>>   -hda /var/qemu/vm_images/F7image.img   -boot c: -m 512 -vnc :2 -k de
>>
>> inside the image there is fedora 7, but a 32bit system.
>>
>> almost everything works (reboot hangs), but the system is extremely
>> slow! the clock inside the system is extremely slow: every *virtual*
>> second in the image is about two or more seconds in the *real* world.
>>   
> 
> Is there anything in dmesg?  What does 'top' report?  What does kvm_stat 
> show?
> 


-
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Anthony Liguori
Dimitry Golubovsky wrote:
> Anthony,
>
> On 8/1/07, Anthony Liguori <[EMAIL PROTECTED]> wrote:
>
>   
>>> feature request: a virtual character device (sort of a virtual serial
>>> line) that the guest OS might use to communicate with the QEMU
>>> monitor. That might solve many problems.
>>>
>>>   
>> Can you provide the use-case you're looking to address with this?  As
>> Dan mentioned, this would be pretty hairy from a security perspective
>> since the guest could do things it's not supposed to be able to do but
>> if you've got something specific in mind, there might be another way to
>> achieve the same results without compromising security.
>> 
>
> I am working on the project named "kvmadm" which is aimed to giving
> users private VMs instead of shell accounts on the host.
>
> This first of all means that VMs run under privileges of users who
> started them (there is a suid wrapper that does the root work).
> Secondly, users are limited in kvm options they are able to supply
> (mainly to name disk image files and kernel file to boot from - by the
> means of the same wrapper). Thirdly, power of users to harm the system
> is same as if they had regular shell accounts on the host that runs
> their VMs.
>   

Why are you using a setuid wrapper instead of just changing ownership of 
/dev/kvm?

> Possible use case for the feature I am proposing:
>
> When guest OS completes shutdown, there should be a clear signal to
> kvm to exit. One possibility is power-off via ACPI which works, but
> there may be problems with acpi (some sources recommend to turn it
> off; personally I personally encountered instability and hangups when
> booting a guest with rtc and acpi enabled together, so I can boot
> either with -no-acpi or with -no-rtc, works fine). Another possibility
> would be sending a monitor command via proposed channel to exit kvm.
>   

The power-off thing is a bug.  I was also thinking that it may be 
possible to detect when most guests have halted.

Regards,

Anthony Liguori

> It may not always be possible to enter such command manually: earlier
> in this thread I described the situation when the guest OS runs a X
> window manager, and it is killed during shutdown, the console window
> may become unaccessible for keyboard input. In the kvmadm wiki, I
> described the way to switch between host's and guest's window
> managers, but kvm process must exit in order for this to work as it is
> not possible to know from outside if the guest OS shut down.
>   

> Thanks.
>
>   


-
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Dimitry Golubovsky
Anthony,

On 8/1/07, Anthony Liguori <[EMAIL PROTECTED]> wrote:

> Why are you using a setuid wrapper instead of just changing ownership of
> /dev/kvm?

Ownership of /dev/kvm is adjusted to be of group "kvm" (for example)
and all users allowed to use it are in the same group. It is also
necessary to create a tap device (and through unique naming of it
users are prevented from running multiple instances of VMs thus
preventing memory overconsumption). Also it is necessary to connect
tap to bridge. If FS (CAP_NETADMIN) capabilities were available in
Linux by default then qemu process might be made capable of that (and
anyway, when dropping to user privileges, capabilities are masked
away). But they are only in special -mm patches, not in the mainstream
kernel. So these tap/bridge operations require root privileges.

> The power-off thing is a bug.  I was also thinking that it may be
> possible to detect when most guests have halted.

Power-off works for me though.

Thanks.

-- 
Dimitry Golubovsky

Anywhere on the Web

-
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Anthony Liguori
Dimitry Golubovsky wrote:
> Anthony,
>
> On 8/1/07, Anthony Liguori <[EMAIL PROTECTED]> wrote:
>
>   
>> Why are you using a setuid wrapper instead of just changing ownership of
>> /dev/kvm?
>> 
>
> Ownership of /dev/kvm is adjusted to be of group "kvm" (for example)
> and all users allowed to use it are in the same group.

Okay, so no root privileges are needed here.

>  It is also
> necessary to create a tap device (and through unique naming of it
> users are prevented from running multiple instances of VMs thus
> preventing memory overconsumption). Also it is necessary to connect
> tap to bridge. If FS (CAP_NETADMIN) capabilities were available in
> Linux by default then qemu process might be made capable of that (and
> anyway, when dropping to user privileges, capabilities are masked
> away). But they are only in special -mm patches, not in the mainstream
> kernel. So these tap/bridge operations require root privileges.
>   

This is one of the reasons the VDE project exists, to delegate 
privileges for tap/bridge devices.

Regards,

Anthony Liguori

>> The power-off thing is a bug.  I was also thinking that it may be
>> possible to detect when most guests have halted.
>> 
>
> Power-off works for me though.
>
> Thanks.
>
>   


-
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] Ways to exit from kvm on behalf of the quest system?

2007-08-01 Thread Anthony Liguori
Dimitry Golubovsky wrote:
> Anthony,
>
> On 8/1/07, Anthony Liguori <[EMAIL PROTECTED]> wrote:
>
>   
>> Why are you using a setuid wrapper instead of just changing ownership of
>> /dev/kvm?
>> 
>
> Ownership of /dev/kvm is adjusted to be of group "kvm" (for example)
> and all users allowed to use it are in the same group. It is also
> necessary to create a tap device (and through unique naming of it
> users are prevented from running multiple instances of VMs thus
> preventing memory overconsumption). Also it is necessary to connect
> tap to bridge. If FS (CAP_NETADMIN) capabilities were available in
> Linux by default then qemu process might be made capable of that (and
> anyway, when dropping to user privileges, capabilities are masked
> away). But they are only in special -mm patches, not in the mainstream
> kernel. So these tap/bridge operations require root privileges.
>
>   
>> The power-off thing is a bug.  I was also thinking that it may be
>> possible to detect when most guests have halted.
>> 
>
> Power-off works for me though.
>   

Note that if your running Linux as a guest, you can issue:

modprobe apm power_off=1

And then when the guest shutdowns, QEMU will exit as expected.  I'm not 
really sure why distros aren't loading apm automatically.

Regards,

Anthony Liguori

> Thanks.
>
>   


-
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] lmsw sets lower 16 bits of cr0, not just lower 4

2007-08-01 Thread Rusty Russell
On Wed, 2007-08-01 at 21:44 +0300, Avi Kivity wrote:
> Rusty Russell wrote:
> > According to my Intel manual, although lmsw only causes an exit when
> > trying to set the bottom 4 bits, it is supposed to set the bottom 16
> > bits of cr0.
> >
> >   
> 
> Well, _my_ Intel manual (2A) says:
> 
> > Loads the source operand into the machine status word, bits 0 through 
> > 15 of register CR0. The
> > source operand can be a 16-bit general-purpose register or a memory 
> > location. Only the low-
> > order 4 bits of the source operand (which contains the PE, MP, EM, and 
> > TS flags) are loaded

Damn, I should have kept reading.

Sorry for the noise!
Rusty.



-
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 hangs on start

2007-08-01 Thread Scott Lerman
On 8/1/07, Avi Kivity <[EMAIL PROTECTED]> wrote:
>
> Scott Lerman wrote:
> > The kernel is the current Ubuntu version, /proc/version is Linux
> > version 2.6.20-16-generic ([EMAIL PROTECTED]) (gcc version 4.1.2 (Ubuntu
> > 4.1.2-0ubuntu4)) #2 SMP Thu Jun 7 20:19:32 UTC 2007
> >
> > The kvm version is also the one from the Ubuntu repository, which apt
> > calls 1:16-1ubuntu2. Not certain if that means it's kvm version 16. Is
> > there a way to get the version directly from kvm? (I didn't see a -v
> > flag in the man page)
> >
>
>
> Yes, I think it's kvm-16.  It's too old to be useful.  I suggest
> downloading kvm-33.  There are a couple of AMD-related regressions in
> there, so if that doesn't work well you should try kvm-34 which will be
> released in a few days.
>
> --
> error compiling committee.c: too many arguments to function
>
>
Is anyone building .deb packages for new versions? I did my share of
compiling everything for servers a few years ago, and the last time I tried
to compile something on my Ubuntu system at home ended up as a nightmare of
tracking down -dev packages. If nobody is, and if there's any interest, I
can try to spend some time doing it at least for i386 packages.

-- 
Scott Lerman
-
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] vnc improvement/bugfix patches from xen

2007-08-01 Thread Matthew Kent
After some issues with qemu vnc I happened upon the patches xen carries
in xen-unstable.hg/tools/ioemu/patches/. After getting them to apply
cleanly they have vastly improved my experience with vnc.

I've taken these, omitted any that are xen specific or add extra
features to qemu, and made some patches that apply cleanly to the latest
qemu and kvm-33 sources. 

http://magoazul.com/proj/qemu/from_xen-unstable.hg_7c5c3aa858cc/

They seem to resolve the following issues for me:

- having the vncviewer 4.1.2 die with:
Rect too big: 4260x16389 at 4259,4323 exceeds 720x400
Aborted
- having some odd stuck bits on the display when using the mouse via gdm
or vim
 -> fixed by vnc-backoff-screen-scan/vnc-cleanup/vnc-fixes

- occasionally having the vnc server go into an infinite loop thus
screwing up the entire vm (verified with gdb)
 -> fixed by vnc-protocol-fixes

- keypad not working
 -> fixed by vnc-keypad-handling

[vnc-altgr-keysym/vnc-fix-text-display-shift-key not sure, included em
anyway]

Obviously I had *zero* hand in creating these patches and the original
authors deserve the credit, I'm merely providing them for anyone
experiencing the same issues. What I have done though is abused the
patched qemu and kvm installs pretty thoroughly with vnc over the past
week without issue.

Also, in the course of this I read the recent 'Merging QEMU-DM upstream'
slides from XenSummit by Anthony Liguori who I've seen on this list.
Wondering if this is ongoing and I just duplicated some work that's
already done? :)
-- 
Matthew Kent <[EMAIL PROTECTED]>
http://magoazul.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