Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/s390/linux

Pull s390 updates from Martin Schwidefsky:

 - A couple of patches for the zcrypt driver:
     + Add two masks to determine which AP cards and queues are host
       devices, this will be useful for KVM AP device passthrough
     + Add-on patch to improve the parsing of the new apmask and aqmask
     + Some code beautification

 - Second try to reenable the GCC plugins, the first patch set had a
   patch to do this but the merge somehow missed this

 - Remove the s390 specific GCC version check and use the generic one

 - Three patches for kdump, two bug fixes and one cleanup

 - Three patches for the PCI layer, one bug fix and two cleanups

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: remove gcc version check (4.3 or newer)
  s390/zcrypt: hex string mask improvements for apmask and aqmask.
  s390/zcrypt: AP bus support for alternate driver(s)
  s390/zcrypt: code beautify
  s390/zcrypt: switch return type to bool for ap_instructions_available()
  s390/kdump: Remove kzalloc_panic
  s390/kdump: Fix memleak in nt_vmcoreinfo
  s390/kdump: Make elfcorehdr size calculation ABI compliant
  s390/pci: remove fmb address from debug output
  s390/pci: remove stale rc
  s390/pci: fix out of bounds access during irq setup
  s390/zcrypt: fix ap_instructions_available() returncodes
  s390: reenable gcc plugins for real
  • Loading branch information
