summaryrefslogtreecommitdiff
path: root/drivers/s390/char/sclp_cmd.c
diff options
context:
space:
mode:
authorSumanth Korikkar <sumanthk@linux.ibm.com>2020-11-11 01:03:02 -0600
committerHeiko Carstens <hca@linux.ibm.com>2020-11-18 12:16:02 +0100
commitb971cbd03ee0a24f7af47b681e8f911794c69780 (patch)
treee5eaec17dc4235384324ad7302f1031da587f66f /drivers/s390/char/sclp_cmd.c
parentd25d23e134a43457759fa602a15c1e9fce741727 (diff)
downloadlwn-b971cbd03ee0a24f7af47b681e8f911794c69780.tar.gz
lwn-b971cbd03ee0a24f7af47b681e8f911794c69780.zip
s390/sclp: provide extended sccb support
As the number of cpus increases, the sccb response can exceed 4k for read cpu and read scp info sclp commands. Hence, all cpu info entries cant be embedded within a sccb response Solution: To overcome this limitation, extended sccb facility is provided by sclp. 1. Check if the extended sccb facility is installed. 2. If extended sccb is installed, perform the read scp and read cpu command considering a max sccb length of three page size. This max length is based on factors like max cpus, sccb header. 3. If extended sccb is not installed, perform the read scp and read cpu sclp command considering a max sccb length of one page size. Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/char/sclp_cmd.c')
-rw-r--r--drivers/s390/char/sclp_cmd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index f6e97f0830f6..7ebe89890a9b 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -27,6 +27,7 @@
#include <asm/page.h>
#include <asm/sclp.h>
#include <asm/numa.h>
+#include <asm/facility.h>
#include "sclp.h"
@@ -87,14 +88,17 @@ out:
int _sclp_get_core_info(struct sclp_core_info *info)
{
int rc;
+ int length = test_facility(140) ? EXT_SCCB_READ_CPU : PAGE_SIZE;
struct read_cpu_info_sccb *sccb;
if (!SCLP_HAS_CPU_INFO)
return -EOPNOTSUPP;
- sccb = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
+
+ sccb = (void *)__get_free_pages(GFP_KERNEL | GFP_DMA | __GFP_ZERO, get_order(length));
if (!sccb)
return -ENOMEM;
- sccb->header.length = sizeof(*sccb);
+ sccb->header.length = length;
+ sccb->header.control_mask[2] = 0x80;
rc = sclp_sync_request_timeout(SCLP_CMDW_READ_CPU_INFO, sccb,
SCLP_QUEUE_INTERVAL);
if (rc)
@@ -107,7 +111,7 @@ int _sclp_get_core_info(struct sclp_core_info *info)
}
sclp_fill_core_info(info, sccb);
out:
- free_page((unsigned long) sccb);
+ free_pages((unsigned long) sccb, get_order(length));
return rc;
}