ia64/xen-unstable

annotate xen/common/event_channel.c @ 1249:4ca11b869b2f

bitkeeper revision 1.825.3.10 (4065558aPBWky8sW_ub8imsOf_yTwg)

Many files:
Cleaned up user-space event-channel handling (now better reflects the underlying abstraction). Also simplified handling of exceptional notifications (now a special case of a normal notification).
author kaf24@scramble.cl.cam.ac.uk
date Sat Mar 27 10:20:58 2004 +0000 (2004-03-27)
parents 916d919c54b7
children 76ba37dc1b89
rev   line source
kaf24@954 1 /******************************************************************************
kaf24@954 2 * event_channel.c
kaf24@954 3 *
kaf24@954 4 * Event channels between domains.
kaf24@954 5 *
kaf24@1127 6 * Copyright (c) 2003-2004, K A Fraser.
kaf24@954 7 *
kaf24@954 8 * This program is distributed in the hope that it will be useful,
kaf24@954 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
kaf24@954 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kaf24@954 11 * GNU General Public License for more details.
kaf24@954 12 *
kaf24@954 13 * You should have received a copy of the GNU General Public License
kaf24@954 14 * along with this program; if not, write to the Free Software
kaf24@954 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
kaf24@954 16 */
kaf24@954 17
kaf24@1210 18 #include <xen/config.h>
kaf24@1210 19 #include <xen/init.h>
kaf24@1210 20 #include <xen/lib.h>
kaf24@1210 21 #include <xen/errno.h>
kaf24@1210 22 #include <xen/sched.h>
kaf24@1210 23 #include <xen/event.h>
kaf24@1239 24 #include <xen/irq.h>
kaf24@954 25
kaf24@1127 26 #include <hypervisor-ifs/hypervisor-if.h>
kaf24@1127 27 #include <hypervisor-ifs/event_channel.h>
kaf24@1127 28
kaf24@1218 29 #define INIT_EVENT_CHANNELS 16
kaf24@1218 30 #define MAX_EVENT_CHANNELS 1024
kaf24@954 31
kaf24@1127 32 static int get_free_port(struct task_struct *p)
kaf24@954 33 {
kaf24@1127 34 int max, port;
kaf24@1127 35 event_channel_t *chn;
kaf24@1127 36
kaf24@1127 37 max = p->max_event_channel;
kaf24@1127 38 chn = p->event_channel;
kaf24@1127 39
kaf24@1127 40 for ( port = 0; port < max; port++ )
kaf24@1127 41 if ( chn[port].state == ECS_FREE )
kaf24@1127 42 break;
kaf24@1127 43
kaf24@1127 44 if ( port == max )
kaf24@1127 45 {
kaf24@1127 46 if ( max == MAX_EVENT_CHANNELS )
kaf24@1127 47 return -ENOSPC;
kaf24@1127 48
kaf24@1127 49 max = (max == 0) ? 4 : (max * 2);
kaf24@1127 50
kaf24@1127 51 chn = kmalloc(max * sizeof(event_channel_t), GFP_KERNEL);
kaf24@1127 52 if ( unlikely(chn == NULL) )
kaf24@1127 53 return -ENOMEM;
kaf24@1127 54
kaf24@1127 55 memset(chn, 0, max * sizeof(event_channel_t));
kaf24@1127 56
kaf24@1127 57 if ( p->event_channel != NULL )
kaf24@1127 58 {
kaf24@1127 59 memcpy(chn, p->event_channel, (max/2) * sizeof(event_channel_t));
kaf24@1127 60 kfree(p->event_channel);
kaf24@1127 61 }
kaf24@1127 62
kaf24@1127 63 p->event_channel = chn;
kaf24@1127 64 p->max_event_channel = max;
kaf24@1127 65 }
kaf24@1127 66
kaf24@1127 67 return port;
kaf24@1127 68 }
kaf24@1127 69
kaf24@1218 70 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
kaf24@1127 71 {
kaf24@1129 72 struct task_struct *p1, *p2;
kaf24@1129 73 int port1 = 0, port2 = 0;
kaf24@1218 74 domid_t dom1 = bind->dom1, dom2 = bind->dom2;
kaf24@954 75 long rc = 0;
kaf24@954 76
kaf24@1127 77 if ( !IS_PRIV(current) )
kaf24@1127 78 return -EPERM;
kaf24@954 79
kaf24@1129 80 if ( dom1 == DOMID_SELF )
kaf24@1129 81 dom1 = current->domain;
kaf24@1129 82 if ( dom2 == DOMID_SELF )
kaf24@1135 83 dom2 = current->domain;
kaf24@1127 84
kaf24@1129 85 if ( ((p1 = find_domain_by_id(dom1)) == NULL) ||
kaf24@1129 86 ((p2 = find_domain_by_id(dom2)) == NULL) )
kaf24@1127 87 {
kaf24@1129 88 if ( p1 != NULL )
kaf24@1129 89 put_task_struct(p1);
kaf24@1127 90 return -ESRCH;
kaf24@1127 91 }
kaf24@1127 92
kaf24@1127 93 /* Avoid deadlock by first acquiring lock of domain with smaller id. */
kaf24@1129 94 if ( dom1 < dom2 )
kaf24@954 95 {
kaf24@1129 96 spin_lock(&p1->event_channel_lock);
kaf24@1129 97 spin_lock(&p2->event_channel_lock);
kaf24@954 98 }
kaf24@954 99 else
kaf24@954 100 {
kaf24@1135 101 if ( p1 != p2 )
kaf24@1135 102 spin_lock(&p2->event_channel_lock);
kaf24@1129 103 spin_lock(&p1->event_channel_lock);
kaf24@954 104 }
kaf24@954 105
kaf24@1129 106 if ( (port1 = get_free_port(p1)) < 0 )
kaf24@954 107 {
kaf24@1129 108 rc = port1;
kaf24@1127 109 goto out;
kaf24@954 110 }
kaf24@954 111
kaf24@1129 112 if ( (port2 = get_free_port(p2)) < 0 )
kaf24@954 113 {
kaf24@1129 114 rc = port2;
kaf24@1127 115 goto out;
kaf24@1127 116 }
kaf24@954 117
kaf24@1218 118 p1->event_channel[port1].u.remote.dom = p2;
kaf24@1218 119 p1->event_channel[port1].u.remote.port = (u16)port2;
kaf24@1218 120 p1->event_channel[port1].state = ECS_INTERDOMAIN;
kaf24@954 121
kaf24@1218 122 p2->event_channel[port2].u.remote.dom = p1;
kaf24@1218 123 p2->event_channel[port2].u.remote.port = (u16)port1;
kaf24@1218 124 p2->event_channel[port2].state = ECS_INTERDOMAIN;
kaf24@1127 125
kaf24@1218 126 evtchn_set_pending(p1, port1);
kaf24@1218 127 evtchn_set_pending(p2, port2);
kaf24@954 128
kaf24@954 129 out:
kaf24@1129 130 spin_unlock(&p1->event_channel_lock);
kaf24@1135 131 if ( p1 != p2 )
kaf24@1135 132 spin_unlock(&p2->event_channel_lock);
kaf24@1127 133
kaf24@1129 134 put_task_struct(p1);
kaf24@1129 135 put_task_struct(p2);
kaf24@1127 136
kaf24@1218 137 bind->port1 = port1;
kaf24@1218 138 bind->port2 = port2;
kaf24@954 139
kaf24@954 140 return rc;
kaf24@954 141 }
kaf24@954 142
kaf24@954 143
kaf24@1218 144 static long evtchn_bind_virq(evtchn_bind_virq_t *bind)
kaf24@1218 145 {
kaf24@1218 146 struct task_struct *p = current;
kaf24@1218 147 int virq = bind->virq;
kaf24@1218 148 int port;
kaf24@1218 149
kaf24@1235 150 if ( virq >= ARRAY_SIZE(p->virq_to_evtchn) )
kaf24@1218 151 return -EINVAL;
kaf24@1218 152
kaf24@1218 153 spin_lock(&p->event_channel_lock);
kaf24@1218 154
kaf24@1218 155 /*
kaf24@1218 156 * Port 0 is the fallback port for VIRQs that haven't been explicitly
kaf24@1249 157 * bound yet. The exception is the 'misdirect VIRQ', which is permanently
kaf24@1218 158 * bound to port 0.
kaf24@1218 159 */
kaf24@1218 160 if ( ((port = p->virq_to_evtchn[virq]) != 0) ||
kaf24@1249 161 (virq == VIRQ_MISDIRECT) ||
kaf24@1218 162 ((port = get_free_port(p)) < 0) )
kaf24@1218 163 goto out;
kaf24@1218 164
kaf24@1218 165 p->event_channel[port].state = ECS_VIRQ;
kaf24@1218 166 p->event_channel[port].u.virq = virq;
kaf24@1218 167
kaf24@1218 168 p->virq_to_evtchn[virq] = port;
kaf24@1218 169
kaf24@1218 170 out:
kaf24@1218 171 spin_unlock(&p->event_channel_lock);
kaf24@1218 172
kaf24@1218 173 if ( port < 0 )
kaf24@1218 174 return port;
kaf24@1218 175
kaf24@1218 176 bind->port = port;
kaf24@1218 177 return 0;
kaf24@1218 178 }
kaf24@1218 179
kaf24@1218 180
kaf24@1235 181 static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
kaf24@1235 182 {
kaf24@1235 183 struct task_struct *p = current;
kaf24@1235 184 int pirq = bind->pirq;
kaf24@1239 185 int port, rc;
kaf24@1235 186
kaf24@1235 187 if ( pirq >= ARRAY_SIZE(p->pirq_to_evtchn) )
kaf24@1235 188 return -EINVAL;
kaf24@1235 189
kaf24@1235 190 spin_lock(&p->event_channel_lock);
kaf24@1235 191
kaf24@1239 192 if ( ((rc = port = p->pirq_to_evtchn[pirq]) != 0) ||
kaf24@1239 193 ((rc = port = get_free_port(p)) < 0) )
kaf24@1235 194 goto out;
kaf24@1235 195
kaf24@1239 196 p->pirq_to_evtchn[pirq] = port;
kaf24@1239 197 if ( (rc = pirq_guest_bind(p, pirq)) != 0 )
kaf24@1239 198 {
kaf24@1239 199 p->pirq_to_evtchn[pirq] = 0;
kaf24@1239 200 goto out;
kaf24@1239 201 }
kaf24@1239 202
kaf24@1235 203 p->event_channel[port].state = ECS_PIRQ;
kaf24@1235 204 p->event_channel[port].u.pirq = pirq;
kaf24@1235 205
kaf24@1235 206 out:
kaf24@1235 207 spin_unlock(&p->event_channel_lock);
kaf24@1235 208
kaf24@1239 209 if ( rc < 0 )
kaf24@1239 210 return rc;
kaf24@1235 211
kaf24@1235 212 bind->port = port;
kaf24@1235 213 return 0;
kaf24@1235 214 }
kaf24@1235 215
kaf24@1235 216
kaf24@1218 217 static long __evtchn_close(struct task_struct *p1, int port1)
kaf24@954 218 {
kaf24@1129 219 struct task_struct *p2 = NULL;
kaf24@1129 220 event_channel_t *chn1, *chn2;
kaf24@1129 221 int port2;
kaf24@954 222 long rc = 0;
kaf24@954 223
kaf24@954 224 again:
kaf24@1129 225 spin_lock(&p1->event_channel_lock);
kaf24@954 226
kaf24@1129 227 chn1 = p1->event_channel;
kaf24@954 228
kaf24@1249 229 /* NB. Port 0 is special (VIRQ_MISDIRECT). Never let it be closed. */
kaf24@1218 230 if ( (port1 <= 0) || (port1 >= p1->max_event_channel) )
kaf24@954 231 {
kaf24@954 232 rc = -EINVAL;
kaf24@954 233 goto out;
kaf24@954 234 }
kaf24@954 235
kaf24@1218 236 switch ( chn1[port1].state )
kaf24@954 237 {
kaf24@1218 238 case ECS_FREE:
kaf24@1218 239 rc = -EINVAL;
kaf24@1218 240 goto out;
kaf24@1218 241
kaf24@1218 242 case ECS_UNBOUND:
kaf24@1218 243 break;
kaf24@1218 244
kaf24@1218 245 case ECS_PIRQ:
kaf24@1239 246 if ( (rc = pirq_guest_unbind(p1, chn1[port1].u.pirq)) == 0 )
kaf24@1239 247 p1->pirq_to_evtchn[chn1[port1].u.pirq] = 0;
kaf24@1218 248 break;
kaf24@1218 249
kaf24@1218 250 case ECS_VIRQ:
kaf24@1218 251 p1->virq_to_evtchn[chn1[port1].u.virq] = 0;
kaf24@1218 252 break;
kaf24@1218 253
kaf24@1218 254 case ECS_INTERDOMAIN:
kaf24@1129 255 if ( p2 == NULL )
kaf24@954 256 {
kaf24@1218 257 p2 = chn1[port1].u.remote.dom;
kaf24@1129 258 get_task_struct(p2);
kaf24@1127 259
kaf24@1129 260 if ( p1->domain < p2->domain )
kaf24@954 261 {
kaf24@1129 262 spin_lock(&p2->event_channel_lock);
kaf24@954 263 }
kaf24@1135 264 else if ( p1 != p2 )
kaf24@954 265 {
kaf24@1129 266 spin_unlock(&p1->event_channel_lock);
kaf24@1129 267 spin_lock(&p2->event_channel_lock);
kaf24@954 268 goto again;
kaf24@954 269 }
kaf24@954 270 }
kaf24@1218 271 else if ( p2 != chn1[port1].u.remote.dom )
kaf24@954 272 {
kaf24@954 273 rc = -EINVAL;
kaf24@954 274 goto out;
kaf24@954 275 }
kaf24@954 276
kaf24@1129 277 chn2 = p2->event_channel;
kaf24@1218 278 port2 = chn1[port1].u.remote.port;
kaf24@954 279
kaf24@1129 280 if ( port2 >= p2->max_event_channel )
kaf24@1127 281 BUG();
kaf24@1218 282 if ( chn2[port2].state != ECS_INTERDOMAIN )
kaf24@1127 283 BUG();
kaf24@1218 284 if ( chn2[port2].u.remote.dom != p1 )
kaf24@1127 285 BUG();
kaf24@954 286
kaf24@1218 287 chn2[port2].state = ECS_UNBOUND;
kaf24@1218 288 chn2[port2].u.remote.dom = NULL;
kaf24@1218 289 chn2[port2].u.remote.port = 0xFFFF;
kaf24@1127 290
kaf24@1218 291 evtchn_set_exception(p2, port2);
kaf24@1218 292
kaf24@1218 293 break;
kaf24@1218 294
kaf24@1218 295 default:
kaf24@1218 296 BUG();
kaf24@954 297 }
kaf24@954 298
kaf24@1218 299 chn1[port1].state = ECS_FREE;
kaf24@1218 300 chn1[port1].u.remote.dom = NULL;
kaf24@1218 301 chn1[port1].u.remote.port = 0xFFFF;
kaf24@954 302
kaf24@1218 303 evtchn_set_exception(p1, port1);
kaf24@1133 304
kaf24@954 305 out:
kaf24@1129 306 if ( p2 != NULL )
kaf24@954 307 {
kaf24@1135 308 if ( p1 != p2 )
kaf24@1135 309 spin_unlock(&p2->event_channel_lock);
kaf24@1129 310 put_task_struct(p2);
kaf24@954 311 }
kaf24@954 312
kaf24@1145 313 spin_unlock(&p1->event_channel_lock);
kaf24@1145 314
kaf24@954 315 return rc;
kaf24@954 316 }
kaf24@954 317
kaf24@954 318
kaf24@1218 319 static long evtchn_close(evtchn_close_t *close)
kaf24@1127 320 {
kaf24@1129 321 struct task_struct *p;
kaf24@1127 322 long rc;
kaf24@1129 323 domid_t dom = close->dom;
kaf24@1127 324
kaf24@1129 325 if ( dom == DOMID_SELF )
kaf24@1129 326 dom = current->domain;
kaf24@1127 327 else if ( !IS_PRIV(current) )
kaf24@1127 328 return -EPERM;
kaf24@1127 329
kaf24@1129 330 if ( (p = find_domain_by_id(dom)) == NULL )
kaf24@1127 331 return -ESRCH;
kaf24@1127 332
kaf24@1218 333 rc = __evtchn_close(p, close->port);
kaf24@1127 334
kaf24@1129 335 put_task_struct(p);
kaf24@1127 336 return rc;
kaf24@1127 337 }
kaf24@1127 338
kaf24@1127 339
kaf24@1218 340 static long evtchn_send(int lport)
kaf24@954 341 {
kaf24@954 342 struct task_struct *lp = current, *rp;
kaf24@1127 343 int rport;
kaf24@954 344
kaf24@954 345 spin_lock(&lp->event_channel_lock);
kaf24@954 346
kaf24@1127 347 if ( unlikely(lport < 0) ||
kaf24@1127 348 unlikely(lport >= lp->max_event_channel) ||
kaf24@1218 349 unlikely(lp->event_channel[lport].state != ECS_INTERDOMAIN) )
kaf24@954 350 {
kaf24@954 351 spin_unlock(&lp->event_channel_lock);
kaf24@954 352 return -EINVAL;
kaf24@954 353 }
kaf24@954 354
kaf24@1218 355 rp = lp->event_channel[lport].u.remote.dom;
kaf24@1218 356 rport = lp->event_channel[lport].u.remote.port;
kaf24@1127 357
kaf24@1127 358 get_task_struct(rp);
kaf24@954 359
kaf24@954 360 spin_unlock(&lp->event_channel_lock);
kaf24@954 361
kaf24@1218 362 evtchn_set_pending(rp, rport);
kaf24@954 363
kaf24@954 364 put_task_struct(rp);
kaf24@1127 365
kaf24@954 366 return 0;
kaf24@954 367 }
kaf24@954 368
kaf24@954 369
kaf24@1218 370 static long evtchn_status(evtchn_status_t *status)
kaf24@954 371 {
kaf24@1129 372 struct task_struct *p;
kaf24@1218 373 domid_t dom = status->dom;
kaf24@1218 374 int port = status->port;
kaf24@1129 375 event_channel_t *chn;
kaf24@1127 376
kaf24@1129 377 if ( dom == DOMID_SELF )
kaf24@1129 378 dom = current->domain;
kaf24@1127 379 else if ( !IS_PRIV(current) )
kaf24@1127 380 return -EPERM;
kaf24@1127 381
kaf24@1129 382 if ( (p = find_domain_by_id(dom)) == NULL )
kaf24@1127 383 return -ESRCH;
kaf24@954 384
kaf24@1129 385 spin_lock(&p->event_channel_lock);
kaf24@954 386
kaf24@1129 387 chn = p->event_channel;
kaf24@954 388
kaf24@1129 389 if ( (port < 0) || (port >= p->max_event_channel) )
kaf24@954 390 {
kaf24@1129 391 spin_unlock(&p->event_channel_lock);
kaf24@1127 392 return -EINVAL;
kaf24@1127 393 }
kaf24@1127 394
kaf24@1129 395 switch ( chn[port].state )
kaf24@1127 396 {
kaf24@1127 397 case ECS_FREE:
kaf24@1127 398 status->status = EVTCHNSTAT_closed;
kaf24@1127 399 break;
kaf24@1218 400 case ECS_UNBOUND:
kaf24@1218 401 status->status = EVTCHNSTAT_unbound;
kaf24@1127 402 break;
kaf24@1218 403 case ECS_INTERDOMAIN:
kaf24@1218 404 status->status = EVTCHNSTAT_interdomain;
kaf24@1218 405 status->u.interdomain.dom = chn[port].u.remote.dom->domain;
kaf24@1218 406 status->u.interdomain.port = chn[port].u.remote.port;
kaf24@1218 407 break;
kaf24@1218 408 case ECS_PIRQ:
kaf24@1218 409 status->status = EVTCHNSTAT_pirq;
kaf24@1218 410 status->u.pirq = chn[port].u.pirq;
kaf24@1218 411 break;
kaf24@1218 412 case ECS_VIRQ:
kaf24@1218 413 status->status = EVTCHNSTAT_virq;
kaf24@1218 414 status->u.virq = chn[port].u.virq;
kaf24@1127 415 break;
kaf24@1127 416 default:
kaf24@1127 417 BUG();
kaf24@954 418 }
kaf24@954 419
kaf24@1129 420 spin_unlock(&p->event_channel_lock);
kaf24@1127 421 return 0;
kaf24@954 422 }
kaf24@954 423
kaf24@954 424
kaf24@1127 425 long do_event_channel_op(evtchn_op_t *uop)
kaf24@954 426 {
kaf24@954 427 long rc;
kaf24@1127 428 evtchn_op_t op;
kaf24@954 429
kaf24@1127 430 if ( copy_from_user(&op, uop, sizeof(op)) != 0 )
kaf24@1127 431 return -EFAULT;
kaf24@1127 432
kaf24@1127 433 switch ( op.cmd )
kaf24@954 434 {
kaf24@1218 435 case EVTCHNOP_bind_interdomain:
kaf24@1218 436 rc = evtchn_bind_interdomain(&op.u.bind_interdomain);
kaf24@1235 437 if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
kaf24@1218 438 rc = -EFAULT; /* Cleaning up here would be a mess! */
kaf24@1218 439 break;
kaf24@1218 440
kaf24@1218 441 case EVTCHNOP_bind_virq:
kaf24@1218 442 rc = evtchn_bind_virq(&op.u.bind_virq);
kaf24@1235 443 if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
kaf24@1235 444 rc = -EFAULT; /* Cleaning up here would be a mess! */
kaf24@1235 445 break;
kaf24@1235 446
kaf24@1235 447 case EVTCHNOP_bind_pirq:
kaf24@1235 448 rc = evtchn_bind_pirq(&op.u.bind_pirq);
kaf24@1235 449 if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
kaf24@1127 450 rc = -EFAULT; /* Cleaning up here would be a mess! */
kaf24@954 451 break;
kaf24@954 452
kaf24@954 453 case EVTCHNOP_close:
kaf24@1218 454 rc = evtchn_close(&op.u.close);
kaf24@954 455 break;
kaf24@954 456
kaf24@954 457 case EVTCHNOP_send:
kaf24@1218 458 rc = evtchn_send(op.u.send.local_port);
kaf24@954 459 break;
kaf24@954 460
kaf24@954 461 case EVTCHNOP_status:
kaf24@1218 462 rc = evtchn_status(&op.u.status);
kaf24@1235 463 if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
kaf24@1127 464 rc = -EFAULT;
kaf24@954 465 break;
kaf24@954 466
kaf24@954 467 default:
kaf24@954 468 rc = -ENOSYS;
kaf24@954 469 break;
kaf24@954 470 }
kaf24@954 471
kaf24@954 472 return rc;
kaf24@954 473 }
kaf24@954 474
kaf24@954 475
kaf24@1218 476 int init_event_channels(struct task_struct *p)
kaf24@1218 477 {
kaf24@1218 478 spin_lock_init(&p->event_channel_lock);
kaf24@1218 479 p->event_channel = kmalloc(INIT_EVENT_CHANNELS * sizeof(event_channel_t),
kaf24@1218 480 GFP_KERNEL);
kaf24@1218 481 if ( unlikely(p->event_channel == NULL) )
kaf24@1218 482 return -ENOMEM;
kaf24@1218 483 p->max_event_channel = INIT_EVENT_CHANNELS;
kaf24@1218 484 memset(p->event_channel, 0, INIT_EVENT_CHANNELS * sizeof(event_channel_t));
kaf24@1218 485 p->event_channel[0].state = ECS_VIRQ;
kaf24@1249 486 p->event_channel[0].u.virq = VIRQ_MISDIRECT;
kaf24@1218 487 return 0;
kaf24@1218 488 }
kaf24@1218 489
kaf24@1218 490
kaf24@954 491 void destroy_event_channels(struct task_struct *p)
kaf24@954 492 {
kaf24@954 493 int i;
kaf24@954 494 if ( p->event_channel != NULL )
kaf24@954 495 {
kaf24@954 496 for ( i = 0; i < p->max_event_channel; i++ )
kaf24@1218 497 (void)__evtchn_close(p, i);
kaf24@954 498 kfree(p->event_channel);
kaf24@954 499 }
kaf24@954 500 }