Re: [PATCH 11/22] KVM: MMU: Add infrastructure for two-level pagewalker

From: Avi Kivity
Date: Wed Apr 28 2010 - 07:46:36 EST


On 04/28/2010 02:03 PM, Joerg Roedel wrote:
On Tue, Apr 27, 2010 at 03:34:10PM +0300, Avi Kivity wrote:
On 04/27/2010 01:38 PM, Joerg Roedel wrote:
This patch introduces a mmu-callback to translate gpa
addresses in the walk_addr code. This is later used to
translate l2_gpa addresses into l1_gpa addresses.

+static inline gfn_t gpa_to_gfn(gpa_t gpa)
+{
+ return (gfn_t)gpa>> PAGE_SHIFT;
+}
+
This overflows on 32-bit, since gpa_t is u64 and gfn_t is ulong.
Thinking again about it, on 32 bit the physical address width is only 36
bits. So there shouldn't be an overflow, no?

It's limited by MAXPHYADDR (at least on Intel) even on 32-bits.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/