kern_softint.c revision 1.1.2.12 1 /* $NetBSD: kern_softint.c,v 1.1.2.12 2007/08/21 13:59:43 ad Exp $ */
2
3 /*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 /*
40 * Generic software interrupt framework.
41 *
42 * Overview
43 *
44 * The soft interrupt framework provides a mechanism to schedule a
45 * low priority callback that runs with thread context. It allows
46 * for dynamic registration of software interrupts, and for fair
47 * queueing and prioritization of those interrupts. The callbacks
48 * can be scheduled to run from nearly any point in the kernel: by
49 * code running with thread context, by code running from a
50 * hardware interrupt handler, and at any interrupt priority
51 * level.
52 *
53 * Priority levels
54 *
55 * Since soft interrupt dispatch can be tied to the underlying
56 * architecture's interrupt dispatch code, it can be limited
57 * both by the capabilities of the hardware and the capabilities
58 * of the interrupt dispatch code itself. The number of priority
59 * levels is restricted to four. In order of priority (lowest to
60 * highest) the levels are: clock, bio, net, serial.
61 *
62 * The names are symbolic and in isolation do not have any direct
63 * connection with a particular kind of device activity: they are
64 * only meant as a guide.
65 *
66 * The four priority levels map directly to scheduler priority
67 * levels, and where the architecture implements 'fast' software
68 * interrupts, they also map onto interrupt priorities. The
69 * interrupt priorities are intended to be hidden from machine
70 * independent code, which should use thread-safe mechanisms to
71 * synchronize with software interrupts (for example: mutexes).
72 *
73 * Capabilities
74 *
75 * Software interrupts run with limited machine context. In
76 * particular, they do not posess any address space context. They
77 * should not try to operate on user space addresses, or to use
78 * virtual memory facilities other than those noted as interrupt
79 * safe.
80 *
81 * Unlike hardware interrupts, software interrupts do have thread
82 * context. They may block on synchronization objects, sleep, and
83 * resume execution at a later time.
84 *
85 * Since software interrupts are a limited resource and run with
86 * higher priority than most other LWPs in the system, all
87 * block-and-resume activity by a software interrupt must be kept
88 * short to allow futher processing at that level to continue. By
89 * extension, code running in the bottom half of the kernel must
90 * take care to ensure that any lock that may be taken from a
91 * software interrupt can not be held for more than a short period
92 * of time.
93 *
94 * The kernel does not allow software interrupts to use facilities
95 * or perform actions that may block for a significant amount of
96 * time. This means that it's not valid for a software interrupt
97 * to: sleep on condition variables, use the lockmgr() facility,
98 * or wait for resources to become available (for example,
99 * memory).
100 *
101 * Per-CPU operation
102 *
103 * If a soft interrupt is triggered on a CPU, it can only be
104 * dispatched on the same CPU. Each LWP dedicated to handling a
105 * soft interrupt is bound to its home CPU, so if the LWP blocks
106 * and needs to run again, it can only run there. Nearly all data
107 * structures used to manage software interrupts are per-CPU.
108 *
109 * The per-CPU requirement is intended to reduce "ping-pong" of
110 * cache lines between CPUs: lines occupied by data structures
111 * used to manage the soft interrupts, and lines occupied by data
112 * items being passed down to the soft interrupt. As a positive
113 * side effect, this also means that the soft interrupt dispatch
114 * code does not need to to use spinlocks to synchronize with the
115 * upper half.
116 *
117 * Generic implementation
118 *
119 * A generic, low performance implementation is provided that
120 * works across all architectures, with no machine-dependent
121 * modifications needed. This implementation uses the scheduler,
122 * and so has a number of restrictions:
123 *
124 * 1) Since software interrupts can be triggered from any priority
125 * level, on architectures where the generic implementation is
126 * used IPL_SCHED must be equal to IPL_HIGH (it must block all
127 * interrupts).
128 *
129 * 2) The software interrupts are not currently preemptive, so
130 * must wait for the currently executing LWP to yield the CPU.
131 * This can introduce latency.
132 *
133 * 3) A context switch is required for each soft interrupt to be
134 * handled, which can be quite expensive.
135 *
136 * 'Fast' software interrupts
137 *
138 * If an architectures defines __HAVE_FAST_SOFTINTS, it implements
139 * the fast mechanism. Threads running either in the kernel or in
140 * userspace will be interrupted, but will not be preempted. When
141 * the soft interrupt completes execution, the interrupted LWP
142 * is resumed. Interrupt dispatch code must provide the minimum
143 * level of context necessary for the soft interrupt to block and
144 * be resumed at a later time. The machine-dependent dispatch
145 * path looks something like the following:
146 *
147 * softintr()
148 * {
149 * go to IPL_HIGH if necessary for switch;
150 * save any necessary registers in a format that can be
151 * restored by cpu_switchto if the softint blocks;
152 * arrange for cpu_switchto() to restore into the
153 * trampoline function;
154 * identify LWP to handle this interrupt;
155 * switch to the LWP's stack;
156 * switch register stacks, if necessary;
157 * assign new value of curlwp;
158 * call MI softint_dispatch, passing old curlwp and IPL
159 * to execute interrupt at;
160 * switch back to old stack;
161 * switch back to old register stack, if necessary;
162 * restore curlwp;
163 * return to interrupted LWP;
164 * }
165 *
166 * If the soft interrupt blocks, a trampoline function is returned
167 * to in the context of the interrupted LWP, as arranged for by
168 * softint():
169 *
170 * softint_ret()
171 * {
172 * unlock soft interrupt LWP;
173 * resume interrupt processing, likely returning to
174 * interrupted LWP or dispatching another, different
175 * interrupt;
176 * }
177 *
178 * Once the soft interrupt has fired (and even if it has blocked),
179 * no further soft interrupts at that level will be triggered by
180 * MI code until the soft interrupt handler has ceased execution.
181 * If a soft interrupt handler blocks and is resumed, it resumes
182 * execution as a normal LWP (kthread) and gains VM context. Only
183 * when it has completed and is ready to fire again will it
184 * interrupt other threads.
185 */
186
187 #include <sys/cdefs.h>
188 __KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.1.2.12 2007/08/21 13:59:43 ad Exp $");
189
190 #include <sys/param.h>
191 #include <sys/malloc.h>
192 #include <sys/proc.h>
193 #include <sys/intr.h>
194 #include <sys/mutex.h>
195 #include <sys/kthread.h>
196 #include <sys/evcnt.h>
197 #include <sys/cpu.h>
198
199 #include <net/netisr.h>
200
201 #include <uvm/uvm_extern.h>
202
203 #define PRI_SOFTSERIAL (PRI_COUNT - 1)
204 #define PRI_SOFTNET (PRI_SOFTSERIAL - schedppq * 1)
205 #define PRI_SOFTBIO (PRI_SOFTSERIAL - schedppq * 2)
206 #define PRI_SOFTCLOCK (PRI_SOFTSERIAL - schedppq * 3)
207
208 /* This could overlap with signal info in struct lwp. */
209 typedef struct softint {
210 SIMPLEQ_HEAD(, softhand) si_q;
211 struct lwp *si_lwp;
212 struct cpu_info *si_cpu;
213 uintptr_t si_machdep;
214 struct evcnt si_evcnt;
215 int si_active;
216 char si_name[8];
217 } softint_t;
218
219 typedef struct softhand {
220 SIMPLEQ_ENTRY(softhand) sh_q;
221 void (*sh_func)(void *);
222 void *sh_arg;
223 softint_t *sh_isr;
224 u_int sh_pending;
225 u_int sh_flags;
226 } softhand_t;
227
228 typedef struct softcpu {
229 struct cpu_info *sc_cpu;
230 softint_t sc_int[SOFTINT_COUNT];
231 softhand_t sc_hand[1];
232 } softcpu_t;
233
234 static void softint_thread(void *);
235 static void softint_netisr(void *);
236
237 u_int softint_bytes = 8192;
238 u_int softint_timing;
239 static u_int softint_max;
240 static kmutex_t softint_lock;
241 static void *softint_netisr_sih;
242 struct evcnt softint_block;
243
244 /*
245 * softint_init_isr:
246 *
247 * Initialize a single interrupt level for a single CPU.
248 */
249 static void
250 softint_init_isr(softcpu_t *sc, const char *desc, pri_t pri, u_int level)
251 {
252 struct cpu_info *ci;
253 softint_t *si;
254 int error;
255
256 si = &sc->sc_int[level];
257 ci = sc->sc_cpu;
258 si->si_cpu = ci;
259
260 SIMPLEQ_INIT(&si->si_q);
261
262 error = kthread_create(pri, KTHREAD_MPSAFE | KTHREAD_INTR |
263 KTHREAD_IDLE, ci, softint_thread, si, &si->si_lwp,
264 "soft%s/%d", desc, (int)ci->ci_cpuid);
265 if (error != 0)
266 panic("softint_init_isr: error %d", error);
267
268 snprintf(si->si_name, sizeof(si->si_name), "%s/%d", desc,
269 (int)ci->ci_cpuid);
270 evcnt_attach_dynamic(&si->si_evcnt, EVCNT_TYPE_INTR, NULL,
271 "softint", si->si_name);
272
273 si->si_lwp->l_private = si;
274 softint_init_md(si->si_lwp, level, &si->si_machdep);
275 #ifdef __HAVE_FAST_SOFTINTS
276 si->si_lwp->l_mutex = &ci->ci_schedstate.spc_lwplock;
277 #endif
278 }
279 /*
280 * softint_init:
281 *
282 * Initialize per-CPU data structures. Called from mi_cpu_attach().
283 */
284 void
285 softint_init(struct cpu_info *ci)
286 {
287 static struct cpu_info *first;
288 softcpu_t *sc, *scfirst;
289 softhand_t *sh, *shmax;
290
291 if (first == NULL) {
292 /* Boot CPU. */
293 first = ci;
294 mutex_init(&softint_lock, MUTEX_DEFAULT, IPL_NONE);
295 softint_bytes = round_page(softint_bytes);
296 softint_max = (softint_bytes - sizeof(softcpu_t)) /
297 sizeof(softhand_t);
298 evcnt_attach_dynamic(&softint_block, EVCNT_TYPE_INTR,
299 NULL, "softint", "block");
300 }
301
302 sc = (softcpu_t *)uvm_km_alloc(kernel_map, softint_bytes, 0,
303 UVM_KMF_WIRED | UVM_KMF_ZERO);
304 if (sc == NULL)
305 panic("softint_init_cpu: cannot allocate memory");
306
307 ci->ci_data.cpu_softcpu = sc;
308 sc->sc_cpu = ci;
309
310 softint_init_isr(sc, "net", PRI_SOFTNET, SOFTINT_NET);
311 softint_init_isr(sc, "bio", PRI_SOFTBIO, SOFTINT_BIO);
312 softint_init_isr(sc, "clk", PRI_SOFTCLOCK, SOFTINT_CLOCK);
313 softint_init_isr(sc, "ser", PRI_SOFTSERIAL, SOFTINT_SERIAL);
314
315 if (first != ci) {
316 /* Don't lock -- autoconfiguration will prevent reentry. */
317 scfirst = first->ci_data.cpu_softcpu;
318 sh = sc->sc_hand;
319 memcpy(sh, scfirst->sc_hand, sizeof(*sh) * softint_max);
320
321 /* Update pointers for this CPU. */
322 for (shmax = sh + softint_max; sh < shmax; sh++) {
323 if (sh->sh_func == NULL)
324 continue;
325 sh->sh_isr =
326 &sc->sc_int[sh->sh_flags & SOFTINT_LVLMASK];
327 }
328 } else {
329 /* Establish a handler for legacy net interrupts. */
330 softint_netisr_sih = softint_establish(SOFTINT_NET,
331 softint_netisr, NULL);
332 KASSERT(softint_netisr_sih != NULL);
333 }
334 }
335
336 /*
337 * softint_establish:
338 *
339 * Register a software interrupt handler.
340 */
341 void *
342 softint_establish(u_int flags, void (*func)(void *), void *arg)
343 {
344 CPU_INFO_ITERATOR cii;
345 struct cpu_info *ci;
346 softcpu_t *sc;
347 softhand_t *sh;
348 u_int level, index;
349
350 level = (flags & SOFTINT_LVLMASK);
351 KASSERT(level < SOFTINT_COUNT);
352
353 mutex_enter(&softint_lock);
354
355 /* Find a free slot. */
356 sc = curcpu()->ci_data.cpu_softcpu;
357 for (index = 1; index < softint_max; index++)
358 if (sc->sc_hand[index].sh_func == NULL)
359 break;
360 if (index == softint_max) {
361 mutex_exit(&softint_lock);
362 printf("WARNING: softint_establish: table full, "
363 "increase softint_bytes\n");
364 return NULL;
365 }
366
367 /* Set up the handler on each CPU. */
368 for (CPU_INFO_FOREACH(cii, ci)) {
369 sc = ci->ci_data.cpu_softcpu;
370 sh = &sc->sc_hand[index];
371
372 sh->sh_isr = &sc->sc_int[level];
373 sh->sh_func = func;
374 sh->sh_arg = arg;
375 sh->sh_flags = flags;
376 sh->sh_pending = 0;
377 }
378
379 mutex_exit(&softint_lock);
380
381 return (void *)((uint8_t *)&sc->sc_hand[index] - (uint8_t *)sc);
382 }
383
384 /*
385 * softint_disestablish:
386 *
387 * Unregister a software interrupt handler.
388 */
389 void
390 softint_disestablish(void *arg)
391 {
392 CPU_INFO_ITERATOR cii;
393 struct cpu_info *ci;
394 softcpu_t *sc;
395 softhand_t *sh;
396 uintptr_t offset;
397
398 offset = (uintptr_t)arg;
399 KASSERT(offset != 0 && offset < softint_bytes);
400
401 mutex_enter(&softint_lock);
402
403 /* Set up the handler on each CPU. */
404 for (CPU_INFO_FOREACH(cii, ci)) {
405 sc = ci->ci_data.cpu_softcpu;
406 sh = (softhand_t *)((uint8_t *)sc + offset);
407 KASSERT(sh->sh_func != NULL);
408 KASSERT(sh->sh_pending == 0);
409 sh->sh_func = NULL;
410 }
411
412 mutex_exit(&softint_lock);
413 }
414
415 /*
416 * softint_schedule:
417 *
418 * Trigger a software interrupt. Must be called from a hardware
419 * interrupt handler, or with preemption disabled (since we are
420 * using the value of curcpu()).
421 */
422 void
423 softint_schedule(void *arg)
424 {
425 softhand_t *sh;
426 softint_t *si;
427 uintptr_t offset;
428 int s;
429
430 /* Find the handler record for this CPU. */
431 offset = (uintptr_t)arg;
432 KASSERT(offset != 0 && offset < softint_bytes);
433 sh = (softhand_t *)((uint8_t *)curcpu()->ci_data.cpu_softcpu + offset);
434
435 /* If it's already pending there's nothing to do. */
436 if (sh->sh_pending)
437 return;
438
439 /*
440 * Enqueue the handler into the LWP's pending list.
441 * If the LWP is completely idle, then make it run.
442 */
443 s = splhigh();
444 if (!sh->sh_pending) {
445 si = sh->sh_isr;
446 sh->sh_pending = 1;
447 SIMPLEQ_INSERT_TAIL(&si->si_q, sh, sh_q);
448 if (si->si_active == 0) {
449 si->si_active = 1;
450 softint_trigger(si->si_machdep);
451 }
452 }
453 splx(s);
454 }
455
456 /*
457 * softint_execute:
458 *
459 * Invoke handlers for the specified soft interrupt.
460 * Must be entered at splhigh. Will drop the priority
461 * to the level specified, but returns back at splhigh.
462 */
463 static inline void
464 softint_execute(softint_t *si, lwp_t *l, int s)
465 {
466 softhand_t *sh;
467 bool havelock;
468
469 KASSERT(si->si_lwp == curlwp);
470 KASSERT(si->si_cpu == curcpu());
471 KASSERT(si->si_lwp->l_wchan == NULL);
472 KASSERT(si->si_active);
473
474 havelock = false;
475
476 /*
477 * Note: due to priority inheritance we may have interrupted a
478 * higher priority LWP. Since the soft interrupt must be quick
479 * and is non-preemptable, we don't bother yielding.
480 */
481
482 while (!SIMPLEQ_EMPTY(&si->si_q)) {
483 /*
484 * Pick the longest waiting handler to run. We block
485 * interrupts but do not lock in order to do this, as
486 * we are protecting against the local CPU only.
487 */
488 sh = SIMPLEQ_FIRST(&si->si_q);
489 SIMPLEQ_REMOVE_HEAD(&si->si_q, sh_q);
490 sh->sh_pending = 0;
491 splx(s);
492
493 /* Run the handler. */
494 if ((sh->sh_flags & SOFTINT_MPSAFE) == 0 && !havelock) {
495 KERNEL_LOCK(1, l);
496 havelock = true;
497 }
498 (*sh->sh_func)(sh->sh_arg);
499
500 (void)splhigh();
501 }
502
503 if (havelock) {
504 KERNEL_UNLOCK_ONE(l);
505 }
506
507 /*
508 * Unlocked, but only for statistics.
509 * Should be per-CPU to prevent cache ping-pong.
510 */
511 uvmexp.softs++;
512
513 si->si_evcnt.ev_count++;
514 si->si_active = 0;
515 }
516
517 /*
518 * schednetisr:
519 *
520 * Trigger a legacy network interrupt. XXX Needs to go away.
521 */
522 void
523 schednetisr(int isr)
524 {
525 int s;
526
527 s = splhigh();
528 curcpu()->ci_data.cpu_netisrs |= (1 << isr);
529 softint_schedule(softint_netisr_sih);
530 splx(s);
531 }
532
533 /*
534 * softintr_netisr:
535 *
536 * Dispatch legacy network interrupts. XXX Needs to go away.
537 */
538 static void
539 softint_netisr(void *cookie)
540 {
541 struct cpu_info *ci;
542 int s, bits;
543
544 ci = curcpu();
545
546 s = splhigh();
547 bits = ci->ci_data.cpu_netisrs;
548 ci->ci_data.cpu_netisrs = 0;
549 splx(s);
550
551 #define DONETISR(which, func) \
552 do { \
553 void func(void); \
554 if ((bits & (1 << which)) != 0) \
555 func(); \
556 } while(0);
557 #include <net/netisr_dispatch.h>
558 #undef DONETISR
559 }
560
561 #ifndef __HAVE_FAST_SOFTINTS
562
563 /*
564 * softint_init_md:
565 *
566 * Perform machine-dependent initialization.
567 */
568 void
569 softint_init_md(lwp_t *l, u_int level, uintptr_t *machdep)
570 {
571 softint_t *si;
572
573 *machdep = (uintptr_t)l;
574 si = l->l_private;
575
576 lwp_lock(l);
577 /* Cheat and make the KASSERT in softint_thread() happy. */
578 si->si_active = 1;
579 l->l_stat = LSRUN;
580 sched_enqueue(l, false);
581 lwp_unlock(l);
582 }
583
584 /*
585 * softint_trigger:
586 *
587 * Cause a soft interrupt handler to begin executing.
588 */
589 void
590 softint_trigger(uintptr_t machdep)
591 {
592 struct cpu_info *ci;
593 lwp_t *l;
594
595 l = (lwp_t *)machdep;
596 ci = l->l_cpu;
597
598 spc_lock(ci);
599 l->l_mutex = ci->ci_schedstate.spc_mutex;
600 l->l_stat = LSRUN;
601 sched_enqueue(l, false);
602 cpu_need_resched(ci, RESCHED_IMMED);
603 spc_unlock(ci);
604 }
605
606 /*
607 * softint_thread:
608 *
609 * Slow path MI software interrupt dispatch.
610 */
611 void
612 softint_thread(void *cookie)
613 {
614 softint_t *si;
615 lwp_t *l;
616 int s;
617
618 l = curlwp;
619 si = l->l_private;
620 s = splhigh();
621
622 for (;;) {
623 softint_execute(si, l, s);
624
625 lwp_lock(l);
626 l->l_stat = LSIDL;
627 mi_switch(l);
628 }
629 }
630
631 #else /* !__HAVE_FAST_SOFTINTS */
632
633 /*
634 * softint_thread:
635 *
636 * In the __HAVE_FAST_SOFTINTS case, the LWP is switched to without
637 * restoring any state, so we should not arrive here - there is a
638 * direct handoff between the interrupt stub and softint_dispatch().
639 */
640 void
641 softint_thread(void *cookie)
642 {
643
644 panic("softint_thread");
645 }
646
647 /*
648 * softint_dispatch:
649 *
650 * Entry point from machine-dependent code.
651 */
652 void
653 softint_dispatch(lwp_t *pinned, int s)
654 {
655 struct timeval now;
656 softint_t *si;
657 u_int timing;
658 lwp_t *l;
659
660 l = curlwp;
661 si = l->l_private;
662
663 /*
664 * Note the interrupted LWP, and mark the current LWP as running
665 * before proceeding. Although this must as a rule be done with
666 * the LWP locked, at this point no external agents will want to
667 * modify the interrupt LWP's state.
668 */
669 timing = (softint_timing ? LW_TIMEINTR : 0);
670 l->l_switchto = pinned;
671 l->l_stat = LSONPROC;
672 l->l_flag |= (LW_RUNNING | timing);
673
674 /*
675 * Dispatch the interrupt. If softints are being timed, charge
676 * for it.
677 */
678 if (timing)
679 microtime(&l->l_stime);
680 softint_execute(si, l, s);
681 if (timing) {
682 microtime(&now);
683 updatertime(l, &now);
684 l->l_flag &= ~LW_TIMEINTR;
685 }
686
687 /*
688 * If we blocked while handling the interrupt, the pinned LWP is
689 * gone so switch to the idle LWP. It will select a new LWP to
690 * run.
691 *
692 * We must drop the priority level as switching at IPL_HIGH could
693 * deadlock the system. We have already set si->si_active = 0,
694 * which means another interrupt at this level can be triggered.
695 * That's not be a problem: we are lowering to level 's' which will
696 * prevent softint_dispatch() from being reentered at level 's',
697 * until the priority is finally dropped to IPL_NONE on entry to
698 * the idle loop.
699 */
700 l->l_stat = LSIDL;
701 if (l->l_switchto == NULL) {
702 splx(s);
703 lwp_exit_switchaway(l);
704 /* NOTREACHED */
705 }
706 l->l_switchto = NULL;
707 l->l_flag &= ~LW_RUNNING;
708 }
709
710 #endif /* !__HAVE_FAST_SOFTINTS */
711