linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Krowiak <akrowiak@linux.ibm.com>
To: pmorel@linux.ibm.com, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	sebott@linux.ibm.com, oberpar@linux.ibm.com,
	freude@linux.ibm.com, pasic@linux.ibm.com, cohuck@redhat.com
Subject: Re: [PATCH] zcrypt: handle AP Info notification from CHSC SEI command
Date: Thu, 31 Jan 2019 18:32:30 -0500	[thread overview]
Message-ID: <c8025bc5-91dc-98dc-63b0-e0617b781bb9@linux.ibm.com> (raw)
In-Reply-To: <95a29dd5-11d5-0984-ffbd-73ef92ed1aba@linux.ibm.com>

On 1/31/19 4:09 AM, Pierre Morel wrote:
> On 30/01/2019 18:48, Tony Krowiak wrote:
>> The current AP bus implementation periodically polls the AP configuration
>> to detect changes. When the AP configuration is dynamically changed 
>> via the
>> SE or an SCLP instruction, the changes will not be reflected to sysfs 
>> until
>> the next time the AP configuration is polled. The CHSC architecture
>> provides a Store Event Information (SEI)command to make notification 
>> of an
>> AP configuration change. This patch introduces a handler to process
>> notification from the CHSC SEI command BY immediately kickING off an 
>> AP bus
>> scan.
>>
>> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
>> Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
>> ---
>>   arch/s390/include/asm/ap.h   | 12 ++++++++++++
>>   drivers/s390/cio/chsc.c      | 12 ++++++++++++
>>   drivers/s390/cio/chsc.h      |  1 +
>>   drivers/s390/crypto/ap_bus.c | 12 ++++++++++++
>>   4 files changed, 37 insertions(+)
>>
>> diff --git a/arch/s390/include/asm/ap.h b/arch/s390/include/asm/ap.h
>> index 1a6a7092d942..c778593d509f 100644
>> --- a/arch/s390/include/asm/ap.h
>> +++ b/arch/s390/include/asm/ap.h
>> @@ -360,4 +360,16 @@ static inline struct ap_queue_status 
>> ap_dqap(ap_qid_t qid,
>>       return reg1;
>>   }
>> +/*
>> + * Interface to tell the AP bus code that a configuration
>> + * change has happened. The bus code should at least do
>> + * an ap bus resource rescan.
>> + */
>> +#if IS_ENABLED(CONFIG_ZCRYPT)
>> +void ap_bus_cfg_chg(void);
>> +#else
>> +#error "no CONFIG_ZCRYPT"
>> +static void ap_bus_cfg_chg(void){};
>> +#endif
>> +
>>   #endif /* _ASM_S390_AP_H_ */
>> diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
>> index a0baee25134c..dccccc337078 100644
>> --- a/drivers/s390/cio/chsc.c
>> +++ b/drivers/s390/cio/chsc.c
>> @@ -586,6 +586,15 @@ static void chsc_process_sei_scm_avail(struct 
>> chsc_sei_nt0_area *sei_area)
>>                     " failed (rc=%d).\n", ret);
>>   }
>> +static void chsc_process_sei_ap_cfg_chg(struct chsc_sei_nt0_area 
>> *sei_area)
>> +{
>> +    CIO_CRW_EVENT(3, "chsc: ap config changed\n");
>> +    if (sei_area->rs != 5)
> 
> Why just return if the rs code is 5?
> 
> The event content code concerns the AP configuration change.
> 
> Should the source of the reporting of this change hold us from 
> rescanning the available AP?

Why rescan if the RS code does not indicate the AP configuration
changed?

> 
> 
> Regards,
> Pierre
> 
> 
>> +        return;
>> +
>> +    ap_bus_cfg_chg();
>> +}
>> +
>>   static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area)
>>   {
>>       switch (sei_area->cc) {
>> @@ -612,6 +621,9 @@ static void chsc_process_sei_nt0(struct 
>> chsc_sei_nt0_area *sei_area)
>>       case 2: /* i/o resource accessibility */
>>           chsc_process_sei_res_acc(sei_area);
>>           break;
>> +    case 3: /* ap config changed */
>> +        chsc_process_sei_ap_cfg_chg(sei_area);
>> +        break;
>>       case 7: /* channel-path-availability information */
>>           chsc_process_sei_chp_avail(sei_area);
>>           break;
>> diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h
>> index 78aba8d94eec..5651066c46e3 100644
>> --- a/drivers/s390/cio/chsc.h
>> +++ b/drivers/s390/cio/chsc.h
>> @@ -9,6 +9,7 @@
>>   #include <asm/chsc.h>
>>   #include <asm/schid.h>
>>   #include <asm/qdio.h>
>> +#include <asm/ap.h>
>>   #define CHSC_SDA_OC_MSS   0x2
>> diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
>> index 48ea0004a56d..94f621783d6b 100644
>> --- a/drivers/s390/crypto/ap_bus.c
>> +++ b/drivers/s390/crypto/ap_bus.c
>> @@ -35,6 +35,7 @@
>>   #include <linux/mod_devicetable.h>
>>   #include <linux/debugfs.h>
>>   #include <linux/ctype.h>
>> +#include <asm/crw.h>
>>   #include "ap_bus.h"
>>   #include "ap_debug.h"
>> @@ -860,6 +861,17 @@ void ap_bus_force_rescan(void)
>>   EXPORT_SYMBOL(ap_bus_force_rescan);
>>   /*
>> +* A config change has happened, Force an ap bus rescan.
>> +*/
>> +void ap_bus_cfg_chg(void)
>> +{
>> +    AP_DBF(DBF_INFO, "%s config change, forcing bus rescan\n", 
>> __func__);
>> +
>> +    ap_bus_force_rescan();
>> +}
>> +EXPORT_SYMBOL(ap_bus_cfg_chg);
>> +
>> +/*
>>    * hex2bitmap() - parse hex mask string and set bitmap.
>>    * Valid strings are "0x012345678" with at least one valid hex number.
>>    * Rest of the bitmap to the right is padded with 0. No spaces allowed
>>
> 
> 


  reply	other threads:[~2019-01-31 23:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 17:48 [PATCH] zcrypt: handle AP Info notification from CHSC SEI command Tony Krowiak
2019-01-30 18:32 ` Sebastian Ott
2019-01-31 23:28   ` Tony Krowiak
2019-02-01  9:01     ` Heiko Carstens
2019-02-01 11:08       ` Martin Schwidefsky
2019-02-01 13:05       ` Heiko Carstens
2019-02-01 15:40         ` Tony Krowiak
2019-02-01 15:38       ` Tony Krowiak
2019-02-04 10:06         ` Harald Freudenberger
2019-02-05 20:26           ` Tony Krowiak
2019-02-04 10:01     ` Sebastian Ott
2019-02-05 20:27       ` Tony Krowiak
2019-02-21 10:42   ` Harald Freudenberger
2019-02-21 12:12     ` Cornelia Huck
2019-02-21 12:55       ` Heiko Carstens
2019-01-31  9:09 ` Pierre Morel
2019-01-31 23:32   ` Tony Krowiak [this message]
2019-01-31  9:23 ` Pierre Morel
2019-01-31  9:55 ` Cornelia Huck
2019-01-31 23:50   ` Tony Krowiak
2019-02-01 14:35     ` Cornelia Huck
2019-02-01 15:50       ` Tony Krowiak
2019-02-04 10:15       ` Harald Freudenberger
2019-02-04 12:07         ` Cornelia Huck
2019-02-05 20:30         ` Tony Krowiak
2019-02-03  9:25 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8025bc5-91dc-98dc-63b0-e0617b781bb9@linux.ibm.com \
    --to=akrowiak@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=freude@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).