linux/drivers/lguest/core.c
<<
>>
Prefs
   1/*P:400
   2 * This contains run_guest() which actually calls into the Host<->Guest
   3 * Switcher and analyzes the return, such as determining if the Guest wants the
   4 * Host to do something.  This file also contains useful helper routines.
   5:*/
   6#include <linux/module.h>
   7#include <linux/stringify.h>
   8#include <linux/stddef.h>
   9#include <linux/io.h>
  10#include <linux/mm.h>
  11#include <linux/vmalloc.h>
  12#include <linux/cpu.h>
  13#include <linux/freezer.h>
  14#include <linux/highmem.h>
  15#include <linux/slab.h>
  16#include <asm/paravirt.h>
  17#include <asm/pgtable.h>
  18#include <asm/uaccess.h>
  19#include <asm/poll.h>
  20#include <asm/asm-offsets.h>
  21#include "lg.h"
  22
  23
  24static struct vm_struct *switcher_vma;
  25static struct page **switcher_page;
  26
  27/* This One Big lock protects all inter-guest data structures. */
  28DEFINE_MUTEX(lguest_lock);
  29
  30/*H:010
  31 * We need to set up the Switcher at a high virtual address.  Remember the
  32 * Switcher is a few hundred bytes of assembler code which actually changes the
  33 * CPU to run the Guest, and then changes back to the Host when a trap or
  34 * interrupt happens.
  35 *
  36 * The Switcher code must be at the same virtual address in the Guest as the
  37 * Host since it will be running as the   22
  28 *
  29
<3 href39s="comment"> * The Switcher cory2orytual asethreulare Guest asd bn unus theile ang.  T, sof="drivers/lguest/core.c#L4" id="L4" clasass="lin4" name="L30">  30/*H:010appet's noal asimple one-0"> ref="drivers/lguest/core.c#L35" id="L35" c4ass="lin4" name="L31">  31 * We need to seef="drivers/lguest/core.c#L28" id="L28" c4ass="lin4" name="L32">  32vm_struct __ini"="+coensf=lguest_lock" cma _/a>;
vm_struct ma _/a>;
  33   4vm_struct is="c,f=lguest_lock" c.vm_struct .  35page **page **  36  37/*H:010
  28 *
oryef="drivers/lguest/core.c#L35" id="L35" c4ass="lin4" name="L29">  29
<4 href49s="comment"> * The Switcherrrrrrrrr*f="drivers/lguest/core.c#L5" id="L5" clasass="lin5" name="L30">  30/*H:010arrrrrrrr* Ituaurn con" nhualif weto ooseat a  Guest a0xFFC00000 (4MB und  31 * We need to srrrrrrrr* topss in the Guest ),nninmak Hotchte anr at a href ;
  32 * Switcher is rrrrrrrr* easyef="drivers/lguest/core.c#L35" id="L35" c5ass="lin5" name="L33">  33 * CPU to run trrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c5ss="line5" name="L4">   4   5/*H:010
  36 * The Switcherrrrrrrrr* Ws ushreate bn arraycode="+codehref poens.
  37 * Host since irrrrrrrr* this, rath  28 *
  29
<5 href59s="c        oswitcher_page" class="sref">switcher_page;
switcher_pageswitcher_page;
switcher_page  30switcher_page  31switcher_page;
  32vm_struct .vm_struct ENOMEM"drivers/lguest/core.c#L26" id="L26" c6ass="lin6" name="L33">  33vm_struct on""drivers/lguest/core.c#L26" id="L26" c6ss="line6" name="L4">   4   5   6#incan cl66s="c        omment">/*H:010
  37 * Host since irrrrrrrr* Now wetes the  28 *
  29
<6 href69s="comment"> * The Switcherrrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c7ass="lin7" name="L30">  30vm_struct is="c = 0;f=lguest_lock" ci>vm_struct is="c+ambif=lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_pagevm_struct is="c++) {ers/lguest/core.c#L28" id="L28" c7ass="lin7" name="L31">  31switcher_page;
vm_struct is="c] = oswitcher_page"ushresref">switcher_pageswitcher_pagevm_struct __GFP_ZERO="drivers/lguest/core.c#L29" id="L29" c7ass="lin7" name="L32">  32switcher_page;
vm_struct is="c]) {ers/lguest/core.c#L28" id="L28" c7ass="lin7" name="L33">  33vm_struct .vm_struct ENOMEM"drivers/lguest/core.c#L26" id="L26" c7ss="line7" name="L4">   4vm_struct gt;
_is fhref=s"drivers/lguest/core.c#L26" id="L26" c7ss="line7" name="L5">   5   6#in7an cl76s="c        }ers/lguest/core.c#L26" id="L26" c7ss="line"" name="L7">   7#incan cl77drivers/lguest/core.c#L27" id="L27" c7ass="lin7" name="L28">  28/*H:010
  29
<7 href79s="comment"> * The Switcherrrrrrrrr* Firspaneto e whehrtual ahigh virtwon't ih50la at a fixma hareh aef="drivers/lguest/core.c#L3" id="L3" cla8ass="lin8" name="L30">  30/*H:010arrrrrrrr* t a topsodean>orye  It's currspa  31 * We need to srrrrrrrr* re.ye="+the  eff-guesef nineh502>
  32 * Switcher is rrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c8ass="lin8" name="L33">  33vm_struct SWITCHER_ADDRs="c + (=lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_pageswitcher_pageswitcher_page   4vm_struct .vm_struct ENOMEM"drivers/lguest/core.c#L26" id="L26" c8ss="line8" name="L5">   5lguest_lock * Sw>>
"f="drivL26" i:/ma pe ansigh virtwould thwt whfixma \n"driver="drivivers/lguest/core.c#L29" id="L29" c8ss="line8" name="L6">   6#in8an cl86s="c                gohoa=lguest_lock" cgt;
_ref=s>vm_struct gt;
_ref=s"drivers/lguest/core.c#L26" id="L26" c8ss="line8" name="L7">   7#in8an cl87s="c        }ers/lguest/core.c#L26" id="L26" c8ss="line"" name="L8">   8#inchref=88drivers/lguest/core.c#L27" id="L27" c8ass="lin8" name="L29">  29
<8 href89s="c        omment">/*H:010
  30/*H:010arrrrrrrr* Now wetrasarve t a "drives in thean>orytureh"drive wet >
<:a0xFFC00000f="drivers/lguest/core.c#L28" id="L28" c9ass="lin9" name="L31">  31 * We need to srrrrrrrr* (SWITCHER_ADDR)e  Wetm"> noalgetnnins the  32 * Switcher is rrrrrrrr* et's worked so farlso cthee reGuest a thes +1 because __get_vm_arehf="drivers/lguest/core.c#L32" id="L32" c9ass="lin9" name="L33">  33 * CPU to run trrrrrrrr*sushreated bn ex"+t guard href, so wet the mmece for ehrtef="drivers/lguest/core.c#L5" id="L5" cla9ss="line9" name="L4">   4 * interrupt harrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c9ss="line9" name="L5">   5switcher_vma;
vm_struct __get_vm_arehf=ode=lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_pageswitcher_page   6#in9an cl96s="c                                     =switcher_page"VM_ALLOC>switcher_pagevm_struct SWITCHER_ADDRs="c,f=lguest_lock" cSWITCHER_ADDR>vm_struct SWITCHER_ADDRs="cers/lguest/core.c#L6" id="L6" cla9ss="line9" name="L7">   7#in9an cl97s="c                                     + (=lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_pageswitcher_page   8#in9href=98s="c        ef (!=lguest_lock" c class="sef">switcher_vma;
   9#inc href99s="c                =lguest_lock" c.vm_struct .vm_struct ENOMEM"drivers/lguest/core.c#L26" id="L26" c10ass="line"" name="L10">  10#incan c100s="c                =switcher_page"hrint">lguest_lock * Sw>>
"f="drivL26" i:/could noalma hsigh virtref=saddre\n"driver="drivivers/lguest/core.c#L29" id="L29" c10ass="line0" name="L11">  11#in01n c101s="c                gohoa=lguest_lock" cgt;
_ref=s>vm_struct gt;
_ref=s"drivers/lguest/core.c#L26" id="L26" c10ass="line0" name="L12">  12#in02n c102s="c        }ers/lguest/core.c#L26" id="L26" c10ass="line0" name="L13">  13#in03n c10"drivers/lguest/core.c#L24" id="L24" c10ass="line0" name="L14">  14#in04n c104s="c        omment">/*H:010
  15#in05n c10ss="comment"> *
  16#in06n c10ss="comment"> * The Switcherrrrrrrrr* SWITCHER_ADDRe  17#in07n c10ss="comment"> * Host since irrrrrrrr* kie rodehrefr we're/ma pe an(kernelehrefr)nges ba poens.< Swiouef="drivers/lguest/core.c#L34" id="L34" c10ass="line0" name="L18">  18#in08n c108s="comment"> *
  19#in09n c109s="comment"> * The Switcherrrrrrrrr* careef="drivers/lguest/core.c#L5" id="L5" cla1lass="linee" name="L10">  10#innclud11ss="comment">/*H:010arrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c1lass="line"" name="L11">  11#inc1n c111s="c        oswitcher_vma" hrefp>page **switcher_page;
  12#innclud112s="c        oswitcher_vma" .vm_struct .vm_struct ma _vm_arehf=ode=lguest_lock" c class="sef">switcher_vma;
switcher_pagepage **  13#innclud113s="c        ef (=lguest_lock" c.vm_struct .  14#innclud114s="c                =lguest_lock" chrint">lguest_lock * Sw>>
"f="drivL26" i:/ma _vm_areh failed: %i\n"driver="driv,f=lguest_lock" c.vm_struct .  15#innclud115s="c                gohoa=lguest_lock" cgt;
_ef">switcher_vma  16#innclud116s="c        }ers/lguest/core.c#L26" id="L26" c1lass="linee" name="L17">  17#innclud117drivers/lguest/core.c#L27" id="L27" c1lass="linee" name="L18">  18#innclud118s="c        omment">/*H:010
  19#innclud119s="comment"> * The Switcherrrrrrrrr* Now t a high virtss/ma pee atual a=">reGuest ,anetoan't fail!f="drivers/lguest/core.c#L28" id="L28" c1lass="lin1e" name="L20">  20#i1nclud12ss="comment">/*H:010arrrrrrrr* Copyas the;
  21#i1nclud12ss="comment"> * We need to srrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" c1lass="lin1e" name="L22">  22
<1a hre122s="c        oswitcher_vma" memcpy>vm_struct memcpyf=ode=lguest_lock" c class="sef">switcher_vma;
switcher_page;
;
  23
<1a hre123s="c               =lguest_lock" c.nd_/a>;
;
;
;
  24st1atic 124drivers/lguest/core.c#L27" id="L27" c1lass="lin1e" name="L25">  25st1atic 125s="c        oswitcher_vma" hrint">lguest_lockvm_struct KERN_INFOs="c =mment"> * Sw>>
"f="drivL26" i:/ma phe migh virtual% \n"driver="driv,ers/lguest/core.c#L6" id="L6" cla1lass="linee" name="L26">  26
<1a hre126s="c               =lguest_lock" c class="sef">switcher_vma;
switcher_page  27/*H:010
< As bw  succeeded.. href="drivers/lguest/core.c#L28" id="L28" c1lass="lin1e" name="L28">  28  29
<1a hre1="drivers/lguest/core.c#L30" id="L30" c1lass="lin1e" name="L30">  30switcher_vma  31switcher_vmaswitcher_vma;
switcher_page  32vm_struct gt;
_ref=s"dri:ers/lguest/core.c#L30" id="L30" c1lass="line"" name="L13">  13#inc hre133s="c        oswitcher_vma" i>vm_struct is="c = =lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_page  34vm_struct gt;
_is fhref=s"dri:ers/lguest/core.c#L30" id="L30" c1lass="lin1e" name="L35">  35vm_struct is="c;f=lguest_lock" ci>vm_struct is="c+a>
<= 0;f=lguest_lock" ci>vm_struct is="c--)ers/lguest/core.c#L28" id="L28" c1lass="lin1e" name="L36">  36vm_struct __gt;
_ref=sf=ode=lguest_lock" c class="sref">switcher_page;
vm_struct is="c], 0ivers/lguest/core.c#L29" id="L29" c1lass="linee" name="L37">  37vm_struct kgt;
f=ode=lguest_lock" c class="sref">switcher_page;
  28vm_struct on""dri:ers/lguest/core.c#L30" id="L30" c1lass="line3" name="L29">  29
<13 hre139s="c        >
	vm_struct .  30  31 * We need to /*href="drivers/lguest/core.c#L6" id="L6" cla14ass="lin14" name="L32">  32  33 * CPU to run 
< Cleane anr at a ma pe an   4;
vm_struct unma _/a>;
  35  36vm_struct is="cvers/lguest/core.c#L14" id="L14" claass="line4" name="L37">  37  28/*H:010
< vunma () undoes *both*/ma _vm_arehllyes b__get_vm_areh()ehref="drivers/lguest/core.c#L28" id="L28" c14ass="line4" name="L29">  29
<14 hre149s="c        oswitcher_page"vunma >switcher_vmaswitcher_vma;
switcher_page  30/*H:010
< Now wetjsame the Swigt;
at a hrefs we copied  31vm_struct is="c = 0;f=lguest_lock" ci>vm_struct is="c+ambif=lguest_lock" cTOTAL_SWITCHER_PAGES>switcher_pagevm_struct is="c++)ers/lguest/core.c#L28" id="L28" c15ass="lin15" name="L32">  32vm_struct __gt;
_ref=sf=ode=lguest_lock" c class="sref">switcher_page;
vm_struct is="c], 0ivers/lguest/core.c#L29" id="L29" c15ass="lin15" name="L33">  33vm_struct kgt;
f=ode=lguest_lock" c class="sref">switcher_page;
   4   5  36 * The Switche
  37 * Host since i* Deale anWithheoryef="drivers/lguest/core.c#L35" id="L35" c1sass="lin15" name="L28">  28 *
  29
<15 hre159s="comment"> * The Switcher cBefore we gohtoo mningfurtrirts Swia trap o, wet the Swigrokual a=>
  30/*H:010appwetuse g.  eal withheoryef="drivers/lguest/core.c#L35" id="L35" c16ass="lin16" name="L31">  31 * We need to sef="drivers/lguest/core.c#L35" id="L35" c16ass="lin16" name="L32">  32 * Switcher is a W/spat a e  33 * CPU to run thet a normthecopy_from_userlly&ecopy_to_userllyo the plece inf="drivers/lguest/core.c#L35" id="L35" c16ss="line16" name="L4">   4 * interrupt happt a mn>orytreg6.11eshreatee bypt a Laun
   5 *
  16#incan c16ss="comment"> * The Switcher cButnwetoan't trsamet a e  37 * Host since i*at the  Wethaveaen o e whehrtual a+the  sd below t a pfn_limitpt a Laun
  28 *
  29
<16 hre169s="comment"> * The Switcher* positore bypih50flow2  30/*H:010apef="drivers/lguest/core.c#L28" id="L28" c17ass="lin17" name="L31">  31switcher_pagelguest_lock);
lguest_lock)s="c,ers/lguest/core.c#L6" id="L6" cla17ass="lin17" name="L32">  32switcher_pageen"driiers/lguest/core.c#L6" id="L6" cla17ass="lin17" name="L33">  33   4switcher_pageen"drii /s=switcher_page"PAGE_SIZE>switcher_pagelguest_lock)s="can>
lguest_lockswitcher_pageen"dri+a>
<= oswitcher_page"uGue>switcher_page   5   6#in17an c17"drivers/lguest/core.c#L27" id="L27" c17ss="line1"" name="L7">   7#in1can c17ss="comment">/* This One Big f="drivers/lguest/core.c#L28" id="L28" c17ass="lin17" name="L28">  28 *

orytfrom t a e  29
<17 hre179s="comment"> * The Switcher* kill_L32" illy=>
  30/*H:010a* value (t dazeroed)binllea rode the2  31 * We need to spef="drivers/lguest/core.c#L28" id="L28" c18ass="lin18" name="L32">  32vm_struct __L3rea f=odeb"+code=page" class="s>)_cpu>lguest_lock)_cpus="c e=switcher_page"cpu>lguest_lockswitcher_pageswitcher_pageswitcher_page  33   4lguest_lock);
lguest_lock
lguest_lock)s="c,aoswitcher_page"uGue>switcher_pageswitcher_page   5lguest_lockswitcher_pagelguest_lock
lguest_lock)s="can>
_bas">switcher_page_bas"s="c +aoswitcher_page"uGue>switcher_pageswitcher_page   6#in18an c186s="c                omment">/*H:010
< copy_from_user should do this, butnas wetralyyo tit.. href="drivers/lguest/core.c#L28" id="L28" c18ss="line18" name="L7">   7#in18an c187s="c                oswitcher_page"mn>set>lguest_locksetf=ode=switcher_page"b>switcher_pageswitcher_page  18#inchref188s="c                oswitcher_page"kill_);
lguest_locklguest_lock * Sw>>
"f="drivba rrea reGuest a%#lx leis%u"driver="driv,f=lguest_lock" cuGue>switcher_pageswitcher_page  29
<18 hre189s="c        }ers/lguest/core.c#L26" id="L26" c19ass="lin19" name="L30">  30  31  32 * Switcher isg lock pi pt a write (copyas en e  33vm_struct __L3writef=odeb"+code=page" class="s>)_cpu>lguest_lock)_cpus="c e=switcher_page"cpu>lguest_lockswitcher_pageswitcher_page   4switcher_page   5   6#in19an c196s="c        ef (!=lguest_lock" cL28" i_ Guest _o">lguest_lock);
lguest_lock
lguest_lock)s="c,aoswitcher_page"uGue>switcher_pageswitcher_page   7#in19an c197s="c            ||f=switcher_page"copy_to_user>lguest_locklguest_lock
lguest_lock)s="can>
_bas">switcher_page_bas"s="c +aoswitcher_page"uGue>switcher_pageswitcher_pageswitcher_page   8#in19href198s="c                oswitcher_page"kill_);
lguest_locklguest_lock * Sw>>
"f="drivba rwrite eGuest a%#lx leis%u"driver="driv,f=lguest_lock" cuGue>switcher_pageswitcher_page   9#in1c hre199s="c}ers/lguest/core.c#L26" id="L26" c20ass="lin2"" name="L10">  10#i2can c20ss="comment">/*H:010
  11#i201n c20ss="cers/lguest/core.c#L26" id="L26" c20ass="lin20" name="L12">  12#i202n c20ss="comment"> * Switcher isg a ha0f="drivers/lguest/core.c#L28" id="L28" c20ass="lin20" name="L13">  13#i203n c20ss="comment"> * CPU to run theLet's jumpe="+t">rSwia trt a mainaloopy changruns t a e  14#i204n c20ss="comment"> * interrupt happspan>
   5 *
rous bas barous buntil is file anens.<" ie an>
  16#i206n c20ss="comment"> * The Switcherref="drivers/lguest/core.c#L6" id="L6" cla20ass="line0" name="L17">  17#i207n c20ss="csnsf=lguest_lock" crun_);
lguest_locklguest_locklguest_locklguest_lock  18#i208n c208s="c{ers/lguest/core.c#L28" id="L28" c20ass="lin20" name="L19">  19#i209n c209s="c        omment">/*H:010
< Wetstops   22  10#i2nclud210s="c         chle (!=lguest_lock" ccpu>lguest_lock
lguest_lock)s="can>
vm_struct dea f=od) {ers/lguest/core.c#L28" id="L28" c2lass="lin2"" name="L11">  11#i2c1n c211s="c                unsignedasnsf=lguest_lock" cirq>vm_struct irqs="cvers/lguest/core.c#L21" id="L21" claass="lin2e" name="L12">  12#i2nclud212s="c                =lguest_lock" cbool>switcher_pageswitcher_page  13#i2nclud21"drivers/lguest/core.c#L24" id="L24" cllass="lin2e" name="L14">  14#i2nclud214s="c                =mment">/*H:010
< Firspanet andany hypercalls t a e
  15#i2nclud215s="c                ef (=lguest_lock" ccpu>lguest_lock
lguest_lock  16#i2nclud216s="c                        oswitcher_page"do_hypercalls>vm_struct do_hypercallsf=ode=switcher_page"cpu>lguest_lock  17#i2nclud217drivers/lguest/core.c#L27" id="L27" c2lass="lin2e" name="L18">  18#i2nclud218s="c                omment">/* This One Big f="drivers/lguest/core.c#L28" id="L28" c2lass="lin2e" name="L19">  19#i2nclud219s="comment"> * The Switcherrrrrrrrrrrrrrrrr* It's possiblunt a e  20#i2nclud22ss="comment">/*H:010arrrrrrrrrrrrrrrr* Laun
  21#i2nclud22ss="comment"> * We need to srrrrrrrrrrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" cllass="lin2e" name="L22">  22
<2a hre222s="c                ef (=lguest_lock" ccpu>lguest_lock
vm_struct a h 2  23
<2a hre223s="c                        omment">/* This One Big f="drivers/lguest/core.c#L28" id="L28" c2lass="lin2e" name="L24">  24st2atic 22ss="comment"> * interrupt harrrrrrrrrrrrrrrrrrrrrrrr* Does ittjsame thesrSwiwrite en ttreg6ss.<"df="drivers/lguest/core.c#L28" id="L28" c2l5ss="linee" name="L25">  25st2atic 22ss="comment"> *
  26
<2a hre22ss="comment"> * The Switcherrrrrrrrrrrrrrrrrrrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" cllass="lin2e" name="L27">  27vm_struct  .nd_notify_to_ev
lguest_lock  28/* This One Big  OK,anettellrt a mainaLau
  29
<2a hre229s="c                                ef (oswitcher_page"aut_user>lguest_locklguest_lock
vm_struct a h 2lguest_lock  30switcher_page  31lguest_lock
vm_struct a h 2  32  13#i2c hre233s="c                }ers/lguest/core.c#L26" id="L26" c2lass="lin2e" name="L34">  34  35/* This One Big f="drivers/lguest/core.c#L28" id="L28" c2lass="lin2e" name="L36">  36 * The Switcherrrrrrrrrrrrrrrrr* Allrlo  37 * Host since irrrrrrrrrrrrrrrr* ile ancallee t a freeza er Ifia trap opi ptry2  28 *
  29
<23 hre239s="comment"> * The Switcherrrrrrrrrrrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" claass="lin24" name="L30">  30vm_struct try_to_freezaf=ode)vers/lguest/core.c#L21" id="L21" cl4ass="lin24" name="L31">  31  32 * CPU to run 
< C e whfor signalsr*ef="drivers/lguest/core.c#L28" id="L28" claass="lin24" name="L33">  33vm_struct  ignal_a h 2lguest_lock   4switcher_page  35  36/*H:010
  37 * Host since irrrrrrrrrrrrrrrr* C e whifia treturedany ens.  28 *
  29
<24 hre249s="comment"> * The Switcherrrrrrrrrrrrrrrrr*  andt a e  30/*H:010arrrrrrrrrrrrrrrr*ef="drivers/lguest/core.c#L28" id="L28" cl5ass="lin25" name="L31">  31vm_struct irqs="c = =lguest_lock" cens.vm_struct ens.lguest_lockswitcher_page  32vm_struct irqs="c ambif=lguest_lock" cLGUEST_IRQS>switcher_page  33vm_struct try_delore<_ens.lguest_lockvm_struct irqs="c, =switcher_page"m"L2>switcher_page   4   5/* This One Big f="drivers/lguest/core.c#L28" id="L28" c25ass="lin25" name="L36">  36 * The Switcherrrrrrrrrrrrrrrrr* Jsamemak  absolute  37 * Host since irrrrrrrrrrrrrrrr* those hypercalls could haveibespafatal,hfor exampleef="drivers/lguest/core.c#L5" id="L5" cla2sass="lin25" name="L28">  28 *
  29
<25 hre259s="c                ef (=lguest_lock" ccpu>lguest_lock
lguest_lock)s="can>
vm_struct dea f=od)ers/lguest/core.c#L28" id="L28" clsass="lin26" name="L30">  30  31  32 * CPU to run 
  33 * CPU to run trrrrrrrrrrrrrrrr* Ifia tre   4 * interrupt harrrrrrrrrrrrrrrr* clo wheimirtwillrwak  roef="drivers/lguest/core.c#L35" id="L35" c26ss="line26" name="L5">   5 *
  16#i2can c266s="c                ef (=lguest_lock" ccpu>lguest_lock
lguest_lock  37switcher_page< .t_currspa_switcher_page  28 * CPU to run 
  29
<26 hre269s="comment"> * The Switcherrrrrrrrrrrrrrrrrrrrrrrrr* Jsamebefore we  cthe, mak  sure 1=drivers/lguevers/lg>  37 irqs="c = "lin26" name="L30">  30/2H:010apef="drivers/lgurrrrrrrr* Jsamebefore we  ore<"dure utnas :f="aroust/core.c#L35" id="L35" c26ss="line26" name="L31"> 231 232vm_struct>vm_struct ens.lguest_lockswitcher_pageswitcher_page 233switcher_page< .t_currspa_swRUNNINGASK_INTERRUPTIBLEs="RUNNING/core.c#L21" id="L21" cl6ass="lin26" name="L4">  24   5/* This r_page"t * CPU tot_currspa_  26#in17an c17"drivers2lgues27             oswitcher_page"dcontinue.c#L21" id="L21" cl4ass="lin24" name="L37">  7#in1can c17ss="comm2nt">/27             =lguest_.c#L26" id="L26" c2lass="lin2e" name="L28"> 228 2  29
<17 hre179s="comm2nt"> 27     =lguest_lock" c.< run 
 230/2H:010a* value (t dazerrrrrrrrrrrrrrrrra mainnSwigt(kernele/lguynetsia tret the Swoantsee  hypercalput ust/core.c#L28" id="L28" c205ss="line0" name="L31"> 231 2 We need to spef="drivers/lgurrrrrrrrrrrrrrrra e SwlguestDo Not Disturblguestiversst/core.c#L28" id="L28" claass="lin24" name="L32"> 232 233  24  25
  26#in18an c186s="c   2     2      omment">/*H:010lguest_lock=ode=srch__lock=ode=srch__locklguest_lock  27#in18an c187s="c   2     28core.c#L27" id="L27" c2lass="lin2e" name="L18"> 218#inchref188s="c   2     2      oswitcher_page"ki run 
  37 229
<18 hre189s="c   2    }28     =lguest_lock" c.<>lguest_lock 230 231 232 29     =lguest_lock" cbool>switcher_paa>=ode=srch_cutele_tr/vunma f=ode=lguea>=ode=srch_cutele_tr/vage"cpu>lguest_lock 233  24  25  26#in19an c196s="c   2    e2 (!=lguest_lock" cpu>lguest_lock
lguest_lock)s="can>
vm_struct dea f=od)ers/lguest/core =cens.switcher_pagRESTARTSYSs="cvers/lgue/core.c#L28" id="L28" c24ss="line2"" name="L7">  27#in19an c197s="c   2     2  ||f=switcher_paggggglock" cERESTARTSYS>switcher_pagRESTARTSYSs="cvers/lgue/cor.c#L29" id="L29" cllass="lin2e" name="L18"> 28#in19href198s="c   2     29/spanc#L26" id="L26" c2lass="lin2e" name="L9">  29#in1c hre199s="c}er2/lgue29ent">/*H:010
< Wetstops   22 310#i2can c20ss="comm3nt">/30             lock" cERESTARTSYS>switcNOENgRESTARTSYSs="cveNOENg/cor.c#L29" id="L29" cllass="lin2e" na3e="L11"> 311#i201n c20ss="cers3lgues3/core..c#L26" id="L26" c2lass="lin2e" na3e="L12"> 312#i202n c20ss="comm3nt"> 30core.c#L23" id="L23" c14ass="lin14" na3e="L13"> 313#i203n c20ss="comm3nt"> 3 CPU to run theLet's jums/lgu0st/core.c#L28" id="L28" c20ass="lin20" na3e="L14"> 314#i204n c20ss="comm3nt"> 3 interrupt happspan>

  35 3
rous bast/core.c#L28" id="L28" c1lass="lin1e" na3e6"L5">  35#in19an c196s="c   3nt"> 3 The Switcherref="drivers/lgue Bya handpo" ciyour br="drhas examptick  35#in19an c197s="c   3=lgue30Host since i*at the  Wethaveaetbe: wetra	  35#in19href198s="c   3/lgue30/span>

  35#in1c hre199s="c}er3    o30The Switcher* kill_L32" illy=>edasd st/core.c#L35" id="L35" c26ss="line26" na3e="L10"> 310#i2nclud210s="c   3     31:010apef="drivers/lguest/core.c#L28" id="L28" c17ass="lin17" na3e="L11"> 311#i2c1n c211s="c   3     3      est_loc" cirq>vm_structvm_struct>itRESTARTSYSs="cvinit    /core.c#L28" id="L28" c14ass="lin14" na3e="L12"> 312#i2nclud212s="c   3     3      .c#L28" id="L28" c26ass="lin26" na3e="L13"> 313#i2nclud21"drivers3lgues31             " cirq>vm_struct . 314#i2nclud214s="c   3     31core.c#L27" id="L27" c25ss="line2"" na3e="L15"> 315#i2nclud215s="c   3     31itcher_vma" hr run 
 316#i2nclud216s="c   3     31(!=lguest_lock" cpu>lguest_lock 317#i2nclud217drivers3lgues31     oswitcher_page"mn>set>lguest_lock 318#i2nclud218s="c   3     3      omment">/* This lock" cERESTARTSYS>switcPERMRESTARTSYSs="cvePERMcore.c#L14" id="L14" claass="lin14" na3e9"L5">  319#i2nclud219s="comm3nt"> 31s/lguest/core.c#L26" id="L26" c19ass="lin19" na3e="L20"> 320#i2nclud22ss="comm3nt">/32/corec#L21" id="L21" cl4ass="lin24" na3e="L21"> 321#i2nclud22ss="comm3nt"> 321tcher_vma" hr run 
 322
<2a hre222s="c   3     3      ef (=lgurq>vm_struct . unma _/a>;
 323
<2a hre223s="c   3     3              k" cpu>lguest_lock<> . 324st2atic 22ss="comm3nt"> 32             ra	lguest_lock<> on""dri:ers/lguest/core.c#L29" id="L29" cllass="lin2e" na3e="L15"> 325st2atic 22ss="comm3nt"> 32core.c#L27" id="L27" c24ass="lin24" na3e="L26"> 326
<2a hre22ss="comm3nt"> 326tcher_vma" hr run 
 327lguest_lock;
switcher_paSHAREDswitcher_page 328lguest_lock<> .  329
<2a hre229s="c   3     3                      goetspu>lguest_lock 330 331 332 313#i2c hre233s="c   3     33             k" cpu>lguest_lock<> . 334lguest_lock 335 336 336tcher_vma" hr run 
 337 33             rq>vm_struct .=ode=wetice_initRESTARTSYSs="cva>=ode=wetice_inituest/e.c#L29" id="L29" cllass="lin2e" na3e="L28"> 328 33             k" cpu>lguest_lock<> . 329
<23 hre239s="comm3nt"> 33                     goetspu>lguest_lock 330 331 332=ode=srch_cost_inituest/e.c#L29" id="L29" cllass="lin2e" na3e="L33"> 333  34 335 336 337 3 Host su>lguest_lock 328 348    ef (=lgurq>vm_struct 329
<24 hre249s="comm3nt"> 3 The Swu>lguest_lock 330/350    ef (=lgurq>vm_struct 331switcher_pama 332 333  34vm_struct .  35 336 35core.c#L27" id="L27" c17ss="line1"" na3e="L37"> 337 3 Host since irrrrrrrrrrrrrrrnalslea/spaiutresrite e 2 328 3vm_strucexitRESTARTSYSs="cv__exit     rq>vm_struct 329
<25 hre259s="c   3     3      .c#L28" id="L28" c18ss="line18" na3e="L30"> 330=ode=wetice_remov,k" c/e.c#L29" id="L29" cllass="lin2e" na3e="L31"> 331 332 333 363    ef (=lgurq>vm_struct unma _/a>;
 uk" c/e.c#L29" id="L29" cllass="lin2e" na3e="L4">  34 36core.c#L27" id="L27" c25ss="line2"" na3e="L5">  35 365    ef (=lgurq>vm_struct=ode=srch_cost_finio_hypercallsf=oa>=ode=srch_cost_finik" c/e.c#L29" id="L29" cllass="lin2e" na3e="L36"> 316#i2can c266s="c   3     3      .c#L26" id="L26" c17ss="line17" na3e="L37"> 337 328 329
<26 hre269s="comm3nt"> 3 The Switcherrrrrrrrrrrrrrrrest/core.c#L28" id="L28" cl6ass="lin26" na3="L30">  30/3H:010apef="drivers/lgueaT hrn sussidgues lgf="dr> asbeia>edasd ssf="t a Lia>nice wayarivepeopba Not/core.c#L28" id="L28" cl6ass="lin26" na3=="L31"> 331 332 333lguest_lock<>>itRESTARTSYSs="cvinit    e.c#L29" id="L29" cllass="lin2e" na3e="L4">  34lguest_lock  35  36#in17an c17"drivers3lgues37     pu>lguest_lock 37#in1can c17ss="comm3nt">/3 This O/pre O/div>


O/div>

#in1cafooant">
T hrorighn h LXR softwtsy rea 2LXR at aunit_page"u handexperirs/lalrivers/l rea#L29" id=mailto:lxt@n cux.no=oaxt@n cux.nopage.
O/div>
#in1casubfooant">
axt.n cux.no kindly costearrea#L29" id=http://www.redpill-n cpro.no=oRedpill L cpro ASpage"uproviee