Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215929
b: refs/heads/master
c: 77db5cb
h: refs/heads/master
i:
  215927: 09120f8
v: v3
  • Loading branch information
Huang Ying authored and Avi Kivity committed Oct 24, 2010
1 parent 5bf936e commit 54312a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5854dbca9b235f8cdd414a0961018763d2d5bf77
refs/heads/master: 77db5cbd29b7cb0e0fb4fd146e7f7ac2831a025a
18 changes: 10 additions & 8 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2251,22 +2251,24 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
return pt_write;
}

static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn)
static void kvm_send_hwpoison_signal(unsigned long address, struct task_struct *tsk)
{
char buf[1];
void __user *hva;
int r;
siginfo_t info;

info.si_signo = SIGBUS;
info.si_errno = 0;
info.si_code = BUS_MCEERR_AR;
info.si_addr = (void __user *)address;
info.si_addr_lsb = PAGE_SHIFT;

/* Touch the page, so send SIGBUS */
hva = (void __user *)gfn_to_hva(kvm, gfn);
r = copy_from_user(buf, hva, 1);
send_sig_info(SIGBUS, &info, tsk);
}

static int kvm_handle_bad_page(struct kvm *kvm, gfn_t gfn, pfn_t pfn)
{
kvm_release_pfn_clean(pfn);
if (is_hwpoison_pfn(pfn)) {
kvm_send_hwpoison_signal(kvm, gfn);
kvm_send_hwpoison_signal(gfn_to_hva(kvm, gfn), current);
return 0;
} else if (is_fault_pfn(pfn))
return -EFAULT;
Expand Down

0 comments on commit 54312a8

Please sign in to comment.