mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
s390/smp: cleanup core vs. cpu in the SCLP interface
The SCLP interface to query, configure and deconfigure CPUs actually operates on cores. For a machine without the multi-threading faciltiy a CPU and a core are equivalent but starting with System z13 a core can have multiple hardware threads, also referred to as logical CPUs. To avoid confusion replace the word 'cpu' with 'core' in the SCLP interface. Also replace MAX_CPU_ADDRESS with SCLP_MAX_CORES. The core-id is an 8-bit field, the maximum thread id is in the range 0-31. The theoretical limit for the CPU address is therefore 8191. Signed-off-by: Martin Schwidefsky <[email protected]>
This commit is contained in:
parent
e7086eb181
commit
d08d94306e
5 changed files with 50 additions and 52 deletions
|
|
@ -92,8 +92,8 @@ struct read_cpu_info_sccb {
|
|||
u8 reserved[4096 - 16];
|
||||
} __attribute__((packed, aligned(PAGE_SIZE)));
|
||||
|
||||
static void sclp_fill_cpu_info(struct sclp_cpu_info *info,
|
||||
struct read_cpu_info_sccb *sccb)
|
||||
static void sclp_fill_core_info(struct sclp_core_info *info,
|
||||
struct read_cpu_info_sccb *sccb)
|
||||
{
|
||||
char *page = (char *) sccb;
|
||||
|
||||
|
|
@ -101,12 +101,11 @@ static void sclp_fill_cpu_info(struct sclp_cpu_info *info,
|
|||
info->configured = sccb->nr_configured;
|
||||
info->standby = sccb->nr_standby;
|
||||
info->combined = sccb->nr_configured + sccb->nr_standby;
|
||||
info->has_cpu_type = sclp.has_cpu_type;
|
||||
memcpy(&info->cpu, page + sccb->offset_configured,
|
||||
info->combined * sizeof(struct sclp_cpu_entry));
|
||||
memcpy(&info->core, page + sccb->offset_configured,
|
||||
info->combined * sizeof(struct sclp_core_entry));
|
||||
}
|
||||
|
||||
int sclp_get_cpu_info(struct sclp_cpu_info *info)
|
||||
int sclp_get_core_info(struct sclp_core_info *info)
|
||||
{
|
||||
int rc;
|
||||
struct read_cpu_info_sccb *sccb;
|
||||
|
|
@ -127,7 +126,7 @@ int sclp_get_cpu_info(struct sclp_cpu_info *info)
|
|||
rc = -EIO;
|
||||
goto out;
|
||||
}
|
||||
sclp_fill_cpu_info(info, sccb);
|
||||
sclp_fill_core_info(info, sccb);
|
||||
out:
|
||||
free_page((unsigned long) sccb);
|
||||
return rc;
|
||||
|
|
@ -137,7 +136,7 @@ struct cpu_configure_sccb {
|
|||
struct sccb_header header;
|
||||
} __attribute__((packed, aligned(8)));
|
||||
|
||||
static int do_cpu_configure(sclp_cmdw_t cmd)
|
||||
static int do_core_configure(sclp_cmdw_t cmd)
|
||||
{
|
||||
struct cpu_configure_sccb *sccb;
|
||||
int rc;
|
||||
|
|
@ -171,14 +170,14 @@ out:
|
|||
return rc;
|
||||
}
|
||||
|
||||
int sclp_cpu_configure(u8 cpu)
|
||||
int sclp_core_configure(u8 core)
|
||||
{
|
||||
return do_cpu_configure(SCLP_CMDW_CONFIGURE_CPU | cpu << 8);
|
||||
return do_core_configure(SCLP_CMDW_CONFIGURE_CPU | core << 8);
|
||||
}
|
||||
|
||||
int sclp_cpu_deconfigure(u8 cpu)
|
||||
int sclp_core_deconfigure(u8 core)
|
||||
{
|
||||
return do_cpu_configure(SCLP_CMDW_DECONFIGURE_CPU | cpu << 8);
|
||||
return do_core_configure(SCLP_CMDW_DECONFIGURE_CPU | core << 8);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ static int __init sclp_read_info_early(struct read_info_sccb *sccb)
|
|||
|
||||
static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
||||
{
|
||||
struct sclp_cpu_entry *cpue;
|
||||
struct sclp_core_entry *cpue;
|
||||
u16 boot_cpu_address, cpu;
|
||||
|
||||
if (sclp_read_info_early(sccb))
|
||||
|
|
@ -106,7 +106,7 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
|||
|
||||
sclp.facilities = sccb->facilities;
|
||||
sclp.has_sprp = !!(sccb->fac84 & 0x02);
|
||||
sclp.has_cpu_type = !!(sccb->fac84 & 0x01);
|
||||
sclp.has_core_type = !!(sccb->fac84 & 0x01);
|
||||
if (sccb->fac85 & 0x02)
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_ESOP;
|
||||
sclp.rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
|
||||
|
|
@ -116,11 +116,11 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
|||
|
||||
if (!sccb->hcpua) {
|
||||
if (MACHINE_IS_VM)
|
||||
sclp.max_cpu = 64;
|
||||
sclp.max_cores = 64;
|
||||
else
|
||||
sclp.max_cpu = sccb->ncpurl;
|
||||
sclp.max_cores = sccb->ncpurl;
|
||||
} else {
|
||||
sclp.max_cpu = sccb->hcpua + 1;
|
||||
sclp.max_cores = sccb->hcpua + 1;
|
||||
}
|
||||
|
||||
boot_cpu_address = stap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue