WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] Fix xencomm for xm mem-set command

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] Fix xencomm for xm mem-set command
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Sat, 11 Nov 2006 17:21:14 +0900
Delivery-date: Sat, 11 Nov 2006 00:22:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

When I tested xm mem-set command and xm mem-max command, I found a bug 
in xencomm.  About error message, please refer an attached file: 
xm-memset20061111.log.  My operations are as follows. 
  1. Boot Xen/dom0. (dom0_mem is default.)
  2. xm mem-set Domain-0 400
  3. xm mem-max Domain-0 400
  4. xm mem-set Domain-0 512

When balloon driver called the memory_op hypercall, xencomm overwrite 
in the hypercall parameter.  It is extent_start of xen_memory_reservation_t 
that is overwritten.  However, xencomm does not restore the hypercall 
parameter that overwrote.  As a result, hypercall of the 200th line in 
balloon driver fails.

linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
 167 static int increase_reservation(unsigned long nr_pages)
 168 {
 169     unsigned long  pfn, i, flags;
 170     struct page   *page;
[snip]
 190     set_xen_guest_handle(reservation.extent_start, frame_list);
 191     reservation.nr_extents   = nr_pages;
 192     rc = HYPERVISOR_memory_op(
 193         XENMEM_populate_physmap, &reservation);
 194     if (rc < nr_pages) {
 195         if (rc > 0) {
 196             int ret;
 197
 198             /* We hit the Xen hard limit: reprobe. */
 199             reservation.nr_extents = rc;
 200             ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation,
 201                 &reservation);
 202             BUG_ON(ret != rc);
 203         }
[snip]


This patch saves and restores the hypercall parameter within xencomm.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>

Best regards,
 Kan

Attachment: xm-memset20061111.log
Description: Binary data

Attachment: xcom_memory_op.patch
Description: Binary data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>