torvalds committed Aug 24, 2018
2 parents 40c431a + 4ec8483 commit e1dbc5a
Show file tree
Hide file tree
Showing 27 changed files with 706 additions and 300 deletions.
2 changes: 1 addition & 1 deletion arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ config S390
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_TRACER
select HAVE_FUTEX_CMPXCHG if FUTEX
select HAVE_GCC_PLUGINS if BROKEN
select HAVE_GCC_PLUGINS
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZ4
Expand Down
14 changes: 7 additions & 7 deletions arch/s390/include/asm/ap.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ struct ap_queue_status {
/**
* ap_intructions_available() - Test if AP instructions are available.
*
* Returns 0 if the AP instructions are installed.
* Returns true if the AP instructions are installed, otherwise false.
*/
static inline int ap_instructions_available(void)
static inline bool ap_instructions_available(void)
{
register unsigned long reg0 asm ("0") = AP_MKQID(0, 0);
register unsigned long reg1 asm ("1") = -ENODEV;
register unsigned long reg2 asm ("2");
register unsigned long reg1 asm ("1") = 0;
register unsigned long reg2 asm ("2") = 0;

asm volatile(
" .long 0xb2af0000\n" /* PQAP(TAPQ) */
"0: la %0,0\n"
"0: la %0,1\n"
"1:\n"
EX_TABLE(0b, 1b)
: "+d" (reg1), "=d" (reg2)
: "+d" (reg1), "+d" (reg2)
: "d" (reg0)
: "cc");
return reg1;
return reg1 != 0;
}

/**
Expand Down
72 changes: 36 additions & 36 deletions arch/s390/include/uapi/asm/zcrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
* - length(n_modulus) = inputdatalength
*/
struct ica_rsa_modexpo {
char __user * inputdata;
unsigned int inputdatalength;
char __user * outputdata;
unsigned int outputdatalength;
char __user * b_key;
char __user * n_modulus;
char __user *inputdata;
unsigned int inputdatalength;
char __user *outputdata;
unsigned int outputdatalength;
char __user *b_key;
char __user *n_modulus;
};

/**
Expand All @@ -55,15 +55,15 @@ struct ica_rsa_modexpo {
* - length(u_mult_inv) = inputdatalength/2 + 8
*/
struct ica_rsa_modexpo_crt {
char __user * inputdata;
unsigned int inputdatalength;
char __user * outputdata;
unsigned int outputdatalength;
char __user * bp_key;
char __user * bq_key;
char __user * np_prime;
char __user * nq_prime;
char __user * u_mult_inv;
char __user *inputdata;
unsigned int inputdatalength;
char __user *outputdata;
unsigned int outputdatalength;
char __user *bp_key;
char __user *bq_key;
char __user *np_prime;
char __user *nq_prime;
char __user *u_mult_inv;
};

/**
Expand Down Expand Up @@ -93,18 +93,18 @@ struct CPRBX {
unsigned int req_extbl; /* request extension block len */
unsigned char pad_001[4]; /* reserved */
unsigned int rpld_extbl; /* replied extension block len */
unsigned char padx000[16 - sizeof (char *)];
unsigned char * req_parmb; /* request parm block 'address' */
unsigned char padx001[16 - sizeof (char *)];
unsigned char * req_datab; /* request data block 'address' */
unsigned char padx002[16 - sizeof (char *)];
unsigned char * rpl_parmb; /* reply parm block 'address' */
unsigned char padx003[16 - sizeof (char *)];
unsigned char * rpl_datab; /* reply data block 'address' */
unsigned char padx004[16 - sizeof (char *)];
unsigned char * req_extb; /* request extension block 'addr'*/
unsigned char padx005[16 - sizeof (char *)];
unsigned char * rpl_extb; /* reply extension block 'address'*/
unsigned char padx000[16 - sizeof(char *)];
unsigned char *req_parmb; /* request parm block 'address' */
unsigned char padx001[16 - sizeof(char *)];
unsigned char *req_datab; /* request data block 'address' */
unsigned char padx002[16 - sizeof(char *)];
unsigned char *rpl_parmb; /* reply parm block 'address' */
unsigned char padx003[16 - sizeof(char *)];
unsigned char *rpl_datab; /* reply data block 'address' */
unsigned char padx004[16 - sizeof(char *)];
unsigned char *req_extb; /* request extension block 'addr'*/
unsigned char padx005[16 - sizeof(char *)];
unsigned char *rpl_extb; /* reply extension block 'address'*/
unsigned short ccp_rtcode; /* server return code */
unsigned short ccp_rscode; /* server reason code */
unsigned int mac_data_len; /* Mac Data Length */
Expand All @@ -127,17 +127,17 @@ struct ica_xcRB {
unsigned int user_defined;
unsigned short request_ID;
unsigned int request_control_blk_length;
unsigned char padding1[16 - sizeof (char *)];
char __user * request_control_blk_addr;
unsigned char padding1[16 - sizeof(char *)];
char __user *request_control_blk_addr;
unsigned int request_data_length;
char padding2[16 - sizeof (char *)];
char __user * request_data_address;
char padding2[16 - sizeof(char *)];
char __user *request_data_address;
unsigned int reply_control_blk_length;
char padding3[16 - sizeof (char *)];
char __user * reply_control_blk_addr;
char padding3[16 - sizeof(char *)];
char __user *reply_control_blk_addr;
unsigned int reply_data_length;
char padding4[16 - sizeof (char *)];
char __user * reply_data_addr;
char padding4[16 - sizeof(char *)];
char __user *reply_data_addr;
unsigned short priority_window;
unsigned int status;
} __attribute__((packed));
Expand Down Expand Up @@ -233,7 +233,7 @@ struct zcrypt_device_matrix_ext {
struct zcrypt_device_status_ext device[MAX_ZDEV_ENTRIES_EXT];
};

#define AUTOSELECT ((unsigned int)0xFFFFFFFF)
#define AUTOSELECT 0xFFFFFFFF

#define ZCRYPT_IOCTL_MAGIC 'z'

Expand Down
8 changes: 0 additions & 8 deletions arch/s390/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
#include <asm/gmap.h>
#include <asm/nmi.h>

/*
* Make sure that the compiler is new enough. We want a compiler that
* is known to work with the "Q" assembler constraint.
*/
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
#error Your compiler is too old; please use version 4.3 or newer
#endif

int main(void)
{
/* task struct offsets */
Expand Down
70 changes: 34 additions & 36 deletions arch/s390/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,6 @@ int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from,
prot);
}

/*
* Alloc memory and panic in case of ENOMEM
*/
static void *kzalloc_panic(int len)
{
void *rc;

rc = kzalloc(len, GFP_KERNEL);
if (!rc)
panic("s390 kdump kzalloc (%d) failed", len);
return rc;
}

