Re: [Xen-devel] [MINOR FIXES 2/2] lowmemd: fix comparison in cleanup
Hi Wei, as far as I can tell, patch 1 has already been added: http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=71af7d4220227529ea43b898683d4d2e68a90ffd Best, Norbert On 02/20/2017 05:58 PM, Wei Liu wrote: On Fri, Feb 17, 2017 at 11:31:01AM +, Andrew Cooper wrote: On 17/02/17 10:47, Norbert Manthey wrote: The variable virq_port of type uint32_t was compared to being greater than -1. This check always results in false for unsigned data types, resulting in never cleaning up the memory. Furthermore, the initialization with a negative variable for an unsigned type has been fixed. Signed-off-by: Norbert Manthey <nmant...@amazon.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Acked + applied this patch. Tried to apply patch 1 as well but it didn't apply cleanly. Wei. Amazon Development Center Germany GmbH Berlin - Dresden - Aachen main office: Krausenstr. 38, 10117 Berlin Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger Ust-ID: DE289237879 Eingetragen am Amtsgericht Charlottenburg HRB 149173 B ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [MINOR FIXES 1/2] mm: fix memory cleanup
During destroying the m2p mapping, the loop variable was always incremented by one, as the current version used a compare operator on the left hand side, which always evaluated to true, i.e. i += 1UL < (L2_PAGETABLE_SHIFT - 2) The fix increments the value of the variable by the actual page size by using the shift operator instead. Signed-off-by: Norbert Manthey <nmant...@amazon.com> --- xen/arch/x86/x86_64/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 9ead02e..52f2bd5 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -251,7 +251,7 @@ static void destroy_compat_m2p_mapping(struct mem_hotadd_info *info) } } -i += 1UL < (L2_PAGETABLE_SHIFT - 2); +i += 1UL << (L2_PAGETABLE_SHIFT - 2); } return; -- 2.7.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] (no subject)
Dear Xen developers, I would like to bring the attached two patches online, as they fix minor defects in the upstream code base. Best, Norbert ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [MINOR FIXES 2/2] lowmemd: fix comparison in cleanup
The variable virq_port of type uint32_t was compared to being greater than -1. This check always results in false for unsigned data types, resulting in never cleaning up the memory. Furthermore, the initialization with a negative variable for an unsigned type has been fixed. Signed-off-by: Norbert Manthey <nmant...@amazon.com> --- tools/misc/xen-lowmemd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c index 3200404..865a54c 100644 --- a/tools/misc/xen-lowmemd.c +++ b/tools/misc/xen-lowmemd.c @@ -10,14 +10,14 @@ #include #include -static evtchn_port_t virq_port = -1; +static evtchn_port_t virq_port = ~0; static xenevtchn_handle *xce_handle = NULL; static xc_interface *xch= NULL; static struct xs_handle *xs_handle = NULL; void cleanup(void) { -if (virq_port > -1) +if (virq_port != ~0) xenevtchn_unbind(xce_handle, virq_port); if (xce_handle) xenevtchn_close(xce_handle); -- 2.7.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel