Skip to contentSkip to conversation

s390x: fallthrough annotations

PATCH In review Cornelia Huck 5 participants 16 messages Jul 8, 2019 – Jul 18, 2019

lore
Share & tools
lore
#0 lore raw

cover s390x: fallthrough annotations

I looked through the build log linked to in <[email protected]> and came up with the following patches for s390x. I plan to queue them to my fixes branch for 4.1.

Cornelia Huck (2):
s390x/pci: add some fallthrough annotations
s390x/tcg: move fallthrough annotation

 hw/s390x/s390-pci-inst.c        | 2 ++
 target/s390x/translate_vx.inc.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 s390x/pci: add some fallthrough annotations

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")
---
 hw/s390x/s390-pci-inst.c | 2 ++
 1 file changed, 2 insertions(+)
hw/s390x/s390-pci-inst.c +2 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
      * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
     case ZPCI_FS_ERROR:
         fib.fc |= 0x20;
+        /* fallthrough */
     case ZPCI_FS_BLOCKED:
         fib.fc |= 0x40;
+        /* fallthrough */
     case ZPCI_FS_ENABLED:
         fib.fc |= 0x80;
         if (pbdev->iommu->enabled) {
Signature · 1 line
2.20.1
#2 lore raw

Re: [Qemu-devel] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 13 lines
---
 hw/s390x/s390-pci-inst.c | 2 ++
 1 file changed, 2 insertions(+)
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
      * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
     case ZPCI_FS_ERROR:
         fib.fc |= 0x20;
+        /* fallthrough */

This is correct, in case of an error we are also blocked.

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
     case ZPCI_FS_BLOCKED:
         fib.fc |= 0x40;
+        /* fallthrough */

I think this is also correct, but it would be good if Collin could verify.

Quoted 4 lines
hw/s390x/s390-pci-inst.c +0 -0
     case ZPCI_FS_ENABLED:
         fib.fc |= 0x80;
         if (pbdev->iommu->enabled) {
#3 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
  hw/s390x/s390-pci-inst.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
       * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
      case ZPCI_FS_ERROR:
          fib.fc |= 0x20;
+        /* fallthrough */

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
      case ZPCI_FS_BLOCKED:
          fib.fc |= 0x40;
+        /* fallthrough */

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Functionally, this doesn't change anything... so I'll at least give it an ACK for now and investigate this further.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1218

Quoted 4 lines
hw/s390x/s390-pci-inst.c +0 -0
      case ZPCI_FS_ENABLED:
          fib.fc |= 0x80;
          if (pbdev->iommu->enabled) {

Side note: is there somewhere that I could access this bug report? :)

#4 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 38 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
  hw/s390x/s390-pci-inst.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
       * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
      case ZPCI_FS_ERROR:
          fib.fc |= 0x20;
+        /* fallthrough */  

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 4 lines
Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
      case ZPCI_FS_BLOCKED:
          fib.fc |= 0x40;
+        /* fallthrough */  
Quoted 8 lines
Quoted 2 lines

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Might this also be a real issue? Not matching the architecture is not a good sign...

Quoted 3 lines

Functionally, this doesn't change anything... so I'll at least give it an ACK for now and investigate this further.

I prefer to hold off on this patch for now, unless we're really sure that the code does not have a problem here. Actually documenting something that might be wrong does not sound like the right thing to do :/

Quoted 11 lines
Quoted 7 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1218

Quoted 5 lines
hw/s390x/s390-pci-inst.c +0 -0
      case ZPCI_FS_ENABLED:
          fib.fc |= 0x80;
          if (pbdev->iommu->enabled) {

Side note: is there somewhere that I could access this bug report? :)

It's the build log with the extra warnings in
https://qemu.weilnetz.de/results/build-20190708.txt (referenced in <[email protected]> on qemu-devel).

#5 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 44 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 41 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
  hw/s390x/s390-pci-inst.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
       * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
      case ZPCI_FS_ERROR:
          fib.fc |= 0x20;
+        /* fallthrough */    

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
      case ZPCI_FS_BLOCKED:
          fib.fc |= 0x40;
+        /* fallthrough */    

I think this is also correct, but it would be good if Collin could verify.

Quoted 8 lines
Quoted 5 lines

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Might this also be a real issue? Not matching the architecture is not a good sign...

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Quoted 25 lines
Quoted 4 lines

Functionally, this doesn't change anything... so I'll at least give it an ACK for now and investigate this further.

I prefer to hold off on this patch for now, unless we're really sure that the code does not have a problem here. Actually documenting something that might be wrong does not sound like the right thing to do :/

Quoted 11 lines
Quoted 7 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1218

Quoted 5 lines
hw/s390x/s390-pci-inst.c +0 -0
      case ZPCI_FS_ENABLED:
          fib.fc |= 0x80;
          if (pbdev->iommu->enabled) {

Side note: is there somewhere that I could access this bug report? :)

It's the build log with the extra warnings in
https://qemu.weilnetz.de/results/build-20190708.txt (referenced in <[email protected]> on qemu-devel).

#6 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 53 lines · Cornelia Huck
Quoted 50 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 46 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
   hw/s390x/s390-pci-inst.c | 2 ++
   1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
        * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
       case ZPCI_FS_ERROR:
           fib.fc |= 0x20;
+        /* fallthrough */

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
       case ZPCI_FS_BLOCKED:
           fib.fc |= 0x40;
+        /* fallthrough */

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Quoted 6 lines
Quoted 2 lines

Might this also be a real issue? Not matching the architecture is not a good sign...

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Let's take it for now.

#7 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 57 lines · On Tue, 16 Jul 2019 14:34:22 -0400 Collin Walling <[email protected]> wrote:
Quoted 56 lines · Cornelia Huck
Quoted 52 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 38 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
   hw/s390x/s390-pci-inst.c | 2 ++
   1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
        * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
       case ZPCI_FS_ERROR:
           fib.fc |= 0x20;
+        /* fallthrough */  

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 4 lines
Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
       case ZPCI_FS_BLOCKED:
           fib.fc |= 0x40;
+        /* fallthrough */  
Quoted 8 lines
Quoted 2 lines

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Might this also be a real issue? Not matching the architecture is not a good sign...

Quoted 8 lines
Quoted 3 lines

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Let's take it for now.

Just to be clear: You think that the current code is correct AFAYCS?

#8 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 64 lines · Cornelia Huck
Quoted 61 lines · On Tue, 16 Jul 2019 14:34:22 -0400 Collin Walling <[email protected]> wrote:
Quoted 59 lines · Cornelia Huck
Quoted 44 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 41 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
   hw/s390x/s390-pci-inst.c | 2 ++
   1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
        * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
       case ZPCI_FS_ERROR:
           fib.fc |= 0x20;
+        /* fallthrough */  

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
       case ZPCI_FS_BLOCKED:
           fib.fc |= 0x40;
+        /* fallthrough */  

I think this is also correct, but it would be good if Collin could verify.

Quoted 8 lines
Quoted 5 lines

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Might this also be a real issue? Not matching the architecture is not a good sign...

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Quoted 6 lines
Quoted 4 lines

Let's take it for now.

Just to be clear: You think that the current code is correct AFAYCS?

I also looked into this again.
There is a possibility to also be in disabled state.
From what I can see, it makes sense that blocked and error belong to the enable state so the patch seems correct.

#9 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 72 lines · Christian Borntraeger
Quoted 69 lines · Cornelia Huck
Quoted 65 lines · On Tue, 16 Jul 2019 14:34:22 -0400 Collin Walling <[email protected]> wrote:
Quoted 53 lines · Cornelia Huck
Quoted 50 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 46 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
    hw/s390x/s390-pci-inst.c | 2 ++
    1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
         * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
        case ZPCI_FS_ERROR:
            fib.fc |= 0x20;
+        /* fallthrough */

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
        case ZPCI_FS_BLOCKED:
            fib.fc |= 0x40;
+        /* fallthrough */

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Quoted 6 lines
Quoted 2 lines

Might this also be a real issue? Not matching the architecture is not a good sign...

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Let's take it for now.

Quoted 7 lines
Quoted 1 line

Just to be clear: You think that the current code is correct AFAYCS?

I also looked into this again.
There is a possibility to also be in disabled state.
From what I can see, it makes sense that blocked and error belong to the enable state
so the patch seems correct.

Yes I agree. The material I referenced required me to look over a few times and ask around a bit. The patch is good. Apologies for my ambiguous response.

#10 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH for-4.1 1/2] s390x/pci: add some fallthrough annotations

Quoted 81 lines · On Wed, 17 Jul 2019 08:52:54 -0400 Collin Walling <[email protected]> wrote:
Quoted 72 lines · Christian Borntraeger
Quoted 69 lines · Cornelia Huck
Quoted 65 lines · On Tue, 16 Jul 2019 14:34:22 -0400 Collin Walling <[email protected]> wrote:
Quoted 53 lines · Cornelia Huck
Quoted 50 lines · On Wed, 10 Jul 2019 10:20:41 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 46 lines · On Tue, 9 Jul 2019 18:55:34 -0400 Collin Walling <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Cornelia Huck

According to the comment, the bits are supposed to accumulate.

Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")

This patch does not change behaviour, so it is certainly not wrong.

So lets have a look at if the bug report was actually a real bug or just a missing annotation.

Quoted 4 lines
---
    hw/s390x/s390-pci-inst.c | 2 ++
    1 file changed, 2 insertions(+)
Quoted 12 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1212

Quoted 9 lines
hw/s390x/s390-pci-inst.c +1 -0
index 61f30b8e55d2..00235148bed7 100644
@@ -1209,8 +1209,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
         * FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
        case ZPCI_FS_ERROR:
            fib.fc |= 0x20;
+        /* fallthrough */  

This is correct, in case of an error we are also blocked.

Agreed. This is definitely correct based on our architecture.

Quoted 6 lines

hw/s390x/s390-pci-inst.c int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, · line 1215

Quoted 3 lines
hw/s390x/s390-pci-inst.c +1 -0
        case ZPCI_FS_BLOCKED:
            fib.fc |= 0x40;
+        /* fallthrough */  

I think this is also correct, but it would be good if Collin could verify.

I failed to find anything to support setting the function control enabled bit when the function state is in error / blocked. I'm assuming this might be some QEMU hack to get things working? I'll have to dive further to understand why this was done this way, as it doesn't align with how the s390x architecture is documented. It's confusing.

Quoted 6 lines
Quoted 2 lines

Might this also be a real issue? Not matching the architecture is not a good sign...

Friendly ping. If we still want to have this patch or a fix in 4.1, we need to find out soon...

Let's take it for now.

Quoted 7 lines
Quoted 1 line

Just to be clear: You think that the current code is correct AFAYCS?

I also looked into this again.
There is a possibility to also be in disabled state.
From what I can see, it makes sense that blocked and error belong to the enable state
so the patch seems correct.

Quoted 4 lines

Yes I agree. The material I referenced required me to look over a few times and ask around a bit. The patch is good. Apologies for my ambiguous response.

Ok, thanks for the clarification. Queued now.

#11 lore raw

PATCH 2/2 s390x/tcg: move fallthrough annotation

In reply to Cornelia Huck

...so that the compiler properly recognizes it.

Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")
---
 target/s390x/translate_vx.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/translate_vx.inc.c +1 -1
index 7b1d31cba5cf..41d5cf869f94 100644
@@ -577,8 +577,8 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o)
             enr = 0;
             break;
         }
