Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbbHCCh7 (ORCPT ); Sun, 2 Aug 2015 22:37:59 -0400 Received: from mga02.intel.com ([134.134.136.20]:63116 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbHCCh5 convert rfc822-to-8bit (ORCPT ); Sun, 2 Aug 2015 22:37:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,598,1432623600"; d="scan'208";a="534835777" From: "Zhang, Yang Z" To: Paolo Bonzini , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" CC: "alex.williamson@redhat.com" , "srutherford@intel.com" Subject: RE: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted Thread-Topic: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted Thread-Index: AQHQygPaQ9RT5A1SM0ONvbyHVLL0wp30qLewgAALZQCABN7OgA== Date: Mon, 3 Aug 2015 02:37:45 +0000 Message-ID: References: <1438177055-26764-1-git-send-email-pbonzini@redhat.com> <1438177055-26764-2-git-send-email-pbonzini@redhat.com> <55BB2B62.1030605@redhat.com> In-Reply-To: <55BB2B62.1030605@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1887 Lines: 43 Paolo Bonzini wrote on 2015-07-31: > > > On 31/07/2015 01:26, Zhang, Yang Z wrote: >>>> Do not compute TMR in advance. Instead, set the TMR just before >>>> the interrupt is accepted into the IRR. This limits the coupling >>>> between IOAPIC and LAPIC. >> >> Uh.., it back to original way which is wrong. You cannot modify the >> apic page(here is the TMR reg) directly when the corresponding VMCS >> may be used at same time. > > Where is this documented? The TMR is not part of the set of virtualized > APIC registers (TPR, PPR, EOI, ISR, IRR, ICR+ICR2; SDM 29.1.1). > > Only virtualized APIC register reads use the virtual TMR registers (SDM > 29.4.2 or 29.5), but these just read data from the corresponding field > in the virtual APIC page. It's not only for virtual apic page. All data structures that is used by VMCS(either directly inside in VMCS or referenced by pointer in a VMCS) need follow this rule: 24.11.4 Software Access to Related Structures In addition to data in the VMCS region itself, VMX non-root operation can be controlled by data structures that are referenced by pointers in a VMCS (for example, the I/O bitmaps). While the pointers to these data structures are parts of the VMCS, the data structures themselves are not. They are not accessible using VMREAD and VMWRITE but by ordinary memory writes. Software should ensure that each such data structure is modified only when no logical processor with a current VMCS that references it is in VMX non-root operation. Doing otherwise may lead to unpredictable behavior (including behaviors identified in Section 24.11.1). > > Paolo Best regards, Yang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/