From patchwork Mon Sep 24 12:11:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 10612323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7739913 for ; Mon, 24 Sep 2018 12:14:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94FA329E95 for ; Mon, 24 Sep 2018 12:14:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 894C929E99; Mon, 24 Sep 2018 12:14:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0571629E95 for ; Mon, 24 Sep 2018 12:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qykzMm3tcYurF3NBae4hqJ6ilHokC7s2OHRUQxCyY1Y=; b=SJus5mDHv8A21l kvdy+6qMxRK2rov31sW6R93sNYarea74f/gO9hXjVSsZR8K4tSbL/3mwvVPGwc3LTlMAtnItu+HNb qpT6bZ+dU8RPHt0UlrvaAkMwP7QOke1qmXQjnTt5lbv6wylj7dkTN/RG676MkBKFnnRyEiiKmwgoe MLlbub2BaDxKFmAA1+yVGNLOA5JMQ4uFmBl60dyau+47uw4ho0ajQYfzF7sKeArx4kk4AVkg8eXOH pTAMc/X4P42BpsTb7Fv68eHmHw6VleqmX+BjX/jwJrO+00MWt28RK4Tz/buhV0fjXtGajmO07fJ79 E35DA6Aersk1Nip4xjvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4Pkw-0001Jz-EZ; Mon, 24 Sep 2018 12:14:26 +0000 Received: from out02.mta.xmission.com ([166.70.13.232]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4Pj4-0000NC-2U for linux-arm-kernel@lists.infradead.org; Mon, 24 Sep 2018 12:12:41 +0000 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4Pis-0003rD-0B; Mon, 24 Sep 2018 06:12:19 -0600 Received: from [105.184.227.67] (helo=x220.Home) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4Piq-0002Pv-VX; Mon, 24 Sep 2018 06:12:17 -0600 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Date: Mon, 24 Sep 2018 14:11:28 +0200 Message-Id: <20180924121128.5983-4-ebiederm@xmission.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <87pnx32j2p.fsf@xmission.com> References: <87pnx32j2p.fsf@xmission.com> X-XM-SPF: eid=1g4Piq-0002Pv-VX; ; ; mid=<20180924121128.5983-4-ebiederm@xmission.com>; ; ; hst=in02.mta.xmission.com; ; ; ip=105.184.227.67; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX19Cwvc807DrCOccqZ+V3rA7CgpuWCY08U0= X-SA-Exim-Connect-IP: 105.184.227.67 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [REVIEW][PATCH 4/4] signal/arm/kvm: Use send_sig_mceerr X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180924_051230_181537_8D3176FD X-CRM114-Status: UNSURE ( 6.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Russell King , linux-arm-kernel@lists.infradead.org, "Eric W. Biederman" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This simplifies the code making it clearer what is going on, and making the siginfo generation easier to maintain. Signed-off-by: "Eric W. Biederman" --- virt/kvm/arm/mmu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 91aaf73b00df..39c0405f2021 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1450,20 +1450,14 @@ static void invalidate_icache_guest_page(kvm_pfn_t pfn, unsigned long size) static void kvm_send_hwpoison_signal(unsigned long address, struct vm_area_struct *vma) { - siginfo_t info; - - clear_siginfo(&info); - info.si_signo = SIGBUS; - info.si_errno = 0; - info.si_code = BUS_MCEERR_AR; - info.si_addr = (void __user *)address; + short lsb; if (is_vm_hugetlb_page(vma)) - info.si_addr_lsb = huge_page_shift(hstate_vma(vma)); + lsb = huge_page_shift(hstate_vma(vma)); else - info.si_addr_lsb = PAGE_SHIFT; + lsb = PAGE_SHIFT; - send_sig_info(SIGBUS, &info, current); + send_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb, current); } static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,