Skip to contentSkip to conversation

s390/vfio-ap: handle response code 01 on queue reset

PATCH In review Tony Krowiak 4 participants 13 messages Nov 29, 2023 – Jan 9, 2024

Subsystems (4)
lore
Share & tools
lore

Tony Krowiak

author maintainer
#0 lore raw

PATCH 1/1 s390/vfio-ap: handle response code 01 on queue reset

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

---
 drivers/s390/crypto/vfio_ap_ops.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
drivers/s390/crypto/vfio_ap_ops.c +31 -0
index 4db538a55192..91d6334574d8 100644
@@ -1652,6 +1652,21 @@ static int apq_status_check(int apqn, struct ap_queue_status *status)
 		 * a value indicating a reset needs to be performed again.
 		 */
 		return -EAGAIN;
+	case AP_RESPONSE_Q_NOT_AVAIL:
+		/*
+		 * This response code indicates the queue is not available.
+		 * Barring a bug, response code 01 will occur only when a queue
+		 * has been externally removed from the host's AP configuration;
+		 * in which case, the queue must be reset by the machine in
+		 * order to avoid leaking crypto data if/when the queue is
+		 * returned to the host's configuration. In this case, let's go
+		 * ahead and log a warning message and return 0 so the AQIC
+		 * resources get cleaned up by the caller.
+		 */
+		WARN(true,
+		     "Unable to reset queue %02x.%04x: not in host AP configuration\n",
+		     AP_QID_CARD(apqn), AP_QID_QUEUE(apqn));
+			return 0;
 	default:
 		WARN(true,
 		     "failed to verify reset of queue %02x.%04x: TAPQ rc=%u\n",
@@ -1736,6 +1751,22 @@ static void vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q)
 		q->reset_status.response_code = 0;
 		vfio_ap_free_aqic_resources(q);
 		break;
