From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: APIC_ID in apic_reg_write() Date: Wed, 29 Apr 2015 21:07:49 +0200 Message-ID: <55412C05.4090705@siemens.com> References: <55412433.7080805@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Bandan Das Return-path: Received: from david.siemens.de ([192.35.17.14]:50720 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbbD2TH4 (ORCPT ); Wed, 29 Apr 2015 15:07:56 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Am 2015-04-29 um 20:54 schrieb Bandan Das: > Jan Kiszka writes: > >> Am 2015-04-29 um 18:47 schrieb Bandan Das: >>> >>> Why do we allow writes to APIC_ID ? On all _newer_ processors, it's >>> read only. The spec doesn't explicitly mention it though, or atleast >>> I couldn't find it. Does userspace have a reason to modify it ? >> >> The APIC ID is read-only for x2APIC. It remains R/W for xAPIC. > > Are you sure ? In 10.4 of the SDM, there is Note that says > "In processors based on Intel microarchitecture code name Nehalem the Local APIC ID > Register is no longer Read/Write; it is Read Only." Indeed - confusing, specifically as it is placed there without a direct link to the corresponding row in the table. And it doesn't say "since" or so. > > And I can verify on a SandyBridge and Haswell system that it's RO there too. So the APIC just ignores the writes, it doesn't through #GP at least. > > In fact, that was one of the reasons I had submitted a patch to remove > verify_local_APIC() from x86/kernel/apic.c (4399c03c678) If I am wrong we need to > revert atleast the associated commit message :) Well, we can't remove APIC ID modification support from KVM, though, because older CPU types we may want to emulate correctly had that feature. But we may have to make it configurable to ensure accurate behaviour. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux