site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1y0sjYe3ERW0OaoADNuFTTLBh60eGVqJBXy8yJMhRls=; b=j62hk79ZUPriTA3FQ+72b0kQ7I31fVMK1e7etzmPBYiMMOyXES4qK0KrJNH1pskAYb gEUmHFEazu7WKby0tkeDtJJoLX9UXgYny1YibTkRm2zygccXBIiflOaEa0Z4dffWGAL7 58WrfyCOOBZfIa8wN8BrxsdSKQ3zT62TwOSHk= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OgX+js3OrumYs0tiec2xNhxcnaP5U+z7FqAlgYsCT5qEwzl4gvDPQluwcjlcRyfZ1G hKJo6DZ5Iwn40qWHU5tDzLB9SnDi0oyXpXlwPNIpL7Vkto1iAVuCXPr3+ZiYYLDqILcA yxr+f9C074y3ItjHdED5RR9boQzH6slsDVSZM= @Mike - There are many instances where you will need physical addresses. Let me point out couple of them. - Memory ballooning is a technique where in guest driver allocates pages in the guest and passes down PPNs to the hypervisor. Hypervisor takes this pages and gives it to another Virtual machine for its use. Hypervisor does Physical address to Machine address (actual address in Physical ram. w/o virtualization you would call this Physical address) mapping. - Hypervisor wants to do fast IO - i.e read/write from/to guest memory directly. Again you need physical address (different from Machine address.) @Terry - Things are all good only when you have OS being the bottom most layer (you have EFI et all, but still) . With virtualization - you have Hypervisor underneath. Things are complicated then. Shailesh Jain On Sat, Aug 7, 2010 at 2:42 PM, James C <james.from.wellington@gmail.com> wrote:
Hi Terry and Shailesh,
Re (4) below, hypothetically, could that include de-powering only some parts of physical memory, when they're not needed?
Shailesh, you know that the physical memory isn't contiguous. What would you think of being given the physical address of the first 0-byte segment? Why would that not meet your needs?
Regards, James.
Message: 4 Date: Fri, 6 Aug 2010 20:43:42 -0700 From: Terry Lambert <tlambert@apple.com> Subject: Re: Getting Physical address of a buffer To: shailesh jain <coolworldofshail@gmail.com> Cc: darwin-kernel@lists.apple.com Message-ID: <EC5425AB-CC65-4CF5-AFFA-1A015ED530B6@apple.com> Content-Type: text/plain; charset=us-ascii
This question gets asked every once in a while: "why do I have to use OS routines to talk to hardware?".
The basic answer is that there's virtual memory, there's wired memory, and then there's physical memory, and all three aren't the same thing.
There are several reasons that an OS that runs its kernel in a virtual address space doesn't want to give you physical address information directly; let's briefly hit the top four on my personal top ten list:
<snip>
(4) The OS likes to be kept informed of information for its own reasons so it can play tricks behind your back
The tricks themselves don't matter, what matters is that you enable performance and power management winds by following the rules; if you don't follow the rules, and try to avoid the OS interfaces, you also avoid the OS signaling mechanisms that are used to implement these optimization. Unfortunately for you, this is like declaring a variable that is modified out of scope, and not marking it volatile: failure to notify the OS of the nature of your access means the OS gets to do any optimization it wants. For a volatile variable, that may mean not exiting the work loop when the signal handler fires. For a device driver, it generally means a panic in the driver.
-- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/coolworldofshail%40gmai...
This email sent to coolworldofshail@gmail.com
-- Shailesh Jain _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com