From patchwork Thu Apr 6 15:20:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9667645 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 7A5A8601EB for ; Thu, 6 Apr 2017 15:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DDAA2858A for ; Thu, 6 Apr 2017 15:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02C83285A3; Thu, 6 Apr 2017 15:21:22 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 BD1172858A for ; Thu, 6 Apr 2017 15:21:21 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hSoeYkNtLtCfpMwPBVxlXuZeptUMGCQp7BaiapR0YXc=; b=jbAYfez160fFDw q2E4ckeKG82az/3Tr5B68gnIiCetu25OqruI8Yo0oa0hXwzvCecMsf+xhkcVkL/mcpm4T+EfxgTln 2FzjzRiV4fdbTZ3tpIKhgzKjstVC8xPYyehDelw3DlFVRkYajN6FgEURQKPTvqCoeBA0gMdE8HMFH MfQhjiCF9pDy4hgBpSMStqgWdwf69a/qR2NTcuy5ONDJfnJQHuVRSE/JZYXWz1SSdNj1rKqOk8fx6 BeHPiNrrWzSMs8M16P6JY6aVEY5lvUpMCEzboHThV5Y9rqdSHk4H5Rvg/jr/EJSEKyWTHHLsVvyJb lLjnGuKb32aawihYbWyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cw9Dr-0003mz-1C; Thu, 06 Apr 2017 15:21:19 +0000 Received: from userp1040.oracle.com ([156.151.31.81]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cw9Dn-0003jo-1O for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2017 15:21:16 +0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v36FKkXt031553 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Apr 2017 15:20:47 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v36FKkDl028893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Apr 2017 15:20:46 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v36FKjtv002610; Thu, 6 Apr 2017 15:20:45 GMT Received: from olila.local.net-space.pl (/10.175.182.106) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Apr 2017 08:20:44 -0700 Date: Thu, 6 Apr 2017 17:20:40 +0200 From: Daniel Kiper To: Juergen Gross Subject: Re: [PATCH] arm64: xen: Implement EFI reset_system callback Message-ID: <20170406152040.GH4372@olila.local.net-space.pl> References: <20170405181417.15985-1-julien.grall@arm.com> <3f6f5853-cd08-8afc-f71a-b0c1545c7564@arm.com> <20170406142710.GE4372@olila.local.net-space.pl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170406_082115_140019_FEC68D08 X-CRM114-Status: GOOD ( 20.63 ) 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: sstabellini@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xen.org, Julien Grall , Boris Ostrovsky , linux-arm-kernel@lists.infradead.org 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 On Thu, Apr 06, 2017 at 04:38:24PM +0200, Juergen Gross wrote: > On 06/04/17 16:27, Daniel Kiper wrote: > > On Thu, Apr 06, 2017 at 09:32:32AM +0100, Julien Grall wrote: > >> Hi Juergen, > >> > >> On 06/04/17 07:23, Juergen Gross wrote: > >>> On 05/04/17 21:49, Boris Ostrovsky wrote: > >>>> On 04/05/2017 02:14 PM, Julien Grall wrote: > >>>>> The x86 code has theoritically a similar issue, altought EFI does not > >>>>> seem to be the preferred method. I have left it unimplemented on x86 and > >>>>> CCed Linux Xen x86 maintainers to know their view here. > >>>> > >>>> (+Daniel) > >>>> > >>>> This could be a problem for x86 as well, at least theoretically. > >>>> xen_machine_power_off() may call pm_power_off(), which is efi.reset_system. > >>>> > >>>> So I think we should have a similar routine there. > >>> > >>> +1 > >>> > >>> I don't see any problem with such a routine added, in contrast to > >>> potential "reboots" instead of power off without it. > >>> > >>> So I think this dummy xen_efi_reset_system() should be added to > >>> drivers/xen/efi.c instead. > >> > >> I will resend the patch during day with xen_efi_reset_system moved > >> to common code and implement the x86 counterpart (thought, I will > >> not be able to test it). > > > > I think that this is ARM specific issue. On x86 machine_restart() calls > > xen_restart(). Hence, everything works. So, I think that it should be > > fixed only for ARM. Anyway, please CC me when you send a patch. > > What about xen_machine_power_off() (as stated in Boris' mail)? Guys what do you think about that: Julien, for ARM64 please take a look at arch/arm64/kernel/efi.c:efi_poweroff_required(void). I hope that tweaks for both files should solve our problem. Daniel --- a/drivers/firmware/efi/reboot.c +++ b/drivers/firmware/efi/reboot.c @@ -55,7 +55,7 @@ static void efi_power_off(void) static int __init efi_shutdown_init(void) { - if (!efi_enabled(EFI_RUNTIME_SERVICES)) + if (!efi_enabled(EFI_RUNTIME_SERVICES) || efi_enabled(EFI_PARAVIRT)) return -ENODEV; if (efi_poweroff_required())