From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH] mem_event: Allow emulating an instruction that caused a page fault Date: Thu, 17 Jan 2013 15:16:35 +0200 Message-ID: <50F7F9B3.9050206@gmail.com> References: <20130117121610.GB19975@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130117121610.GB19975@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org > Hi, Hello Tim, thank you for taking the time to review this. > I think there ought to be some other control to this: what if a single > instruction accesses multiple pages, each of which would cause an access > fault? You only get a notification of the first one, so short of > emulating the instruction yourself in userspace I don't know how you can > decide that it's safe. You're right, but I can't see how this case could be handled at all without lifting the restrictions, one page at a time. And that's precisely what this patch aims to make unnecessary. I can't see a way around it (not while the emulation support is limited to hvm_emulate_one() and hvm_emulate_one_nowrite()). > This function always operates on the currently scheduled vcpu, so you > don't need to pass a cpu-user-regs struct all the way down the stack -- > you can just use guest_cpu_user_regs() here. Of course. Thank you. > I don't think this is necessary: you only need to add a field to thuiis > file if you'll be using it from assembly code. I thought I'd be polite and add it anyway, in case somebody will want to use it later. Was that pollution? I'll remove it. >> +#define MEM_EVENT_FLAG_EMULATE (1 << 5) > > Please add a comment saying what this flag does. I know the rest of > this code is poorly commented, but let's try to make thing better as we > go. :) I will. Thank you, Razvan Cojocaru