diff options
author | Harald Freudenberger <freude@linux.vnet.ibm.com> | 2016-11-08 13:54:28 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-09-06 10:24:42 +0300 |
commit | 050349b5b71df52c24989037bd6515cb54c3ef35 (patch) | |
tree | 2c3f60dc0709e97964bf3a466ab07895830dc040 /arch/s390/include/asm/ap.h | |
parent | e7fc5146cfe4f1b10f2ed6c36b65248aa948abe8 (diff) | |
download | linux-050349b5b71df52c24989037bd6515cb54c3ef35.tar.xz |
s390/zcrypt: externalize AP config info query
KVM has a need to fetch the crypto configuration information
as it is returned by the PQAP(QCI) instruction. This patch
introduces a new API ap_query_configuration() which provides
this info in a handy way for the caller.
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/ap.h')
-rw-r--r-- | arch/s390/include/asm/ap.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/s390/include/asm/ap.h b/arch/s390/include/asm/ap.h index 0f3e6f38db55..8cefd6ed981d 100644 --- a/arch/s390/include/asm/ap.h +++ b/arch/s390/include/asm/ap.h @@ -61,4 +61,30 @@ struct ap_queue_status ap_test_queue(ap_qid_t qid, int tbit, unsigned long *info); +struct ap_config_info { + unsigned int apsc : 1; /* S bit */ + unsigned int apxa : 1; /* N bit */ + unsigned int qact : 1; /* C bit */ + unsigned int rc8a : 1; /* R bit */ + unsigned char _reserved1 : 4; + unsigned char _reserved2[3]; + unsigned char Na; /* max # of APs - 1 */ + unsigned char Nd; /* max # of Domains - 1 */ + unsigned char _reserved3[10]; + unsigned int apm[8]; /* AP ID mask */ + unsigned int aqm[8]; /* AP queue mask */ + unsigned int adm[8]; /* AP domain mask */ + unsigned char _reserved4[16]; +} __aligned(8); + +/* + * ap_query_configuration(): Fetch cryptographic config info + * + * Returns the ap configuration info fetched via PQAP(QCI). + * On success 0 is returned, on failure a negative errno + * is returned, e.g. if the PQAP(QCI) instruction is not + * available, the return value will be -EOPNOTSUPP. + */ +int ap_query_configuration(struct ap_config_info *info); + #endif /* _ASM_S390_AP_H_ */ |