[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] memaccess: skipping mem_access_send_req


  • To: Gareth Stockwell <Gareth.Stockwell@xxxxxxx>, "xen-devel (xen-devel@xxxxxxxxxxxxx)" <xen-devel@xxxxxxxxxxxxx>
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Fri, 10 Apr 2015 18:11:36 +0300
  • Cc: "stefano.stabellini@xxxxxxxxxx" <stefano.stabellini@xxxxxxxxxx>, "tklengyel@xxxxxxxxxxxxx" <tklengyel@xxxxxxxxxxxxx>, "Ian.Campbell@xxxxxxxxxx" <Ian.Campbell@xxxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Fri, 10 Apr 2015 15:11:49 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=1lFX049kfV63b3WM6U6gFjlsd0bjQa2Z/qbgaf/zk0MWO4fZxrdmEtPMSuOR3PLTPQDD9w6vpcKfGM7r8tpYFsEayQgV/kGXNVXyl3D6pvRlRIDlAv6OecKrudVYP58wouBwU2Tk7VTdCOVW/Yr20pY6gt2TUhLCd6+N8DolZAPe82L4nnzatkL3ho/OgKcSM8ZEeY4ufYYnszxMZWHu+euLHpTriMqxbnJ/fqRrJFamSWzuy9zybNCJhCn2xyLbn7H1eJahqdTf0AkikvPcbc2DY7TTKbmdH5qGFbgZoGio4RraV6EQ+r9OZYpOSqu3cafiMgXiXJPzxs+73uhLMQ==; h=Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 04/10/2015 06:04 PM, Gareth Stockwell wrote:
> My understanding of memaccess is that it provides the following
> functionality:
> 
>  
> 
> 1. Modify permission values in the page table of the target domain.
> 
> 2. When the domain generates an illegal access, the exception handler
> delegates to memaccess, which pauses the VCPU and records the event in a
> ring buffer.
> 
> 3. Some permission values are special in that they automatically mutate
> to a different value following the first access; others are persistently
> applied.
> 
>  
> 
> We would like to use memaccess to perform (1) - but rather than pausing
> the VCPU in (2), instead simply directly inject the exception into the
> VCPU.  I can see two ways of doing this:
> 
>  
> 
> a) Implement an observer of the ring buffer, which triggers injection of
> the exception and unpausing of the VCPU.
> 
> b) Define new xenmem_access_t values which cause the exception handler
> to reinject rather than adding a message to the ring buffer.
> 
>  
> 
> (a) seems cumbersome, and requires multiple context switches in order to
> handle the exception.
> 
> (b) therefore looks preferable, and I think should be fairly simple to
> implement on top of https://github.com/tklengyel/xen/tree/arm_memaccess15.
> 
>  
> 
> Does this sound reasonable?  Or is there a better way of modifying
> access permissions for a specific pfn range of a target domain?

It's not entirely clear to me what you're trying to do, but if I
understand it correctly, there's always the third option of simply using
the vm_event system as it is now, and when you get an EPT violation
event simply use xc_hvm_inject_trap() from userspace to inject the
exception.

If you don't want to remove the page restrictions after this (in order
to unpause the VCPU), you can simply emulate the instruction that caused
the event and continue that way. I've added support for that last year
(but I don't know right now if that part is still functional until
Tamas' final half of the series gets merged).


HTH,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.