No functional change (as curr->arch.debugreg[5] is zero when DE is clear), but
this change simplifies the following patch.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
switch ( reg )
{
case 0 ... 3:
- case 6:
*val = curr->arch.debugreg[reg];
break;
+ case 4:
+ if ( curr->arch.pv.ctrlreg[4] & X86_CR4_DE )
+ goto ud_fault;
+
+ /* Fallthrough */
+ case 6:
+ *val = curr->arch.debugreg[6];
+ break;
+
+ case 5:
+ if ( curr->arch.pv.ctrlreg[4] & X86_CR4_DE )
+ goto ud_fault;
+
+ /* Fallthrough */
case 7:
*val = (curr->arch.debugreg[7] |
curr->arch.debugreg[5]);
break;
- case 4 ... 5:
- if ( !(curr->arch.pv.ctrlreg[4] & X86_CR4_DE) )
- {
- *val = curr->arch.debugreg[reg + 2];
- break;
- }
-
- /* Fallthrough */
+ ud_fault:
default:
if ( ctxt )
x86_emul_hw_exception(TRAP_invalid_op, X86_EVENT_NO_EC, ctxt);