* [PATCH] [XEN] [ACM] Simplify the event channel scanning
@ 2007-02-27 17:19 Stefan Berger
2007-02-27 19:02 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Berger @ 2007-02-27 17:19 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
This patch simplifies the scanning of a domain's event channels
considering that an 'ECS_UNBOUND' event channel is not connected and can
be skipped.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
[-- Attachment #2: acm_evtchn_scan_fix.diff --]
[-- Type: text/x-patch, Size: 1856 bytes --]
diff -r 1c5e6239a8d0 xen/acm/acm_simple_type_enforcement_hooks.c
--- a/xen/acm/acm_simple_type_enforcement_hooks.c Sun Feb 25 23:58:33 2007 -0600
+++ b/xen/acm/acm_simple_type_enforcement_hooks.c Tue Feb 27 11:23:38 2007 -0500
@@ -193,28 +193,14 @@ ste_init_state(struct acm_ste_policy_buf
/* a) check for event channel conflicts */
for (port=0; port < NR_EVTCHN_BUCKETS; port++) {
spin_lock(&d->evtchn_lock);
- if (d->evtchn[port] == NULL) {
+ if (d->evtchn[port] == NULL ||
+ d->evtchn[port]->state == ECS_UNBOUND) {
spin_unlock(&d->evtchn_lock);
continue;
}
if (d->evtchn[port]->state == ECS_INTERDOMAIN) {
rdom = d->evtchn[port]->u.interdomain.remote_dom;
rdomid = rdom->domain_id;
- /* rdom now has remote domain */
- ste_rssid = GET_SSIDP(ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY,
- (struct acm_ssid_domain *)(rdom->ssid));
- ste_rssidref = ste_rssid->ste_ssidref;
- } else if (d->evtchn[port]->state == ECS_UNBOUND) {
- rdomid = d->evtchn[port]->u.unbound.remote_domid;
- if ((rdom = get_domain_by_id(rdomid)) == NULL) {
- printk("%s: Error finding domain to id %x!\n", __func__, rdomid);
- goto out;
- }
- /* rdom now has remote domain */
- ste_rssid = GET_SSIDP(ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY,
- (struct acm_ssid_domain *)(rdom->ssid));
- ste_rssidref = ste_rssid->ste_ssidref;
- put_domain(rdom);
} else {
spin_unlock(&d->evtchn_lock);
continue; /* port unused */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [XEN] [ACM] Simplify the event channel scanning
2007-02-27 17:19 [PATCH] [XEN] [ACM] Simplify the event channel scanning Stefan Berger
@ 2007-02-27 19:02 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2007-02-27 19:02 UTC (permalink / raw)
To: Stefan Berger, xen-devel
On 27/2/07 17:19, "Stefan Berger" <stefanb@us.ibm.com> wrote:
> This patch simplifies the scanning of a domain's event channels
> considering that an 'ECS_UNBOUND' event channel is not connected and can
> be skipped.
>
> Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
This code is still broken: you are checking only the first event-channel in
each bucket. You need a double loop: the new inner loop should iterate from
0 to EVTCHNS_PER_BUCKET-1.
ports = d->evtchn[bucket];
If ( ports == NULL )
break;
for ( j = 0; j < EVTCHNS_PER_BUCKET; j++ )
.... process ports[j] ....
-- Keir
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-27 19:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-27 17:19 [PATCH] [XEN] [ACM] Simplify the event channel scanning Stefan Berger
2007-02-27 19:02 ` Keir Fraser
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.