+	case AP_RESPONSE_Q_NOT_AVAIL:
+		/*
+		 * This response code indicates the queue is not available.
+		 * Barring a bug, response code 01 will occur only when a queue
+		 * has been externally removed from the host's AP configuration;
+		 * in which case, the queue must be reset by the machine in
+		 * order to avoid leaking crypto data if/when the queue is
+		 * returned to the host's configuration. In this case, let's go
+		 * ahead and log a warning message then clean up the AQIC
+		 * resources.
+		 */
+		WARN(true,
+		     "Unable to reset queue %02x.%04x: not in host AP configuration\n",
+		     AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn));
+		vfio_ap_free_aqic_resources(q);
+		break;
 	default:
 		WARN(true,
 		     "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n",
Signature · 1 line
2.41.0
#1 lore raw

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Quoted 54 lines
---
  drivers/s390/crypto/vfio_ap_ops.c | 31 +++++++++++++++++++++++++++++++
  1 file changed, 31 insertions(+)
drivers/s390/crypto/vfio_ap_ops.c +31 -0
index 4db538a55192..91d6334574d8 100644
@@ -1652,6 +1652,21 @@ static int apq_status_check(int apqn, struct ap_queue_status *status)
  		 * a value indicating a reset needs to be performed again.
  		 */
  		return -EAGAIN;
+	case AP_RESPONSE_Q_NOT_AVAIL:
+		/*
+		 * This response code indicates the queue is not available.
+		 * Barring a bug, response code 01 will occur only when a queue
+		 * has been externally removed from the host's AP configuration;
+		 * in which case, the queue must be reset by the machine in
+		 * order to avoid leaking crypto data if/when the queue is
+		 * returned to the host's configuration. In this case, let's go
+		 * ahead and log a warning message and return 0 so the AQIC
+		 * resources get cleaned up by the caller.
+		 */
+		WARN(true,
+		     "Unable to reset queue %02x.%04x: not in host AP configuration\n",
+		     AP_QID_CARD(apqn), AP_QID_QUEUE(apqn));
+			return 0;
  	default:
  		WARN(true,
  		     "failed to verify reset of queue %02x.%04x: TAPQ rc=%u\n",
@@ -1736,6 +1751,22 @@ static void vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q)
  		q->reset_status.response_code = 0;
  		vfio_ap_free_aqic_resources(q);
  		break;
+	case AP_RESPONSE_Q_NOT_AVAIL:
+		/*
+		 * This response code indicates the queue is not available.
+		 * Barring a bug, response code 01 will occur only when a queue
+		 * has been externally removed from the host's AP configuration;
+		 * in which case, the queue must be reset by the machine in
+		 * order to avoid leaking crypto data if/when the queue is
+		 * returned to the host's configuration. In this case, let's go
+		 * ahead and log a warning message then clean up the AQIC
+		 * resources.
+		 */
+		WARN(true,
+		     "Unable to reset queue %02x.%04x: not in host AP configuration\n",
+		     AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn));
+		vfio_ap_free_aqic_resources(q);
+		break;
  	default:
  		WARN(true,
  		     "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n",
author maintainer
#2 lore raw
Quoted 12 lines · Christian Borntraeger

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Quoted 60 lines
Quoted 60 lines

---
  drivers/s390/crypto/vfio_ap_ops.c | 31 +++++++++++++++++++++++++++++++

  1 file changed, 31 insertions(+)
drivers/s390/crypto/vfio_ap_ops.c +15 -0
index 4db538a55192..91d6334574d8 100644
@@ -1652,6 +1652,21 @@ static int apq_status_check(int apqn, struct 
 ap_queue_status *status)
            * a value indicating a reset needs to be performed again.
            */
           return -EAGAIN;
+    case AP_RESPONSE_Q_NOT_AVAIL:
+        /*
+         * This response code indicates the queue is not available.
+         * Barring a bug, response code 01 will occur only when a queue
+         * has been externally removed from the host's AP configuration;
+         * in which case, the queue must be reset by the machine in
+         * order to avoid leaking crypto data if/when the queue is
+         * returned to the host's configuration. In this case, let's go
+         * ahead and log a warning message and return 0 so the AQIC
+         * resources get cleaned up by the caller.
+         */
+        WARN(true,
+             "Unable to reset queue %02x.%04x: not in host AP 
 configuration\n",
+             AP_QID_CARD(apqn), AP_QID_QUEUE(apqn));
+            return 0;

      default:
          WARN(true,
               "failed to verify reset of queue %02x.%04x: TAPQ rc=%u\n",

drivers/s390/crypto/vfio_ap_ops.c +16 -0
@@ -1736,6 +1751,22 @@ static void vfio_ap_mdev_reset_queue(struct 
 vfio_ap_queue *q)
           q->reset_status.response_code = 0;
           vfio_ap_free_aqic_resources(q);
           break;
+    case AP_RESPONSE_Q_NOT_AVAIL:
+        /*
+         * This response code indicates the queue is not available.
+         * Barring a bug, response code 01 will occur only when a queue
+         * has been externally removed from the host's AP configuration;
+         * in which case, the queue must be reset by the machine in
+         * order to avoid leaking crypto data if/when the queue is
+         * returned to the host's configuration. In this case, let's go
+         * ahead and log a warning message then clean up the AQIC
+         * resources.
+         */
+        WARN(true,
+             "Unable to reset queue %02x.%04x: not in host AP 
 configuration\n",
+             AP_QID_CARD(q->apqn), AP_QID_QUEUE(q->apqn));
+        vfio_ap_free_aqic_resources(q);
+        break;

      default:
          WARN(true,
               "PQAP/ZAPQ for %02x.%04x failed with invalid rc=%u\n",

#3 lore raw

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 15 lines · Christian Borntraeger
Quoted 12 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 6 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

maintainer
#4 lore raw
Quoted 16 lines · On Mon, 4 Dec 2023 16:16:31 +0100 Christian Borntraeger…

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 15 lines · Christian Borntraeger
Quoted 12 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

Shouldn't we rather make this an 'info'. I mean we probably do not want people complaining about this condition. Yes it should be a best practice to coordinate such things with the guest, and ideally remove the resource from the guest first. But AFAIU our stack is supposed to be able to handle something like this. IMHO issuing a warning is excessive measure. I know Reinhard and Tony probably disagree with the last sentence though.

Regards,
Halil

author maintainer
#5 lore raw
Quoted 28 lines · Halil Pasic
Quoted 16 lines · On Mon, 4 Dec 2023 16:16:31 +0100 Christian Borntraeger…

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 15 lines · Christian Borntraeger
Quoted 12 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

Quoted 7 lines

Shouldn't we rather make this an 'info'. I mean we probably do not want people complaining about this condition. Yes it should be a best practice to coordinate such things with the guest, and ideally remove the resource from the guest first. But AFAIU our stack is supposed to be able to handle something like this. IMHO issuing a warning is excessive measure. I know Reinhard and Tony probably disagree with the last sentence though.

I don't feel strongly one way or the other. Anybody else?

Quoted 3 lines

Regards,
Halil

#6 lore raw
In reply to Halil Pasic
Quoted 28 lines · Halil Pasic
Quoted 16 lines · On Mon, 4 Dec 2023 16:16:31 +0100 Christian Borntraeger…

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 15 lines · Christian Borntraeger
Quoted 12 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

Quoted 7 lines

Shouldn't we rather make this an 'info'. I mean we probably do not want people complaining about this condition. Yes it should be a best practice to coordinate such things with the guest, and ideally remove the resource from the guest first. But AFAIU our stack is supposed to be able to handle something like this. IMHO issuing a warning is excessive measure. I know Reinhard and Tony probably disagree with the last sentence though.

Halil, Tony, the thing about about info versus warning versus error is our own stuff. Keep in mind that these messages end up in the "debug feature" as FFDC data. So it comes to the point which FFDC data do you/Tony want to see there ? It should be enough to explain to a customer what happened without the need to "recreate with higher debug level" if something serious happened. So my private decision table is:
1) is it something serious, something exceptional, something which may not come up again if tried to recreate ? Yes -> make it visible on the
first
occurrence as error msg.
2) is it something you want to read when a customer hits it and you tell him to extract and examine the debug feature data ? Yes -> make it a
warning
and make sure your debug feature by default records warnings.
3) still serious, but may flood the debug feature. Good enough and high probability to reappear on a recreate ? Yes -> make it an info
message
and live with the risk that you may not be able to explain to a
customer
what happened without a recreate and higher debug level.
4) not 1-3, -> maybe a debug msg but still think about what happens when a customer enables "debug feature" with highest level. Does it squeeze
out
more important stuff ? Maybe make it dynamic debug with pr_debug()
(see
kernel docu admin-guide/dynamic-debug-howto.rst).

