kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] cap code_gen_buffer_size on ia64
@ 2008-09-24  9:19 Jes Sorensen
  2008-09-24 10:58 ` Avi Kivity
  0 siblings, 1 reply; 11+ messages in thread
From: Jes Sorensen @ 2008-09-24  9:19 UTC (permalink / raw)
  To: kvm, kvm-ia64

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

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


[-- Attachment #2: 1200-ia64-code-gen-buffer.patch --]
[-- Type: text/plain, Size: 896 bytes --]

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

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 qemu/exec.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: kvm-userspace.git/qemu/exec.c
===================================================================
--- kvm-userspace.git.orig/qemu/exec.c
+++ 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,

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] cap code_gen_buffer_size on ia64
  2008-09-24  9:19 [patch] cap code_gen_buffer_size on ia64 Jes Sorensen
@ 2008-09-24 10:58 ` Avi Kivity
  2008-09-24 11:00   ` Jes Sorensen
  2008-09-24 11:28   ` [patch] do not allocate code_gen buffer " Jes Sorensen
  0 siblings, 2 replies; 11+ messages in thread
From: Avi Kivity @ 2008-09-24 10:58 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: kvm, kvm-ia64

Jes Sorensen wrote:
> 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)

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] cap code_gen_buffer_size on ia64
  2008-09-24 10:58 ` Avi Kivity
@ 2008-09-24 11:00   ` Jes Sorensen
  2008-09-24 11:28   ` [patch] do not allocate code_gen buffer " Jes Sorensen
  1 sibling, 0 replies; 11+ messages in thread
From: Jes Sorensen @ 2008-09-24 11:00 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, kvm-ia64

Avi Kivity wrote:
> 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch] do not allocate code_gen buffer on ia64
  2008-09-24 10:58 ` Avi Kivity
  2008-09-24 11:00   ` Jes Sorensen
@ 2008-09-24 11:28   ` Jes Sorensen
  2008-09-24 11:39     ` Avi Kivity
  1 sibling, 1 reply; 11+ messages in thread
From: Jes Sorensen @ 2008-09-24 11:28 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, kvm-ia64

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

Avi Kivity wrote:
> Jes Sorensen wrote:
>> 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

[-- Attachment #2: 1200-ia64-code-gen-buffer.patch --]
[-- Type: text/plain, Size: 626 bytes --]

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

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 qemu/exec.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: kvm-userspace.git/qemu/exec.c
===================================================================
--- kvm-userspace.git.orig/qemu/exec.c
+++ 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;

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 11:28   ` [patch] do not allocate code_gen buffer " Jes Sorensen
@ 2008-09-24 11:39     ` Avi Kivity
  2008-09-24 11:42       ` Jes Sorensen
  2008-09-24 15:33       ` Anthony Liguori
  0 siblings, 2 replies; 11+ messages in thread
From: Avi Kivity @ 2008-09-24 11:39 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: kvm, kvm-ia64

Jes Sorensen wrote:
> Avi Kivity wrote:
>> Jes Sorensen wrote:
>>> 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.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 11:39     ` Avi Kivity
@ 2008-09-24 11:42       ` Jes Sorensen
  2008-09-24 12:09         ` Avi Kivity
  2008-09-24 15:33       ` Anthony Liguori
  1 sibling, 1 reply; 11+ messages in thread
From: Jes Sorensen @ 2008-09-24 11:42 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, kvm-ia64

Avi Kivity wrote:
> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 11:42       ` Jes Sorensen
@ 2008-09-24 12:09         ` Avi Kivity
  2008-09-24 12:52           ` Jes Sorensen
  0 siblings, 1 reply; 11+ messages in thread
From: Avi Kivity @ 2008-09-24 12:09 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: kvm, kvm-ia64

Jes Sorensen wrote:
> Avi Kivity wrote:
>> Applied, thanks.  Note qemu uses 4 spaces for intedenation.  Talk to 
>> your editor.
>
> Even when it's a double indentation, ie 8 spaces?
>

Yes.

> Thats just plain sicko :-(

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

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 12:09         ` Avi Kivity
@ 2008-09-24 12:52           ` Jes Sorensen
  2008-09-24 13:09             ` Avi Kivity
  0 siblings, 1 reply; 11+ messages in thread
From: Jes Sorensen @ 2008-09-24 12:52 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, kvm-ia64

Avi Kivity wrote:
> Jes Sorensen wrote:
>> Avi Kivity wrote:
>>> 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 -*- */

>> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 12:52           ` Jes Sorensen
@ 2008-09-24 13:09             ` Avi Kivity
  0 siblings, 0 replies; 11+ messages in thread
From: Avi Kivity @ 2008-09-24 13:09 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: kvm, kvm-ia64

Jes Sorensen wrote:
> Avi Kivity wrote:
>> Jes Sorensen wrote:
>>> Avi Kivity wrote:
>>>> 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 -*- */
>

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

>>> 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.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 11:39     ` Avi Kivity
  2008-09-24 11:42       ` Jes Sorensen
@ 2008-09-24 15:33       ` Anthony Liguori
  2008-09-24 15:40         ` Avi Kivity
  1 sibling, 1 reply; 11+ messages in thread
From: Anthony Liguori @ 2008-09-24 15:33 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Jes Sorensen, kvm, kvm-ia64

Avi Kivity wrote:
> Jes Sorensen wrote:
>> Avi Kivity wrote:
>>> Jes Sorensen wrote:
>>>> 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.

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] do not allocate code_gen buffer on ia64
  2008-09-24 15:33       ` Anthony Liguori
@ 2008-09-24 15:40         ` Avi Kivity
  0 siblings, 0 replies; 11+ messages in thread
From: Avi Kivity @ 2008-09-24 15:40 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Jes Sorensen, kvm, kvm-ia64

Anthony Liguori wrote:
>
> It would seem better to replace #ifdef TARGET_IA64 with if 
> (kvm_enabled()).
>

Right.  Committed.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-09-24 15:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-24  9:19 [patch] cap code_gen_buffer_size on ia64 Jes Sorensen
2008-09-24 10:58 ` Avi Kivity
2008-09-24 11:00   ` Jes Sorensen
2008-09-24 11:28   ` [patch] do not allocate code_gen buffer " Jes Sorensen
2008-09-24 11:39     ` Avi Kivity
2008-09-24 11:42       ` Jes Sorensen
2008-09-24 12:09         ` Avi Kivity
2008-09-24 12:52           ` Jes Sorensen
2008-09-24 13:09             ` Avi Kivity
2008-09-24 15:33       ` Anthony Liguori
2008-09-24 15:40         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).