Mohammed Gamal | 1 Sep 2008 03:46
Picon
Gravatar

[PATCH] kvm: testsuite: Save eflags in exec_in_big_real_mode()

Save eflags in exec_in_big_real_mode(). This is needed to test instructions that
modify the eflags register.

Signed-off-by: Mohammed Gamal <m.gamal005 <at> gmail.com>
---
 user/test/x86/realmode.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/user/test/x86/realmode.c b/user/test/x86/realmode.c
index 79df0f5..906be09 100644
--- a/user/test/x86/realmode.c
+++ b/user/test/x86/realmode.c
 <at>  <at>  -82,6 +82,10  <at>  <at>  static void exec_in_big_real_mode(const struct regs *inregs,
 		"test_insn: . = . + 16\n\t"
 		"test_insn_end: \n\t"

+		/* Save EFLAGS in outregs*/
+		"pushfl \n\t"
+		"popl %[save]+36 \n\t"
+
 		"xchg %%eax, %[save]+0 \n\t"
 		"xchg %%ebx, %[save]+4 \n\t"
 		"xchg %%ecx, %[save]+8 \n\t"
--

-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Mohammed Gamal | 1 Sep 2008 03:46
Picon
Gravatar

[PATCH] kvm: testsuite: Add cld/std, cli/sti, and clc instructions.

Adds cld/std, cli/sti, and clc instructions to the test harness.

Signed-off-by: Mohammed Gamal <m.gamal005 <at> gmail.com>
---
 user/test/x86/realmode.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/user/test/x86/realmode.c b/user/test/x86/realmode.c
index 906be09..904ef21 100644
--- a/user/test/x86/realmode.c
+++ b/user/test/x86/realmode.c
 <at>  <at>  -172,6 +172,45  <at>  <at>  void test_mov_imm(const struct regs *inregs, struct regs *outregs)
 		print_serial("mov test 5: FAIL\n");
 }

+void test_eflags_insn(struct regs *inregs, struct regs *outregs)
+{
+	MK_INSN(clc, "clc");
+	MK_INSN(cli, "cli");
+	MK_INSN(sti, "sti");
+	MK_INSN(cld, "cld");
+	MK_INSN(std, "std");
+
+	exec_in_big_real_mode(inregs, outregs,
+			      insn_clc,
+			      insn_clc_end - insn_clc);
+	if(outregs->eflags & 1)
+		print_serial("clc test: FAIL\n");
+	
+	exec_in_big_real_mode(inregs, outregs,
(Continue reading)

Mohammed Gamal | 1 Sep 2008 03:52
Picon
Gravatar

[PATCH] x86 emulator: Add std and cld instructions (opcodes 0xfc-0xfd)

This adds the std and cld instructions to the emulator.

Encountered while running the BIOS with the invalid guest
state emulation patch.

Signed-off-by: Mohammed Gamal <m.gamal005 <at> gmail.com>
---
 arch/x86/kvm/x86_emulate.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index d5da7f1..005f1db 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
 <at>  <at>  -180,7 +180,7  <at>  <at>  static u16 opcode_table[256] = {
 	ImplicitOps, ImplicitOps, Group | Group3_Byte, Group | Group3,
 	/* 0xF8 - 0xFF */
 	ImplicitOps, 0, ImplicitOps, ImplicitOps,
-	0, 0, Group | Group4, Group | Group5,
+	ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
 };

 static u16 twobyte_table[256] = {
 <at>  <at>  -1755,6 +1755,14  <at>  <at>  special_insn:
 		ctxt->eflags |= X86_EFLAGS_IF;
 		c->dst.type = OP_NONE;	/* Disable writeback. */
 		break;
+	case 0xfc: /* cld */
+		ctxt->eflags &= ~EFLG_DF;
+		c->dst.type = OP_NONE;	/* Disable writeback. */
(Continue reading)

Zhang, Xiantao | 1 Sep 2008 04:06
Picon
Favicon

RE: [PATCH] KVM: Qemu: Set default pm_io_base to 0x1f40.

Avi Kivity wrote:
> Zhang, Xiantao wrote:
>> Avi Kivity wrote:
>> 
>>> Zhang, Xiantao wrote:
>>> 
>>>> From 6039f279745733c52b291ec45c69eca028567c62 Mon Sep 17 00:00:00
>>>> 2001 From: Xiantao Zhang <xiantao.zhang <at> intel.com>
>>>> Date: Sun, 31 Aug 2008 14:27:23 +0800
>>>> Subject: [PATCH] KVM: Qemu: Set default pm_io_base to 0x1f40.
>>>> 
>>>> The firmware of kvm/ia64 use 0x1f40 as default pm_io_base,
>>>> and doesn't have re-configure mechanism, so use 0x1f40 as default
>>>> value to support kvm/ia64's power management.
>>>> Signed-off-by: Xiantao Zhang <xiantao.zhang <at> intel.com> --- 
>>>>  qemu/hw/acpi.c |    4 +++- 1 files changed, 3 insertions(+), 1
>>>> deletions(-) 
>>>> 
>>>> diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c
>>>> index 74535bc..4fc1d3f 100644
>>>> --- a/qemu/hw/acpi.c
>>>> +++ b/qemu/hw/acpi.c
>>>>  <at>  <at>  -498,7 +498,9  <at>  <at>  i2c_bus *piix4_pm_init(PCIBus *bus, int devfn,
>>>>      uint32_t smb_io_base, pci_conf[0x0e] = 0x00; // header_type
>>>>      pci_conf[0x3d] = 0x01; // interrupt pin 1
>>>> 
>>>> -    pci_conf[0x40] = 0x01; /* PM io base read only bit */
>>>> +    pci_conf[0x40] = 0x41; /* PM io base read only bit */ +
>>>> pci_conf[0x41] = 0x1f; +    pm_write_config(s, 0x80, 0x01, 1);
>>>> /*Set default pm_io_base 0x1f40*/ 
(Continue reading)

Yang, Sheng | 1 Sep 2008 07:39
Picon
Favicon

Re: [PATCH] KVM: MMU: Add shadow_accessed_shift

On Sunday 31 August 2008 23:13:54 Avi Kivity wrote:
> yasker <at> gmail.com wrote:
> > From: Sheng Yang <sheng.yang <at> intel.com>
> >
> > We use a "fake" A/D bit for EPT, to keep epte behaviour consistent with
> > shadow spte. But it's not that good for MMU notifier. Now we can only
> > expect return young=0 for clean_flush_young() in most condition.
>
> Perhaps we are better off setting shadow_accessed_mask to 0 for ept, and
> adding a test for clear_flush_young()?  This is the only place that
> needs adjusting as far as I can tell.
>
> I don't see what having a fake accessed bit buys us, and I'd like the
> patch to be as small as possible, since it needs to go into
> 2.6.26-stable and 2.6.27-rc.

Though I still think fake accessed bit here makes logic consistent, here is 
the patch follow your comment. But I think it may not necessary for the 
2.6.26-stable?

----
From: Sheng Yang <sheng.yang <at> intel.com>
Date: Mon, 1 Sep 2008 13:22:09 +0800
Subject: [PATCH] KVM: VMX: Always return 0 for clear_flush_young() when using 
EPT

As well as discard fake accessed bit and dirty bit of EPT.

Signed-off-by: Sheng Yang <sheng.yang <at> intel.com>
---
(Continue reading)

Avi Kivity | 1 Sep 2008 11:16

Re: [REGRESSION] High, likely incorrect process cpu usage counters with kvm and 2.6.2[67]

Parag Warudkar wrote:
> On Sun, Aug 31, 2008 at 11:43 AM, Avi Kivity <avi <at> qumranet.com> wrote:
>   
>> Running an idle Windows VM on Linux 2.6.26+ with kvm, one sees high values
>> for the kvm process in top (30%-70% cpu), where one would normally expect
>> 0%-1%.  Surprisingly, the per-cpu system counters show almost 100% idle,
>> leading me to believe this is an accounting error and that the process does
>> not actually consume this much cpu.
>>     
>
> Busted process accounting - This looks the same as
> http://bugzilla.kernel.org/show_bug.cgi?id=11209 .
> Please verify. Peter's patch in latest git stops showing "incorrect
> looking" CPU usage but at least the process times are still wrong,
> horribly.
> In fact the CPU usage thing in -rc5 is likely also incorrect but I
> need to analyze that bit a little more.
>
> From Today's Git -
>
> PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>
> 12961 parag     20   0 83000 8908 6628 R    0  0.1  5124415h npviewer.bin
>
>   

Yes, it looks very similar.  In my tests, %CPU is consistent with TIME; 
it's just not consistent with what's actually happening and with the 
global statistics.

(Continue reading)

Farkas Levente | 1 Sep 2008 11:20

Re: mandrake-10 not able to boot on kvm-71-73

Henrik Holst wrote:
> mån 2008-08-25 klockan 18:59 +0200 skrev Farkas Levente:
> 
>> the situation is more stranger (but probably another bug)
>> kvm-70 (and kvm-71) with kmod-kvm-73: working if and only if i start
>> mandrake-10 as the first guest, if i start other guest and after i start
>> mandrake-10 (both from command line and virt-manager) i've got this (not
>> too long) error:
>> -----------------------------------------------------
>> # /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name mandrake-10 -monitor
>> pty -boot c -drive
>> file=/dev/VolGroup00/mandrake-10,if=ide,index=0,boot=on -net
>> nic,macaddr=00:16:3e:03:37:eb,vlan=0 -net
>> tap,fd=20,script=,vlan=0,ifname=vnet3 -serial none -parallel none -usb
>> -vnc 127.0.0.1:0
>> bind() failed
> 
> bind() failed indicates that you are trying to run more than one guest
> on the same VNC port that is 127.0.0.1:0 is used on more than one guest
> so the second one cannot bind to port 5900.

ok this last one was my fault:-(
but i retest is again.
- kvm-74 with kmod-kvm-74 not working
- kvm-71 with kmod-kvm-74 working
any progress with this?
anyone can test it with a simple minimal mandrake-10 install. after the
install the system can't boot.
yours.

(Continue reading)

Avi Kivity | 1 Sep 2008 11:26

Re: serial problems cont..

Michael Malone wrote:
> Hi everyone,
>
> I've written a couple of questions regarding the serial device in 
> KVM.  After slightly more investigation I think I have found what's 
> going awry.  Correct me if I'm wrong, but I believe that KVM generates 
> an interrupt for every single character it sends through the serial 
> port.  This throws CPU usage through the roof and I suspect this means 
> that the timers aren't being handled correctly and it failed on a 
> string of 0's for me due to the timing slips.  GNU/Linux and Windows 
> don't have anywhere near the processor usage for their serial ports.  
> Now, I know nothing of serial programming and don't have any time to 
> investigate it too heavily just now, but I have pulled down the source 
> and had a look through that, but it looks to be doing the right thing 
> (I suppose?).   I was mainly wondering how GNU/Linux and windows 
> handle serial interrupts or if some of the serial character events 
> could be buffered, rather than overload the processor?  I guess this 
> is a low priority for you, but any help would be greatly appreciated 
> (And when I have some more time, I will spend some of it helping to 
> develop KVM! Quid pro quo, Clarice...)
>

What version of kvm are you testing?  There were some changes to the 
serial emulation recently.  See for example 
02f0b4c0cc26f3a2578d515d96781f5a6258888d in kvm-73.

--

-- 
error compiling committee.c: too many arguments to function

--
(Continue reading)

Avi Kivity | 1 Sep 2008 11:28

Re: mandrake-10 not able to boot on kvm-71-73

Farkas Levente wrote:
>
> ok this last one was my fault:-(
> but i retest is again.
> - kvm-74 with kmod-kvm-74 not working
> - kvm-71 with kmod-kvm-74 working
> any progress with this?
> anyone can test it with a simple minimal mandrake-10 install. after the
> install the system can't boot.
> yours.
>   

Please provide a pointer to a test .iso image.

--

-- 
error compiling committee.c: too many arguments to function

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

Yang, Sheng | 1 Sep 2008 11:32
Picon
Favicon

[PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae

From: Sheng Yang <sheng.yang <at> intel.com>
Date: Mon, 1 Sep 2008 17:28:59 +0800
Subject: [PATCH] KVM: MMU: Fix overflow of SHADOW_PT_INDEX with EPT in 32pae

EPT is 4 level by default in 32pae (48bits), but virtual address only
got 32 bits. This result in SHADOW_PT_INDEX() overflow when try to
fetch level 4 index.

Fix it by extend virtual address to 64bits in any condition.

Signed-off-by: Sheng Yang <sheng.yang <at> intel.com>
---
 arch/x86/kvm/mmu.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index f33c594..8ca9aad 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
 <at>  <at>  -943,6 +943,7  <at>  <at>  static int walk_shadow(struct kvm_shadow_walk *walker,
 	int level;
 	int r;
 	u64 *sptep;
+	u64 ext_addr = addr;
 	unsigned index;

 	shadow_addr = vcpu->arch.mmu.root_hpa;
 <at>  <at>  -954,7 +955,12  <at>  <at>  static int walk_shadow(struct kvm_shadow_walk *walker,
 	}

(Continue reading)


Gmane