paravirt.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. #ifndef __ASM_PARAVIRT_H
  2. #define __ASM_PARAVIRT_H
  3. /* Various instructions on x86 need to be replaced for
  4. * para-virtualization: those hooks are defined here. */
  5. #include <linux/linkage.h>
  6. #include <linux/stringify.h>
  7. #include <asm/page.h>
  8. #ifdef CONFIG_PARAVIRT
  9. /* These are the most performance critical ops, so we want to be able to patch
  10. * callers */
  11. #define PARAVIRT_IRQ_DISABLE 0
  12. #define PARAVIRT_IRQ_ENABLE 1
  13. #define PARAVIRT_RESTORE_FLAGS 2
  14. #define PARAVIRT_SAVE_FLAGS 3
  15. #define PARAVIRT_SAVE_FLAGS_IRQ_DISABLE 4
  16. #define PARAVIRT_INTERRUPT_RETURN 5
  17. #define PARAVIRT_STI_SYSEXIT 6
  18. /* Bitmask of what can be clobbered: usually at least eax. */
  19. #define CLBR_NONE 0x0
  20. #define CLBR_EAX 0x1
  21. #define CLBR_ECX 0x2
  22. #define CLBR_EDX 0x4
  23. #define CLBR_ANY 0x7
  24. #ifndef __ASSEMBLY__
  25. struct thread_struct;
  26. struct Xgt_desc_struct;
  27. struct tss_struct;
  28. struct mm_struct;
  29. struct paravirt_ops
  30. {
  31. unsigned int kernel_rpl;
  32. int paravirt_enabled;
  33. const char *name;
  34. /*
  35. * Patch may replace one of the defined code sequences with arbitrary
  36. * code, subject to the same register constraints. This generally
  37. * means the code is not free to clobber any registers other than EAX.
  38. * The patch function should return the number of bytes of code
  39. * generated, as we nop pad the rest in generic code.
  40. */
  41. unsigned (*patch)(u8 type, u16 clobber, void *firstinsn, unsigned len);
  42. void (*arch_setup)(void);
  43. char *(*memory_setup)(void);
  44. void (*init_IRQ)(void);
  45. void (*banner)(void);
  46. unsigned long (*get_wallclock)(void);
  47. int (*set_wallclock)(unsigned long);
  48. void (*time_init)(void);
  49. /* All the function pointers here are declared as "fastcall"
  50. so that we get a specific register-based calling
  51. convention. This makes it easier to implement inline
  52. assembler replacements. */
  53. void (*cpuid)(unsigned int *eax, unsigned int *ebx,
  54. unsigned int *ecx, unsigned int *edx);
  55. unsigned long (*get_debugreg)(int regno);
  56. void (*set_debugreg)(int regno, unsigned long value);
  57. void (*clts)(void);
  58. unsigned long (*read_cr0)(void);
  59. void (*write_cr0)(unsigned long);
  60. unsigned long (*read_cr2)(void);
  61. void (*write_cr2)(unsigned long);
  62. unsigned long (*read_cr3)(void);
  63. void (*write_cr3)(unsigned long);
  64. unsigned long (*read_cr4_safe)(void);
  65. unsigned long (*read_cr4)(void);
  66. void (*write_cr4)(unsigned long);
  67. unsigned long (*save_fl)(void);
  68. void (*restore_fl)(unsigned long);
  69. void (*irq_disable)(void);
  70. void (*irq_enable)(void);
  71. void (*safe_halt)(void);
  72. void (*halt)(void);
  73. void (*wbinvd)(void);
  74. /* err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */
  75. u64 (*read_msr)(unsigned int msr, int *err);
  76. int (*write_msr)(unsigned int msr, u64 val);
  77. u64 (*read_tsc)(void);
  78. u64 (*read_pmc)(void);
  79. u64 (*get_scheduled_cycles)(void);
  80. unsigned long (*get_cpu_khz)(void);
  81. void (*load_tr_desc)(void);
  82. void (*load_gdt)(const struct Xgt_desc_struct *);
  83. void (*load_idt)(const struct Xgt_desc_struct *);
  84. void (*store_gdt)(struct Xgt_desc_struct *);
  85. void (*store_idt)(struct Xgt_desc_struct *);
  86. void (*set_ldt)(const void *desc, unsigned entries);
  87. unsigned long (*store_tr)(void);
  88. void (*load_tls)(struct thread_struct *t, unsigned int cpu);
  89. void (*write_ldt_entry)(void *dt, int entrynum,
  90. u32 low, u32 high);
  91. void (*write_gdt_entry)(void *dt, int entrynum,
  92. u32 low, u32 high);
  93. void (*write_idt_entry)(void *dt, int entrynum,
  94. u32 low, u32 high);
  95. void (*load_esp0)(struct tss_struct *tss,
  96. struct thread_struct *thread);
  97. void (*set_iopl_mask)(unsigned mask);
  98. void (*io_delay)(void);
  99. #ifdef CONFIG_X86_LOCAL_APIC
  100. void (*apic_write)(unsigned long reg, unsigned long v);
  101. void (*apic_write_atomic)(unsigned long reg, unsigned long v);
  102. unsigned long (*apic_read)(unsigned long reg);
  103. void (*setup_boot_clock)(void);
  104. void (*setup_secondary_clock)(void);
  105. #endif
  106. void (*flush_tlb_user)(void);
  107. void (*flush_tlb_kernel)(void);
  108. void (*flush_tlb_single)(u32 addr);
  109. void (*map_pt_hook)(int type, pte_t *va, u32 pfn);
  110. void (*alloc_pt)(u32 pfn);
  111. void (*alloc_pd)(u32 pfn);
  112. void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count);
  113. void (*release_pt)(u32 pfn);
  114. void (*release_pd)(u32 pfn);
  115. void (*set_pte)(pte_t *ptep, pte_t pteval);
  116. void (*set_pte_at)(struct mm_struct *mm, u32 addr, pte_t *ptep, pte_t pteval);
  117. void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval);
  118. void (*pte_update)(struct mm_struct *mm, u32 addr, pte_t *ptep);
  119. void (*pte_update_defer)(struct mm_struct *mm, u32 addr, pte_t *ptep);
  120. #ifdef CONFIG_X86_PAE
  121. void (*set_pte_atomic)(pte_t *ptep, pte_t pteval);
  122. void (*set_pte_present)(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte);
  123. void (*set_pud)(pud_t *pudp, pud_t pudval);
  124. void (*pte_clear)(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
  125. void (*pmd_clear)(pmd_t *pmdp);
  126. #endif
  127. void (*set_lazy_mode)(int mode);
  128. /* These two are jmp to, not actually called. */
  129. void (*irq_enable_sysexit)(void);
  130. void (*iret)(void);
  131. void (*startup_ipi_hook)(int phys_apicid, unsigned long start_eip, unsigned long start_esp);
  132. };
  133. /* Mark a paravirt probe function. */
  134. #define paravirt_probe(fn) \
  135. static asmlinkage void (*__paravirtprobe_##fn)(void) __attribute_used__ \
  136. __attribute__((__section__(".paravirtprobe"))) = fn
  137. extern struct paravirt_ops paravirt_ops;
  138. #define paravirt_enabled() (paravirt_ops.paravirt_enabled)
  139. static inline void load_esp0(struct tss_struct *tss,
  140. struct thread_struct *thread)
  141. {
  142. paravirt_ops.load_esp0(tss, thread);
  143. }
  144. #define ARCH_SETUP paravirt_ops.arch_setup();
  145. static inline unsigned long get_wallclock(void)
  146. {
  147. return paravirt_ops.get_wallclock();
  148. }
  149. static inline int set_wallclock(unsigned long nowtime)
  150. {
  151. return paravirt_ops.set_wallclock(nowtime);
  152. }
  153. static inline void (*choose_time_init(void))(void)
  154. {
  155. return paravirt_ops.time_init;
  156. }
  157. /* The paravirtualized CPUID instruction. */
  158. static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
  159. unsigned int *ecx, unsigned int *edx)
  160. {
  161. paravirt_ops.cpuid(eax, ebx, ecx, edx);
  162. }
  163. /*
  164. * These special macros can be used to get or set a debugging register
  165. */
  166. #define get_debugreg(var, reg) var = paravirt_ops.get_debugreg(reg)
  167. #define set_debugreg(val, reg) paravirt_ops.set_debugreg(reg, val)
  168. #define clts() paravirt_ops.clts()
  169. #define read_cr0() paravirt_ops.read_cr0()
  170. #define write_cr0(x) paravirt_ops.write_cr0(x)
  171. #define read_cr2() paravirt_ops.read_cr2()
  172. #define write_cr2(x) paravirt_ops.write_cr2(x)
  173. #define read_cr3() paravirt_ops.read_cr3()
  174. #define write_cr3(x) paravirt_ops.write_cr3(x)
  175. #define read_cr4() paravirt_ops.read_cr4()
  176. #define read_cr4_safe(x) paravirt_ops.read_cr4_safe()
  177. #define write_cr4(x) paravirt_ops.write_cr4(x)
  178. static inline void raw_safe_halt(void)
  179. {
  180. paravirt_ops.safe_halt();
  181. }
  182. static inline void halt(void)
  183. {
  184. paravirt_ops.safe_halt();
  185. }
  186. #define wbinvd() paravirt_ops.wbinvd()
  187. #define get_kernel_rpl() (paravirt_ops.kernel_rpl)
  188. #define rdmsr(msr,val1,val2) do { \
  189. int _err; \
  190. u64 _l = paravirt_ops.read_msr(msr,&_err); \
  191. val1 = (u32)_l; \
  192. val2 = _l >> 32; \
  193. } while(0)
  194. #define wrmsr(msr,val1,val2) do { \
  195. u64 _l = ((u64)(val2) << 32) | (val1); \
  196. paravirt_ops.write_msr((msr), _l); \
  197. } while(0)
  198. #define rdmsrl(msr,val) do { \
  199. int _err; \
  200. val = paravirt_ops.read_msr((msr),&_err); \
  201. } while(0)
  202. #define wrmsrl(msr,val) (paravirt_ops.write_msr((msr),(val)))
  203. #define wrmsr_safe(msr,a,b) ({ \
  204. u64 _l = ((u64)(b) << 32) | (a); \
  205. paravirt_ops.write_msr((msr),_l); \
  206. })
  207. /* rdmsr with exception handling */
  208. #define rdmsr_safe(msr,a,b) ({ \
  209. int _err; \
  210. u64 _l = paravirt_ops.read_msr(msr,&_err); \
  211. (*a) = (u32)_l; \
  212. (*b) = _l >> 32; \
  213. _err; })
  214. #define rdtsc(low,high) do { \
  215. u64 _l = paravirt_ops.read_tsc(); \
  216. low = (u32)_l; \
  217. high = _l >> 32; \
  218. } while(0)
  219. #define rdtscl(low) do { \
  220. u64 _l = paravirt_ops.read_tsc(); \
  221. low = (int)_l; \
  222. } while(0)
  223. #define rdtscll(val) (val = paravirt_ops.read_tsc())
  224. #define get_scheduled_cycles(val) (val = paravirt_ops.get_scheduled_cycles())
  225. #define calculate_cpu_khz() (paravirt_ops.get_cpu_khz())
  226. #define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
  227. #define rdpmc(counter,low,high) do { \
  228. u64 _l = paravirt_ops.read_pmc(); \
  229. low = (u32)_l; \
  230. high = _l >> 32; \
  231. } while(0)
  232. #define load_TR_desc() (paravirt_ops.load_tr_desc())
  233. #define load_gdt(dtr) (paravirt_ops.load_gdt(dtr))
  234. #define load_idt(dtr) (paravirt_ops.load_idt(dtr))
  235. #define set_ldt(addr, entries) (paravirt_ops.set_ldt((addr), (entries)))
  236. #define store_gdt(dtr) (paravirt_ops.store_gdt(dtr))
  237. #define store_idt(dtr) (paravirt_ops.store_idt(dtr))
  238. #define store_tr(tr) ((tr) = paravirt_ops.store_tr())
  239. #define load_TLS(t,cpu) (paravirt_ops.load_tls((t),(cpu)))
  240. #define write_ldt_entry(dt, entry, low, high) \
  241. (paravirt_ops.write_ldt_entry((dt), (entry), (low), (high)))
  242. #define write_gdt_entry(dt, entry, low, high) \
  243. (paravirt_ops.write_gdt_entry((dt), (entry), (low), (high)))
  244. #define write_idt_entry(dt, entry, low, high) \
  245. (paravirt_ops.write_idt_entry((dt), (entry), (low), (high)))
  246. #define set_iopl_mask(mask) (paravirt_ops.set_iopl_mask(mask))
  247. /* The paravirtualized I/O functions */
  248. static inline void slow_down_io(void) {
  249. paravirt_ops.io_delay();
  250. #ifdef REALLY_SLOW_IO
  251. paravirt_ops.io_delay();
  252. paravirt_ops.io_delay();
  253. paravirt_ops.io_delay();
  254. #endif
  255. }
  256. #ifdef CONFIG_X86_LOCAL_APIC
  257. /*
  258. * Basic functions accessing APICs.
  259. */
  260. static inline void apic_write(unsigned long reg, unsigned long v)
  261. {
  262. paravirt_ops.apic_write(reg,v);
  263. }
  264. static inline void apic_write_atomic(unsigned long reg, unsigned long v)
  265. {
  266. paravirt_ops.apic_write_atomic(reg,v);
  267. }
  268. static inline unsigned long apic_read(unsigned long reg)
  269. {
  270. return paravirt_ops.apic_read(reg);
  271. }
  272. static inline void setup_boot_clock(void)
  273. {
  274. paravirt_ops.setup_boot_clock();
  275. }
  276. static inline void setup_secondary_clock(void)
  277. {
  278. paravirt_ops.setup_secondary_clock();
  279. }
  280. #endif
  281. #ifdef CONFIG_SMP
  282. static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip,
  283. unsigned long start_esp)
  284. {
  285. return paravirt_ops.startup_ipi_hook(phys_apicid, start_eip, start_esp);
  286. }
  287. #endif
  288. #define __flush_tlb() paravirt_ops.flush_tlb_user()
  289. #define __flush_tlb_global() paravirt_ops.flush_tlb_kernel()
  290. #define __flush_tlb_single(addr) paravirt_ops.flush_tlb_single(addr)
  291. #define paravirt_map_pt_hook(type, va, pfn) paravirt_ops.map_pt_hook(type, va, pfn)
  292. #define paravirt_alloc_pt(pfn) paravirt_ops.alloc_pt(pfn)
  293. #define paravirt_release_pt(pfn) paravirt_ops.release_pt(pfn)
  294. #define paravirt_alloc_pd(pfn) paravirt_ops.alloc_pd(pfn)
  295. #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) \
  296. paravirt_ops.alloc_pd_clone(pfn, clonepfn, start, count)
  297. #define paravirt_release_pd(pfn) paravirt_ops.release_pd(pfn)
  298. static inline void set_pte(pte_t *ptep, pte_t pteval)
  299. {
  300. paravirt_ops.set_pte(ptep, pteval);
  301. }
  302. static inline void set_pte_at(struct mm_struct *mm, u32 addr, pte_t *ptep, pte_t pteval)
  303. {
  304. paravirt_ops.set_pte_at(mm, addr, ptep, pteval);
  305. }
  306. static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
  307. {
  308. paravirt_ops.set_pmd(pmdp, pmdval);
  309. }
  310. static inline void pte_update(struct mm_struct *mm, u32 addr, pte_t *ptep)
  311. {
  312. paravirt_ops.pte_update(mm, addr, ptep);
  313. }
  314. static inline void pte_update_defer(struct mm_struct *mm, u32 addr, pte_t *ptep)
  315. {
  316. paravirt_ops.pte_update_defer(mm, addr, ptep);
  317. }
  318. #ifdef CONFIG_X86_PAE
  319. static inline void set_pte_atomic(pte_t *ptep, pte_t pteval)
  320. {
  321. paravirt_ops.set_pte_atomic(ptep, pteval);
  322. }
  323. static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
  324. {
  325. paravirt_ops.set_pte_present(mm, addr, ptep, pte);
  326. }
  327. static inline void set_pud(pud_t *pudp, pud_t pudval)
  328. {
  329. paravirt_ops.set_pud(pudp, pudval);
  330. }
  331. static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
  332. {
  333. paravirt_ops.pte_clear(mm, addr, ptep);
  334. }
  335. static inline void pmd_clear(pmd_t *pmdp)
  336. {
  337. paravirt_ops.pmd_clear(pmdp);
  338. }
  339. #endif
  340. /* Lazy mode for batching updates / context switch */
  341. #define PARAVIRT_LAZY_NONE 0
  342. #define PARAVIRT_LAZY_MMU 1
  343. #define PARAVIRT_LAZY_CPU 2
  344. #define PARAVIRT_LAZY_FLUSH 3
  345. #define __HAVE_ARCH_ENTER_LAZY_CPU_MODE
  346. #define arch_enter_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_CPU)
  347. #define arch_leave_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE)
  348. #define arch_flush_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_FLUSH)
  349. #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
  350. #define arch_enter_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_MMU)
  351. #define arch_leave_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE)
  352. #define arch_flush_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_FLUSH)
  353. /* These all sit in the .parainstructions section to tell us what to patch. */
  354. struct paravirt_patch {
  355. u8 *instr; /* original instructions */
  356. u8 instrtype; /* type of this instruction */
  357. u8 len; /* length of original instruction */
  358. u16 clobbers; /* what registers you may clobber */
  359. };
  360. #define paravirt_alt(insn_string, typenum, clobber) \
  361. "771:\n\t" insn_string "\n" "772:\n" \
  362. ".pushsection .parainstructions,\"a\"\n" \
  363. " .long 771b\n" \
  364. " .byte " __stringify(typenum) "\n" \
  365. " .byte 772b-771b\n" \
  366. " .short " __stringify(clobber) "\n" \
  367. ".popsection"
  368. static inline unsigned long __raw_local_save_flags(void)
  369. {
  370. unsigned long f;
  371. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  372. "call *%1;"
  373. "popl %%edx; popl %%ecx",
  374. PARAVIRT_SAVE_FLAGS, CLBR_NONE)
  375. : "=a"(f): "m"(paravirt_ops.save_fl)
  376. : "memory", "cc");
  377. return f;
  378. }
  379. static inline void raw_local_irq_restore(unsigned long f)
  380. {
  381. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  382. "call *%1;"
  383. "popl %%edx; popl %%ecx",
  384. PARAVIRT_RESTORE_FLAGS, CLBR_EAX)
  385. : "=a"(f) : "m" (paravirt_ops.restore_fl), "0"(f)
  386. : "memory", "cc");
  387. }
  388. static inline void raw_local_irq_disable(void)
  389. {
  390. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  391. "call *%0;"
  392. "popl %%edx; popl %%ecx",
  393. PARAVIRT_IRQ_DISABLE, CLBR_EAX)
  394. : : "m" (paravirt_ops.irq_disable)
  395. : "memory", "eax", "cc");
  396. }
  397. static inline void raw_local_irq_enable(void)
  398. {
  399. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  400. "call *%0;"
  401. "popl %%edx; popl %%ecx",
  402. PARAVIRT_IRQ_ENABLE, CLBR_EAX)
  403. : : "m" (paravirt_ops.irq_enable)
  404. : "memory", "eax", "cc");
  405. }
  406. static inline unsigned long __raw_local_irq_save(void)
  407. {
  408. unsigned long f;
  409. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  410. "call *%1; pushl %%eax;"
  411. "call *%2; popl %%eax;"
  412. "popl %%edx; popl %%ecx",
  413. PARAVIRT_SAVE_FLAGS_IRQ_DISABLE,
  414. CLBR_NONE)
  415. : "=a"(f)
  416. : "m" (paravirt_ops.save_fl),
  417. "m" (paravirt_ops.irq_disable)
  418. : "memory", "cc");
  419. return f;
  420. }
  421. #define CLI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
  422. "call *paravirt_ops+%c[irq_disable];" \
  423. "popl %%edx; popl %%ecx", \
  424. PARAVIRT_IRQ_DISABLE, CLBR_EAX)
  425. #define STI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
  426. "call *paravirt_ops+%c[irq_enable];" \
  427. "popl %%edx; popl %%ecx", \
  428. PARAVIRT_IRQ_ENABLE, CLBR_EAX)
  429. #define CLI_STI_CLOBBERS , "%eax"
  430. #define CLI_STI_INPUT_ARGS \
  431. , \
  432. [irq_disable] "i" (offsetof(struct paravirt_ops, irq_disable)), \
  433. [irq_enable] "i" (offsetof(struct paravirt_ops, irq_enable))
  434. #else /* __ASSEMBLY__ */
  435. #define PARA_PATCH(ptype, clobbers, ops) \
  436. 771:; \
  437. ops; \
  438. 772:; \
  439. .pushsection .parainstructions,"a"; \
  440. .long 771b; \
  441. .byte ptype; \
  442. .byte 772b-771b; \
  443. .short clobbers; \
  444. .popsection
  445. #define INTERRUPT_RETURN \
  446. PARA_PATCH(PARAVIRT_INTERRUPT_RETURN, CLBR_ANY, \
  447. jmp *%cs:paravirt_ops+PARAVIRT_iret)
  448. #define DISABLE_INTERRUPTS(clobbers) \
  449. PARA_PATCH(PARAVIRT_IRQ_DISABLE, clobbers, \
  450. pushl %ecx; pushl %edx; \
  451. call *paravirt_ops+PARAVIRT_irq_disable; \
  452. popl %edx; popl %ecx) \
  453. #define ENABLE_INTERRUPTS(clobbers) \
  454. PARA_PATCH(PARAVIRT_IRQ_ENABLE, clobbers, \
  455. pushl %ecx; pushl %edx; \
  456. call *%cs:paravirt_ops+PARAVIRT_irq_enable; \
  457. popl %edx; popl %ecx)
  458. #define ENABLE_INTERRUPTS_SYSEXIT \
  459. PARA_PATCH(PARAVIRT_STI_SYSEXIT, CLBR_ANY, \
  460. jmp *%cs:paravirt_ops+PARAVIRT_irq_enable_sysexit)
  461. #define GET_CR0_INTO_EAX \
  462. call *paravirt_ops+PARAVIRT_read_cr0
  463. #endif /* __ASSEMBLY__ */
  464. #endif /* CONFIG_PARAVIRT */
  465. #endif /* __ASM_PARAVIRT_H */