diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-27 08:40:39 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-28 04:39:16 -0400 |
commit | 63aef00b55d37e9fad837a8b38a2c261f0d32041 (patch) | |
tree | 3cc75663f7b7aef3e303d440a927488e3660657e | |
parent | 993072ee67aa179c48c85eb19869804e68887d86 (diff) |
s390/lowcore: replace lowcore irb array with a per-cpu variable
Remove the 96-byte irb array from the lowcore and create a per-cpu
variable instead. That way we will pick up any change in the definition
of the struct irb automatically.
Acked-By: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/lowcore.h | 13 | ||||
-rw-r--r-- | arch/s390/kernel/asm-offsets.c | 1 | ||||
-rw-r--r-- | drivers/s390/cio/ccwreq.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/chsc_sch.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 9 | ||||
-rw-r--r-- | drivers/s390/cio/cio.h | 2 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/eadm_sch.c | 2 |
8 files changed, 16 insertions, 19 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index a406f24737cd..2070cad80e9e 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -143,10 +143,7 @@ struct _lowcore { | |||
143 | __u32 ftrace_func; /* 0x02f8 */ | 143 | __u32 ftrace_func; /* 0x02f8 */ |
144 | __u32 spinlock_lockval; /* 0x02fc */ | 144 | __u32 spinlock_lockval; /* 0x02fc */ |
145 | 145 | ||
146 | /* Interrupt response block */ | 146 | __u8 pad_0x0300[0x0e00-0x0300]; /* 0x0300 */ |
147 | __u8 irb[96]; /* 0x0300 */ | ||
148 | |||
149 | __u8 pad_0x0360[0x0e00-0x0360]; /* 0x0360 */ | ||
150 | 147 | ||
151 | /* | 148 | /* |
152 | * 0xe00 contains the address of the IPL Parameter Information | 149 | * 0xe00 contains the address of the IPL Parameter Information |
@@ -292,14 +289,10 @@ struct _lowcore { | |||
292 | __u32 spinlock_lockval; /* 0x03a0 */ | 289 | __u32 spinlock_lockval; /* 0x03a0 */ |
293 | __u8 pad_0x03a0[0x0400-0x03a4]; /* 0x03a4 */ | 290 | __u8 pad_0x03a0[0x0400-0x03a4]; /* 0x03a4 */ |
294 | 291 | ||
295 | /* Interrupt response block. */ | ||
296 | __u8 irb[96]; /* 0x0400 */ | ||
297 | __u8 pad_0x0460[0x0480-0x0460]; /* 0x0460 */ | ||
298 | |||
299 | /* Per cpu primary space access list */ | 292 | /* Per cpu primary space access list */ |
300 | __u32 paste[16]; /* 0x0480 */ | 293 | __u32 paste[16]; /* 0x0400 */ |
301 | 294 | ||
302 | __u8 pad_0x04c0[0x0e00-0x04c0]; /* 0x04c0 */ | 295 | __u8 pad_0x04c0[0x0e00-0x0440]; /* 0x0440 */ |
303 | 296 | ||
304 | /* | 297 | /* |
305 | * 0xe00 contains the address of the IPL Parameter Information | 298 | * 0xe00 contains the address of the IPL Parameter Information |
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index 76c4e2f70cab..0c070c44cde2 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c | |||
@@ -144,7 +144,6 @@ int main(void) | |||
144 | DEFINE(__LC_MCCK_CLOCK, offsetof(struct _lowcore, mcck_clock)); | 144 | DEFINE(__LC_MCCK_CLOCK, offsetof(struct _lowcore, mcck_clock)); |
145 | DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags)); | 145 | DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags)); |
146 | DEFINE(__LC_FTRACE_FUNC, offsetof(struct _lowcore, ftrace_func)); | 146 | DEFINE(__LC_FTRACE_FUNC, offsetof(struct _lowcore, ftrace_func)); |
147 | DEFINE(__LC_IRB, offsetof(struct _lowcore, irb)); | ||
148 | DEFINE(__LC_DUMP_REIPL, offsetof(struct _lowcore, ipib)); | 147 | DEFINE(__LC_DUMP_REIPL, offsetof(struct _lowcore, ipib)); |
149 | BLANK(); | 148 | BLANK(); |
150 | DEFINE(__LC_CPU_TIMER_SAVE_AREA, offsetof(struct _lowcore, cpu_timer_save_area)); | 149 | DEFINE(__LC_CPU_TIMER_SAVE_AREA, offsetof(struct _lowcore, cpu_timer_save_area)); |
diff --git a/drivers/s390/cio/ccwreq.c b/drivers/s390/cio/ccwreq.c index fc5fb51d9bce..07676c22d514 100644 --- a/drivers/s390/cio/ccwreq.c +++ b/drivers/s390/cio/ccwreq.c | |||
@@ -252,7 +252,7 @@ static void ccwreq_log_status(struct ccw_device *cdev, enum io_status status) | |||
252 | */ | 252 | */ |
253 | void ccw_request_handler(struct ccw_device *cdev) | 253 | void ccw_request_handler(struct ccw_device *cdev) |
254 | { | 254 | { |
255 | struct irb *irb = (struct irb *)&S390_lowcore.irb; | 255 | struct irb *irb = &__get_cpu_var(cio_irb); |
256 | struct ccw_request *req = &cdev->private->req; | 256 | struct ccw_request *req = &cdev->private->req; |
257 | enum io_status status; | 257 | enum io_status status; |
258 | int rc = -EOPNOTSUPP; | 258 | int rc = -EOPNOTSUPP; |
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index 1d3661af7bd8..3d22d2a4ce14 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
@@ -58,7 +58,7 @@ static void chsc_subchannel_irq(struct subchannel *sch) | |||
58 | { | 58 | { |
59 | struct chsc_private *private = dev_get_drvdata(&sch->dev); | 59 | struct chsc_private *private = dev_get_drvdata(&sch->dev); |
60 | struct chsc_request *request = private->request; | 60 | struct chsc_request *request = private->request; |
61 | struct irb *irb = (struct irb *)&S390_lowcore.irb; | 61 | struct irb *irb = &__get_cpu_var(cio_irb); |
62 | 62 | ||
63 | CHSC_LOG(4, "irb"); | 63 | CHSC_LOG(4, "irb"); |
64 | CHSC_LOG_HEX(4, irb, sizeof(*irb)); | 64 | CHSC_LOG_HEX(4, irb, sizeof(*irb)); |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 9e058c4657a3..77f9c92df4b9 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -46,6 +46,9 @@ debug_info_t *cio_debug_msg_id; | |||
46 | debug_info_t *cio_debug_trace_id; | 46 | debug_info_t *cio_debug_trace_id; |
47 | debug_info_t *cio_debug_crw_id; | 47 | debug_info_t *cio_debug_crw_id; |
48 | 48 | ||
49 | DEFINE_PER_CPU_ALIGNED(struct irb, cio_irb); | ||
50 | EXPORT_PER_CPU_SYMBOL(cio_irb); | ||
51 | |||
49 | /* | 52 | /* |
50 | * Function: cio_debug_init | 53 | * Function: cio_debug_init |
51 | * Initializes three debug logs for common I/O: | 54 | * Initializes three debug logs for common I/O: |
@@ -560,7 +563,7 @@ static irqreturn_t do_cio_interrupt(int irq, void *dummy) | |||
560 | 563 | ||
561 | __this_cpu_write(s390_idle.nohz_delay, 1); | 564 | __this_cpu_write(s390_idle.nohz_delay, 1); |
562 | tpi_info = (struct tpi_info *) &get_irq_regs()->int_code; | 565 | tpi_info = (struct tpi_info *) &get_irq_regs()->int_code; |
563 | irb = (struct irb *) &S390_lowcore.irb; | 566 | irb = &__get_cpu_var(cio_irb); |
564 | sch = (struct subchannel *)(unsigned long) tpi_info->intparm; | 567 | sch = (struct subchannel *)(unsigned long) tpi_info->intparm; |
565 | if (!sch) { | 568 | if (!sch) { |
566 | /* Clear pending interrupt condition. */ | 569 | /* Clear pending interrupt condition. */ |
@@ -609,7 +612,7 @@ void cio_tsch(struct subchannel *sch) | |||
609 | struct irb *irb; | 612 | struct irb *irb; |
610 | int irq_context; | 613 | int irq_context; |
611 | 614 | ||
612 | irb = (struct irb *)&S390_lowcore.irb; | 615 | irb = &__get_cpu_var(cio_irb); |
613 | /* Store interrupt response block to lowcore. */ | 616 | /* Store interrupt response block to lowcore. */ |
614 | if (tsch(sch->schid, irb) != 0) | 617 | if (tsch(sch->schid, irb) != 0) |
615 | /* Not status pending or not operational. */ | 618 | /* Not status pending or not operational. */ |
@@ -746,7 +749,7 @@ __clear_io_subchannel_easy(struct subchannel_id schid) | |||
746 | struct tpi_info ti; | 749 | struct tpi_info ti; |
747 | 750 | ||
748 | if (tpi(&ti)) { | 751 | if (tpi(&ti)) { |
749 | tsch(ti.schid, (struct irb *)&S390_lowcore.irb); | 752 | tsch(ti.schid, &__get_cpu_var(cio_irb)); |
750 | if (schid_equal(&ti.schid, &schid)) | 753 | if (schid_equal(&ti.schid, &schid)) |
751 | return 0; | 754 | return 0; |
752 | } | 755 | } |
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h index d42f67412bd8..a01376ae1749 100644 --- a/drivers/s390/cio/cio.h +++ b/drivers/s390/cio/cio.h | |||
@@ -102,6 +102,8 @@ struct subchannel { | |||
102 | struct schib_config config; | 102 | struct schib_config config; |
103 | } __attribute__ ((aligned(8))); | 103 | } __attribute__ ((aligned(8))); |
104 | 104 | ||
105 | DECLARE_PER_CPU(struct irb, cio_irb); | ||
106 | |||
105 | #define to_subchannel(n) container_of(n, struct subchannel, dev) | 107 | #define to_subchannel(n) container_of(n, struct subchannel, dev) |
106 | 108 | ||
107 | extern int cio_validate_subchannel (struct subchannel *, struct subchannel_id); | 109 | extern int cio_validate_subchannel (struct subchannel *, struct subchannel_id); |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index c7638c543250..0bc902b3cd84 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -739,7 +739,7 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event) | |||
739 | struct irb *irb; | 739 | struct irb *irb; |
740 | int is_cmd; | 740 | int is_cmd; |
741 | 741 | ||
742 | irb = (struct irb *)&S390_lowcore.irb; | 742 | irb = &__get_cpu_var(cio_irb); |
743 | is_cmd = !scsw_is_tm(&irb->scsw); | 743 | is_cmd = !scsw_is_tm(&irb->scsw); |
744 | /* Check for unsolicited interrupt. */ | 744 | /* Check for unsolicited interrupt. */ |
745 | if (!scsw_is_solicited(&irb->scsw)) { | 745 | if (!scsw_is_solicited(&irb->scsw)) { |
@@ -805,7 +805,7 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event) | |||
805 | { | 805 | { |
806 | struct irb *irb; | 806 | struct irb *irb; |
807 | 807 | ||
808 | irb = (struct irb *)&S390_lowcore.irb; | 808 | irb = &__get_cpu_var(cio_irb); |
809 | /* Check for unsolicited interrupt. */ | 809 | /* Check for unsolicited interrupt. */ |
810 | if (scsw_stctl(&irb->scsw) == | 810 | if (scsw_stctl(&irb->scsw) == |
811 | (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { | 811 | (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { |
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c index 3a2ee4a740b4..c4f7bf3e24c2 100644 --- a/drivers/s390/cio/eadm_sch.c +++ b/drivers/s390/cio/eadm_sch.c | |||
@@ -134,7 +134,7 @@ static void eadm_subchannel_irq(struct subchannel *sch) | |||
134 | { | 134 | { |
135 | struct eadm_private *private = get_eadm_private(sch); | 135 | struct eadm_private *private = get_eadm_private(sch); |
136 | struct eadm_scsw *scsw = &sch->schib.scsw.eadm; | 136 | struct eadm_scsw *scsw = &sch->schib.scsw.eadm; |
137 | struct irb *irb = (struct irb *)&S390_lowcore.irb; | 137 | struct irb *irb = &__get_cpu_var(cio_irb); |
138 | int error = 0; | 138 | int error = 0; |
139 | 139 | ||
140 | EADM_LOG(6, "irq"); | 140 | EADM_LOG(6, "irq"); |