static const char *nt_name(Elf64_Word type)
{
const char *name = "LINUX";
Expand Down Expand Up @@ -451,11 +438,15 @@ static void *get_vmcoreinfo_old(unsigned long *size)
if (copy_oldmem_kernel(nt_name, addr + sizeof(note),
sizeof(nt_name) - 1))
return NULL;
if (strcmp(nt_name, "VMCOREINFO") != 0)
if (strcmp(nt_name, VMCOREINFO_NOTE_NAME) != 0)
return NULL;
vmcoreinfo = kzalloc(note.n_descsz, GFP_KERNEL);
if (!vmcoreinfo)
return NULL;
vmcoreinfo = kzalloc_panic(note.n_descsz);
if (copy_oldmem_kernel(vmcoreinfo, addr + 24, note.n_descsz))
if (copy_oldmem_kernel(vmcoreinfo, addr + 24, note.n_descsz)) {
kfree(vmcoreinfo);
return NULL;
}
*size = note.n_descsz;
return vmcoreinfo;
}
Expand All @@ -465,39 +456,38 @@ static void *get_vmcoreinfo_old(unsigned long *size)
*/
static void *nt_vmcoreinfo(void *ptr)
{
const char *name = VMCOREINFO_NOTE_NAME;
unsigned long size;
void *vmcoreinfo;

vmcoreinfo = os_info_old_entry(OS_INFO_VMCOREINFO, &size);
if (!vmcoreinfo)
vmcoreinfo = get_vmcoreinfo_old(&size);
if (vmcoreinfo)
return nt_init_name(ptr, 0, vmcoreinfo, size, name);

vmcoreinfo = get_vmcoreinfo_old(&size);
if (!vmcoreinfo)
return ptr;
return nt_init_name(ptr, 0, vmcoreinfo, size, "VMCOREINFO");
ptr = nt_init_name(ptr, 0, vmcoreinfo, size, name);
kfree(vmcoreinfo);
return ptr;
}

static size_t nt_vmcoreinfo_size(void)
{
const char *name = "VMCOREINFO";
char nt_name[11];
Elf64_Nhdr note;
void *addr;

if (copy_oldmem_kernel(&addr, &S390_lowcore.vmcore_info, sizeof(addr)))
return 0;

if (copy_oldmem_kernel(&note, addr, sizeof(note)))
return 0;
const char *name = VMCOREINFO_NOTE_NAME;
unsigned long size;
void *vmcoreinfo;

memset(nt_name, 0, sizeof(nt_name));
if (copy_oldmem_kernel(nt_name, addr + sizeof(note),
sizeof(nt_name) - 1))
return 0;
vmcoreinfo = os_info_old_entry(OS_INFO_VMCOREINFO, &size);
if (vmcoreinfo)
return nt_size_name(size, name);

if (strcmp(nt_name, name) != 0)
vmcoreinfo = get_vmcoreinfo_old(&size);
if (!vmcoreinfo)
return 0;

return nt_size_name(note.n_descsz, name);
kfree(vmcoreinfo);
return nt_size_name(size, name);
}

/*
Expand Down Expand Up @@ -660,7 +650,15 @@ int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size)

alloc_size = get_elfcorehdr_size(mem_chunk_cnt);

hdr = kzalloc_panic(alloc_size);
hdr = kzalloc(alloc_size, GFP_KERNEL);

/* Without elfcorehdr /proc/vmcore cannot be created. Thus creating
* a dump with this crash kernel will fail. Panic now to allow other
* dump mechanisms to take over.
*/
if (!hdr)
panic("s390 kdump allocating elfcorehdr failed");

/* Init elf header */
ptr = ehdr_init(hdr, mem_chunk_cnt);
/* Init program headers */
Expand Down
3 changes: 2 additions & 1 deletion arch/s390/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
/* Request MSI interrupts */
hwirq = 0;
for_each_pci_msi_entry(msi, pdev) {
rc = -EIO;
if (hwirq >= msi_vecs)
break;
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
if (irq < 0)
return -ENOMEM;
Expand Down
1 change: 0 additions & 1 deletion arch/s390/pci/pci_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ static int pci_perf_show(struct seq_file *m, void *v)
}

/* header */
seq_printf(m, "FMB @ %p\n", zdev->fmb);
seq_printf(m, "Update interval: %u ms\n", zdev->fmb_update);
seq_printf(m, "Samples: %u\n", zdev->fmb->samples);
seq_printf(m, "Last update TOD: %Lx\n", zdev->fmb->last_update);
Expand Down
Loading

0 comments on commit e1dbc5a

Please sign in to comment.