From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1 of 3] KEXEC: Add new hypercall to fix 64/32bit truncation errors. v2 Date: Fri, 23 Dec 2011 11:17:37 +0000 Message-ID: <4EF46351.8080301@citrix.com> References: <4EF44B130200007800069B5D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EF44B130200007800069B5D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 23/12/11 08:34, Jan Beulich wrote: >>>> On 22.12.11 at 18:36, Andrew Cooper wrote: >> Currently, KEXEC_CMD_kexec_get_range in compat mode, or with 32bit >> Xen, will truncate 64bit pointers to 32bits, leading to problems on >> machines with more than 4GiB of RAM. As 32bit dom0 kernels tend to be >> PAE capable, this is especially wasteful, as most structures currently >> limited to <4GiB could easily be <64GiB instead. >> >> Therefore, introduce a new hypercall 'KEXEC_CMD_kexec64_get_range' >> which passes similar information as KEXEC_CMD_kexec_get_range, but >> which uses a structure with explicitly specified field widths, causing >> it to be identical in the compat and regular case. This new >> structure, xen_kexec64_range_t, will be the same as xen_kexec_range_t >> if Xen is compiled for x86_64, but will still use 64bit integers if >> Xen is compiled for x86_32. >> >> To fix 32bit Xen which uses 32bit integers for addresses and sizes, >> change the internals to use xen_kexec64_range_t which will use 64bit >> integers instead. This also involves changing several casts to >> explicitly use uint64_ts rather than unsigned longs. > Just for the record - I continue to be opposed to doing this for the > 32-bit hypervisor. All relevant allocations are below 4G there, so > there's simply no need to decrease code readability for no benefit. > > Jan I don't mind reducing the scope to ignore the 32bit Xen case. Any object Keir? -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com