paravirt.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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 desc_struct;
  30. struct paravirt_ops
  31. {
  32. unsigned int kernel_rpl;
  33. int paravirt_enabled;
  34. const char *name;
  35. /*
  36. * Patch may replace one of the defined code sequences with arbitrary
  37. * code, subject to the same register constraints. This generally
  38. * means the code is not free to clobber any registers other than EAX.
  39. * The patch function should return the number of bytes of code
  40. * generated, as we nop pad the rest in generic code.
  41. */
  42. unsigned (*patch)(u8 type, u16 clobber, void *firstinsn, unsigned len);
  43. void (*arch_setup)(void);
  44. char *(*memory_setup)(void);
  45. void (*init_IRQ)(void);
  46. void (*banner)(void);
  47. unsigned long (*get_wallclock)(void);
  48. int (*set_wallclock)(unsigned long);
  49. void (*time_init)(void);
  50. /* All the function pointers here are declared as "fastcall"
  51. so that we get a specific register-based calling
  52. convention. This makes it easier to implement inline
  53. assembler replacements. */
  54. void (*cpuid)(unsigned int *eax, unsigned int *ebx,
  55. unsigned int *ecx, unsigned int *edx);
  56. unsigned long (*get_debugreg)(int regno);
  57. void (*set_debugreg)(int regno, unsigned long value);
  58. void (*clts)(void);
  59. unsigned long (*read_cr0)(void);
  60. void (*write_cr0)(unsigned long);
  61. unsigned long (*read_cr2)(void);
  62. void (*write_cr2)(unsigned long);
  63. unsigned long (*read_cr3)(void);
  64. void (*write_cr3)(unsigned long);
  65. unsigned long (*read_cr4_safe)(void);
  66. unsigned long (*read_cr4)(void);
  67. void (*write_cr4)(unsigned long);
  68. unsigned long (*save_fl)(void);
  69. void (*restore_fl)(unsigned long);
  70. void (*irq_disable)(void);
  71. void (*irq_enable)(void);
  72. void (*safe_halt)(void);
  73. void (*halt)(void);
  74. void (*wbinvd)(void);
  75. /* err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */
  76. u64 (*read_msr)(unsigned int msr, int *err);
  77. int (*write_msr)(unsigned int msr, u64 val);
  78. u64 (*read_tsc)(void);
  79. u64 (*read_pmc)(void);
  80. u64 (*get_scheduled_cycles)(void);
  81. unsigned long (*get_cpu_khz)(void);
  82. void (*load_tr_desc)(void);
  83. void (*load_gdt)(const struct Xgt_desc_struct *);
  84. void (*load_idt)(const struct Xgt_desc_struct *);
  85. void (*store_gdt)(struct Xgt_desc_struct *);
  86. void (*store_idt)(struct Xgt_desc_struct *);
  87. void (*set_ldt)(const void *desc, unsigned entries);
  88. unsigned long (*store_tr)(void);
  89. void (*load_tls)(struct thread_struct *t, unsigned int cpu);
  90. void (*write_ldt_entry)(struct desc_struct *,
  91. int entrynum, u32 low, u32 high);
  92. void (*write_gdt_entry)(struct desc_struct *,
  93. int entrynum, u32 low, u32 high);
  94. void (*write_idt_entry)(struct desc_struct *,
  95. int entrynum, u32 low, u32 high);
  96. void (*load_esp0)(struct tss_struct *tss, struct thread_struct *t);
  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. /* These should all do BUG_ON(_err), but our headers are too tangled. */
  189. #define rdmsr(msr,val1,val2) do { \
  190. int _err; \
  191. u64 _l = paravirt_ops.read_msr(msr,&_err); \
  192. val1 = (u32)_l; \
  193. val2 = _l >> 32; \
  194. } while(0)
  195. #define wrmsr(msr,val1,val2) do { \
  196. u64 _l = ((u64)(val2) << 32) | (val1); \
  197. paravirt_ops.write_msr((msr), _l); \
  198. } while(0)
  199. #define rdmsrl(msr,val) do { \
  200. int _err; \
  201. val = paravirt_ops.read_msr((msr),&_err); \
  202. } while(0)
  203. #define wrmsrl(msr,val) (paravirt_ops.write_msr((msr),(val)))
  204. #define wrmsr_safe(msr,a,b) ({ \
  205. u64 _l = ((u64)(b) << 32) | (a); \
  206. paravirt_ops.write_msr((msr),_l); \
  207. })
  208. /* rdmsr with exception handling */
  209. #define rdmsr_safe(msr,a,b) ({ \
  210. int _err; \
  211. u64 _l = paravirt_ops.read_msr(msr,&_err); \
  212. (*a) = (u32)_l; \
  213. (*b) = _l >> 32; \
  214. _err; })
  215. #define rdtsc(low,high) do { \
  216. u64 _l = paravirt_ops.read_tsc(); \
  217. low = (u32)_l; \
  218. high = _l >> 32; \
  219. } while(0)
  220. #define rdtscl(low) do { \
  221. u64 _l = paravirt_ops.read_tsc(); \
  222. low = (int)_l; \
  223. } while(0)
  224. #define rdtscll(val) (val = paravirt_ops.read_tsc())
  225. #define get_scheduled_cycles(val) (val = paravirt_ops.get_scheduled_cycles())
  226. #define calculate_cpu_khz() (paravirt_ops.get_cpu_khz())
  227. #define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
  228. #define rdpmc(counter,low,high) do { \
  229. u64 _l = paravirt_ops.read_pmc(); \
  230. low = (u32)_l; \
  231. high = _l >> 32; \
  232. } while(0)
  233. #define load_TR_desc() (paravirt_ops.load_tr_desc())
  234. #define load_gdt(dtr) (paravirt_ops.load_gdt(dtr))
  235. #define load_idt(dtr) (paravirt_ops.load_idt(dtr))
  236. #define set_ldt(addr, entries) (paravirt_ops.set_ldt((addr), (entries)))
  237. #define store_gdt(dtr) (paravirt_ops.store_gdt(dtr))
  238. #define store_idt(dtr) (paravirt_ops.store_idt(dtr))
  239. #define store_tr(tr) ((tr) = paravirt_ops.store_tr())
  240. #define load_TLS(t,cpu) (paravirt_ops.load_tls((t),(cpu)))
  241. #define write_ldt_entry(dt, entry, low, high) \
  242. (paravirt_ops.write_ldt_entry((dt), (entry), (low), (high)))
  243. #define write_gdt_entry(dt, entry, low, high) \
  244. (paravirt_ops.write_gdt_entry((dt), (entry), (low), (high)))
  245. #define write_idt_entry(dt, entry, low, high) \
  246. (paravirt_ops.write_idt_entry((dt), (entry), (low), (high)))
  247. #define set_iopl_mask(mask) (paravirt_ops.set_iopl_mask(mask))
  248. /* The paravirtualized I/O functions */
  249. static inline void slow_down_io(void) {
  250. paravirt_ops.io_delay();
  251. #ifdef REALLY_SLOW_IO
  252. paravirt_ops.io_delay();
  253. paravirt_ops.io_delay();
  254. paravirt_ops.io_delay();
  255. #endif
  256. }
  257. #ifdef CONFIG_X86_LOCAL_APIC
  258. /*
  259. * Basic functions accessing APICs.
  260. */
  261. static inline void apic_write(unsigned long reg, unsigned long v)
  262. {
  263. paravirt_ops.apic_write(reg,v);
  264. }
  265. static inline void apic_write_atomic(unsigned long reg, unsigned long v)
  266. {
  267. paravirt_ops.apic_write_atomic(reg,v);
  268. }
  269. static inline unsigned long apic_read(unsigned long reg)
  270. {
  271. return paravirt_ops.apic_read(reg);
  272. }
  273. static inline void setup_boot_clock(void)
  274. {
  275. paravirt_ops.setup_boot_clock();
  276. }
  277. static inline void setup_secondary_clock(void)
  278. {
  279. paravirt_ops.setup_secondary_clock();
  280. }
  281. #endif
  282. #ifdef CONFIG_SMP
  283. static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip,
  284. unsigned long start_esp)
  285. {
  286. return paravirt_ops.startup_ipi_hook(phys_apicid, start_eip, start_esp);
  287. }
  288. #endif
  289. #define __flush_tlb() paravirt_ops.flush_tlb_user()
  290. #define __flush_tlb_global() paravirt_ops.flush_tlb_kernel()
  291. #define __flush_tlb_single(addr) paravirt_ops.flush_tlb_single(addr)
  292. #define paravirt_map_pt_hook(type, va, pfn) paravirt_ops.map_pt_hook(type, va, pfn)
  293. #define paravirt_alloc_pt(pfn) paravirt_ops.alloc_pt(pfn)
  294. #define paravirt_release_pt(pfn) paravirt_ops.release_pt(pfn)
  295. #define paravirt_alloc_pd(pfn) paravirt_ops.alloc_pd(pfn)
  296. #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) \
  297. paravirt_ops.alloc_pd_clone(pfn, clonepfn, start, count)
  298. #define paravirt_release_pd(pfn) paravirt_ops.release_pd(pfn)
  299. static inline void set_pte(pte_t *ptep, pte_t pteval)
  300. {
  301. paravirt_ops.set_pte(ptep, pteval);
  302. }
  303. static inline void set_pte_at(struct mm_struct *mm, u32 addr, pte_t *ptep, pte_t pteval)
  304. {
  305. paravirt_ops.set_pte_at(mm, addr, ptep, pteval);
  306. }
  307. static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
  308. {
  309. paravirt_ops.set_pmd(pmdp, pmdval);
  310. }
  311. static inline void pte_update(struct mm_struct *mm, u32 addr, pte_t *ptep)
  312. {
  313. paravirt_ops.pte_update(mm, addr, ptep);
  314. }
  315. static inline void pte_update_defer(struct mm_struct *mm, u32 addr, pte_t *ptep)
  316. {
  317. paravirt_ops.pte_update_defer(mm, addr, ptep);
  318. }
  319. #ifdef CONFIG_X86_PAE
  320. static inline void set_pte_atomic(pte_t *ptep, pte_t pteval)
  321. {
  322. paravirt_ops.set_pte_atomic(ptep, pteval);
  323. }
  324. static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
  325. {
  326. paravirt_ops.set_pte_present(mm, addr, ptep, pte);
  327. }
  328. static inline void set_pud(pud_t *pudp, pud_t pudval)
  329. {
  330. paravirt_ops.set_pud(pudp, pudval);
  331. }
  332. static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
  333. {
  334. paravirt_ops.pte_clear(mm, addr, ptep);
  335. }
  336. static inline void pmd_clear(pmd_t *pmdp)
  337. {
  338. paravirt_ops.pmd_clear(pmdp);
  339. }
  340. #endif
  341. /* Lazy mode for batching updates / context switch */
  342. #define PARAVIRT_LAZY_NONE 0
  343. #define PARAVIRT_LAZY_MMU 1
  344. #define PARAVIRT_LAZY_CPU 2
  345. #define PARAVIRT_LAZY_FLUSH 3
  346. #define __HAVE_ARCH_ENTER_LAZY_CPU_MODE
  347. #define arch_enter_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_CPU)
  348. #define arch_leave_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE)
  349. #define arch_flush_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_FLUSH)
  350. #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
  351. #define arch_enter_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_MMU)
  352. #define arch_leave_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE)
  353. #define arch_flush_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_FLUSH)
  354. /* These all sit in the .parainstructions section to tell us what to patch. */
  355. struct paravirt_patch {
  356. u8 *instr; /* original instructions */
  357. u8 instrtype; /* type of this instruction */
  358. u8 len; /* length of original instruction */
  359. u16 clobbers; /* what registers you may clobber */
  360. };
  361. #define paravirt_alt(insn_string, typenum, clobber) \
  362. "771:\n\t" insn_string "\n" "772:\n" \
  363. ".pushsection .parainstructions,\"a\"\n" \
  364. " .long 771b\n" \
  365. " .byte " __stringify(typenum) "\n" \
  366. " .byte 772b-771b\n" \
  367. " .short " __stringify(clobber) "\n" \
  368. ".popsection"
  369. static inline unsigned long __raw_local_save_flags(void)
  370. {
  371. unsigned long f;
  372. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  373. "call *%1;"
  374. "popl %%edx; popl %%ecx",
  375. PARAVIRT_SAVE_FLAGS, CLBR_NONE)
  376. : "=a"(f): "m"(paravirt_ops.save_fl)
  377. : "memory", "cc");
  378. return f;
  379. }
  380. static inline void raw_local_irq_restore(unsigned long f)
  381. {
  382. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  383. "call *%1;"
  384. "popl %%edx; popl %%ecx",
  385. PARAVIRT_RESTORE_FLAGS, CLBR_EAX)
  386. : "=a"(f) : "m" (paravirt_ops.restore_fl), "0"(f)
  387. : "memory", "cc");
  388. }
  389. static inline void raw_local_irq_disable(void)
  390. {
  391. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  392. "call *%0;"
  393. "popl %%edx; popl %%ecx",
  394. PARAVIRT_IRQ_DISABLE, CLBR_EAX)
  395. : : "m" (paravirt_ops.irq_disable)
  396. : "memory", "eax", "cc");
  397. }
  398. static inline void raw_local_irq_enable(void)
  399. {
  400. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  401. "call *%0;"
  402. "popl %%edx; popl %%ecx",
  403. PARAVIRT_IRQ_ENABLE, CLBR_EAX)
  404. : : "m" (paravirt_ops.irq_enable)
  405. : "memory", "eax", "cc");
  406. }
  407. static inline unsigned long __raw_local_irq_save(void)
  408. {
  409. unsigned long f;
  410. __asm__ __volatile__(paravirt_alt( "pushl %%ecx; pushl %%edx;"
  411. "call *%1; pushl %%eax;"
  412. "call *%2; popl %%eax;"
  413. "popl %%edx; popl %%ecx",
  414. PARAVIRT_SAVE_FLAGS_IRQ_DISABLE,
  415. CLBR_NONE)
  416. : "=a"(f)
  417. : "m" (paravirt_ops.save_fl),
  418. "m" (paravirt_ops.irq_disable)
  419. : "memory", "cc");
  420. return f;
  421. }
  422. #define CLI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
  423. "call *paravirt_ops+%c[irq_disable];" \
  424. "popl %%edx; popl %%ecx", \
  425. PARAVIRT_IRQ_DISABLE, CLBR_EAX)
  426. #define STI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
  427. "call *paravirt_ops+%c[irq_enable];" \
  428. "popl %%edx; popl %%ecx", \
  429. PARAVIRT_IRQ_ENABLE, CLBR_EAX)
  430. #define CLI_STI_CLOBBERS , "%eax"
  431. #define CLI_STI_INPUT_ARGS \
  432. , \
  433. [irq_disable] "i" (offsetof(struct paravirt_ops, irq_disable)), \
  434. [irq_enable] "i" (offsetof(struct paravirt_ops, irq_enable))
  435. #else /* __ASSEMBLY__ */
  436. #define PARA_PATCH(ptype, clobbers, ops) \
  437. 771:; \
  438. ops; \
  439. 772:; \
  440. .pushsection .parainstructions,"a"; \
  441. .long 771b; \
  442. .byte ptype; \
  443. .byte 772b-771b; \
  444. .short clobbers; \
  445. .popsection
  446. #define INTERRUPT_RETURN \
  447. PARA_PATCH(PARAVIRT_INTERRUPT_RETURN, CLBR_ANY, \
  448. jmp *%cs:paravirt_ops+PARAVIRT_iret)
  449. #define DISABLE_INTERRUPTS(clobbers) \
  450. PARA_PATCH(PARAVIRT_IRQ_DISABLE, clobbers, \
  451. pushl %ecx; pushl %edx; \
  452. call *paravirt_ops+PARAVIRT_irq_disable; \
  453. popl %edx; popl %ecx) \
  454. #define ENABLE_INTERRUPTS(clobbers) \
  455. PARA_PATCH(PARAVIRT_IRQ_ENABLE, clobbers, \
  456. pushl %ecx; pushl %edx; \
  457. call *%cs:paravirt_ops+PARAVIRT_irq_enable; \
  458. popl %edx; popl %ecx)
  459. #define ENABLE_INTERRUPTS_SYSEXIT \
  460. PARA_PATCH(PARAVIRT_STI_SYSEXIT, CLBR_ANY, \
  461. jmp *%cs:paravirt_ops+PARAVIRT_irq_enable_sysexit)
  462. #define GET_CR0_INTO_EAX \
  463. call *paravirt_ops+PARAVIRT_read_cr0
  464. #endif /* __ASSEMBLY__ */
  465. #endif /* CONFIG_PARAVIRT */
  466. #endif /* __ASM_PARAVIRT_H */