Quoted 3 lines

Regards,
Halil

maintainer
#7 lore raw
Quoted 62 lines · On Tue, 05 Dec 2023 09:04:23 +0100 Harald Freudenberger <[email protected]>…
Quoted 28 lines · Halil Pasic
Quoted 16 lines · On Mon, 4 Dec 2023 16:16:31 +0100 Christian Borntraeger…

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 15 lines · Christian Borntraeger
Quoted 12 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

Quoted 10 lines

Shouldn't we rather make this an 'info'. I mean we probably do not want people complaining about this condition. Yes it should be a best practice
to coordinate such things with the guest, and ideally remove the resource
from the guest first. But AFAIU our stack is supposed to be able to handle something like this. IMHO issuing a warning is excessive measure.
I know Reinhard and Tony probably disagree with the last sentence though.

Halil, Tony, the thing about about info versus warning versus error is our
own stuff. Keep in mind that these messages end up in the "debug feature"
as FFDC data. So it comes to the point which FFDC data do you/Tony want to
see there ? It should be enough to explain to a customer what happened without the need to "recreate with higher debug level" if something serious
happened. So my private decision table is:
1) is it something serious, something exceptional, something which may not

    come up again if tried to recreate ? Yes -> make it visible on the 

first
occurrence as error msg.
2) is it something you want to read when a customer hits it and you tell him

    to extract and examine the debug feature data ? Yes -> make it a 
