From patchwork Thu Apr 25 07:51:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nakajima, Jun" X-Patchwork-Id: 2487411 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 841703FC64 for ; Thu, 25 Apr 2013 07:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756154Ab3DYHvY (ORCPT ); Thu, 25 Apr 2013 03:51:24 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:47594 "EHLO mail-vc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755873Ab3DYHvX (ORCPT ); Thu, 25 Apr 2013 03:51:23 -0400 Received: by mail-vc0-f173.google.com with SMTP id ia10so1240429vcb.32 for ; Thu, 25 Apr 2013 00:51:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=yAAMRtCRRYNhJeLVyYaZ03hkkvEXDMju7QooXeSnNfw=; b=Y/a7HBygL7KDlGjbGUM1mtN1pPFya6nKmaTZerzPcV/w26DeOulZzilx/ce5egDkfT zEXg5w3b04ysRrkFuaUe7VigGwEMBE2ZDdS0dUa0iaeQcEsCAfqlpA0L4lhNS2HM/cWd 2525eZhBeCkYY08tqQACN86i60Rgcug8EoC9uBHYGinHXjAN/43dyBcIwmHugxpkX8WD EbvHOFNBkq83FarvicGMpGrhXLYU6obk3hpAsQlizELQ5fo3qTqwFM+UGvcw+ETv/DeV Da+cYuXiCv6FOWjod58amnLEZW9HmVqO2udNotfS6Fs9nRuBZHM+CpfFxK0Yf+htwwnf Exrw== MIME-Version: 1.0 X-Received: by 10.220.189.9 with SMTP id dc9mr13216173vcb.8.1366876282990; Thu, 25 Apr 2013 00:51:22 -0700 (PDT) Received: by 10.58.64.196 with HTTP; Thu, 25 Apr 2013 00:51:22 -0700 (PDT) Date: Thu, 25 Apr 2013 00:51:22 -0700 Message-ID: Subject: [PATCH 06/12] Subject: [PATCH 06/10] nEPT: Some additional comments From: "Nakajima, Jun" To: "kvm@vger.kernel.org" X-Gm-Message-State: ALoCoQl02+aDbHQuTRLkOiRjPffo8bAFpHtLw1XVbAT8z5phsJX93Yk6ANoHV7Agb/5CUFR/oEEg Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Some additional comments to preexisting code: Explain who (L0 or L1) handles EPT violation and misconfiguration exits. Don't mention "shadow on either EPT or shadow" as the only two options. Signed-off-by: Nadav Har'El Signed-off-by: Jun Nakajima modified: arch/x86/kvm/vmx.c --- arch/x86/kvm/vmx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING); -- 1.8.2.1.610.g562af5b -- 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 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d4bfd32..0e99b15 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6126,7 +6126,20 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) return nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES); case EXIT_REASON_EPT_VIOLATION: + /* + * L0 always deals with the EPT violation. If nested EPT is + * used, and the nested mmu code discovers that the address is + * missing in the guest EPT table (EPT12), the EPT violation + * will be injected with nested_ept_inject_page_fault() + */ + return 0; case EXIT_REASON_EPT_MISCONFIG: + /* + * L2 never uses directly L1's EPT, but rather L0's own EPT + * table (shadow on EPT) or a merged EPT table that L0 built + * (EPT on EPT). So any problems with the structure of the + * table is L0's fault. + */ return 0; case EXIT_REASON_WBINVD: