From mboxrd@z Thu Jan 1 00:00:00 1970 From: "=?utf-8?B?WmhhbmcgSGFveXU=?=" Subject: =?utf-8?B?UmU6IEhvdyBkb2VzIGt2bSBzdXBwb3J0IHgyYXBpYz8=?= Date: Wed, 11 Jun 2014 09:33:51 +0800 Message-ID: <201406110933486245462@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: "=?utf-8?B?Smlkb25nIFhpYW8=?=" , "=?utf-8?B?S1ZN?=" Return-path: Received: from smtp.sanfor.com ([58.251.49.30]:45137 "EHLO mail.sangfor.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753219AbaFKBeT (ORCPT ); Tue, 10 Jun 2014 21:34:19 -0400 Sender: kvm-owner@vger.kernel.org List-ID: > Hi, > > According to this: > > https://github.com/torvalds/linux/commit/0d1de2d901f4ba0972a3886496a44fb1d3300dbd > > It looks like kvm have been supporting x2apic since kernel 2.6.32, or > even earlier. > This patch is to emulate x2apic for guest, then guest can benefit from some advantages of x2apic, like using RDMSR/WRMSR instead of mmio. > However, this following patch: > > https://github.com/torvalds/linux/commit/8d14695f9542e9e0195d6e41ddaa52c32322adf5 > > Also claims that adding support for x2apic. But this later patch was > for kernel 3.9. This patch is to support virtual x2apic mode, which can virtualizing MSR-based APIC accesses by configuring MSR bitmaps, you can specify some MSR-based accesses without VM exit, the other MSR-based accesses with VM exit, which belongs to APIC virtualization from certain angle. > > So I am very confused: > > First, what's the difference between these two patches? Or say, does > kvm support x2apic since kernel 2.6.32, or since kernel 3.9? > kvm support x2apic since kernel 2.6.32, but not support virtual x2apic mode until kernel 3.9. > Second, can guest use x2apic even if the host does not? (Assuming qemu >has exposed this feature to guest.) The word "use" means something > like, accessing x2apic registers, setting the x2apic enable bit in > IA32_APICBASE MSR (i.e. bit 10). > Yes, you can use x2apic even if the PCPU does not support, and benefit from it, like performance bonus from MSR accesses instead of MMIO. But, if I remember correctly, if your guest does not support interrupt-remmping, you only can use physical destination mode when using x2apic, please see enable_IR_x2apic(). > -Jidong