From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH RFC] x86/kvm/lapic: always disable MMIO interface in x2APIC mode Date: Mon, 30 Jul 2018 11:14:54 +0200 Message-ID: <87sh41nkz5.fsf@vitty.brq.redhat.com> References: <20180727144448.9606-1-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Jim Mattson , kvm list , Radim =?utf-8?B?S3LEjW3DocWZ?= , the arch/x86 maintainers , LKML To: Paolo Bonzini Return-path: In-Reply-To: (Paolo Bonzini's message of "Fri, 27 Jul 2018 19:00:38 +0200") Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Paolo Bonzini writes: > On 27/07/2018 18:48, Jim Mattson wrote: >> On a physical machine, I would expect the default local APIC page to >> fall in the PCI hole, so it would be correct to sink writes and to >> return all ones for reads. Does qemu implement a PCI hole, and does >> this address fall into it? > > It does implement a PCI hole, but when using the kernel LAPIC it expects > that only devices write to that range; therefore that address doesn't > fall into the PCI hole, and instead it generates an MSIs. Yes, and that's why I believe it's correct to never forward lapic reads/writes from KVM to userspace when lapic is in kernel. "RFC" was mostly about the inconsistency with the case when APIC access page is in use. To be 100% correct I would suggest to somehow make it behave like MMIO hole in case we're in x2APIC/disabled mode too. -- Vitaly