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: 9667649 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 7EA56601EB for ; Thu, 6 Apr 2017 15:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19D332858A for ; Thu, 6 Apr 2017 15:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EB7A285A2; Thu, 6 Apr 2017 15:23:24 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8E4F0285A0 for ; Thu, 6 Apr 2017 15:23:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cw9Dt-0008HP-Db; Thu, 06 Apr 2017 15:21:21 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cw9Ds-0008HH-Bn for xen-devel@lists.xen.org; Thu, 06 Apr 2017 15:21:20 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id 14/95-03012-FEC56E85; Thu, 06 Apr 2017 15:21:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRWlGSWpSXmKPExsUyZ7p8oO77mGc RBuv/CVgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmdB98yFmwXqDjQ/pGlgXETbxcjF4eQwCQm iZmTprBAOL8YJfY+O8gK4axnlHi26T5UZiKjxPS2P0AOJweLgIrEvx93mUBsNgEdiYtfHrKD2 CICyhIfW3vZQRqYBR4xSrz5uAasQVjAReLF8eNsXYwcHLwCNhI3LohDDN3AJLFg+imwGl4BQY mTM5+A2cwCWhI3/r1kAqlnFpCWWP6PAyTMCdT6v+MNG4gtCnTDlJPbwGwJAWOJ9rcX2SYwCs5 CMmkWkkmzECYtYGRexahRnFpUllqka2iul1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yf u4kRGLoMQLCD8fbGgEOMkhxMSqK8Cj5PIoT4kvJTKjMSizPii0pzUosPMcpwcChJ8LICY0FIs Cg1PbUiLTMHGEUwaQkOHiUR3h/RQGne4oLE3OLMdIjUKUZdjndLP7xnEmLJy89LlRLnPQpSJA BSlFGaBzcCFtGXGGWlhHkZgY4S4ilILcrNLEGVf8UozsGoBFQBcglPZl4J3KZXQEcwAR3hc+s pyBEliQgpqQZGTcaHL9aFL+d8tj3okqTXrfSnloa7L+9OSZijwtdhvv/+5Cl2lm8bQpcevBcl 3BIxecPFO9usnh9h/KwzMUFzc26o+6KINSFuHrY1e49umfzdSONl6QaVpPhjWku2r+tTvhqSt lbR6p6B58XdszY/Py7xROim0fEev72zu+++X670bqX+97Bn55RYijMSDbWYi4oTAQopX1DjAg AA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1491492077!86631950!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11920 invoked from network); 6 Apr 2017 15:21:18 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 6 Apr 2017 15:21:18 -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 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] Cc: sstabellini@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xen.org, Julien Grall , Boris Ostrovsky , linux-arm-kernel@lists.infradead.org Subject: Re: [Xen-devel] [PATCH] arm64: xen: Implement EFI reset_system callback X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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())