From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPyjL-0005vU-St for qemu-devel@nongnu.org; Fri, 27 May 2011 11:13:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPyjK-00050N-RR for qemu-devel@nongnu.org; Fri, 27 May 2011 11:13:39 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:34988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPyjK-00050D-MI for qemu-devel@nongnu.org; Fri, 27 May 2011 11:13:38 -0400 Date: Fri, 27 May 2011 08:13:31 -0700 From: Josh Triplett Message-ID: <20110527151330.GA10016@leaf> References: <20110526090804.GA32647@leaf> <59EA76FC-950D-4397-962C-338CBAE71E33@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59EA76FC-950D-4397-962C-338CBAE71E33@suse.de> Subject: Re: [Qemu-devel] [PATCH] target-i386: GPF on invalid MSRs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On Thu, May 26, 2011 at 11:12:12AM +0200, Alexander Graf wrote: > On 26.05.2011, at 11:08, Josh Triplett wrote: > > qemu currently returns 0 for rdmsr on invalid MSRs, and ignores wrmsr on > > invalid MSRs. Real x86 processors GPF on invalid MSRs, which allows > > software to detect unavailable MSRs. Emulate this behavior correctly in > > qemu. > > > > Bug discovered via the BIOS Implementation Test Suite > > ; fix tested the same way, for both 32-bit and > > 64-bit x86. > > This would break a _lot_ of guests that work just fine today, as qemu doesn't handle all the necessary MSRs. It also fixes guests that rely on the GPF to indicate the absence of an MSR, and assume that the lack of GPF means the availability of that MSR. Silently returning 0 for unknown MSRs means silent breakage. What (buggy) guests expect to use random model-specific registers without either handling GPFs or checking the CPU model first? What MSRs do those guests expect that qemu doesn't currently implement? If this represents a workaround for buggy guests, then may I add an option to control this behavior? - Josh Triplett