* [PATCH] libxc: use correct return type for do_memory_op()
@ 2015-11-27 9:00 Juergen Gross
2015-11-30 10:23 ` Wei Liu
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2015-11-27 9:00 UTC (permalink / raw)
To: xen-devel, Ian.Campbell, ian.jackson, stefano.stabellini,
wei.liu2
Cc: Juergen Gross
Currently do_memory_op() is returning int, while the hypervisor is
returning long. This will lead to wrong return informations as soon as
e.g. a pfn larger than about 2 billion (8 TB) is returned.
Use the correct long return type instead and correct the functions
expecting a pfn via the return value of do_memory_op().
Signed-off-by: Juergen Gross <jgross@suse.com>
---
tools/libxc/xc_domain.c | 2 +-
tools/libxc/xc_private.c | 2 +-
tools/libxc/xc_private.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index e7278dd..83afc75 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -828,7 +828,7 @@ int xc_domain_get_tsc_info(xc_interface *xch,
int xc_domain_maximum_gpfn(xc_interface *xch, domid_t domid, xen_pfn_t *gpfns)
{
- int rc = do_memory_op(xch, XENMEM_maximum_gpfn, &domid, sizeof(domid));
+ long rc = do_memory_op(xch, XENMEM_maximum_gpfn, &domid, sizeof(domid));
if ( rc >= 0 )
{
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 7c39897..6c0c0d6 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -519,7 +519,7 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
return flush_mmu_updates(xch, mmu);
}
-int do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
+long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
{
DECLARE_HYPERCALL;
DECLARE_HYPERCALL_BOUNCE(arg, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 2df1d59..f603c15 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -374,7 +374,7 @@ static inline int do_multicall_op(xc_interface *xch,
return ret;
}
-int do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len);
+long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len);
void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
size_t size, int prot, size_t chunksize,
--
2.6.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] libxc: use correct return type for do_memory_op()
2015-11-27 9:00 [PATCH] libxc: use correct return type for do_memory_op() Juergen Gross
@ 2015-11-30 10:23 ` Wei Liu
2015-12-01 12:38 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-11-30 10:23 UTC (permalink / raw)
To: Juergen Gross
Cc: wei.liu2, stefano.stabellini, ian.jackson, Ian.Campbell,
xen-devel
On Fri, Nov 27, 2015 at 10:00:51AM +0100, Juergen Gross wrote:
> Currently do_memory_op() is returning int, while the hypervisor is
> returning long. This will lead to wrong return informations as soon as
> e.g. a pfn larger than about 2 billion (8 TB) is returned.
>
> Use the correct long return type instead and correct the functions
> expecting a pfn via the return value of do_memory_op().
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libxc: use correct return type for do_memory_op()
2015-11-30 10:23 ` Wei Liu
@ 2015-12-01 12:38 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-12-01 12:38 UTC (permalink / raw)
To: Wei Liu, Juergen Gross; +Cc: stefano.stabellini, ian.jackson, xen-devel
On Mon, 2015-11-30 at 10:23 +0000, Wei Liu wrote:
> On Fri, Nov 27, 2015 at 10:00:51AM +0100, Juergen Gross wrote:
> > Currently do_memory_op() is returning int, while the hypervisor is
> > returning long. This will lead to wrong return informations as soon as
> > e.g. a pfn larger than about 2 billion (8 TB) is returned.
> >
> > Use the correct long return type instead and correct the functions
> > expecting a pfn via the return value of do_memory_op().
> >
> > Signed-off-by: Juergen Gross <jgross@suse.com>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-01 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27 9:00 [PATCH] libxc: use correct return type for do_memory_op() Juergen Gross
2015-11-30 10:23 ` Wei Liu
2015-12-01 12:38 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.