public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Riepe <michael-0QoEqw4nQxo@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Plan 9 install problems
Date: Sun, 17 Dec 2006 13:28:16 +0100	[thread overview]
Message-ID: <458537E0.8040800@mr511.de> (raw)
In-Reply-To: <458507E9.7080509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

Hi there!

Avi Kivity wrote:
> Michael Riepe wrote:
> 
>> Hi!
>>
>> Avi Kivity wrote:
>>
>>  
>>
>>> The way to fix is to add handling to {svm,vmx}_get_msr() for msr 1
>>> (and any other pointless msrs the guest reads or writes).  From a
>>> cursory reading of the machine check docs, returning 0 should be fine
>>> for msr 1.

Done, see mce-handling.patch. The AMD part is not tested yet (I don't
have access to an SVM capable machine).

>> Yep.
>>
>> But that doesn't help with Plan9 (just checked it). The installer fails
>> at VM entry later because it tries to use a "big" code segment (limit =
>> 0xffffffff). The same is true for OpenSolaris (cs limit = 0xfffff), by
>> the way.
>>   
> 
> 
> Okay.  Can someone with an AMD machine test these two OSes?  There
> shouldn't be any problems with real mode there.

OpenSolaris runs on Intel with a simple modification: force the CS limit
to 0xffff in real mode (I wonder why that didn't happen already).

Plan9, on the other hand, seems to execute code outside the 64K range.
With cs-limit.patch, it dies at RIP 0x100212. I'm afraid we will need a
full-blown real mode instruction emulator to handle that.

Please apply cs-limit.patch first in order to avoid fuzz.

-- 
Michael "Tired" Riepe <michael-0QoEqw4nQxo@public.gmane.org>
X-Tired: Each morning I get up I die a little

[-- Attachment #2: cs-limit.patch --]
[-- Type: text/plain, Size: 462 bytes --]

Signed-off-by: Michael Riepe <michael-0QoEqw4nQxo@public.gmane.org>

Index: vmx.c
===================================================================
--- vmx.c	(revision 4118)
+++ vmx.c	(working copy)
@@ -726,6 +726,7 @@
 	vmcs_write32(GUEST_SS_AR_BYTES, 0xf3);
 
 	vmcs_write32(GUEST_CS_AR_BYTES, 0xf3);
+	vmcs_write32(GUEST_CS_LIMIT, 0xffff);
 	vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4);
 
 	fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es);

[-- Attachment #3: mce-handling.patch --]
[-- Type: text/plain, Size: 819 bytes --]

Signed-off-by: Michael Riepe <michael-0QoEqw4nQxo@public.gmane.org>
 
Index: svm.c
===================================================================
--- svm.c	(revision 4117)
+++ svm.c	(working copy)
@@ -1073,6 +1073,8 @@
 static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
 {
 	switch (ecx) {
+	case MSR_IA32_P5_MC_ADDR:
+	case MSR_IA32_P5_MC_TYPE:
 	case MSR_IA32_MC0_CTL:
 	case MSR_IA32_MCG_STATUS:
 	case MSR_IA32_MCG_CAP:
Index: vmx.c
===================================================================
--- vmx.c	(revision 4117)
+++ vmx.c	(working copy)
@@ -359,6 +359,8 @@
 	case MSR_IA32_SYSENTER_ESP:
 		data = vmcs_read32(GUEST_SYSENTER_ESP);
 		break;
+	case MSR_IA32_P5_MC_ADDR:
+	case MSR_IA32_P5_MC_TYPE:
 	case MSR_IA32_MC0_CTL:
 	case MSR_IA32_MCG_STATUS:
 	case MSR_IA32_MCG_CAP:

[-- Attachment #4: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #5: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2006-12-17 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15 17:59 Plan 9 install problems James Morris
2006-12-16  7:58 ` Avi Kivity
     [not found]   ` <4583A71D.50300-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-16 18:02     ` Michael Riepe
     [not found]       ` <458434C0.5010800-0QoEqw4nQxo@public.gmane.org>
2006-12-17  9:03         ` Avi Kivity
     [not found]           ` <458507E9.7080509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-17  9:48             ` Linux - KVM - MAC OS X sean-cz32UWRuVxBIf6P1QZMOBw
     [not found]               ` <48097.83.180.72.194.1166348910.squirrel-zlo8yn1fO0LtICQD1roDeV6hYfS7NtTn@public.gmane.org>
2006-12-17  9:53                 ` Avi Kivity
2006-12-17 12:28             ` Michael Riepe [this message]
     [not found]               ` <458537E0.8040800-0QoEqw4nQxo@public.gmane.org>
2006-12-17 12:43                 ` Plan 9 install problems Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458537E0.8040800@mr511.de \
    --to=michael-0qoeqw4nqxo@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox