x86: Add missing forward declaration and include to hvm/svm/vmcb.h
PATCH 1/1 x86: Add missing forward declaration and include to hvm/svm/vmcb.h
"struct segment_register" requires a prior inclusion of x86_emulate.h, and it's missing a forward declaration of "struct vcpu" too.
Sort these out so the header can be included by itself.
Not a functional change.
---
This dependency already exists today. I'm just making it explicit.
"segment_register" is weird. It naturally belongs in vmcb.h, but the emulator makes use of it and must be compilable outside of Xen.
I don't like having vmcb.h depending on the emulator header, but I see no way of breaking that dependency without breaking the emulator unit tests.
--- xen/arch/x86/include/asm/hvm/svm/vmcb.h | 4 ++++ 1 file changed, 4 insertions(+)
xen/arch/x86/include/asm/hvm/svm/vmcb.h +4 -0
@@ -10,6 +10,10 @@#include <xen/types.h> +#include <asm/x86_emulate.h> /* for "struct segment_register" */ + +struct vcpu ; +/* general 1 intercepts */ enum GenericIntercept1bits {
base-commit: b6fc307b0b00314d4e4460fcf8be2cd9e4ff8652
Signature · 1 line
2.43.0
Quoted 8 lines · Alejandro Vallejo
"struct
segment_register" requires a prior inclusion ofx86_emulate.h, and it's missing a forward declaration of "struct vcpu" too.Sort these out so the header can be included by itself.
Not a functional change.
Signed-off-by Alejandro Vallejo <[email protected]>
I have a pending series for 4.22 which does substantially more rearranging of this file and others. See
https://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/xen-svm-hdrs
I'd found the need for struct vcpu, but not for segment_register. How did you find it?
Quoted 9 lines
---
This dependency already exists today. I'm just making it explicit."
segment_register" is weird. It naturally belongs invmcb.h, but the emulator makes use of it and must be compilable outside of Xen.I don't like having
vmcb.hdepending on the emulator header, but I see no way of breaking that dependency without breaking the emulator unit tests.
Pulling it into a new header is fine. The emulator can include anything (free-enough standing) in arch/x86/include/asm/
~Andrew
Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Alejandro Vallejo
"struct
segment_register" requires a prior inclusion ofx86_emulate.h, and it's missing a forward declaration of "struct vcpu" too.Sort these out so the header can be included by itself.
Not a functional change.
Quoted 8 lines
Quoted 1 line
Signed-off-by Alejandro Vallejo <[email protected]>I have a pending series for 4.22 which does substantially more rearranging of this file and others. See
https://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/xen-svm-hdrsI'd found the need for struct vcpu, but not for segment_register. How did you find it?
By chance. I happened to include it in a file at a position where the x86_emulate.h header hadn't been included.
Quoted 7 lines
Quoted 7 lines
---
This dependency already exists today. I'm just making it explicit."
segment_register" is weird. It naturally belongs invmcb.h, but the emulator makes use of it and must be compilable outside of Xen.
Quoted 6 lines
Quoted 3 lines
I don't like having
vmcb.hdepending on the emulator header, but I see no way of breaking that dependency without breaking the emulator unit tests.Pulling it into a new header is fine. The emulator can include anything (free-enough standing) in
arch/x86/include/asm/
I thought it didn't, if so I'm at a loss at to why segment_register is where it is.
Be that as it may, your series conflicts with this patch and it makes no sense to keep both around (when none of them are going in for until 4.22).
Will you be including a fix for the segment register in your series also? If so, I'll just drop this one.
Cheers,
Alejandro
Quoted 8 lines · Alejandro Vallejo
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Alejandro Vallejo
---
This dependency already exists today. I'm just making it explicit."
segment_register" is weird. It naturally belongs invmcb.h, but the emulator makes use of it and must be compilable outside of Xen.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I don't like having
vmcb.hdepending on the emulator header, but I see no way of breaking that dependency without breaking the emulator unit tests.Pulling it into a new header is fine. The emulator can include anything (free-enough standing) in
arch/x86/include/asm/I thought it didn't, if so I'm at a loss at to why
segment_registeris where it is.
Well - it's needed by the emulator as well as SVM.
Quoted 6 lines
Be that as it may, your series conflicts with this patch and it makes no sense to keep both around (when none of them are going in for until 4.22).
Will you be including a fix for the segment register in your series also? If so, I'll just drop this one.
I've folded the extra include into my first patch.
~Andrew
Quoted 12 lines · Andrew Cooper
Quoted 11 lines · Alejandro Vallejo
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Alejandro Vallejo
---
This dependency already exists today. I'm just making it explicit."
segment_register" is weird. It naturally belongs invmcb.h, but the emulator makes use of it and must be compilable outside of Xen.I don't like having
vmcb.hdepending on the emulator header, but I see no way of breaking that dependency without breaking the emulator unit tests.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Pulling it into a new header is fine. The emulator can include anything (free-enough standing) in
arch/x86/include/asm/I thought it didn't, if so I'm at a loss at to why
segment_registeris where it is.Well - it's needed by the emulator as well as SVM.
I meant that it's an SVM-specific description of segments, which is then conveniently reused on the emulator. It's a bit shocking for an SVM struct to be described by the emulator.
I'd have expected the dependency to go the other way around, if it were possible to have it that way.
Quoted 9 lines
Quoted 7 lines
Be that as it may, your series conflicts with this patch and it makes no sense to keep both around (when none of them are going in for until 4.22).
Will you be including a fix for the segment register in your series also? If so, I'll just drop this one.
I've folded the extra include into my first patch.
Ta.
Cheers,
Alejandro