s390x: fallthrough annotations
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
PATCH 1/2 s390x/pci: add some fallthrough annotations
According to the comment, the bits are supposed to accumulate.
--- hw/s390x/s390-pci-inst.c | 2 ++ 1 file changed, 2 insertions(+)
hw/s390x/s390-pci-inst.c +2 -0
@@ -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
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>
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@@ -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
-0case 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
-0case ZPCI_FS_ENABLED : fib.fc |=0x80 ;if (pbdev->iommu->enabled) {
Collin Walling
Acked-byRe: [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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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
-0case ZPCI_FS_ENABLED : fib.fc |=0x80 ;if (pbdev->iommu->enabled) {
Side note: is there somewhere that I could access this bug report? :)
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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
-0case ZPCI_FS_ENABLED : fib.fc |=0x80 ;if (pbdev->iommu->enabled) {Acked-by Collin Walling <[email protected]>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).
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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
-0case ZPCI_FS_ENABLED : fib.fc |=0x80 ;if (pbdev->iommu->enabled) {Acked-by Collin Walling <[email protected]>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).
Collin Walling
Acked-byRe: [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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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.
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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.
Acked-by Collin Walling <[email protected]>
Just to be clear: You think that the current code is correct AFAYCS?
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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.
Acked-by Collin Walling <[email protected]>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.
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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.
Acked-by Collin Walling <[email protected]>
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.
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.
Reported-by Stefan Weil <[email protected]>Fixes 5d1abf234462 ("s390x/pci: enforce zPCI state checking")Signed-off-by Cornelia Huck <[email protected]>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@@ -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
-0case 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.
Acked-by Collin Walling <[email protected]>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.
PATCH 2/2 s390x/tcg: move fallthrough annotation
In reply to Cornelia Huck...so that the compiler properly recognizes it.
--- target/s390x/translate_vx.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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 ; }
Signature · 1 line
2.20.1
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.
Reported-by Stefan Weil <[email protected]>Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")Signed-off-by Cornelia Huck <[email protected]>--- target/s390x/translate_vx.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/s390x/translate_vx.inc.c +0
-0
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
Re: [Qemu-devel] [PATCH for-4.1 2/2] s390x/tcg: move fallthrough annotation
In reply to Cornelia HuckQuoted 14 lines · Cornelia Huck
...so that the compiler properly recognizes it.
Reported-by Stefan Weil <[email protected]>Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")Signed-off-by Cornelia Huck <[email protected]>--- target/s390x/translate_vx.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/s390x/translate_vx.inc.c +0
-0
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
-0gen_program_exception (s,PGM_SPECIFICATION );return DISAS_NORETURN ; }
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.
Reported-by Stefan Weil <[email protected]>Fixes f180da83c039 ("s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO")Signed-off-by Cornelia Huck <[email protected]>--- target/s390x/translate_vx.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/s390x/translate_vx.inc.c +0
-0target/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
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks, but this is already merged :)
Quoted 5 lines
Quoted 5 lines
target/s390x/translate_vx.inc.c +0
-0gen_program_exception (s,PGM_SPECIFICATION );return DISAS_NORETURN ; }
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 annotationhw/s390x/s390-pci-inst.c | 2 ++ target/s390x/translate_vx.inc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)