mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/pv: Move async_exception_cleanup() into pv/iret.c
All callers are in pv/iret.c. Move the function and make it static. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
4782b7aeea
commit
094796affb
3 files changed
+24
-27
No files matched your search
+24
-1
@@ -22,7 +22,30 @@
|
||||
#include <xen/sched.h>
|
||||
|
||||
#include <asm/current.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
static void async_exception_cleanup(struct vcpu *curr)
|
||||
{
|
||||
unsigned int trap;
|
||||
|
||||
if ( !curr->async_exception_mask )
|
||||
return;
|
||||
|
||||
if ( !(curr->async_exception_mask & (curr->async_exception_mask - 1)) )
|
||||
trap = __scanbit(curr->async_exception_mask, VCPU_TRAP_NONE);
|
||||
else
|
||||
for ( trap = VCPU_TRAP_NONE + 1; trap <= VCPU_TRAP_LAST; ++trap )
|
||||
if ( (curr->async_exception_mask ^
|
||||
curr->async_exception_state(trap).old_mask) == (1u << trap) )
|
||||
break;
|
||||
if ( unlikely(trap > VCPU_TRAP_LAST) )
|
||||
{
|
||||
ASSERT_UNREACHABLE();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Restore previous asynchronous exception mask. */
|
||||
curr->async_exception_mask = curr->async_exception_state(trap).old_mask;
|
||||
}
|
||||
|
||||
unsigned long do_iret(void)
|
||||
{
|
||||
|
||||
@@ -1593,30 +1593,6 @@ static void pci_serr_softirq(void)
|
||||
outb(inb(0x61) & 0x0b, 0x61); /* re-enable the PCI SERR error line. */
|
||||
}
|
||||
|
||||
void async_exception_cleanup(struct vcpu *curr)
|
||||
{
|
||||
int trap;
|
||||
|
||||
if ( !curr->async_exception_mask )
|
||||
return;
|
||||
|
||||
if ( !(curr->async_exception_mask & (curr->async_exception_mask - 1)) )
|
||||
trap = __scanbit(curr->async_exception_mask, VCPU_TRAP_NONE);
|
||||
else
|
||||
for ( trap = VCPU_TRAP_NONE + 1; trap <= VCPU_TRAP_LAST; ++trap )
|
||||
if ( (curr->async_exception_mask ^
|
||||
curr->async_exception_state(trap).old_mask) == (1 << trap) )
|
||||
break;
|
||||
if ( unlikely(trap > VCPU_TRAP_LAST) )
|
||||
{
|
||||
ASSERT_UNREACHABLE();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Restore previous asynchronous exception mask. */
|
||||
curr->async_exception_mask = curr->async_exception_state(trap).old_mask;
|
||||
}
|
||||
|
||||
static void nmi_hwdom_report(unsigned int reason_idx)
|
||||
{
|
||||
struct domain *d = hardware_domain;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#ifndef ASM_TRAP_H
|
||||
#define ASM_TRAP_H
|
||||
|
||||
void async_exception_cleanup(struct vcpu *);
|
||||
|
||||
const char *trapstr(unsigned int trapnr);
|
||||
|
||||
#endif /* ASM_TRAP_H */
|
||||
|
||||