Skip to contentSkip to conversation

cap code_gen_buffer_size on ia64

PATCH In review Jes Sorensen 3 participants 11 messages Sep 24, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cap code_gen_buffer_size on ia64

Hi,

This one limits the code_gen_buffer_size on ia64, phys_mem_size/4 really gets out of hand when you boot say a 64GB guest.

Cheers,
Jes

Cap code_gen_buffer_size on ia64 - it quickly goes out of hand otherwise when booting larger guests.

---
 qemu/exec.c |    4 ++++
 1 file changed, 4 insertions(+)
qemu/exec.c +4 -0
Index: kvm-userspace.git/qemu/exec.c
===================================================================
@@ -443,6 +443,10 @@
         start = (void *) 0x60000000UL;
         if (code_gen_buffer_size > (512 * 1024 * 1024))
             code_gen_buffer_size = (512 * 1024 * 1024);
+#elif defined(__ia64__)
+	/* cap the mapping, don't want it totally out of hand */
+        if (code_gen_buffer_size > (512 * 1024 * 1024))
+            code_gen_buffer_size = (512 * 1024 * 1024);
 #endif
         code_gen_buffer = mmap(start, code_gen_buffer_size,
                                PROT_WRITE | PROT_READ | PROT_EXEC,
#1 lore raw
Quoted 5 lines · Jes Sorensen

Hi,

This one limits the code_gen_buffer_size on ia64, phys_mem_size/4 really gets out of hand when you boot say a 64GB guest.

ia64 doesn't codegen; why not set it to zero?

(and the phys_ram_size / 4 heuristic is ridiculous; code size doesn't scale with guest size)

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

ia64 doesn't codegen; why not set it to zero?

(and the phys_ram_size / 4 heuristic is ridiculous; code size doesn't scale with guest size)

That works too - I didn't really know this part too well, but I hit the problem that I was unable to allocate the space because of 64 bit issues.

I'll whip up a patch to disable it for ia64.

Cheers,
Jes

#3 lore raw

PATCH 1/1 do not allocate code_gen buffer on ia64

In reply to Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 4 lines · Jes Sorensen

Hi,

This one limits the code_gen_buffer_size on ia64, phys_mem_size/4 really gets out of hand when you boot say a 64GB guest.

ia64 doesn't codegen; why not set it to zero?

How about this one then?

Jes

Do not allocate a code_gen buffer on ia64 given it doesn't support code generation.

---
 qemu/exec.c |    4 ++++
 1 file changed, 4 insertions(+)
qemu/exec.c +4 -0
Index: kvm-userspace.git/qemu/exec.c
===================================================================
@@ -407,6 +407,10 @@
 
 static void code_gen_alloc(unsigned long tb_size)
 {
+#ifdef TARGET_IA64
+	return;
+#endif
+
 #ifdef USE_STATIC_CODE_GEN_BUFFER
     code_gen_buffer = static_code_gen_buffer;
     code_gen_buffer_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
Applied
#4 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 11 lines · Jes Sorensen
Quoted 7 lines · Avi Kivity
Quoted 4 lines · Jes Sorensen

Hi,

This one limits the code_gen_buffer_size on ia64, phys_mem_size/4 really gets out of hand when you boot say a 64GB guest.

ia64 doesn't codegen; why not set it to zero?

How about this one then?

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 2 lines · Avi Kivity

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

Even when it's a double indentation, ie 8 spaces?

Thats just plain sicko :-(

Jes

#6 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 6 lines · Jes Sorensen
Quoted 2 lines · Avi Kivity

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

Even when it's a double indentation, ie 8 spaces?

Yes.

Quoted 1 line

Thats just plain sicko :-(

It's the only scheme that works 100% reliably.

Signature · 1 line
error compiling committee.c: too many arguments to function
#7 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 7 lines · Avi Kivity
Quoted 5 lines · Jes Sorensen
Quoted 2 lines · Avi Kivity

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

Even when it's a double indentation, ie 8 spaces?

Yes.

:-(

Well then we really should add something like this to every file in qemu, since this behavior is so non standard from what any normal editor does per default.

/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */

Quoted 3 lines
Quoted 1 line

Thats just plain sicko :-(

It's the only scheme that works 100% reliably.

Ehm, maybe, but then that makes 8 space (tab) indention work 110% reliable :-)

Cheers,
Jes

#8 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 9 lines · Jes Sorensen
Quoted 7 lines · Avi Kivity
Quoted 5 lines · Jes Sorensen
Quoted 2 lines · Avi Kivity

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

Even when it's a double indentation, ie 8 spaces?

Yes.

Quoted 8 lines

:-(

Well then we really should add something like this to every file in qemu, since this behavior is so non standard from what any normal editor does per default.

/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */

I taught emacs to do this locally. It would be great if qemu upstream adopts it.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Thats just plain sicko :-(

It's the only scheme that works 100% reliably.

Ehm, maybe, but then that makes 8 space (tab) indention work 110% reliable :-)

Drunk on Documentation/CodingStyle kool-aid, I see.

Signature · 1 line
error compiling committee.c: too many arguments to function
#9 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

In reply to Avi Kivity
Quoted 8 lines · Avi Kivity
Quoted 7 lines · Jes Sorensen
Quoted 6 lines · Avi Kivity
Quoted 4 lines · Jes Sorensen

Hi,

This one limits the code_gen_buffer_size on ia64, phys_mem_size/4 really gets out of hand when you boot say a 64GB guest.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

ia64 doesn't codegen; why not set it to zero?

How about this one then?

Applied, thanks. Note qemu uses 4 spaces for intedenation. Talk to your editor.

It would seem better to replace #ifdef TARGET_IA64 with if (kvm_enabled()).

If QEMU ever got proper ia64 target support, that's going to be an ugly bug to find.

Regards,

Anthony Liguori

#10 lore raw

Re: [patch] do not allocate code_gen buffer on ia64

Quoted 4 lines · Anthony Liguori

It would seem better to replace #ifdef TARGET_IA64 with if (kvm_enabled()).

Right. Committed.

Signature · 1 line
error compiling committee.c: too many arguments to function