From: Alex Bligh Subject: Re: [qemu-upstream-4.2-testing test] 16779: regressions - FAIL Date: Wed, 06 Mar 2013 14:15:42 +0000 Message-ID: References: <20784.54292.926802.900837@mariner.uk.xensource.com> <348E65CAC53021DF1562094C@nimrod.local> <20788.34832.934506.156681@mariner.uk.xensource.com> <89D1720972979969F5F2FA5A@Ximines.local> <20790.10001.977307.565239@mariner.uk.xensource.com> Reply-To: Alex Bligh Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20790.10001.977307.565239@mariner.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Anthony Perard , xen-devel@lists.xensource.com, Alex Bligh , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian, --On 5 March 2013 17:10:41 +0000 Ian Jackson wrote: >> I haven't yet (though possibly from failure to get hold of the relevant >> OS version). I'd actually appreciate some code review with the last of >> the qemu patches as I was unsure what was meant to be going on (as per >> last message to Stefano). > > Well, I have reproduced this. I was hoping to actually debug it but > gdb is having no luck getting a useful stack trce out of > qemu-system-i386, even after I removed a bunch of bizarre compiler > options and rebuilt it. > > I can bisect it so that's what I'll do next I guess. We still can't reproduce this here, but I have recoded that routine to be more obviously correct, and it also doesn't crash here. I suspect the problem is that I can't get xc_hvm_track_dirty_vram to fail. I think this patch makes the routine more obviously correct, and the problem might be I was not translating through get_physmapping()->phys_offset on the failure case. This assuming the success case is correct). If you can reproduce it, perhaps you'd care to try this. Otherwise, any comments welcome. Patch appended below in no-doubt mailer mangled form for context, but already sent to the list with git send-email under Message-Id: <1362579002-7981-1-git-send-email-alex@alex.org.uk> -- Alex Bligh Subject: [PATCH] xen: xen_sync_dirty_bitmap: attempt to fix SEGV Date: Wed, 6 Mar 2013 14:10:02 +0000 Message-Id: <1362579002-7981-1-git-send-email-alex@alex.org.uk> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <89D1720972979969F5F2FA5A@Ximines.local> References: <89D1720972979969F5F2FA5A@Ximines.local> When xc_hvm_track_dirty_vram fails, iterate through pages based on vram_offset and npages, rather than start_addr and size. DPRINTF before the loop in the hope of seeing output before SEGV. Signed-off-by: Alex Bligh --- xen-all.c | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/xen-all.c b/xen-all.c index dbd759c..96a34a9 100644 --- a/xen-all.c +++ b/xen-all.c @@ -472,18 +472,17 @@ static int xen_sync_dirty_bitmap(XenIOState *state, bitmap); if (rc < 0) { if (rc != -ENODATA) { - ram_addr_t addr, end; - - xen_modified_memory(start_addr, size); - - end = TARGET_PAGE_ALIGN(start_addr + size); - for (addr = start_addr & TARGET_PAGE_MASK; addr < end; addr += TARGET_PAGE_SIZE) { - cpu_physical_memory_set_dirty(addr); - } + target_phys_addr_t todirty; DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx ", 0x" TARGET_FMT_plx "): %s\n", start_addr, start_addr + size, strerror(-rc)); + + xen_modified_memory(vram_offset, npages * TARGET_PAGE_SIZE); + + for (todirty = vram_offset, i=0; i < npages; todirty += TARGET_PAGE_SIZE, i++) { + cpu_physical_memory_set_dirty(todirty); + } } return rc; } -- 1.7.4.1