2
2
#ifndef _ASM_X86_PARAVIRT_TYPES_H
3
3
#define _ASM_X86_PARAVIRT_TYPES_H
4
4
5
- /* Bitmask of what can be clobbered: usually at least eax. */
6
- #define CLBR_EAX (1 << 0)
7
- #define CLBR_ECX (1 << 1)
8
- #define CLBR_EDX (1 << 2)
9
- #define CLBR_EDI (1 << 3)
10
-
11
- #ifdef CONFIG_X86_32
12
- /* CLBR_ANY should match all regs platform has. For i386, that's just it */
13
- #define CLBR_ANY ((1 << 4) - 1)
14
-
15
- #define CLBR_ARG_REGS (CLBR_EAX | CLBR_EDX | CLBR_ECX)
16
- #define CLBR_RET_REG (CLBR_EAX | CLBR_EDX)
17
- #else
18
- #define CLBR_RAX CLBR_EAX
19
- #define CLBR_RCX CLBR_ECX
20
- #define CLBR_RDX CLBR_EDX
21
- #define CLBR_RDI CLBR_EDI
22
- #define CLBR_RSI (1 << 4)
23
- #define CLBR_R8 (1 << 5)
24
- #define CLBR_R9 (1 << 6)
25
- #define CLBR_R10 (1 << 7)
26
- #define CLBR_R11 (1 << 8)
27
-
28
- #define CLBR_ANY ((1 << 9) - 1)
29
-
30
- #define CLBR_ARG_REGS (CLBR_RDI | CLBR_RSI | CLBR_RDX | \
31
- CLBR_RCX | CLBR_R8 | CLBR_R9)
32
- #define CLBR_RET_REG (CLBR_RAX)
33
-
34
- #endif /* X86_64 */
35
-
36
5
#ifndef __ASSEMBLY__
37
6
38
7
#include <asm/desc_defs.h>
@@ -279,27 +248,23 @@ extern struct paravirt_patch_template pv_ops;
279
248
#define paravirt_type (op ) \
280
249
[paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \
281
250
[paravirt_opptr] "m" (pv_ops.op)
282
- #define paravirt_clobber (clobber ) \
283
- [paravirt_clobber] "i" (clobber)
284
-
285
251
/*
286
252
* Generate some code, and mark it as patchable by the
287
253
* apply_paravirt() alternate instruction patcher.
288
254
*/
289
- #define _paravirt_alt (insn_string , type , clobber ) \
255
+ #define _paravirt_alt (insn_string , type ) \
290
256
"771:\n\t" insn_string "\n" "772:\n" \
291
257
".pushsection .parainstructions,\"a\"\n" \
292
258
_ASM_ALIGN "\n" \
293
259
_ASM_PTR " 771b\n" \
294
260
" .byte " type "\n" \
295
261
" .byte 772b-771b\n" \
296
- " .short " clobber "\n" \
297
262
_ASM_ALIGN "\n" \
298
263
".popsection\n"
299
264
300
265
/* Generate patchable code, with the default asm parameters. */
301
266
#define paravirt_alt (insn_string ) \
302
- _paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]" )
267
+ _paravirt_alt(insn_string, "%c[paravirt_typenum]")
303
268
304
269
/* Simple instruction patching code. */
305
270
#define NATIVE_LABEL (a ,x ,b ) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"
@@ -451,20 +416,19 @@ int paravirt_disable_iospace(void);
451
416
})
452
417
453
418
454
- #define ____PVOP_CALL (ret , op , clbr , call_clbr , extra_clbr , ...) \
419
+ #define ____PVOP_CALL (ret , op , call_clbr , extra_clbr , ...) \
455
420
({ \
456
421
PVOP_CALL_ARGS; \
457
422
PVOP_TEST_NULL(op); \
458
423
asm volatile(paravirt_alt(PARAVIRT_CALL) \
459
424
: call_clbr, ASM_CALL_CONSTRAINT \
460
425
: paravirt_type(op), \
461
- paravirt_clobber(clbr), \
462
426
##__VA_ARGS__ \
463
427
: "memory", "cc" extra_clbr); \
464
428
ret; \
465
429
})
466
430
467
- #define ____PVOP_ALT_CALL (ret , op , alt , cond , clbr , call_clbr , \
431
+ #define ____PVOP_ALT_CALL (ret , op , alt , cond , call_clbr , \
468
432
extra_clbr , ...) \
469
433
({ \
470
434
PVOP_CALL_ARGS; \
@@ -473,45 +437,44 @@ int paravirt_disable_iospace(void);
473
437
alt, cond) \
474
438
: call_clbr, ASM_CALL_CONSTRAINT \
475
439
: paravirt_type(op), \
476
- paravirt_clobber(clbr), \
477
440
##__VA_ARGS__ \
478
441
: "memory", "cc" extra_clbr); \
479
442
ret; \
480
443
})
481
444
482
445
#define __PVOP_CALL (rettype , op , ...) \
483
- ____PVOP_CALL(PVOP_RETVAL(rettype), op, CLBR_ANY, \
446
+ ____PVOP_CALL(PVOP_RETVAL(rettype), op, \
484
447
PVOP_CALL_CLOBBERS, EXTRA_CLOBBERS, ##__VA_ARGS__)
485
448
486
449
#define __PVOP_ALT_CALL (rettype , op , alt , cond , ...) \
487
- ____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op, alt, cond, CLBR_ANY, \
450
+ ____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op, alt, cond, \
488
451
PVOP_CALL_CLOBBERS, EXTRA_CLOBBERS, \
489
452
##__VA_ARGS__)
490
453
491
454
#define __PVOP_CALLEESAVE (rettype , op , ...) \
492
- ____PVOP_CALL(PVOP_RETVAL(rettype), op.func, CLBR_RET_REG, \
455
+ ____PVOP_CALL(PVOP_RETVAL(rettype), op.func, \
493
456
PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
494
457
495
458
#define __PVOP_ALT_CALLEESAVE (rettype , op , alt , cond , ...) \
496
459
____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op.func, alt, cond, \
497
- CLBR_RET_REG, PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
460
+ PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
498
461
499
462
500
463
#define __PVOP_VCALL (op , ...) \
501
- (void)____PVOP_CALL(, op, CLBR_ANY, PVOP_VCALL_CLOBBERS, \
464
+ (void)____PVOP_CALL(, op, PVOP_VCALL_CLOBBERS, \
502
465
VEXTRA_CLOBBERS, ##__VA_ARGS__)
503
466
504
467
#define __PVOP_ALT_VCALL (op , alt , cond , ...) \
505
- (void)____PVOP_ALT_CALL(, op, alt, cond, CLBR_ANY, \
468
+ (void)____PVOP_ALT_CALL(, op, alt, cond, \
506
469
PVOP_VCALL_CLOBBERS, VEXTRA_CLOBBERS, \
507
470
##__VA_ARGS__)
508
471
509
472
#define __PVOP_VCALLEESAVE (op , ...) \
510
- (void)____PVOP_CALL(, op.func, CLBR_RET_REG, \
473
+ (void)____PVOP_CALL(, op.func, \
511
474
PVOP_VCALLEE_CLOBBERS, , ##__VA_ARGS__)
512
475
513
476
#define __PVOP_ALT_VCALLEESAVE (op , alt , cond , ...) \
514
- (void)____PVOP_ALT_CALL(, op.func, alt, cond, CLBR_RET_REG, \
477
+ (void)____PVOP_ALT_CALL(, op.func, alt, cond, \
515
478
PVOP_VCALLEE_CLOBBERS, , ##__VA_ARGS__)
516
479
517
480
0 commit comments