|
@@ -95,7 +95,7 @@ static void *elfcorehdr_newmem;
|
|
|
/*
|
|
/*
|
|
|
* Copy one page from zfcpdump "oldmem"
|
|
* Copy one page from zfcpdump "oldmem"
|
|
|
*
|
|
*
|
|
|
- * For pages below ZFCPDUMP_HSA_SIZE memory from the HSA is copied. Otherwise
|
|
|
|
|
|
|
+ * For pages below HSA size memory from the HSA is copied. Otherwise
|
|
|
* real memory copy is used.
|
|
* real memory copy is used.
|
|
|
*/
|
|
*/
|
|
|
static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize,
|
|
static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize,
|
|
@@ -103,7 +103,7 @@ static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize,
|
|
|
{
|
|
{
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
- if (src < ZFCPDUMP_HSA_SIZE) {
|
|
|
|
|
|
|
+ if (src < sclp_get_hsa_size()) {
|
|
|
rc = memcpy_hsa(buf, src, csize, userbuf);
|
|
rc = memcpy_hsa(buf, src, csize, userbuf);
|
|
|
} else {
|
|
} else {
|
|
|
if (userbuf)
|
|
if (userbuf)
|
|
@@ -188,18 +188,19 @@ static int remap_oldmem_pfn_range_kdump(struct vm_area_struct *vma,
|
|
|
/*
|
|
/*
|
|
|
* Remap "oldmem" for zfcpdump
|
|
* Remap "oldmem" for zfcpdump
|
|
|
*
|
|
*
|
|
|
- * We only map available memory above ZFCPDUMP_HSA_SIZE. Memory below
|
|
|
|
|
- * ZFCPDUMP_HSA_SIZE is read on demand using the copy_oldmem_page() function.
|
|
|
|
|
|
|
+ * We only map available memory above HSA size. Memory below HSA size
|
|
|
|
|
+ * is read on demand using the copy_oldmem_page() function.
|
|
|
*/
|
|
*/
|
|
|
static int remap_oldmem_pfn_range_zfcpdump(struct vm_area_struct *vma,
|
|
static int remap_oldmem_pfn_range_zfcpdump(struct vm_area_struct *vma,
|
|
|
unsigned long from,
|
|
unsigned long from,
|
|
|
unsigned long pfn,
|
|
unsigned long pfn,
|
|
|
unsigned long size, pgprot_t prot)
|
|
unsigned long size, pgprot_t prot)
|
|
|
{
|
|
{
|
|
|
|
|
+ unsigned long hsa_end = sclp_get_hsa_size();
|
|
|
unsigned long size_hsa;
|
|
unsigned long size_hsa;
|
|
|
|
|
|
|
|
- if (pfn < ZFCPDUMP_HSA_SIZE >> PAGE_SHIFT) {
|
|
|
|
|
- size_hsa = min(size, ZFCPDUMP_HSA_SIZE - (pfn << PAGE_SHIFT));
|
|
|
|
|
|
|
+ if (pfn < hsa_end >> PAGE_SHIFT) {
|
|
|
|
|
+ size_hsa = min(size, hsa_end - (pfn << PAGE_SHIFT));
|
|
|
if (size == size_hsa)
|
|
if (size == size_hsa)
|
|
|
return 0;
|
|
return 0;
|
|
|
size -= size_hsa;
|
|
size -= size_hsa;
|
|
@@ -238,9 +239,9 @@ int copy_from_oldmem(void *dest, void *src, size_t count)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if ((unsigned long) src < ZFCPDUMP_HSA_SIZE) {
|
|
|
|
|
- copied = min(count,
|
|
|
|
|
- ZFCPDUMP_HSA_SIZE - (unsigned long) src);
|
|
|
|
|
|
|
+ unsigned long hsa_end = sclp_get_hsa_size();
|
|
|
|
|
+ if ((unsigned long) src < hsa_end) {
|
|
|
|
|
+ copied = min(count, hsa_end - (unsigned long) src);
|
|
|
rc = memcpy_hsa(dest, (unsigned long) src, copied, 0);
|
|
rc = memcpy_hsa(dest, (unsigned long) src, copied, 0);
|
|
|
if (rc)
|
|
if (rc)
|
|
|
return rc;
|
|
return rc;
|
|
@@ -580,6 +581,9 @@ int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size)
|
|
|
/* If elfcorehdr= has been passed via cmdline, we use that one */
|
|
/* If elfcorehdr= has been passed via cmdline, we use that one */
|
|
|
if (elfcorehdr_addr != ELFCORE_ADDR_MAX)
|
|
if (elfcorehdr_addr != ELFCORE_ADDR_MAX)
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
+ /* If we cannot get HSA size for zfcpdump return error */
|
|
|
|
|
+ if (ipl_info.type == IPL_TYPE_FCP_DUMP && !sclp_get_hsa_size())
|
|
|
|
|
+ return -ENODEV;
|
|
|
mem_chunk_cnt = get_mem_chunk_cnt();
|
|
mem_chunk_cnt = get_mem_chunk_cnt();
|
|
|
|
|
|
|
|
alloc_size = 0x1000 + get_cpu_cnt() * 0x300 +
|
|
alloc_size = 0x1000 + get_cpu_cnt() * 0x300 +
|