Merge tag 's390-5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik: - Add support for IBM z15 machines. - Add SHA3 and CCA AES cipher key support in zcrypt and pkey refactoring. - Move to arch_stack_walk infrastructure for the stack unwinder. - Various kasan fixes and improvements. - Various command line parsing fixes. - Improve decompressor phase debuggability. - Lift no bss usage restriction for the early code. - Use refcount_t for reference counters for couple of places in mm code. - Logging improvements and return code fix in vfio-ccw code. - Couple of zpci fixes and minor refactoring. - Remove some outdated documentation. - Fix secure boot detection. - Other various minor code clean ups. * tag 's390-5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (48 commits) s390: remove pointless drivers-y in drivers/s390/Makefile s390/cpum_sf: Fix line length and format string s390/pci: fix MSI message data s390: add support for IBM z15 machines s390/crypto: Support for SHA3 via CPACF (MSA6) s390/startup: add pgm check info printing s390/crypto: xts-aes-s390 fix extra run-time crypto self tests finding vfio-ccw: fix error return code in vfio_ccw_sch_init() s390: vfio-ap: fix warning reset not completed s390/base: remove unused s390_base_mcck_handler s390/sclp: Fix bit checked for has_sipl s390/zcrypt: fix wrong handling of cca cipher keygenflags s390/kasan: add kdump support s390/setup: avoid using strncmp with hardcoded length s390/sclp: avoid using strncmp with hardcoded length s390/module: avoid using strncmp with hardcoded length s390/pci: avoid using strncmp with hardcoded length s390/kaslr: reserve memory for kasan usage s390/mem_detect: provide single get_mem_detect_end s390/cmma: reuse kstrtobool for option value parsing ...
This commit is contained in:
@@ -93,6 +93,10 @@
|
||||
#define CPACF_KIMD_SHA_1 0x01
|
||||
#define CPACF_KIMD_SHA_256 0x02
|
||||
#define CPACF_KIMD_SHA_512 0x03
|
||||
#define CPACF_KIMD_SHA3_224 0x20
|
||||
#define CPACF_KIMD_SHA3_256 0x21
|
||||
#define CPACF_KIMD_SHA3_384 0x22
|
||||
#define CPACF_KIMD_SHA3_512 0x23
|
||||
#define CPACF_KIMD_GHASH 0x41
|
||||
|
||||
/*
|
||||
@@ -103,6 +107,10 @@
|
||||
#define CPACF_KLMD_SHA_1 0x01
|
||||
#define CPACF_KLMD_SHA_256 0x02
|
||||
#define CPACF_KLMD_SHA_512 0x03
|
||||
#define CPACF_KLMD_SHA3_224 0x20
|
||||
#define CPACF_KLMD_SHA3_256 0x21
|
||||
#define CPACF_KLMD_SHA3_384 0x22
|
||||
#define CPACF_KLMD_SHA3_512 0x23
|
||||
|
||||
/*
|
||||
* function codes for the KMAC (COMPUTE MESSAGE AUTHENTICATION CODE)
|
||||
|
@@ -9,6 +9,8 @@
|
||||
#ifndef _ASM_S390_GMAP_H
|
||||
#define _ASM_S390_GMAP_H
|
||||
|
||||
#include <linux/refcount.h>
|
||||
|
||||
/* Generic bits for GMAP notification on DAT table entry changes. */
|
||||
#define GMAP_NOTIFY_SHADOW 0x2
|
||||
#define GMAP_NOTIFY_MPROT 0x1
|
||||
@@ -46,7 +48,7 @@ struct gmap {
|
||||
struct radix_tree_root guest_to_host;
|
||||
struct radix_tree_root host_to_guest;
|
||||
spinlock_t guest_table_lock;
|
||||
atomic_t ref_count;
|
||||
refcount_t ref_count;
|
||||
unsigned long *table;
|
||||
unsigned long asce;
|
||||
unsigned long asce_end;
|
||||
|
@@ -79,4 +79,16 @@ static inline void get_mem_detect_reserved(unsigned long *start,
|
||||
*size = 0;
|
||||
}
|
||||
|
||||
static inline unsigned long get_mem_detect_end(void)
|
||||
{
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
|
||||
if (mem_detect.count) {
|
||||
__get_mem_detect_block(mem_detect.count - 1, &start, &end);
|
||||
return end;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -86,6 +86,7 @@ extern unsigned long zero_page_mask;
|
||||
*/
|
||||
extern unsigned long VMALLOC_START;
|
||||
extern unsigned long VMALLOC_END;
|
||||
#define VMALLOC_DEFAULT_SIZE ((128UL << 30) - MODULES_LEN)
|
||||
extern struct page *vmemmap;
|
||||
|
||||
#define VMEM_MAX_PHYS ((unsigned long) vmemmap)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Kernelspace interface to the pkey device driver
|
||||
*
|
||||
* Copyright IBM Corp. 2016
|
||||
* Copyright IBM Corp. 2016,2019
|
||||
*
|
||||
* Author: Harald Freudenberger <freude@de.ibm.com>
|
||||
*
|
||||
@@ -15,116 +15,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <uapi/asm/pkey.h>
|
||||
|
||||
/*
|
||||
* Generate (AES) random secure key.
|
||||
* @param cardnr may be -1 (use default card)
|
||||
* @param domain may be -1 (use default domain)
|
||||
* @param keytype one of the PKEY_KEYTYPE values
|
||||
* @param seckey pointer to buffer receiving the secure key
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_genseckey(__u16 cardnr, __u16 domain,
|
||||
__u32 keytype, struct pkey_seckey *seckey);
|
||||
|
||||
/*
|
||||
* Generate (AES) secure key with given key value.
|
||||
* @param cardnr may be -1 (use default card)
|
||||
* @param domain may be -1 (use default domain)
|
||||
* @param keytype one of the PKEY_KEYTYPE values
|
||||
* @param clrkey pointer to buffer with clear key data
|
||||
* @param seckey pointer to buffer receiving the secure key
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_clr2seckey(__u16 cardnr, __u16 domain, __u32 keytype,
|
||||
const struct pkey_clrkey *clrkey,
|
||||
struct pkey_seckey *seckey);
|
||||
|
||||
/*
|
||||
* Derive (AES) proteced key from the (AES) secure key blob.
|
||||
* @param cardnr may be -1 (use default card)
|
||||
* @param domain may be -1 (use default domain)
|
||||
* @param seckey pointer to buffer with the input secure key
|
||||
* @param protkey pointer to buffer receiving the protected key and
|
||||
* additional info (type, length)
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_sec2protkey(__u16 cardnr, __u16 domain,
|
||||
const struct pkey_seckey *seckey,
|
||||
struct pkey_protkey *protkey);
|
||||
|
||||
/*
|
||||
* Derive (AES) protected key from a given clear key value.
|
||||
* @param keytype one of the PKEY_KEYTYPE values
|
||||
* @param clrkey pointer to buffer with clear key data
|
||||
* @param protkey pointer to buffer receiving the protected key and
|
||||
* additional info (type, length)
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_clr2protkey(__u32 keytype,
|
||||
const struct pkey_clrkey *clrkey,
|
||||
struct pkey_protkey *protkey);
|
||||
|
||||
/*
|
||||
* Search for a matching crypto card based on the Master Key
|
||||
* Verification Pattern provided inside a secure key.
|
||||
* @param seckey pointer to buffer with the input secure key
|
||||
* @param cardnr pointer to cardnr, receives the card number on success
|
||||
* @param domain pointer to domain, receives the domain number on success
|
||||
* @param verify if set, always verify by fetching verification pattern
|
||||
* from card
|
||||
* @return 0 on success, negative errno value on failure. If no card could be
|
||||
* found, -ENODEV is returned.
|
||||
*/
|
||||
int pkey_findcard(const struct pkey_seckey *seckey,
|
||||
__u16 *cardnr, __u16 *domain, int verify);
|
||||
|
||||
/*
|
||||
* Find card and transform secure key to protected key.
|
||||
* @param seckey pointer to buffer with the input secure key
|
||||
* @param protkey pointer to buffer receiving the protected key and
|
||||
* additional info (type, length)
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_skey2pkey(const struct pkey_seckey *seckey,
|
||||
struct pkey_protkey *protkey);
|
||||
|
||||
/*
|
||||
* Verify the given secure key for being able to be useable with
|
||||
* the pkey module. Check for correct key type and check for having at
|
||||
* least one crypto card being able to handle this key (master key
|
||||
* or old master key verification pattern matches).
|
||||
* Return some info about the key: keysize in bits, keytype (currently
|
||||
* only AES), flag if key is wrapped with an old MKVP.
|
||||
* @param seckey pointer to buffer with the input secure key
|
||||
* @param pcardnr pointer to cardnr, receives the card number on success
|
||||
* @param pdomain pointer to domain, receives the domain number on success
|
||||
* @param pkeysize pointer to keysize, receives the bitsize of the key
|
||||
* @param pattributes pointer to attributes, receives additional info
|
||||
* PKEY_VERIFY_ATTR_AES if the key is an AES key
|
||||
* PKEY_VERIFY_ATTR_OLD_MKVP if key has old mkvp stored in
|
||||
* @return 0 on success, negative errno value on failure. If no card could
|
||||
* be found which is able to handle this key, -ENODEV is returned.
|
||||
*/
|
||||
int pkey_verifykey(const struct pkey_seckey *seckey,
|
||||
u16 *pcardnr, u16 *pdomain,
|
||||
u16 *pkeysize, u32 *pattributes);
|
||||
|
||||
/*
|
||||
* In-kernel API: Generate (AES) random protected key.
|
||||
* @param keytype one of the PKEY_KEYTYPE values
|
||||
* @param protkey pointer to buffer receiving the protected key
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_genprotkey(__u32 keytype, struct pkey_protkey *protkey);
|
||||
|
||||
/*
|
||||
* In-kernel API: Verify an (AES) protected key.
|
||||
* @param protkey pointer to buffer containing the protected key to verify
|
||||
* @return 0 on success, negative errno value on failure. In case the protected
|
||||
* key is not valid -EKEYREJECTED is returned
|
||||
*/
|
||||
int pkey_verifyprotkey(const struct pkey_protkey *protkey);
|
||||
|
||||
/*
|
||||
* In-kernel API: Transform an key blob (of any type) into a protected key.
|
||||
* @param key pointer to a buffer containing the key blob
|
||||
@@ -132,7 +22,7 @@ int pkey_verifyprotkey(const struct pkey_protkey *protkey);
|
||||
* @param protkey pointer to buffer receiving the protected key
|
||||
* @return 0 on success, negative errno value on failure
|
||||
*/
|
||||
int pkey_keyblob2pkey(const __u8 *key, __u32 keylen,
|
||||
int pkey_keyblob2pkey(const u8 *key, u32 keylen,
|
||||
struct pkey_protkey *protkey);
|
||||
|
||||
#endif /* _KAPI_PKEY_H */
|
||||
|
@@ -324,11 +324,9 @@ static inline void __noreturn disabled_wait(void)
|
||||
* Basic Machine Check/Program Check Handler.
|
||||
*/
|
||||
|
||||
extern void s390_base_mcck_handler(void);
|
||||
extern void s390_base_pgm_handler(void);
|
||||
extern void s390_base_ext_handler(void);
|
||||
|
||||
extern void (*s390_base_mcck_handler_fn)(void);
|
||||
extern void (*s390_base_pgm_handler_fn)(void);
|
||||
extern void (*s390_base_ext_handler_fn)(void);
|
||||
|
||||
|
@@ -83,6 +83,7 @@ struct parmarea {
|
||||
extern int noexec_disabled;
|
||||
extern int memory_end_set;
|
||||
extern unsigned long memory_end;
|
||||
extern unsigned long vmalloc_size;
|
||||
extern unsigned long max_physmem_end;
|
||||
extern unsigned long __swsusp_reset_dma;
|
||||
|
||||
|
@@ -71,11 +71,16 @@ extern void *__memmove(void *dest, const void *src, size_t n);
|
||||
#define memcpy(dst, src, len) __memcpy(dst, src, len)
|
||||
#define memmove(dst, src, len) __memmove(dst, src, len)
|
||||
#define memset(s, c, n) __memset(s, c, n)
|
||||
#define strlen(s) __strlen(s)
|
||||
|
||||
#define __no_sanitize_prefix_strfunc(x) __##x
|
||||
|
||||
#ifndef __NO_FORTIFY
|
||||
#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define __no_sanitize_prefix_strfunc(x) x
|
||||
#endif /* defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__) */
|
||||
|
||||
void *__memset16(uint16_t *s, uint16_t v, size_t count);
|
||||
@@ -163,8 +168,8 @@ static inline char *strcpy(char *dst, const char *src)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __HAVE_ARCH_STRLEN
|
||||
static inline size_t strlen(const char *s)
|
||||
#if defined(__HAVE_ARCH_STRLEN) || (defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__))
|
||||
static inline size_t __no_sanitize_prefix_strfunc(strlen)(const char *s)
|
||||
{
|
||||
register unsigned long r0 asm("0") = 0;
|
||||
const char *tmp = s;
|
||||
|
Reference in New Issue
Block a user