ia64/xen-unstable

changeset 15661:522a1932111f

[IA64] Declarations for PKR

Added new declarations for protection keys and define
XEN_IA64_NPKRS representing number of PKRs for PV domains.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
author Alex Williamson <alex.williamson@hp.com>
date Mon Jul 30 16:07:11 2007 -0600 (2007-07-30)
parents 32825349924d
children 85c2f2d754ef
files xen/arch/ia64/xen/fw_emul.c xen/include/asm-ia64/xenkregs.h xen/include/asm-ia64/xenprocessor.h
line diff
     1.1 --- a/xen/arch/ia64/xen/fw_emul.c	Mon Jul 30 16:01:05 2007 -0600
     1.2 +++ b/xen/arch/ia64/xen/fw_emul.c	Mon Jul 30 16:07:11 2007 -0600
     1.3 @@ -669,7 +669,7 @@ xen_pal_emulator(unsigned long index, u6
     1.4  				 { .vw = 1,
     1.5  				   .phys_add_size = 44,
     1.6  				   .key_size = 16,
     1.7 -				   .max_pkr = 15,
     1.8 +				   .max_pkr = XEN_IA64_NPKRS,
     1.9  				   .hash_tag_id = 0x30,
    1.10  				   .max_dtr_entry = NDTRS - 1,
    1.11  				   .max_itr_entry = NITRS - 1,
     2.1 --- a/xen/include/asm-ia64/xenkregs.h	Mon Jul 30 16:01:05 2007 -0600
     2.2 +++ b/xen/include/asm-ia64/xenkregs.h	Mon Jul 30 16:07:11 2007 -0600
     2.3 @@ -38,13 +38,29 @@
     2.4  /* Some cr.itir declarations. */
     2.5  #define	IA64_ITIR_PS		2
     2.6  #define	IA64_ITIR_PS_LEN	6
     2.7 -#define IA64_ITIR_PS_MASK	(((__IA64_UL(1) << IA64_ITIR_PS_LEN) - 1) \
     2.8 -							<< IA64_ITIR_PS)
     2.9 +#define	IA64_ITIR_PS_MASK	(((__IA64_UL(1) << IA64_ITIR_PS_LEN) - 1) \
    2.10 + 							<< IA64_ITIR_PS)
    2.11  #define	IA64_ITIR_KEY		8
    2.12  #define	IA64_ITIR_KEY_LEN	24
    2.13  #define	IA64_ITIR_KEY_MASK	(((__IA64_UL(1) << IA64_ITIR_KEY_LEN) - 1) \
    2.14  							<< IA64_ITIR_KEY)
    2.15 -#define IA64_ITIR_PS_KEY(_ps, _key)	(((_ps) << IA64_ITIR_PS) | \
    2.16 -					(((_key) << IA64_ITIR_KEY)))
    2.17 +#define	IA64_ITIR_PS_KEY(_ps, _key)	(((_ps) << IA64_ITIR_PS) | \
    2.18 +					 (((_key) << IA64_ITIR_KEY)))
    2.19 +
    2.20 +/* Define Protection Key Register (PKR) */
    2.21 +#define	IA64_PKR_V		0
    2.22 +#define	IA64_PKR_WD		1
    2.23 +#define	IA64_PKR_RD		2
    2.24 +#define	IA64_PKR_XD		3
    2.25 +#define	IA64_PKR_MBZ0		4
    2.26 +#define	IA64_PKR_KEY		8
    2.27 +#define	IA64_PKR_KEY_LEN	24
    2.28 +#define	IA64_PKR_MBZ1		32
    2.29 +
    2.30 +#define	IA64_PKR_VALID		(1 << IA64_PKR_V)
    2.31 +#define	IA64_PKR_KEY_MASK	(((__IA64_UL(1) << IA64_PKR_KEY_LEN) - 1) \
    2.32 +							<< IA64_PKR_KEY)
    2.33 +
    2.34 +#define	XEN_IA64_NPKRS		15	/* Number of pkr's in PV */
    2.35  
    2.36  #endif /* _ASM_IA64_XENKREGS_H */
     3.1 --- a/xen/include/asm-ia64/xenprocessor.h	Mon Jul 30 16:01:05 2007 -0600
     3.2 +++ b/xen/include/asm-ia64/xenprocessor.h	Mon Jul 30 16:07:11 2007 -0600
     3.3 @@ -237,6 +237,19 @@ typedef union {
     3.4      u64 itir;
     3.5  } ia64_itir_t;
     3.6  
     3.7 +typedef union {
     3.8 +	u64 val;
     3.9 +	struct {
    3.10 +		u64 v  : 1;
    3.11 +		u64 wd : 1;
    3.12 +		u64 rd : 1;
    3.13 +		u64 xd : 1;
    3.14 +		u64 reserved1 : 4;
    3.15 +		u64 key : 24;
    3.16 +		u64 reserved2 : 32;
    3.17 +	};
    3.18 +} ia64_pkr_t;
    3.19 +
    3.20  #define dump_execution_state() printk("FIXME: implement ia64 dump_execution_state()\n");
    3.21  
    3.22  #endif // _ASM_IA64_XENPROCESSOR_H