public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SVM: do not intercept task switch with NPT
@ 2008-04-09 14:04 Joerg Roedel
  2008-04-11 12:36 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2008-04-09 14:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, Joerg Roedel

When KVM uses NPT there is no reason to intercept task switches. This patch
removes the intercept for it in that case.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 arch/x86/kvm/svm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index ad27346..51defe6 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -590,6 +590,7 @@ static void init_vmcb(struct vcpu_svm *svm)
 	if (npt_enabled) {
 		/* Setup VMCB for Nested Paging */
 		control->nested_ctl = 1;
+		control->intercept &= ~(1ULL << INTERCEPT_TASK_SWITCH);
 		control->intercept_exceptions &= ~(1 << PF_VECTOR);
 		control->intercept_cr_read &= ~(INTERCEPT_CR0_MASK|
 						INTERCEPT_CR3_MASK);
-- 
1.5.3.7



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH] SVM: do not intercept task switch with NPT
  2008-04-09 14:04 [PATCH] SVM: do not intercept task switch with NPT Joerg Roedel
@ 2008-04-11 12:36 ` Avi Kivity
  2008-04-11 12:46   ` Joerg Roedel
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2008-04-11 12:36 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: kvm-devel

Joerg Roedel wrote:
> When KVM uses NPT there is no reason to intercept task switches. This patch
> removes the intercept for it in that case.
>   

Applied, thanks.  I didn't know task switch and npt were related under svm.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH] SVM: do not intercept task switch with NPT
  2008-04-11 12:36 ` Avi Kivity
@ 2008-04-11 12:46   ` Joerg Roedel
  2008-04-11 12:52     ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2008-04-11 12:46 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

On Fri, Apr 11, 2008 at 03:36:57PM +0300, Avi Kivity wrote:
> Joerg Roedel wrote:
> >When KVM uses NPT there is no reason to intercept task switches. This patch
> >removes the intercept for it in that case.
> >  
> 
> Applied, thanks.  I didn't know task switch and npt were related under svm.

The only reason why task switch is intercepted is the cr3 switch it
involves. But with NPT we don't intercept cr3 switches anymore so we can
disable task switch intercept too.

Joerg

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


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

* Re: [PATCH] SVM: do not intercept task switch with NPT
  2008-04-11 12:46   ` Joerg Roedel
@ 2008-04-11 12:52     ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-04-11 12:52 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: kvm-devel

Joerg Roedel wrote:

 

>> Applied, thanks.  I didn't know task switch and npt were related under svm.
>>     
>
> The only reason why task switch is intercepted is the cr3 switch it
> involves. But with NPT we don't intercept cr3 switches anymore so we can
> disable task switch intercept too.
>   

Ah!  Of course.  Thanks.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

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

end of thread, other threads:[~2008-04-11 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 14:04 [PATCH] SVM: do not intercept task switch with NPT Joerg Roedel
2008-04-11 12:36 ` Avi Kivity
2008-04-11 12:46   ` Joerg Roedel
2008-04-11 12:52     ` Avi Kivity

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