diff mbox

[11/12] kvm/svm: handle #pf intercepts in nested_svm_exit_handled directly

Message ID 1248872192-30881-12-git-send-email-joerg.roedel@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joerg Roedel July 29, 2009, 12:56 p.m. UTC
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 arch/x86/kvm/svm.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

Comments

Alexander Graf July 29, 2009, 2:20 p.m. UTC | #1
Joerg Roedel wrote:
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

Acked-by: Alexander Graf <agraf@suse.de>

I'm really starting to miss comments on the commits ...
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf July 29, 2009, 2:41 p.m. UTC | #2
Avi Kivity wrote:
> On 07/29/2009 05:20 PM, Alexander Graf wrote:
>> Joerg Roedel wrote:
>>   
>>> Signed-off-by: Joerg Roedel<joerg.roedel@amd.com>
>>>      
>>
>> Acked-by: Alexander Graf<agraf@suse.de>
>>
>> I'm really starting to miss comments on the commits ...
>>    
>
> Me too.  Why ack then?

Because the patch is fine. It's just the description that's missing.
Shouldn't I ack when the only thing I don't like is the description?


Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity July 29, 2009, 2:44 p.m. UTC | #3
On 07/29/2009 05:20 PM, Alexander Graf wrote:
> Joerg Roedel wrote:
>    
>> Signed-off-by: Joerg Roedel<joerg.roedel@amd.com>
>>      
>
> Acked-by: Alexander Graf<agraf@suse.de>
>
> I'm really starting to miss comments on the commits ...
>    

Me too.  Why ack then?

Joerg, not only is this interesting, it is also complicated.  Please 
provide more detailed change logs.  The change, motivation, if a fix, 
what scenario does it fix.
Alexander Graf July 29, 2009, 2:46 p.m. UTC | #4
Avi Kivity wrote:
> On 07/29/2009 05:41 PM, Alexander Graf wrote:
>>> Me too.  Why ack then?
>>>      
>>
>> Because the patch is fine. It's just the description that's missing.
>> Shouldn't I ack when the only thing I don't like is the description?
>>    
>
> The description is part of the patch, an important one.

Ok, no ack for empty description patches then :-).

Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity July 29, 2009, 2:49 p.m. UTC | #5
On 07/29/2009 05:41 PM, Alexander Graf wrote:
>> Me too.  Why ack then?
>>      
>
> Because the patch is fine. It's just the description that's missing.
> Shouldn't I ack when the only thing I don't like is the description?
>    

The description is part of the patch, an important one.
diff mbox

Patch

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1a44e43..381ed38 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1498,6 +1498,9 @@  static int nested_svm_exit_handled_msr(struct vcpu_svm *svm,
 	return 0;
 }
 
+/*
+ * If this function returns true, this #vmexit was already handled
+ */
 static int nested_svm_exit_handled(struct vcpu_svm *svm, bool kvm_override)
 {
 	u32 exit_code = svm->vmcb->control.exit_code;
@@ -1515,8 +1518,27 @@  static int nested_svm_exit_handled(struct vcpu_svm *svm, bool kvm_override)
 			break;
 		/* When we're shadowing, trap PFs */
 		case SVM_EXIT_EXCP_BASE + PF_VECTOR:
-			if (!npt_enabled)
-				return 0;
+			if (!npt_enabled) {
+				u64 fault_address;
+				u32 error_code;
+
+				fault_address  = svm->vmcb->control.exit_info_2;
+				error_code     = svm->vmcb->control.exit_info_1;
+
+				kvm_mmu_page_fault(&svm->vcpu,
+						   fault_address,
+						   error_code);
+
+				/*
+				 * If we are still nested here the pending
+				 * irqs/exceptions must be reinjected
+				 */
+				//if (is_nested(svm))
+				//	svm_complete_interrupts(svm);
+
+				return true;
+			}
+
 			break;
 		default:
 			break;