-    default:
         /* fallthrough */
+    default:
         gen_program_exception(s, PGM_SPECIFICATION);
         return DISAS_NORETURN;
     }
Signature · 1 line
2.20.1
Reviewed-by on v1 2/2
#12 lore raw

Re: [Qemu-devel] [PATCH for-4.1 2/2] s390x/tcg: move fallthrough annotation

Am 08.07.2019 um 14:54 schrieb Cornelia Huck:

Quoted 14 lines

...so that the compiler properly recognizes it.

Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")
---
 target/s390x/translate_vx.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/translate_vx.inc.c +0 -0
index 7b1d31cba5cf..41d5cf869f94 100644

target/s390x/translate_vx.inc.c static DisasJumpType op_vllez(DisasContext *s, DisasOps *o) · line 584

Quoted 9 lines
target/s390x/translate_vx.inc.c +1 -1
@@ -577,8 +577,8 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o)
             enr = 0;
             break;
         }
-    default:
         /* fallthrough */
+    default:
         gen_program_exception(s, PGM_SPECIFICATION);
         return DISAS_NORETURN;
     }

Thanks, Stefan

Reviewed-by on v1 2/2
#13 lore raw

Re: [Qemu-devel] [PATCH for-4.1 2/2] s390x/tcg: move fallthrough annotation

