diff mbox series

[Xen-devel,1/4,v3] libxl: Fix the bug introduced in commit "libxl: use correct type modifier for vuart_gfn"

Message ID 1509432908-17449-1-git-send-email-bhupinder.thakur@linaro.org
State Accepted
Commit 9b4bddc386e744c901dd685fa67be7a77f73f479
Headers show
Series [Xen-devel,1/4,v3] libxl: Fix the bug introduced in commit "libxl: use correct type modifier for vuart_gfn" | expand

Commit Message

Bhupinder Thakur Oct. 31, 2017, 6:55 a.m. UTC
In libxl__device_vuart_add vuart_gfn is getting stored as a hex value:

> flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));

However, xenstore reads this value as a decimal value and tries to map the
wrong address and fails.

This patch introduces a new format specifier "PRIu_xen_pfn" which formats the value as a
decimal value.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>

 tools/libxl/libxl_console.c       | 2 +-
 xen/include/public/arch-arm.h     | 1 +
 xen/include/public/arch-x86/xen.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

Comments

Wei Liu Oct. 31, 2017, 10:07 a.m. UTC | #1
Change the tag to for-4.10.

Julien, this is needed to fix vuart emulation.
Julien Grall Nov. 13, 2017, 3:56 p.m. UTC | #2
Hi Wei,

Sorry I missed that e-mail.

On 10/31/2017 10:07 AM, Wei Liu wrote:
> Change the tag to for-4.10.
> 
> Julien, this is needed to fix vuart emulation.

To confirm, only patch #1 is candidate for Xen 4.10, right? The rest 
will be queued for Xen 4.11?

For patch #1:

Release-acked-by: Julien Grall <julien.grall@linaro.org>

Cheers,

--
Julien Grall
Wei Liu Nov. 14, 2017, 10:05 a.m. UTC | #3
On Mon, Nov 13, 2017 at 03:56:23PM +0000, Julien Grall wrote:
> Hi Wei,
> 
> Sorry I missed that e-mail.
> 
> On 10/31/2017 10:07 AM, Wei Liu wrote:
> > Change the tag to for-4.10.
> > 
> > Julien, this is needed to fix vuart emulation.
> 
> To confirm, only patch #1 is candidate for Xen 4.10, right? The rest will be
> queued for Xen 4.11?
> 

I think so. 

Bhupinder, can you confirm that?
Bhupinder Thakur Nov. 14, 2017, 11:42 a.m. UTC | #4
Hi,

On 14 Nov 2017 3:35 pm, "Wei Liu" <wei.liu2@citrix.com> wrote:

> On Mon, Nov 13, 2017 at 03:56:23PM +0000, Julien Grall wrote:

> > Hi Wei,

> >

> > Sorry I missed that e-mail.

> >

> > On 10/31/2017 10:07 AM, Wei Liu wrote:

> > > Change the tag to for-4.10.

> > >

> > > Julien, this is needed to fix vuart emulation.

> >

> > To confirm, only patch #1 is candidate for Xen 4.10, right? The rest

> will be

> > queued for Xen 4.11?

> >

>

> I think so.

>

> Bhupinder, can you confirm that?

>


Yes. Only first patch is required for fixing the compilation issue.

Regards,
Bhupinder
<div dir="ltr"><div>Hi,</div><div class="gmail_extra"><br><div class="gmail_quote">On 14 Nov 2017 3:35 pm, &quot;Wei Liu&quot; &lt;<a href="mailto:wei.liu2@citrix.com" target="_blank">wei.liu2@citrix.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Nov 13, 2017 at 03:56:23PM +0000, Julien Grall wrote:<br>
&gt; Hi Wei,<br>
&gt;<br>
&gt; Sorry I missed that e-mail.<br>
&gt;<br>
&gt; On 10/31/2017 10:07 AM, Wei Liu wrote:<br>
&gt; &gt; Change the tag to for-4.10.<br>
&gt; &gt;<br>
&gt; &gt; Julien, this is needed to fix vuart emulation.<br>
&gt;<br>
&gt; To confirm, only patch #1 is candidate for Xen 4.10, right? The rest will be<br>
&gt; queued for Xen 4.11?<br>
&gt;<br>
<br>
I think so.<br>
<br>
Bhupinder, can you confirm that?<br></blockquote><div><br></div><div dir="auto">Yes. Only first patch is required for fixing the compilation issue.<div dir="auto"><br></div><div dir="auto">Regards,</div></div><div>Bhupinder </div></div></div>
</div>
Wei Liu Nov. 14, 2017, 1:56 p.m. UTC | #5
On Tue, Nov 14, 2017 at 05:12:26PM +0530, Bhupinder Thakur wrote:
> Hi,
> 
> On 14 Nov 2017 3:35 pm, "Wei Liu" <wei.liu2@citrix.com> wrote:
> 
> > On Mon, Nov 13, 2017 at 03:56:23PM +0000, Julien Grall wrote:
> > > Hi Wei,
> > >
> > > Sorry I missed that e-mail.
> > >
> > > On 10/31/2017 10:07 AM, Wei Liu wrote:
> > > > Change the tag to for-4.10.
> > > >
> > > > Julien, this is needed to fix vuart emulation.
> > >
> > > To confirm, only patch #1 is candidate for Xen 4.10, right? The rest
> > will be
> > > queued for Xen 4.11?
> > >
> >
> > I think so.
> >
> > Bhupinder, can you confirm that?
> >
> 
> Yes. Only first patch is required for fixing the compilation issue.
> 

Thanks. I will commit the first patch and put the rest in my for-next
queue.
diff mbox series

Patch

diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
index c05dc28..6bfc0e5 100644
--- a/tools/libxl/libxl_console.c
+++ b/tools/libxl/libxl_console.c
@@ -376,7 +376,7 @@  int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid,
     flexarray_append(ro_front, "port");
     flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port));
     flexarray_append(ro_front, "ring-ref");
-    flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn));
+    flexarray_append(ro_front, GCSPRINTF("%"PRIu_xen_pfn, state->vuart_gfn));
     flexarray_append(ro_front, "limit");
     flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(ro_front, "type");
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 5708cd2..05fd11c 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -274,6 +274,7 @@  DEFINE_XEN_GUEST_HANDLE(vcpu_guest_core_regs_t);
 
 typedef uint64_t xen_pfn_t;
 #define PRI_xen_pfn PRIx64
+#define PRIu_xen_pfn PRIu64
 
 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
 /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index ff91831..3b0b1d6 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -75,6 +75,7 @@  __DeFiNe__ __DECL_REG_LO16(name) e ## name
 #ifndef __ASSEMBLY__
 typedef unsigned long xen_pfn_t;
 #define PRI_xen_pfn "lx"
+#define PRIu_xen_pfn "lu"
 #endif
 
 #define XEN_HAVE_PV_GUEST_ENTRY 1