All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] configure: Support system emulation with large memory on w32 hosts
Date: Fri, 20 Jul 2012 13:53:17 +1000	[thread overview]
Message-ID: <5008D62D.5080705@ozlabs.ru> (raw)
In-Reply-To: <1342629463-3378-1-git-send-email-sw@weilnetz.de>

On 19/07/12 02:37, Stefan Weil wrote:
> 32-bit applications on Windows normally only get virtual memory in
> the lower 2 GiB address space.
> 
> Because of memory fragmentation, VirtualAlloc() usually won't get 1 GiB
> of contiguous virtual memory in that address space. Therefore running
> system emulations with 1 GiB or more RAM will abort with a failure.
> 
> The linker flag --large-address-aware allows addresses in the upper 2 GiB.
> With this flag, it is possible to run emulated machines with up to
> 2047 MiB RAM.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> 
> I tested the executables with large address awareness on a 64 bit Windows
> (works) and with Wine on Debian 32 bit Linux (no longer aborts, but hangs
> when 1024 or more MiB are requested).
> 
> Maybe the support for large addresses is broken in my Wine version.
> Please report any different test results.

I tried with native WindowsXP, the patch did not help.

QEMU was compiled with the new parameter:

Install prefix    c:/Program Files/QEMU
BIOS directory    c:/Program Files/QEMU
binary directory  c:/Program Files/QEMU
library directory c:/Program Files/QEMU/lib
include directory c:/Program Files/QEMU/include
config directory  c:/Program Files/QEMU
Source path       /home/aik/testken/qemu
C compiler        i686-pc-mingw32-gcc
Host C compiler   gcc
CFLAGS            -O2 -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS       -m32 -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN
-DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing  -fstack-protector-all
-Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--large-address-aware
-Wl,--dynamicbase -Wl,--warn-common -m32 -static -g
make              make
install           install
python            python
smbd              /usr/sbin/smbd
host CPU          i386
host big endian   no
target list       ppc64-softmmu
[...]



qemu/ppc64-softmmu/qemu-system-ppc64 -M pseries -m 1024 -nographic -L
qemu/pc-bios/ -net none -append console=hvc0 -initrd ./1.cpio -kernel
./guest.vmlinux.n -net nic,model=virtio -net user,hostfwd=tcp::5555-:22
-drive file=test-virtio-blk.img,if=virtio,index=0,media=disk,cache=unsafe
***qemu_memalign 200 (512) size 800 (2048)
Warning: Disabling some instructions which are not emulated by TCG (0x0, 0x6)
***qemu_vmalloc 40000000 (1073741824)
Failed to allocate memory: 8

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


The lines with *** are mine printf("%s %x(%u)", __func__, etc).

It still works with "-m 1023".



> Regards,
> 
> Stefan Weil
> 
> 
>  configure |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index df5c99a..b681f9a 100755
> --- a/configure
> +++ b/configure
> @@ -2937,9 +2937,9 @@ else
>      POD2MAN="pod2man"
>  fi
>  
> -# Use ASLR, no-SEH and DEP if available
> +# Use ASLR, large addresses, no-SEH and DEP if available
>  if test "$mingw32" = "yes" ; then
> -    for flag in --dynamicbase --no-seh --nxcompat; do
> +    for flag in --dynamicbase --large-address-aware --no-seh --nxcompat; do
>          if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then
>              LDFLAGS="-Wl,$flag $LDFLAGS"
>          fi
> 


-- 
Alexey

  reply	other threads:[~2012-07-20  3:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 16:37 [Qemu-devel] [PATCH] configure: Support system emulation with large memory on w32 hosts Stefan Weil
2012-07-20  3:53 ` Alexey Kardashevskiy [this message]
2012-07-20  5:23   ` Stefan Weil
2012-07-20  5:37     ` Alexey Kardashevskiy
2012-07-20  6:05       ` Alexey Kardashevskiy
2012-07-20  6:38         ` Alexey Kardashevskiy
2012-07-20 17:19           ` Stefan Weil
2012-07-23 18:32             ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5008D62D.5080705@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.