s390/protvirt: fix compilation issue
Claudio Imbrenda
maintainerPATCH 1/1 s390/protvirt: fix compilation issue
The kernel fails to compile with CONFIG_PROTECTED_VIRTUALIZATION_GUEST set but CONFIG_KVM unset.
This patch fixes the issue by making the needed variable always available.
--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)
arch/s390/boot/uv.c +0 -2
@@ -7,9 +7,7 @@#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST int __bootdata_preserved (prot_virt_guest );#endif -#if IS_ENABLED (CONFIG_KVM )struct uv_info __bootdata_preserved (uv_info ); -#endif void uv_query_info (void ) {
arch/s390/kernel/uv.c +2 -1
@@ -23,10 +23,11 @@int __bootdata_preserved (prot_virt_guest );#endif +struct uv_info __bootdata_preserved (uv_info ); +#if IS_ENABLED (CONFIG_KVM )int prot_virt_host;EXPORT_SYMBOL (prot_virt_host); -struct uv_info __bootdata_preserved (uv_info );EXPORT_SYMBOL (uv_info);static int __init prot_virt_setup (char *val)
Signature · 1 line
2.25.3
Quoted 38 lines · Claudio Imbrenda
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information")Reported-by kbuild test robot <[email protected]>Reported-by Philipp Rudo <[email protected]>Suggested-by Philipp Rudo <[email protected]>CC Vasily Gorbik <[email protected]>Signed-off-by Claudio Imbrenda <[email protected]>--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)arch/s390/boot/uv.c +0
-2@@ -7,9 +7,7 @@#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST int __bootdata_preserved (prot_virt_guest );#endif -#if IS_ENABLED (CONFIG_KVM )struct uv_info __bootdata_preserved (uv_info ); -#endif void uv_query_info (void ) {arch/s390/kernel/uv.c +0
-0@@ -23,10 +23,11 @@int __bootdata_preserved (prot_virt_guest );#endif
arch/s390/kernel/uv.c line 33
Quoted 10 lines
arch/s390/kernel/uv.c +2
-1+struct uv_info __bootdata_preserved (uv_info ); +#if IS_ENABLED (CONFIG_KVM )int prot_virt_host;EXPORT_SYMBOL (prot_virt_host); -struct uv_info __bootdata_preserved (uv_info );EXPORT_SYMBOL (uv_info);static int __init prot_virt_setup (char *val)
Signature · 3 lines
Thanks, David / dhildenb
Quoted 11 lines · On Thu, 23 Apr 2020 14:01:14 +0200 Claudio Imbrenda <[email protected]>…
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information")Reported-by kbuild test robot <[email protected]>Reported-by Philipp Rudo <[email protected]>Suggested-by Philipp Rudo <[email protected]>CC Vasily Gorbik <[email protected]>Signed-off-by Claudio Imbrenda <[email protected]>
Quoted 5 lines
--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)
Quoted 4 lines · Claudio Imbrenda
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
This statement confuses me a bit.
It's worth to mention that both arch/s390/boot/uv.c (for the decompressor) and arch/s390/kernel/uv.c (for the main kernel) are only built when either CONFIG_PROTECTED_VIRTUALIZATION_GUEST or CONFIG_KVM is enabled.
Both arch/s390/boot/Makefile and arch/s390/kernel/Makefile contain:
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
So this makes the variable available when CONFIG_PROTECTED_VIRTUALIZATION_GUEST or CONFIG_KVM (expressed via CONFIG_PGSTE) is enabled. Hence no need for extra conditions for variable declaration.
Quoted 30 lines
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information")Reported-by kbuild test robot <[email protected]>Reported-by Philipp Rudo <[email protected]>Suggested-by Philipp Rudo <[email protected]>CC Vasily Gorbik <[email protected]>Signed-off-by Claudio Imbrenda <[email protected]>--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)arch/s390/boot/uv.c +0
-2@@ -7,9 +7,7 @@#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST int __bootdata_preserved (prot_virt_guest );#endif -#if IS_ENABLED (CONFIG_KVM )struct uv_info __bootdata_preserved (uv_info ); -#endif void uv_query_info (void ) {arch/s390/kernel/uv.c +0
-0
arch/s390/kernel/uv.c line 31
Quoted 10 lines
arch/s390/kernel/uv.c +2
-1@@ -23,10 +23,11 @@int __bootdata_preserved (prot_virt_guest );#endif +struct uv_info __bootdata_preserved (uv_info ); +#if IS_ENABLED (CONFIG_KVM )int prot_virt_host;EXPORT_SYMBOL (prot_virt_host); -struct uv_info __bootdata_preserved (uv_info );EXPORT_SYMBOL (uv_info);
hm, EXPORT_SYMBOL(uv_info) is not needed without CONFIG_KVM and this saves 1 symbol export, but I'd still made EXPORT_SYMBOL follow the declaration immediately. Documentation/process/coding-style.rst mentions that only for function declarations though.
Claudio Imbrenda
maintainerQuoted 17 lines · On Thu, 23 Apr 2020 14:54:22 +0200 Vasily Gorbik <[email protected]> wrote:
Quoted 5 lines · Claudio Imbrenda
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
This statement confuses me a bit.
It's worth to mention that both
arch/s390/boot/uv.c(for the decompressor) andarch/s390/kernel/uv.c(for the main kernel) are only built when eitherCONFIG_PROTECTED_VIRTUALIZATION_GUESTorCONFIG_KVMis enabled.
Botharch/s390/boot/Makefileandarch/s390/kernel/Makefilecontain:
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST)
$(CONFIG_PGSTE)) += uv.o
Quoted 4 lines
So this makes the variable available when
CONFIG_PROTECTED_VIRTUALIZATION_GUESTorCONFIG_KVM(expressed viaCONFIG_PGSTE) is enabled. Hence no need for extra conditions for variable declaration.
yes, "always available" when the file is compiled at all, obviously.
in fact, there are some probably useless ifdefs in that file too, but this patch should only address the bug
Quoted 33 lines
Quoted 33 lines
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmwareinterface for Ultravisor information") Reported-by: kbuild test robot <[email protected]> Reported-by: Philipp Rudo <[email protected]> Suggested-by: Philipp Rudo <[email protected]> CC: Vasily Gorbik <[email protected]>
Signed-off-by Claudio Imbrenda <[email protected]>--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)arch/s390/boot/uv.c +0
-2@@ -7,9 +7,7 @@#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST int __bootdata_preserved (prot_virt_guest );#endif -#if IS_ENABLED (CONFIG_KVM )struct uv_info __bootdata_preserved (uv_info ); -#endif void uv_query_info (void ) {arch/s390/kernel/uv.c +0
-0@@ -23,10 +23,11 @@int __bootdata_preserved (prot_virt_guest );#endif
Quoted 12 lines
arch/s390/kernel/uv.c line 31
Quoted 7 lines
arch/s390/kernel/uv.c +2
-1+struct uv_info __bootdata_preserved (uv_info ); +#if IS_ENABLED (CONFIG_KVM )int prot_virt_host;EXPORT_SYMBOL (prot_virt_host); -struct uv_info __bootdata_preserved (uv_info );EXPORT_SYMBOL (uv_info);hm,
EXPORT_SYMBOL(uv_info)is not needed withoutCONFIG_KVMand this saves 1 symbol export, but I'd still madeEXPORT_SYMBOLfollow the declaration immediately.Documentation/process/coding-style.rstmentions that only for function declarations though.
I was wondering the same regarding the export.
I don't have any strong opinions, so if anyone has a preference, speak up and I can fix it.
Quoted 1 line
Reviewed-by Vasily Gorbik <[email protected]>
Christian Borntraeger
Acked-byQuoted 66 lines · Vasily Gorbik
Quoted 4 lines · Claudio Imbrenda
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
This statement confuses me a bit.
It's worth to mention that both
arch/s390/boot/uv.c(for the decompressor) andarch/s390/kernel/uv.c(for the main kernel) are only built when eitherCONFIG_PROTECTED_VIRTUALIZATION_GUESTorCONFIG_KVMis enabled.
Botharch/s390/boot/Makefileandarch/s390/kernel/Makefilecontain:
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.oSo this makes the variable available when
CONFIG_PROTECTED_VIRTUALIZATION_GUESTorCONFIG_KVM(expressed viaCONFIG_PGSTE) is enabled. Hence no need for extra conditions for variable declaration.Quoted 30 lines
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information")Reported-by kbuild test robot <[email protected]>Reported-by Philipp Rudo <[email protected]>Suggested-by Philipp Rudo <[email protected]>CC Vasily Gorbik <[email protected]>Signed-off-by Claudio Imbrenda <[email protected]>--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)arch/s390/boot/uv.c +0
-2@@ -7,9 +7,7 @@#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST int __bootdata_preserved (prot_virt_guest );#endif -#if IS_ENABLED (CONFIG_KVM )struct uv_info __bootdata_preserved (uv_info ); -#endif void uv_query_info (void ) {arch/s390/kernel/uv.c +0
-0arch/s390/kernel/uv.c line 31
Quoted 10 lines
arch/s390/kernel/uv.c +2
-1@@ -23,10 +23,11 @@int __bootdata_preserved (prot_virt_guest );#endif +struct uv_info __bootdata_preserved (uv_info ); +#if IS_ENABLED (CONFIG_KVM )int prot_virt_host;EXPORT_SYMBOL (prot_virt_host); -struct uv_info __bootdata_preserved (uv_info );EXPORT_SYMBOL (uv_info);hm,
EXPORT_SYMBOL(uv_info)is not needed withoutCONFIG_KVMand this saves 1 symbol export, but I'd still madeEXPORT_SYMBOLfollow the declaration immediately.Documentation/process/coding-style.rstmentions that only for function declarations though.
Quoted 1 line
Reviewed-by Vasily Gorbik <[email protected]>
Vasily, I guess you have a pull request soon? Do you want to pick this?
Vasily Gorbik
maintainerQuoted 4 lines · Christian Borntraeger
Vasily, I guess you have a pull request soon? Do you want to pick this?
yes, I'll pick this up.
Quoted 11 lines · Claudio Imbrenda
The kernel fails to compile with
CONFIG_PROTECTED_VIRTUALIZATION_GUESTset butCONFIG_KVMunset.This patch fixes the issue by making the needed variable always available.
Fixes a0f60f8431999bf5 ("s390/protvirt: Add sysfs firmware interface for Ultravisor information")Reported-by kbuild test robot <[email protected]>Reported-by Philipp Rudo <[email protected]>Suggested-by Philipp Rudo <[email protected]>CC Vasily Gorbik <[email protected]>Signed-off-by Claudio Imbrenda <[email protected]>
Quoted 5 lines
--- arch/s390/boot/uv.c | 2 -- arch/s390/kernel/uv.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)
Applied, thanks