* [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen
@ 2014-03-27 4:35 Alexey Kardashevskiy
2014-03-27 12:15 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kardashevskiy @ 2014-03-27 4:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, Paolo Bonzini
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 <pbonzini@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
I need this change for VFIO-on-sPAPR series as it is going to support
16MB IOMMU pages. Thanks.
---
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);
}
--
1.8.4.rc4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen
2014-03-27 4:35 [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen Alexey Kardashevskiy
@ 2014-03-27 12:15 ` Paolo Bonzini
2014-03-27 12:17 ` Stefano Stabellini
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2014-03-27 12:15 UTC (permalink / raw)
To: Alexey Kardashevskiy, qemu-devel, Stefano Stabellini
Il 27/03/2014 05:35, Alexey Kardashevskiy ha scritto:
> 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 <pbonzini@redhat.com>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>
> I need this change for VFIO-on-sPAPR series as it is going to support
> 16MB IOMMU pages. Thanks.
> ---
> 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);
> }
>
Stefano, can you include this in your Xen tree for 2.1?
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen
2014-03-27 12:15 ` Paolo Bonzini
@ 2014-03-27 12:17 ` Stefano Stabellini
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2014-03-27 12:17 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Alexey Kardashevskiy, qemu-devel, Stefano Stabellini
On Thu, 27 Mar 2014, Paolo Bonzini wrote:
> Il 27/03/2014 05:35, Alexey Kardashevskiy ha scritto:
> > 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 <pbonzini@redhat.com>
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> >
> > I need this change for VFIO-on-sPAPR series as it is going to support
> > 16MB IOMMU pages. Thanks.
> > ---
> > 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);
> > }
> >
>
> Stefano, can you include this in your Xen tree for 2.1?
Sure.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-27 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 4:35 [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen Alexey Kardashevskiy
2014-03-27 12:15 ` Paolo Bonzini
2014-03-27 12:17 ` Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).