[RFC PATCH 19/35] subarch support for control register accesses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Zachary Amsden (zach@xxxxxxxxxx) wrote:
> 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.

Heh ;-)

> >+#define stts() write_cr0(8 | read_cr0())
> >  
> 
> Nit: You shouldn't need to redefine stts() in the subarch.

Yes, you're right, better to keep things consolidated.

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux