[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 1/7] exec: Limit translation limiting in address_
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 1/7] exec: Limit translation limiting in address_space_translate to xen |
Date: |
Wed, 7 May 2014 16:12:42 +0100 |
On 7 May 2014 16:09, Stefano Stabellini
<address@hidden> wrote:
> From: Alexey Kardashevskiy <address@hidden>
>
> The address_space_translate() function cuts the returned plen (page size)
> to hardcoded TARGET_PAGE_SIZE. This function can be used on pages bigger
> than that so this limiting should not be used on such pages.
>
> Since originally the limiting was introduced for XEN, we can safely
> limit this piece of code to XEN. So does the patch.
>
> Suggested-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> Signed-off-by: Stefano Stabellini <address@hidden>
> ---
> exec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/exec.c b/exec.c
> index 91513c6..cf12049 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -380,7 +380,7 @@ MemoryRegion *address_space_translate(AddressSpace *as,
> hwaddr addr,
> as = iotlb.target_as;
> }
>
> - if (memory_access_is_direct(mr, is_write)) {
> + if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
> hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
> len = MIN(page, len);
> }
We should put this patch in (both as an efficiency thing and an
expedient fix) but we really need to either track down which
callers of this API are relying on the returned plen not being
truncated, or we need to fix Xen to not truncate either. This
is just a bandaid IMHO.
thanks
-- PMM
[Qemu-devel] [PULL 3/7] xen: move Xen PV machine files to hw/xenpv, Stefano Stabellini, 2014/05/07
[Qemu-devel] [PULL 4/7] xen: move Xen HVM files under hw/i386/xen, Stefano Stabellini, 2014/05/07
[Qemu-devel] [PULL 7/7] xen_disk: add discard support, Stefano Stabellini, 2014/05/07
[Qemu-devel] [PULL 5/7] xen: factor out common functions, Stefano Stabellini, 2014/05/07
Re: [Qemu-devel] [PULL 0/7] xen-140507, Peter Maydell, 2014/05/07