xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: run time memory trap question
Date: Mon, 17 Feb 2014 17:01:12 +0200	[thread overview]
Message-ID: <CAH_mUMP=G96gJG_vPvngMsPsktUDJOxFmmMQRBXfZ42iu3kAKQ@mail.gmail.com> (raw)
In-Reply-To: <530219C4.3050304@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 1654 bytes --]

Hi Julien,


> >
> >     > Can anyone clarify - is it possible to make a run time memory trap
> in
> >     > Xen hypervisor?
> >
> >     I guess you are talking about ARM? If so, it's not possible right
> now.
> >
> >
> > Does it mean, that it is possible on x86 ?
>
> Yes, you can look at register_io_handler in xen/arch/x86/hvm/intercept.c
>
> It's used a static array, but I don't think this is the solution for
> ARM. We don't know in advance the maximum number of MMIO region to handle.
>
>
What I'm thinking about for ARM - is to use linked list for MMIO handlers +
API to register / unregister handler.

xen/arch/arm/io.c:

 25 static const struct mmio_handler *const mmio_handlers[] =
 26 {
 27     &vgic_distr_mmio_handler,
 28     &vuart_mmio_handler,
 29 };

This can be changed to list. New API will add / remove entries. VGIC and
VUART will call something like
mmio_register_handler(&vgic_distr_mmio_handle) during corresponding
initcall.

Than the only change which is required for existing int
handle_mmio(mmio_info_t *info) function  - is to enumerate list, instead of
array
 32 int handle_mmio(mmio_info_t *info)
 33 {
 34     struct vcpu *v = current;
 35     int i;
 36
 37     for ( i = 0; i < MMIO_HANDLER_NR; i++ ) --> *list_for_each*
 38         if ( mmio_handlers[i]->check_handler(v, info->gpa) )
 39             return info->dabt.write ?
 40                 mmio_handlers[i]->write_handler(v, info) :
 41                 mmio_handlers[i]->read_handler(v, info);
 42
 43     return 0;
 44 }

Something like this.

Regards,
Andrii



> --
> Julien Grall
>



-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

[-- Attachment #1.2: Type: text/html, Size: 3573 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2014-02-17 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 11:33 run time memory trap question Andrii Tseglytskyi
2014-02-17 12:02 ` Julien Grall
2014-02-17 14:06   ` Andrii Tseglytskyi
2014-02-17 14:16     ` Julien Grall
2014-02-17 15:01       ` Andrii Tseglytskyi [this message]
2014-02-17 15:02         ` Stefano Stabellini
2014-02-17 15:19         ` Julien Grall
2014-02-17 15:38           ` Andrii Tseglytskyi
2014-02-17 15:56             ` Julien Grall
2014-02-18 11:05             ` Ian Campbell
2014-02-18 17:52               ` Andrii Tseglytskyi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH_mUMP=G96gJG_vPvngMsPsktUDJOxFmmMQRBXfZ42iu3kAKQ@mail.gmail.com' \
    --to=andrii.tseglytskyi@globallogic.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).