warning
    and make sure your debug feature by default records warnings.
3) still serious, but may flood the debug feature. Good enough and high
    probability to reappear on a recreate ? Yes -> make it an info 
Quoted 11 lines

message
and live with the risk that you may not be able to explain to a
customer
what happened without a recreate and higher debug level.
4) not 1-3, -> maybe a debug msg but still think about what happens when a
customer enables "debug feature" with highest level. Does it squeeze
out
more important stuff ? Maybe make it dynamic debug with pr_debug()
(see
kernel docu admin-guide/dynamic-debug-howto.rst).

AFAIU the default log level of the S390 Debug Feature is 3 that is error. So warnings do not help us there by default. And if we are already asking the reporter to crank up the loglevel of the debug feature, we can as the reporter to crank it up to 5, assumed there is not too much stuff that log level 5 in that area... How much info stuff do we have for the 'ap' debug facility (I hope that is the facility used by vfio_ap)?

I think log levels are supposed to be primarily about severity, and and I'm not sure that a queue becoming unavailable in G1 without fist re-configuring the G2 so that it no more has access to the given queue is not really a warning severity thing. IMHO if we really do want people complaining about this should they ever see it, yes it should be a warning. If not then probably not.

Regards,
Halil

author maintainer
#8 lore raw
Quoted 74 lines · Halil Pasic
Quoted 60 lines · On Tue, 05 Dec 2023 09:04:23 +0100 Harald Freudenberger <[email protected]>…
Quoted 23 lines · Halil Pasic
Quoted 14 lines · On Mon, 4 Dec 2023 16:16:31 +0100 Christian Borntraeger…

Am 04.12.23 um 15:53 schrieb Tony Krowiak:

Quoted 13 lines · Christian Borntraeger
Quoted 11 lines

Am 29.11.23 um 15:35 schrieb Tony Krowiak:

Quoted 10 lines

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration. The response code 01 case will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

To me it looks like this can be triggered by the LPAR admin, correct? So it is not desireable but possible.
In that case I prefer to not use WARN, maybe use dev_warn or dev_err instead. WARN can be a disruptive event if panic_on_warn is set.

Yes, it can be triggered by the LPAR admin. I can't use dev_warn here because we don't have a reference to any device, but I can use pr_warn if that suffices.

Ok, please use pr_warn then.

Quoted 14 lines

Shouldn't we rather make this an 'info'. I mean we probably do not want
people complaining about this condition. Yes it should be a besNo info logging is done via the S390 Debug Feature in vfio_ap.
There are a few warning messages logged solely in the handle_pqap
and vfio_ap_irq_enable functions. The question is, why are we
talking about the S390 Debug Feature? We are talking about using
pr_warn verses pr_info. What am I missing here?t
practice
to coordinate such things with the guest, and ideally remove the
resource
from the guest first. But AFAIU our stack is supposed to be able to
handle something like this. IMHO issuing a warning is excessive
measure.
I know Reinhard and Tony probably disagree with the last sentence
though.

Halil, Tony, the thing about about info versus warning versus error is our
own stuff. Keep in mind that these messages end up in the "debug feature"
as FFDC data. So it comes to the point which FFDC data do you/Tony want to
see there ? It should be enough to explain to a customer what happened without the need to "recreate with higher debug level" if something serious
happened. So my private decision table is:
1) is it something serious, something exceptional, something which may not

     come up again if tried to recreate ? Yes -> make it visible on the

first
occurrence as error msg.
2) is it something you want to read when a customer hits it and you tell him

     to extract and examine the debug feature data ? Yes -> make it a
warning
     and make sure your debug feature by default records warnings.
3) still serious, but may flood the debug feature. Good enough and high
     probability to reappear on a recreate ? Yes -> make it an info
Quoted 11 lines

message
and live with the risk that you may not be able to explain to a
customer
what happened without a recreate and higher debug level.
4) not 1-3, -> maybe a debug msg but still think about what happens when a
customer enables "debug feature" with highest level. Does it squeeze
out
more important stuff ? Maybe make it dynamic debug with pr_debug()
(see
kernel docu admin-guide/dynamic-debug-howto.rst).

