All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] qemu in full emulation on win32
Date: Wed, 18 Jul 2012 16:30:10 +1000	[thread overview]
Message-ID: <500657F2.1080703@ozlabs.ru> (raw)

Hi!

Found 2 problems while I was debugging qemu/ppc64-softmmu/qemu-system-ppc64.exe
WindowsXP SP3 Pro, 32bit, i686-pc-mingw32-gcc (GCC) 4.5.2.


1. The size of the following is 7 bytes on linux and 8 bytes on Windows:
struct {
    uint32_t hi;
    uint64_t child;
    uint64_t parent;
    uint64_t size;
} __attribute__((packed)) ranges[];

The structure is used between QEMU and Open Firmware (powerpc bios) so it is important.

The Feature is described here:
http://stackoverflow.com/questions/7789668/why-would-the-size-of-a-packed-structure-be-different-on-linux-and-windows-when
Shortly there is packing and ms-packing and they are different :)

The solutions are:
1. Add MS-specific #pragma pack(push,1) and #pragma pack(pop).
2. Add -mno-ms-bitfields (gcc >= 4.7.0)
3. Change the structure above to use only uint32_t.

What is the common way of solving such problems in QEMU?


2. QEMU cannot allocate 1024MB for the guest RAM. Literally, VirtualAlloc() fails on 1024MB BUT it does not if I allocate 1023MB and 64MB by 2 subsequent calls. We allocate RAM via memory_region_init_ram(). I am pretty sure this is not happening on 64bit Windows and I suspect that it is happening with qemu-system-x86.exe, is not it?

Do we care that there is actually enough RAM and we could allocate it in several chunks?



-- 
Alexey

             reply	other threads:[~2012-07-18  6:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18  6:30 Alexey Kardashevskiy [this message]
2012-07-18  8:01 ` [Qemu-devel] qemu in full emulation on win32 Peter Maydell
2012-07-18 16:29   ` Stefan Weil
2012-07-18 17:15     ` Peter Maydell
2012-07-18 16:35 ` Stefan Weil
2012-07-19  0:49   ` Alexey Kardashevskiy

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=500657F2.1080703@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    /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.