* [PATCH] Flag events caused by foreign domains
@ 2011-12-01 20:56 Andres Lagar-Cavilla
2011-12-02 7:11 ` Olaf Hering
0 siblings, 1 reply; 6+ messages in thread
From: Andres Lagar-Cavilla @ 2011-12-01 20:56 UTC (permalink / raw)
To: xen-devel; +Cc: andres, keir.xen, tim, olaf, adin
xen/arch/x86/mm/mem_event.c | 6 ++++++
xen/include/public/mem_event.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
Add a new flag for mem events, as consumers might need to discriminate
foreign domain-caused from guest-caused events. The vcpu field of an
event is bogus from a consumer p.o.v. for foreign domain-caused events.
Also assert that we shouldn't be pausing foreign vcpus.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla>
diff -r 8ad7af68e017 -r 2a4ec2e2ae36 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -143,6 +143,12 @@ void mem_event_put_request(struct domain
front_ring = &med->front_ring;
req_prod = front_ring->req_prod_pvt;
+ if ( current->domain != d )
+ {
+ req->flags |= MEM_EVENT_FLAG_FOREIGN;
+ ASSERT( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) );
+ }
+
/* Copy request */
memcpy(RING_GET_REQUEST(front_ring, req_prod), req, sizeof(*req));
req_prod++;
diff -r 8ad7af68e017 -r 2a4ec2e2ae36 xen/include/public/mem_event.h
--- a/xen/include/public/mem_event.h
+++ b/xen/include/public/mem_event.h
@@ -39,6 +39,7 @@
#define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0)
#define MEM_EVENT_FLAG_DROP_PAGE (1 << 1)
#define MEM_EVENT_FLAG_EVICT_FAIL (1 << 2)
+#define MEM_EVENT_FLAG_FOREIGN (1 << 3)
/* Reasons for the memory event request */
#define MEM_EVENT_REASON_UNKNOWN 0 /* typical reason */
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Flag events caused by foreign domains
2011-12-01 20:56 [PATCH] Flag events caused by foreign domains Andres Lagar-Cavilla
@ 2011-12-02 7:11 ` Olaf Hering
2011-12-02 15:29 ` Andres Lagar-Cavilla
0 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2011-12-02 7:11 UTC (permalink / raw)
To: Andres Lagar-Cavilla; +Cc: andres, xen-devel, tim, keir.xen, adin
On Thu, Dec 01, Andres Lagar-Cavilla wrote:
> Add a new flag for mem events, as consumers might need to discriminate
> foreign domain-caused from guest-caused events. The vcpu field of an
> event is bogus from a consumer p.o.v. for foreign domain-caused events.
How is this supposed to be used?
If the toolstack is going to use this then I have to say that it cant
delay events much because the ring will be filled up quickly with the
result that no more events can be generated until the toolstack sends
responses back to the hypervisor.
Olaf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Flag events caused by foreign domains
2011-12-02 7:11 ` Olaf Hering
@ 2011-12-02 15:29 ` Andres Lagar-Cavilla
2011-12-02 19:43 ` Olaf Hering
0 siblings, 1 reply; 6+ messages in thread
From: Andres Lagar-Cavilla @ 2011-12-02 15:29 UTC (permalink / raw)
To: Olaf Hering; +Cc: andres, xen-devel, tim, keir.xen, adin
> On Thu, Dec 01, Andres Lagar-Cavilla wrote:
>
>> Add a new flag for mem events, as consumers might need to discriminate
>> foreign domain-caused from guest-caused events. The vcpu field of an
>> event is bogus from a consumer p.o.v. for foreign domain-caused events.
>
> How is this supposed to be used?
We're just OR'ing an extra flag on existing events. Toolstacks can ignore
it, or use it to handle foreign events differently, or whatever. No new
events are generated, timings don't change etc.
Is that your concern?
Andres
>
> If the toolstack is going to use this then I have to say that it cant
> delay events much because the ring will be filled up quickly with the
> result that no more events can be generated until the toolstack sends
> responses back to the hypervisor.
>
> Olaf
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Flag events caused by foreign domains
2011-12-02 15:29 ` Andres Lagar-Cavilla
@ 2011-12-02 19:43 ` Olaf Hering
2011-12-02 19:56 ` Andres Lagar-Cavilla
0 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2011-12-02 19:43 UTC (permalink / raw)
To: Andres Lagar-Cavilla; +Cc: andres, xen-devel, tim, keir.xen, adin
On Fri, Dec 02, Andres Lagar-Cavilla wrote:
> > On Thu, Dec 01, Andres Lagar-Cavilla wrote:
> >
> >> Add a new flag for mem events, as consumers might need to discriminate
> >> foreign domain-caused from guest-caused events. The vcpu field of an
> >> event is bogus from a consumer p.o.v. for foreign domain-caused events.
> >
> > How is this supposed to be used?
> We're just OR'ing an extra flag on existing events. Toolstacks can ignore
> it, or use it to handle foreign events differently, or whatever. No new
> events are generated, timings don't change etc.
Thats obvious.
> Is that your concern?
I'm wondering wether it really achieves what you want, no stall in the
ring buffer etc.
Olaf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Flag events caused by foreign domains
2011-12-02 19:43 ` Olaf Hering
@ 2011-12-02 19:56 ` Andres Lagar-Cavilla
2011-12-05 11:19 ` Olaf Hering
0 siblings, 1 reply; 6+ messages in thread
From: Andres Lagar-Cavilla @ 2011-12-02 19:56 UTC (permalink / raw)
To: Olaf Hering; +Cc: andres, xen-devel, tim, keir.xen, adin
> On Fri, Dec 02, Andres Lagar-Cavilla wrote:
>
>> > On Thu, Dec 01, Andres Lagar-Cavilla wrote:
>> >
>> >> Add a new flag for mem events, as consumers might need to
>> discriminate
>> >> foreign domain-caused from guest-caused events. The vcpu field of an
>> >> event is bogus from a consumer p.o.v. for foreign domain-caused
>> events.
>> >
>> > How is this supposed to be used?
>> We're just OR'ing an extra flag on existing events. Toolstacks can
>> ignore
>> it, or use it to handle foreign events differently, or whatever. No new
>> events are generated, timings don't change etc.
>
> Thats obvious.
>
>> Is that your concern?
>
> I'm wondering wether it really achieves what you want, no stall in the
> ring buffer etc.
That's not what I want with this patch...
Andres
>
> Olaf
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-12-05 11:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 20:56 [PATCH] Flag events caused by foreign domains Andres Lagar-Cavilla
2011-12-02 7:11 ` Olaf Hering
2011-12-02 15:29 ` Andres Lagar-Cavilla
2011-12-02 19:43 ` Olaf Hering
2011-12-02 19:56 ` Andres Lagar-Cavilla
2011-12-05 11:19 ` Olaf Hering
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.