From: Avi Kivity <avi@redhat.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base
Date: Tue, 28 Apr 2009 09:49:48 +0000 [thread overview]
Message-ID: <49F6D13C.1060908@redhat.com> (raw)
In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC236A2BC04@pdsmsx503.ccr.corp.intel.com>
Zhang, Xiantao wrote:
> From aaf97331da3d6cd34522441218c8c9ab3c1067f6 Mon Sep 17 00:00:00 2001
> From: Xiantao Zhang <xiantao.zhang@intel.com>
> Date: Tue, 28 Apr 2009 16:55:47 +0800
> Subject: [PATCH] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c
>
> Upstream has dropped phys_ram_base, so ia64 also remove
> the dependency for that.
>
> +++ b/hw/ipf.c
> @@ -54,7 +54,8 @@ static fdctrl_t *floppy_controller;
> static RTCState *rtc_state;
> static PCIDevice *i440fx_state;
>
> -uint8_t *g_fw_start;
> +ram_addr_t gfw_start;
> +
> static uint32_t ipf_to_legacy_io(target_phys_addr_t addr)
> {
> return (uint32_t)(((addr&0x3ffffff) >> 12 << 2)|((addr) & 0x3));
> @@ -454,15 +455,15 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size,
> if (kvm_enabled()) {
> unsigned long image_size;
> char *image = NULL;
> - uint8_t *fw_image_start;
> + ram_addr_t fw_image_start;
> unsigned long nvram_addr = 0;
> unsigned long nvram_fd = 0;
> unsigned long type = READ_FROM_NVRAM;
> unsigned long i = 0;
> - ram_addr_t fw_offset = qemu_ram_alloc(GFW_SIZE);
> - uint8_t *fw_start = phys_ram_base + fw_offset;
>
> - g_fw_start = fw_start;
> + ram_addr = qemu_ram_alloc(GFW_SIZE);
> + gfw_start = (ram_addr_t)qemu_get_ram_ptr(ram_addr);
>
qemu_get_ram_ptr() returns a pointer. Don't cast it to a ram_addr_t,
leave it a pointer.
But why not use cpu_physical_memory_write() (or
cpu_physical_memory_write_rom())? It's much simpler and cleaner.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2009-04-28 9:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 9:29 [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for Zhang, Xiantao
2009-04-28 9:49 ` Avi Kivity [this message]
2009-04-28 10:36 ` [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base Zhang, Xiantao
2009-04-28 11:05 ` Avi Kivity
2009-04-28 12:38 ` [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base for ipf.c Jes Sorensen
2009-04-28 12:49 ` [PATCH 03/04] qemu-kvm: Remove the dependency for phys_ram_base Avi Kivity
2009-04-28 15:02 ` Jes Sorensen
2009-04-29 2:04 ` Zhang, Xiantao
2009-04-29 2:05 ` Zhang, Xiantao
2009-04-29 8:21 ` Jes Sorensen
2009-04-29 8:35 ` Zhang, Xiantao
2009-04-29 8:42 ` Jes Sorensen
2009-04-29 14:02 ` Zhang, Xiantao
2009-04-29 15:07 ` Jes Sorensen
2009-04-30 9:11 ` Jes Sorensen
2009-04-30 9:23 ` Avi Kivity
2009-04-30 14:09 ` Jes Sorensen
2009-04-30 15:22 ` Avi Kivity
2009-05-01 10:30 ` Jes Sorensen
2009-05-03 16:14 ` Avi Kivity
2009-05-04 1:44 ` Zhang, Xiantao
2009-05-04 5:11 ` Jes Sorensen
2009-05-04 5:12 ` Zhang, Xiantao
2009-05-04 8:16 ` Avi Kivity
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=49F6D13C.1060908@redhat.com \
--to=avi@redhat.com \
--cc=kvm-ia64@vger.kernel.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