From b8aeec34175fc8fe8b0d40efea4846dfc1ba663e Mon Sep 17 00:00:00 2001 From: Hidetoshi Seto Date: Thu, 7 Oct 2010 15:31:31 +0900 Subject: [PATCH] HWPOISON/signalfd: add support for addr_lsb Similar change as to signal delivery: copy out the si_addr_lsb field to user space in signalfd Signed-off-by: Hidetoshi Seto Signed-off-by: Andi Kleen --- fs/signalfd.c | 10 ++++++++++ include/linux/signalfd.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 1c5a6add779d..bdd4496ae67f 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -98,6 +98,16 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, err |= __put_user((long) kinfo->si_addr, &uinfo->ssi_addr); #ifdef __ARCH_SI_TRAPNO err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno); +#endif +#ifdef BUS_MCEERR_AO + /* + * Other callers might not initialize the si_lsb field, + * so check explicitly for the right codes here. + */ + if (kinfo->si_code == BUS_MCEERR_AR || + kinfo->si_code == BUS_MCEERR_AO) + err |= __put_user((short) kinfo->si_addr_lsb, + &uinfo->ssi_addr_lsb); #endif break; case __SI_CHLD: diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h index b363b916c909..3ff4961da9b5 100644 --- a/include/linux/signalfd.h +++ b/include/linux/signalfd.h @@ -33,6 +33,7 @@ struct signalfd_siginfo { __u64 ssi_utime; __u64 ssi_stime; __u64 ssi_addr; + __u16 ssi_addr_lsb; /* * Pad strcture to 128 bytes. Remember to update the @@ -43,7 +44,7 @@ struct signalfd_siginfo { * comes out of a read(2) and we really don't want to have * a compat on read(2). */ - __u8 __pad[48]; + __u8 __pad[46]; }; -- 2.39.2