qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] s390x: initialize virtio dev region


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] s390x: initialize virtio dev region
Date: Fri, 11 Nov 2011 17:46:32 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8

On 11/11/2011 05:44 PM, Peter Maydell wrote:
On 11 November 2011 16:24, Alexander Graf<address@hidden>  wrote:
On 11/11/2011 05:11 PM, Peter Maydell wrote:
Yes, so that's option (2) and you need to be using a target_phys_addr_t.
But ram_size is ram_addr_t and is the ram size that I have available to use,
so it's exactly the address that I want. I don't see your point. Should go
jump through random useless hoops of doing

  target_phys_addr_t ram_end = ram_size;

just because there are some subtile semantic differences between the two
variables? They're integers at the end of the day. Both of them.
Because handing a ram_addr_t to something that wants a target_phys_addr_t
is a red flag that something might be wrong. (As is handing a variable
called _size to something that wants an address.)

Force in Newtons and Force in pound-feet are also both just integers
at the end of the day, but that doesn't make them interchangeable:
http://en.wikipedia.org/wiki/Mars_Climate_Orbiter#Communications_loss

Haha :). In this case, I pass ram_size indirectly to ram_alloc just a few lines above though, mapping it to 0. So while if this was normal device code I would agree with your reservation, in this case I don't think adding indirection buys us anything.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]