Skip to contentSkip to conversation

kvm: Make kvm_rebooting visible

PATCH In review Andi Kleen 3 participants 5 messages Aug 5, 2013 – Aug 7, 2013 KVM

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

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
index 1580dd4..eff6abd 100644
@@ -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
#1 lore raw
Quoted 15 lines · Andi Kleen

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 +0 -0
index 1580dd4..eff6abd 100644

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

author
#2 lore raw
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.
maintainer
#3 lore raw
In reply to Andi Kleen
Quoted 16 lines · Andi Kleen

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 +0 -0
index 1580dd4..eff6abd 100644

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

author
#4 lore raw
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