Quoted 7 lines

AFAIU the default log level of the S390 Debug Feature is 3 that is error. So warnings do not help us there by default. And if we are already asking the reporter to crank up the loglevel of the debug feature, we can as the reporter to crank it up to 5, assumed there is not too much stuff that log level 5 in that area... How much info stuff do we have for the 'ap' debug facility (I hope that is the facility used by vfio_ap)?

No info logging is done via the S390 Debug Feature in vfio_ap. There are a few warning messages logged solely in the handle_pqap and vfio_ap_irq_enable functions. The question is, why are we talking about the S390 Debug Feature given the discussion is about using pr_warn verses pr_info. What am I missing here?

Quoted 10 lines

I think log levels are supposed to be primarily about severity, and and I'm not sure that a queue becoming unavailable in G1 without fist re-configuring the G2 so that it no more has access to the given queue is not really a warning severity thing. IMHO if we really do want people complaining about this should they ever see it, yes it should be a warning. If not then probably not.

Regards,
Halil

maintainer Reviewed-by on v1 1/1
#9 lore raw
In reply to Tony Krowiak
Quoted 7 lines · On Wed, 29 Nov 2023 09:35:24 -0500 Tony Krowiak <[email protected]> wrote:

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration.

s/if\/when/at latest before/

I would argue that some of the cleanups need to happen before even 01 is reflected...

The code comments may also require a similar rewording. With that fixed:

Regards,
Halil

Quoted 5 lines

The response code 01 case
will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

author maintainer
#10 lore raw
Quoted 11 lines · Halil Pasic
Quoted 7 lines · On Wed, 29 Nov 2023 09:35:24 -0500 Tony Krowiak <[email protected]> wrote:

In the current implementation, response code 01 (AP queue number not valid) is handled as a default case along with other response codes returned from a queue reset operation that are not handled specifically. Barring a bug, response code 01 will occur only when a queue has been externally removed from the host's AP configuration; nn this case, the queue must be reset by the machine in order to avoid leaking crypto data if/when the queue is returned to the host's configuration.

Quoted 4 lines

s/if\/when/at latest before/

I would argue that some of the cleanups need to happen before even 01 is reflected...

To what cleanups are you referring?

Quoted 12 lines

The code comments may also require a similar rewording. With that fixed:

Regards,
Halil

Quoted 5 lines

The response code 01 case
will be handled specifically by logging a WARN message followed by cleaning up the IRQ resources.

maintainer
#11 lore raw
Quoted 6 lines · On Mon, 4 Dec 2023 12:51:49 -0500 Tony Krowiak <[email protected]> wrote:
Quoted 4 lines

s/if\/when/at latest before/

I would argue that some of the cleanups need to happen before even 01 is reflected...

To what cleanups are you referring?

Event notification and interruption disablement for starters. Otherwise OS has no way to figure out when is GISA and NIB safe to deallocate. Those actions are part of the reset process. I.e. some of the reset stuff can be deferred at most until the queue is made accessible again, some not so much.

Regards,
Halil

author maintainer
#12 lore raw
Quoted 5 lines · Halil Pasic
Quoted 2 lines · On Mon, 4 Dec 2023 12:51:49 -0500 Tony Krowiak <[email protected]> wrote:
Quoted 2 lines

s/if\/when/at latest before/

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

I would argue that some of the cleanups need to happen before even 01 is reflected...

To what cleanups are you referring?

Event notification and interruption disablement for starters. Otherwise OS has no way to figure out when is GISA and NIB safe to deallocate. Those actions are part of the reset process. I.e. some of the reset stuff can be deferred at most until the queue is made accessible again, some not so much.

How do you propose we disable interrupts if the PQAP(AQIC) will likely fail with response code 01 which is the subject of this patch? Do you think we should not free up the AQIC resources as we do in this patch?

Quoted 4 lines

Regards,
Halil