From patchwork Sun Jan 8 00:52:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 9503305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A088B6071A for ; Sun, 8 Jan 2017 00:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 874F828421 for ; Sun, 8 Jan 2017 00:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 785F52843B; Sun, 8 Jan 2017 00:52:57 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID,T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5E4128421 for ; Sun, 8 Jan 2017 00:52:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933592AbdAHAww (ORCPT ); Sat, 7 Jan 2017 19:52:52 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36728 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933014AbdAHAwv (ORCPT ); Sat, 7 Jan 2017 19:52:51 -0500 Received: by mail-oi0-f66.google.com with SMTP id u143so11402404oif.3; Sat, 07 Jan 2017 16:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AM7Gq2jOV4dbK3462f+4KxUlDglr1JJY6/EwGuMEDig=; b=Pv+f91hrk1MxtWXrDwy9T9Eg1FwMsN7OFS4E1oyzfrPNhE+98AMTn40hnFlWyYjh0K Hen2uIbbyCWqqQz67j0fn7ZxkPEwoP0czeIf+HDavfbVvAJW93JwmVFVnMcjmoIIKkJT nN75Zr3wLRzdFRyyNF9W9Xg4eJhz4tnTjRHUnMcsxWEqq/ABdqri41h/mCV3jcNrEujq tNnkMb+ZRqjbro7BaCdcFiOYPoIPimXoNY04OWn9fAXjp27Q4d53PCG2KhlQLU2KHI5V tqyZO7RUvwGAdMJ454OOwpX03rdv+vthFVCsoJq7gg+I8tXbEn4N6kfbiR7uDUECr+HB QxYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AM7Gq2jOV4dbK3462f+4KxUlDglr1JJY6/EwGuMEDig=; b=pc2DfLXNr9EJYUcfLQ8Dr71HCs2kihqnAZZPFL04qbumpBqDGqA4dLanFikaLVDO5k bB1j47oc+yvJ85+MyiFKulzDFeX4KJj76e5V2M+u7wkM0iQX0eAMrFBfSfoD1tkIqJZk m9hGFrfJ/gj4E7uaF5vdF051nOAYBnlI7SGT7CKT+b+t6e0bmy46GS2KOZIAmbiiXaGG QbQ2o0M92PCLK8R0gU39HWWRiFRRx8BLaYit2p+mw++EB8k49RqeSo3ia69a7jxwxKIY dfdWLr2do0IBlfSrqSp/jNzZHp7Qh2a803xayvHxT+3DeKS5oBzVVlGmReMWn2A81bzK WfVw== X-Gm-Message-State: AIkVDXKSn0MOREG4TeDCCpy9tu9ltl6H/nHTC/uko6yx2VhAWWv0APPGhf4ou6PSiO9XUBmjb/unRpEhwz0GeA== X-Received: by 10.202.55.70 with SMTP id e67mr41218858oia.51.1483836771004; Sat, 07 Jan 2017 16:52:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.12.152 with HTTP; Sat, 7 Jan 2017 16:52:50 -0800 (PST) In-Reply-To: <20170108003730.hlcqkhdxtah65z66@pd.tnic> References: <20170107204227.bwdb5yzrjpiggkmo@pd.tnic> <4034dde8-ffc1-18e2-f40c-00cf37471793@intel.com> <20170108000702.wrov5ajeou2y3tuy@pd.tnic> <20170108003730.hlcqkhdxtah65z66@pd.tnic> From: "Rafael J. Wysocki" Date: Sun, 8 Jan 2017 01:52:50 +0100 X-Google-Sender-Auth: B2Crd8GAqyzWMnAyzN-xh44TcSs Message-ID: Subject: Re: 174cc7187e6f ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel To: Borislav Petkov Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Lv Zheng , Bob Moore , =?UTF-8?B?SsO2cmcgUsO2ZGVs?= , lkml , Linux ACPI Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Jan 8, 2017 at 1:37 AM, Borislav Petkov wrote: > On Sun, Jan 08, 2017 at 01:22:55AM +0100, Rafael J. Wysocki wrote: >> Is an IVRS table actually present on this machine? > > Like this? > > [ 0.000000] ACPI: IVRS 0x000000009CFD6000 0000D0 (v02 AMD AGESA 00000001 AMD 00000000) Yup. So we get the table, but apparently we crash when we attempt to put it. Let's try to check the obvious just to rule it out (see attached), but honestly I'm not sure what's going on in there. Thanks, Rafael --- drivers/iommu/amd_iommu_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Index: linux-pm/drivers/iommu/amd_iommu_init.c =================================================================== --- linux-pm.orig/drivers/iommu/amd_iommu_init.c +++ linux-pm/drivers/iommu/amd_iommu_init.c @@ -2337,8 +2337,10 @@ static int __init early_amd_iommu_init(v out: /* Don't leak any ACPI memory */ - acpi_put_table(ivrs_base); - ivrs_base = NULL; + if (ivrs_base) { + acpi_put_table(ivrs_base); + ivrs_base = NULL; + } return ret; } @@ -2372,7 +2374,8 @@ static bool detect_ivrs(void) return false; } - acpi_put_table(ivrs_base); + if (ivrs_base) + acpi_put_table(ivrs_base); /* Make sure ACS will be enabled during PCI probe */ pci_request_acs();