Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbbHCIKQ (ORCPT ); Mon, 3 Aug 2015 04:10:16 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:35106 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbbHCIKN (ORCPT ); Mon, 3 Aug 2015 04:10:13 -0400 Subject: Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted To: "Zhang, Yang Z" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" References: <1438177055-26764-1-git-send-email-pbonzini@redhat.com> <1438177055-26764-2-git-send-email-pbonzini@redhat.com> <55BB2B62.1030605@redhat.com> Cc: "alex.williamson@redhat.com" , "srutherford@intel.com" From: Paolo Bonzini X-Enigmail-Draft-Status: N1110 Message-ID: <55BF21E1.5030100@redhat.com> Date: Mon, 3 Aug 2015 10:10:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1793 Lines: 40 On 03/08/2015 04:37, Zhang, Yang Z wrote: >> > 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. > > 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. I don't think the TMR fields of the virtual-APIC page are among the data structures that _controls_ VMX non-root operations, because: * it is not part of the virtualized APIC state is listed in 29.1.1 * read accesses from the APIC-access page simply return data from the corresponding page offset on the virtual-APIC page using the memory access type stored in IA32_VMX_BASIC_MSR. I think this explicitly says that the effects of 24.11.1 (especially non-deterministic behavior after a write) do not apply here. In any case, the TMR behavior introduced by the APICv patches is completely different from the hardware behavior, so it has to be fixed. The alternative is to inject level-triggered interrupts synchronously, without using posted interrupts. I'll write some testcases to understand the functioning of TMR in the virtual-APIC page, but the manual seems clear to me. Paolo -- 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/