Skip to contentSkip to conversation

ia64 kvm fixes for O=... builds

PATCH In review Al Viro 4 participants 7 messages Apr 28, 2008 – May 5, 2008

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 ia64 kvm fixes for O=... builds

* EXTRA_CFLAGS do not apply for *.S
* don't bother with symlinks to ../lib/mem*.S, just add ../lib/mem*.o to object list

---
 arch/ia64/kvm/Makefile |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
arch/ia64/kvm/Makefile +2 -5
index 41b034f..5235339 100644
@@ -42,10 +42,7 @@ $(obj)/$(offsets-file): arch/ia64/kvm/asm-offsets.s
 #
 
 EXTRA_CFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
-
-$(addprefix $(objtree)/,$(obj)/memcpy.S $(obj)/memset.S):
-	$(shell ln -snf ../lib/memcpy.S $(src)/memcpy.S)
-	$(shell ln -snf ../lib/memset.S $(src)/memset.S)
+EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
 
 common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o)
 
@@ -57,5 +54,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
 	vtlb.o process.o
 #Add link memcpy and memset to avoid possible structure assignment error
-kvm-intel-objs += memset.o memcpy.o
+kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
Signature · 1 line
1.5.3.GIT
#1 lore raw
Quoted 29 lines · Al Viro

* EXTRA_CFLAGS do not apply for *.S
* don't bother with symlinks to ../lib/mem*.S, just add ../lib/mem*.o to object list

---
 arch/ia64/kvm/Makefile |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
arch/ia64/kvm/Makefile +1 -4
index 41b034f..5235339 100644
@@ -42,10 +42,7 @@ $(obj)/$(offsets-file): arch/ia64/kvm/asm-offsets.s
 #
 
 EXTRA_CFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
-
-$(addprefix $(objtree)/,$(obj)/memcpy.S $(obj)/memset.S):
-	$(shell ln -snf ../lib/memcpy.S $(src)/memcpy.S)
-	$(shell ln -snf ../lib/memset.S $(src)/memset.S)
+EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
 
 common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o)
 
@@ -57,5 +54,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o
 	mmio.o \ vtlb.o process.o
 #Add link memcpy and memset to avoid possible structure assignment
Quoted 3 lines

error -kvm-intel-objs += memset.o memcpy.o +kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o

I don't think it is workable for kvm-ia64. Currently, kvm-intel module needs to be relocated at insertion time, so the code is position-indenpent. Howerver, lib/*.memset.o(memcoy.o) are not compiled as position independent code, they can't be linked into the module correctly in your way. That is why we use symbol link instead of linking the objects under /lib.

Xiantao

#2 lore raw
Quoted 7 lines · Xiantao
Quoted 6 lines

kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o
mmio.o \ vtlb.o process.o
#Add link memcpy and memset to avoid possible structure assignment
error -kvm-intel-objs += memset.o memcpy.o +kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o

Quoted 6 lines

I don't think it is workable for kvm-ia64. Currently, kvm-intel module needs to be relocated at insertion time, so the code is position-indenpent. Howerver, lib/*.memset.o(memcoy.o) are not compiled as position independent code, they can't be linked into the module correctly in your way. That is why we use symbol link instead of linking the objects under /lib.

symlinks won't work as you use them. If you really need separately compiled, use file with a couple of #include "../lib/......S" and be done with that.

#3 lore raw
Quoted 15 lines · Al Viro
Quoted 7 lines · Xiantao
Quoted 6 lines

kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o
mmio.o \ vtlb.o process.o
#Add link memcpy and memset to avoid possible structure assignment
error -kvm-intel-objs += memset.o memcpy.o +kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o

Quoted 6 lines

I don't think it is workable for kvm-ia64. Currently, kvm-intel module needs to be relocated at insertion time, so the code is position-indenpent. Howerver, lib/*.memset.o(memcoy.o) are not compiled as position independent code, they can't be linked into the module correctly in your way. That is why we use symbol link instead of linking the objects under /lib.

Quoted 3 lines

symlinks won't work as you use them. If you really need separately compiled, use file with a couple of #include "../lib/......S" and be done with that.

... like this, perhaps? I still wonder what will happen with either this or the original tree if you make CONFIG_KVM_INTEL=y, though - won't either variant give you duplicate symbols?

arch/ia64/kvm/Makefile +1 -1
index 5235339..e7b9432 100644
@@ -54,5 +54,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
 	vtlb.o process.o
 #Add link memcpy and memset to avoid possible structure assignment error
-kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
+kvm-intel-objs += memset.o memcpy.o
 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
arch/ia64/kvm/memcpy.S new file +1 -0
new file mode 100644
index 0000000..c04cdbe
@@ -0,0 +1 @@
+#include "../lib/memcpy.S"
arch/ia64/kvm/memset.S new file +1 -0
new file mode 100644
index 0000000..83c3066
@@ -0,0 +1 @@
+#include "../lib/memset.S"
#4 lore raw

Hi, Airo
Currenlty, We only allow CONFIG_KVM_INTEL = m , since it needs to
be relocated at insertion time.
Xiantao

Quoted 48 lines · Al Viro
Quoted 14 lines · Al Viro
Quoted 6 lines · Xiantao
Quoted 5 lines

kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ vtlb.o process.o #Add link memcpy and memset to avoid
possible structure assignment error -kvm-intel-objs += memset.o memcpy.o +kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o

Quoted 6 lines

I don't think it is workable for kvm-ia64. Currently, kvm-intel module needs to be relocated at insertion time, so the code is position-indenpent. Howerver, lib/*.memset.o(memcoy.o) are not compiled as position independent code, they can't be linked into the module correctly in your way. That is why we use symbol link instead of linking the objects under /lib.

Quoted 3 lines

symlinks won't work as you use them. If you really need separately compiled, use file with a couple of #include "../lib/......S" and be done with that.

... like this, perhaps? I still wonder what will happen with either this or the original tree if you make CONFIG_KVM_INTEL=y, though - won't either variant give you duplicate symbols?

arch/ia64/kvm/Makefile +0 -0
index 5235339..e7b9432 100644
@@ -54,5 +54,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o
 	mmio.o \ vtlb.o process.o
 #Add link memcpy and memset to avoid possible structure assignment

error -kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o

arch/ia64/kvm/Makefile +1 -0
+kvm-intel-objs += memset.o memcpy.o
 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
arch/ia64/kvm/memcpy.S new file +1 -0
new file mode 100644
index 0000000..c04cdbe
@@ -0,0 +1 @@
+#include "../lib/memcpy.S"
arch/ia64/kvm/memset.S new file +1 -0
new file mode 100644
index 0000000..83c3066
@@ -0,0 +1 @@
+#include "../lib/memset.S"
#5 lore raw
Quoted 4 lines · Xiantao

Hi, Airo
Currenlty, We only allow CONFIG_KVM_INTEL = m , since it needs to
be relocated at insertion time.

In many ways this module is more like firmware than a standard kernel module, no?

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 8 lines · Avi Kivity
Quoted 4 lines · Xiantao

Hi, Airo
Currenlty, We only allow CONFIG_KVM_INTEL = m , since it needs
to be relocated at insertion time.

In many ways this module is more like firmware than a standard kernel module, no?

Right, this module doesn't work in kernel context. Instead, it is responsible for switching world between host and guest after relocation. In this way, likely to be a firmware.
Xiantao