kvm: Make kvm_rebooting visible
PATCH 1/1 kvm: Make kvm_rebooting visible
From: Andi Kleen <[email protected]>
kvm_rebooting is referenced from assembler code, thus needs to be visible.
--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +1 -1
@@ -95,7 +95,7 @@ static void hardware_disable_all(void);static void kvm_io_bus_destroy (struct kvm_io_bus *bus); -bool kvm_rebooting; +__visible bool kvm_rebooting;EXPORT_SYMBOL_GPL (kvm_rebooting);static bool largepages_enabled = true;
Signature · 1 line
1.8.3.1
Quoted 15 lines · Andi Kleen
From: Andi Kleen <[email protected]>
kvm_rebootingis referenced from assembler code, thus needs to be visible.Signed-off-by Andi Kleen <[email protected]>--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)virt/kvm/kvm_main.c +0
-0
virt/kvm/kvm_main.c static void hardware_disable_all(void); · line 99
Quoted 6 lines
virt/kvm/kvm_main.c +1
-1@@ -95,7 +95,7 @@ static void hardware_disable_all(void);static void kvm_io_bus_destroy (struct kvm_io_bus *bus); -bool kvm_rebooting; +__visible bool kvm_rebooting;EXPORT_SYMBOL_GPL (kvm_rebooting);
How many of these are there kernel wide?
Could you do something like this instead:
DEFINE_AND_EXPORT_GPL(bool, kvm_rebooting);
The definition of DEFINE_AND_EXPORT_GPL(_type, _name) is left as an exercise for the reader.
David Daney
Quoted 7 lines
virt/kvm/kvm_main.c static void hardware_disable_all(void); · line 99
Quoted 5 lines
static void
kvm_io_bus_destroy(struct kvm_io_bus *bus);virt/kvm/kvm_main.c +1
-1-bool kvm_rebooting; +__visible bool kvm_rebooting;EXPORT_SYMBOL_GPL (kvm_rebooting);How many of these are there kernel wide?
Not very many (at least on x86 allyes) <~10.
Also most users are not exported.
Probably not worth an own macro.
Quoted 7 lines
Could you do something like this instead:
DEFINE_AND_EXPORT_GPL(bool, kvm_rebooting);The definition of
DEFINE_AND_EXPORT_GPL(_type, _name)is left as an exercise for the reader.
I actually had EXPORT_SYMBOL make things always visible for a long time, but it prevents optimizing away unused code in very small non modular configurations. So I switched to separate annotations.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Paolo Bonzini
maintainerQuoted 16 lines · Andi Kleen
From: Andi Kleen <[email protected]>
kvm_rebootingis referenced from assembler code, thus needs to be visible.Signed-off-by Andi Kleen <[email protected]>--- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)virt/kvm/kvm_main.c +0
-0
virt/kvm/kvm_main.c static void hardware_disable_all(void); · line 101
Quoted 8 lines
virt/kvm/kvm_main.c +1
-1@@ -95,7 +95,7 @@ static void hardware_disable_all(void);static void kvm_io_bus_destroy (struct kvm_io_bus *bus); -bool kvm_rebooting; +__visible bool kvm_rebooting;EXPORT_SYMBOL_GPL (kvm_rebooting);static bool largepages_enabled = true;
Should this go into 3.11 too? Or it never worked?
Paolo
Quoted 2 lines
Should this go into 3.11 too? Or it never worked?
It's ok to keep it for .12. It was broken since it was merged, but normal builds don't trigger the problem.
-andi