diff options
| author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-07-08 18:07:09 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-07-16 05:04:41 -0400 |
| commit | 4a5c3e77f70b3ea8b361d7fa9eb2e4dad18f70ae (patch) | |
| tree | 8dd0085bb4dc6eeceb5a6dd070b9a05890d2d756 | |
| parent | 0775b3dbcb6d17b531b36df520ddab735647f3f7 (diff) | |
xen64: implement failsafe callback
Implement the failsafe callback, so that iret and segment register
load exceptions are reported to the kernel.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | arch/x86/kernel/entry_64.S | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 7cc2de796146..6aa6932e21b1 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -1365,10 +1365,8 @@ END(do_hypervisor_callback) | |||
| 1365 | # with its current contents: any discrepancy means we in category 1. | 1365 | # with its current contents: any discrepancy means we in category 1. |
| 1366 | */ | 1366 | */ |
| 1367 | ENTRY(xen_failsafe_callback) | 1367 | ENTRY(xen_failsafe_callback) |
| 1368 | #if 1 | 1368 | framesz = (RIP-0x30) /* workaround buggy gas */ |
| 1369 | ud2a | 1369 | _frame framesz |
| 1370 | #else | ||
| 1371 | _frame (RIP-0x30) | ||
| 1372 | CFI_REL_OFFSET rcx, 0 | 1370 | CFI_REL_OFFSET rcx, 0 |
| 1373 | CFI_REL_OFFSET r11, 8 | 1371 | CFI_REL_OFFSET r11, 8 |
| 1374 | movw %ds,%cx | 1372 | movw %ds,%cx |
| @@ -1391,8 +1389,13 @@ ENTRY(xen_failsafe_callback) | |||
| 1391 | CFI_RESTORE r11 | 1389 | CFI_RESTORE r11 |
| 1392 | addq $0x30,%rsp | 1390 | addq $0x30,%rsp |
| 1393 | CFI_ADJUST_CFA_OFFSET -0x30 | 1391 | CFI_ADJUST_CFA_OFFSET -0x30 |
| 1394 | movq $11,%rdi /* SIGSEGV */ | 1392 | pushq $0 |
| 1395 | jmp do_exit | 1393 | CFI_ADJUST_CFA_OFFSET 8 |
| 1394 | pushq %r11 | ||
| 1395 | CFI_ADJUST_CFA_OFFSET 8 | ||
| 1396 | pushq %rcx | ||
| 1397 | CFI_ADJUST_CFA_OFFSET 8 | ||
| 1398 | jmp general_protection | ||
| 1396 | CFI_RESTORE_STATE | 1399 | CFI_RESTORE_STATE |
| 1397 | 1: /* Segment mismatch => Category 1 (Bad segment). Retry the IRET. */ | 1400 | 1: /* Segment mismatch => Category 1 (Bad segment). Retry the IRET. */ |
| 1398 | movq (%rsp),%rcx | 1401 | movq (%rsp),%rcx |
| @@ -1406,7 +1409,6 @@ ENTRY(xen_failsafe_callback) | |||
| 1406 | SAVE_ALL | 1409 | SAVE_ALL |
| 1407 | jmp error_exit | 1410 | jmp error_exit |
| 1408 | CFI_ENDPROC | 1411 | CFI_ENDPROC |
| 1409 | #endif | ||
| 1410 | END(xen_failsafe_callback) | 1412 | END(xen_failsafe_callback) |
| 1411 | 1413 | ||
| 1412 | #endif /* CONFIG_XEN */ | 1414 | #endif /* CONFIG_XEN */ |