In reply to Cornelia Huck
Quoted 14 lines · Cornelia Huck

...so that the compiler properly recognizes it.

Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")
---
 target/s390x/translate_vx.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/translate_vx.inc.c +0 -0
index 7b1d31cba5cf..41d5cf869f94 100644

target/s390x/translate_vx.inc.c static DisasJumpType op_vllez(DisasContext *s, DisasOps *o) · line 581

Quoted 6 lines
target/s390x/translate_vx.inc.c +1 -1
@@ -577,8 +577,8 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o)
             enr = 0;
             break;
         }
-    default:
         /* fallthrough */
+    default:

Haha :)

Quoted 4 lines
target/s390x/translate_vx.inc.c +0 -0
         gen_program_exception(s, PGM_SPECIFICATION);
         return DISAS_NORETURN;
     }
#14 lore raw

Re: [Qemu-devel] [PATCH for-4.1 2/2] s390x/tcg: move fallthrough annotation

Quoted 24 lines · On Tue, 16 Jul 2019 17:22:59 +0200 Philippe Mathieu-Daudé <[email protected]>…
Quoted 14 lines · Cornelia Huck

...so that the compiler properly recognizes it.

Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")
---
 target/s390x/translate_vx.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/translate_vx.inc.c +0 -0
index 7b1d31cba5cf..41d5cf869f94 100644

target/s390x/translate_vx.inc.c static DisasJumpType op_vllez(DisasContext *s, DisasOps *o) · line 581

Quoted 6 lines
target/s390x/translate_vx.inc.c +1 -1
@@ -577,8 +577,8 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o)
             enr = 0;
             break;
         }
-    default:
         /* fallthrough */
+    default:  

Haha :)

Quoted 1 line

Thanks, but this is already merged :)

Quoted 5 lines
Quoted 5 lines
target/s390x/translate_vx.inc.c +0 -0
         gen_program_exception(s, PGM_SPECIFICATION);
         return DISAS_NORETURN;
     }
#15 lore raw
In reply to Cornelia Huck
Quoted 4 lines · On Mon, 8 Jul 2019 14:54:31 +0200 Cornelia Huck <[email protected]> wrote:

I looked through the build log linked to in <[email protected]> and came up with the following patches for s390x. I plan to queue them to my fixes branch for 4.1.

Queued patch 2; still waiting for a final ack for patch 1.

Quoted 9 lines

Cornelia Huck (2):
s390x/pci: add some fallthrough annotations
s390x/tcg: move fallthrough annotation

 hw/s390x/s390-pci-inst.c        | 2 ++
 target/s390x/translate_vx.inc.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)