public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: emulate read/write access to cr8
@ 2007-12-06 14:46 Joerg Roedel
       [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2007-12-06 14:46 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Joerg Roedel,
	Markus Rechberger, Joerg Roedel

From: Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>

This patch adds code to emulate the access to the cr8 register to the x86
instruction emulator in kvm.

Signed-off-by: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
Signed-off-by: Markus Rechberger <markus.rechberger-5C7GfCeVMHo@public.gmane.org>
---
 drivers/kvm/x86.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 6deb052..9db4e32 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -2236,6 +2236,8 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
 		return vcpu->cr3;
 	case 4:
 		return vcpu->cr4;
+	case 8:
+		return get_cr8(vcpu);
 	default:
 		vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
 		return 0;
@@ -2259,6 +2261,9 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val,
 	case 4:
 		set_cr4(vcpu, mk_cr_64(vcpu->cr4, val));
 		break;
+	case 8:
+		set_cr8(vcpu, val & 0xfUL);
+		break;
 	default:
 		vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
 	}
-- 
1.5.2.5




-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: emulate read/write access to cr8
       [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
@ 2007-12-06 15:34   ` Avi Kivity
  2007-12-06 17:38   ` Avi Kivity
  1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2007-12-06 15:34 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Markus Rechberger,
	Joerg Roedel

Joerg Roedel wrote:
> This patch adds code to emulate the access to the cr8 register to the x86
> instruction emulator in kvm.
>   

Applied, thanks.


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


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: emulate read/write access to cr8
       [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
  2007-12-06 15:34   ` Avi Kivity
@ 2007-12-06 17:38   ` Avi Kivity
       [not found]     ` <47583398.1080303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-12-06 17:38 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Markus Rechberger,
	Joerg Roedel

Joerg Roedel wrote:
> From: Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>
>
> This patch adds code to emulate the access to the cr8 register to the x86
> instruction emulator in kvm.
>
>   

I wrote a unit test for 'mov cr8', and it passes!

Seems we aren't trapping cr8 access at all for svm.

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


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: emulate read/write access to cr8
       [not found]     ` <47583398.1080303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-06 17:51       ` Avi Kivity
       [not found]         ` <475836B5.5070505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-12-06 17:51 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Markus Rechberger,
	Joerg Roedel

Avi Kivity wrote:
> Joerg Roedel wrote:
>   
>> From: Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>
>>
>> This patch adds code to emulate the access to the cr8 register to the x86
>> instruction emulator in kvm.
>>
>>   
>>     
>
> I wrote a unit test for 'mov cr8', and it passes!
>
> Seems we aren't trapping cr8 access at all for svm.
>
>   

Okay, I added mov cr8 trapping to svm.c.


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


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: emulate read/write access to cr8
       [not found]         ` <475836B5.5070505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-06 19:04           ` Joerg Roedel
  0 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2007-12-06 19:04 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Markus Rechberger,
	Joerg Roedel

On Thu, Dec 06, 2007 at 07:51:49PM +0200, Avi Kivity wrote:
> Avi Kivity wrote:
> >Joerg Roedel wrote:
> >  
> >>From: Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>
> >>
> >>This patch adds code to emulate the access to the cr8 register to the x86
> >>instruction emulator in kvm.
> >>
> >>      
> >
> >I wrote a unit test for 'mov cr8', and it passes!
> >
> >Seems we aren't trapping cr8 access at all for svm.
> >
> >  
> 
> Okay, I added mov cr8 trapping to svm.c.

I have cr8 access intercepted here, but this is not sufficient for
getting Vista 64bit running. Therefore I have not sent the patch yet.

-- 
           |           AMD Saxony Limited Liability Company & Co. KG
 Operating |         Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 System    |                  Register Court Dresden: HRA 4896
 Research  |              General Partner authorized to represent:
 Center    |             AMD Saxony LLC (Wilmington, Delaware, US)
           | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-06 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06 14:46 [PATCH] x86: emulate read/write access to cr8 Joerg Roedel
     [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2007-12-06 15:34   ` Avi Kivity
2007-12-06 17:38   ` Avi Kivity
     [not found]     ` <47583398.1080303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-06 17:51       ` Avi Kivity
     [not found]         ` <475836B5.5070505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-06 19:04           ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox