@@ -20,37 +20,6 @@ enum paravirt_lazy_mode {
20
20
21
21
#ifdef CONFIG_PARAVIRT
22
22
23
- /* Bitmask of what can be clobbered: usually at least eax. */
24
- #define CLBR_EAX (1 << 0)
25
- #define CLBR_ECX (1 << 1)
26
- #define CLBR_EDX (1 << 2)
27
- #define CLBR_EDI (1 << 3)
28
-
29
- #ifdef CONFIG_X86_32
30
- /* CLBR_ANY should match all regs platform has. For i386, that's just it */
31
- #define CLBR_ANY ((1 << 4) - 1)
32
-
33
- #define CLBR_ARG_REGS (CLBR_EAX | CLBR_EDX | CLBR_ECX)
34
- #define CLBR_RET_REG (CLBR_EAX | CLBR_EDX)
35
- #else
36
- #define CLBR_RAX CLBR_EAX
37
- #define CLBR_RCX CLBR_ECX
38
- #define CLBR_RDX CLBR_EDX
39
- #define CLBR_RDI CLBR_EDI
40
- #define CLBR_RSI (1 << 4)
41
- #define CLBR_R8 (1 << 5)
42
- #define CLBR_R9 (1 << 6)
43
- #define CLBR_R10 (1 << 7)
44
- #define CLBR_R11 (1 << 8)
45
-
46
- #define CLBR_ANY ((1 << 9) - 1)
47
-
48
- #define CLBR_ARG_REGS (CLBR_RDI | CLBR_RSI | CLBR_RDX | \
49
- CLBR_RCX | CLBR_R8 | CLBR_R9)
50
- #define CLBR_RET_REG (CLBR_RAX)
51
-
52
- #endif /* X86_64 */
53
-
54
23
#ifndef __ASSEMBLY__
55
24
56
25
#include <asm/desc_defs.h>
@@ -297,27 +266,23 @@ extern struct paravirt_patch_template pv_ops;
297
266
#define paravirt_type (op ) \
298
267
[paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \
299
268
[paravirt_opptr] "m" (pv_ops.op)
300
- #define paravirt_clobber (clobber ) \
301
- [paravirt_clobber] "i" (clobber)
302
-
303
269
/*
304
270
* Generate some code, and mark it as patchable by the
305
271
* apply_paravirt() alternate instruction patcher.
306
272
*/
307
- #define _paravirt_alt (insn_string , type , clobber ) \
273
+ #define _paravirt_alt (insn_string , type ) \
308
274
"771:\n\t" insn_string "\n" "772:\n" \
309
275
".pushsection .parainstructions,\"a\"\n" \
310
276
_ASM_ALIGN "\n" \
311
277
_ASM_PTR " 771b\n" \
312
278
" .byte " type "\n" \
313
279
" .byte 772b-771b\n" \
314
- " .short " clobber "\n" \
315
280
_ASM_ALIGN "\n" \
316
281
".popsection\n"
317
282
318
283
/* Generate patchable code, with the default asm parameters. */
319
284
#define paravirt_alt (insn_string ) \
320
- _paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]" )
285
+ _paravirt_alt(insn_string, "%c[paravirt_typenum]")
321
286
322
287
/* Simple instruction patching code. */
323
288
#define NATIVE_LABEL (a ,x ,b ) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"
@@ -469,20 +434,19 @@ int paravirt_disable_iospace(void);
469
434
})
470
435
471
436
472
- #define ____PVOP_CALL (ret , op , clbr , call_clbr , extra_clbr , ...) \
437
+ #define ____PVOP_CALL (ret , op , call_clbr , extra_clbr , ...) \
473
438
({ \
474
439
PVOP_CALL_ARGS; \
475
440
PVOP_TEST_NULL(op); \
476
441
asm volatile(paravirt_alt(PARAVIRT_CALL) \
477
442
: call_clbr, ASM_CALL_CONSTRAINT \
478
443
: paravirt_type(op), \
479
- paravirt_clobber(clbr), \
480
444
##__VA_ARGS__ \
481
445
: "memory", "cc" extra_clbr); \
482
446
ret; \
483
447
})
484
448
485
- #define ____PVOP_ALT_CALL (ret , op , alt , cond , clbr , call_clbr , \
449
+ #define ____PVOP_ALT_CALL (ret , op , alt , cond , call_clbr , \
486
450
extra_clbr , ...) \
487
451
({ \
488
452
PVOP_CALL_ARGS; \
@@ -491,45 +455,44 @@ int paravirt_disable_iospace(void);
491
455
alt, cond) \
492
456
: call_clbr, ASM_CALL_CONSTRAINT \
493
457
: paravirt_type(op), \
494
- paravirt_clobber(clbr), \
495
458
##__VA_ARGS__ \
496
459
: "memory", "cc" extra_clbr); \
497
460
ret; \
498
461
})
499
462
500
463
#define __PVOP_CALL (rettype , op , ...) \
501
- ____PVOP_CALL(PVOP_RETVAL(rettype), op, CLBR_ANY, \
464
+ ____PVOP_CALL(PVOP_RETVAL(rettype), op, \
502
465
PVOP_CALL_CLOBBERS, EXTRA_CLOBBERS, ##__VA_ARGS__)
503
466
504
467
#define __PVOP_ALT_CALL (rettype , op , alt , cond , ...) \
505
- ____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op, alt, cond, CLBR_ANY, \
468
+ ____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op, alt, cond, \
506
469
PVOP_CALL_CLOBBERS, EXTRA_CLOBBERS, \
507
470
##__VA_ARGS__)
508
471
509
472
#define __PVOP_CALLEESAVE (rettype , op , ...) \
510
- ____PVOP_CALL(PVOP_RETVAL(rettype), op.func, CLBR_RET_REG, \
473
+ ____PVOP_CALL(PVOP_RETVAL(rettype), op.func, \
511
474
PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
512
475
513
476
#define __PVOP_ALT_CALLEESAVE (rettype , op , alt , cond , ...) \
514
477
____PVOP_ALT_CALL(PVOP_RETVAL(rettype), op.func, alt, cond, \
515
- CLBR_RET_REG, PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
478
+ PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__)
516
479
517
480
518
481
#define __PVOP_VCALL (op , ...) \
519
- (void)____PVOP_CALL(, op, CLBR_ANY, PVOP_VCALL_CLOBBERS, \
482
+ (void)____PVOP_CALL(, op, PVOP_VCALL_CLOBBERS, \
520
483
VEXTRA_CLOBBERS, ##__VA_ARGS__)
521
484
522
485
#define __PVOP_ALT_VCALL (op , alt , cond , ...) \
523
- (void)____PVOP_ALT_CALL(, op, alt, cond, CLBR_ANY, \
486
+ (void)____PVOP_ALT_CALL(, op, alt, cond, \
524
487
PVOP_VCALL_CLOBBERS, VEXTRA_CLOBBERS, \
525
488
##__VA_ARGS__)
526
489
527
490
#define __PVOP_VCALLEESAVE (op , ...) \
528
- (void)____PVOP_CALL(, op.func, CLBR_RET_REG, \
491
+ (void)____PVOP_CALL(, op.func, \
529
492
PVOP_VCALLEE_CLOBBERS, , ##__VA_ARGS__)
530
493
531
494
#define __PVOP_ALT_VCALLEESAVE (op , alt , cond , ...) \
532
- (void)____PVOP_ALT_CALL(, op.func, alt, cond, CLBR_RET_REG, \
495
+ (void)____PVOP_ALT_CALL(, op.func, alt, cond, \
533
496
PVOP_VCALLEE_CLOBBERS, , ##__VA_ARGS__)
534
497
535
498
0 commit comments