From: Zachary Amsden Subject: Re: [RFC PATCH 19/35] subarch support for control register accesses Date: Wed, 22 Mar 2006 00:55:12 -0800 Message-ID: <442110F0.9090805@vmware.com> References: <20060322063040.960068000@sorel.sous-sol.org> <20060322063754.391952000@sorel.sous-sol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060322063754.391952000@sorel.sous-sol.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Chris Wright Cc: virtualization@lists.osdl.org, Christian Limpach , xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, Ian Pratt List-Id: xen-devel@lists.xenproject.org Chris Wright wrote: > +#define read_cr4_safe() ({ \ > + unsigned int __dummy; \ > + /* This could fault if %cr4 does not exist */ \ > + __asm__("1: movl %%cr4, %0 \n" \ > + "2: \n" \ > + ".section __ex_table,\"a\" \n" \ > + ".long 1b,2b \n" \ > + ".previous \n" \ > + : "=r" (__dummy): "0" (0)); \ > + __dummy; \ > +}) I think you'll find trap and emulate quite sufficient for this one. > +#define stts() write_cr0(8 | read_cr0()) > Nit: You shouldn't need to redefine stts() in the subarch.