From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] subpages with memory region aliases (was: [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests)
Date: Thu, 09 Feb 2012 09:35:17 +0100 [thread overview]
Message-ID: <4F338545.7090205@web.de> (raw)
In-Reply-To: <5c058df627b83bf0c35c2e1dcd92b0a3fd301181.1328445531.git.jan.kiszka@web.de>
[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]
Avi,
Before I forget:
On 2012-02-05 13:39, Jan Kiszka wrote:
> +static void vapic_map_rom_writable(VAPICROMState *s)
> +{
> + target_phys_addr_t rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK;
> + MemoryRegionSection section;
> + MemoryRegion *as;
> + size_t rom_size;
> + uint8_t *ram;
> +
> + as = sysbus_address_space(&s->busdev);
> +
> + if (s->rom_mapped_writable) {
> + memory_region_del_subregion(as, &s->rom);
> + memory_region_destroy(&s->rom);
> + }
> +
> + /* grab RAM memory region (region @rom_paddr may still be pc.rom) */
> + section = memory_region_find(as, 0, 1);
> +
> + /* read ROM size from RAM region */
> + ram = memory_region_get_ram_ptr(section.mr);
> + rom_size = ram[rom_paddr + 2] * ROM_BLOCK_SIZE;
> + s->rom_size = rom_size;
> +
> + /* FIXME: round up as everything underneath would fall apart otherwise
> + * (subpages are broken) */
> + rom_size = TARGET_PAGE_ALIGN(rom_size);
Removing this alignment triggers an interesting bug in the memory layer.
Haven't understood the details yet. Is subpage support supposed to work?
> +
> + memory_region_init_alias(&s->rom, "kvmvapic-rom", section.mr, rom_paddr,
> + rom_size);
> + memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000);
> + s->rom_mapped_writable = true;
> +}
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-02-09 8:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-05 12:39 [Qemu-devel] [PATCH 0/6] uq/master: TPR access optimization for Windows guests Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 1/6] target-i386: Add infrastructure for reporting TPR MMIO accesses Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 2/6] kvmvapic: Add option ROM Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Jan Kiszka
2012-02-09 8:35 ` Jan Kiszka [this message]
2012-02-09 9:32 ` [Qemu-devel] subpages with memory region aliases Avi Kivity
2012-02-09 14:23 ` Jan Kiszka
2012-02-09 15:05 ` Avi Kivity
2012-02-09 15:18 ` [Qemu-devel] [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Avi Kivity
2012-02-09 15:39 ` Jan Kiszka
2012-02-09 16:00 ` Avi Kivity
2012-02-09 16:32 ` Jan Kiszka
2012-02-09 16:47 ` Avi Kivity
2012-02-09 17:24 ` Jan Kiszka
2012-02-09 17:20 ` Paolo Bonzini
2012-02-09 18:01 ` Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 4/6] kvmvapic: Simplify mp/up_set_tpr Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 5/6] optionsrom: Reserve space for checksum Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] [PATCH 6/6] kvmvapic: Use optionrom helpers Jan Kiszka
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=4F338545.7090205@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--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 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).