linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Julien Grall <julien.grall@arm.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xen.org, sstabellini@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: xen: Implement EFI reset_system callback
Date: Thu, 6 Apr 2017 19:39:18 +0200	[thread overview]
Message-ID: <b6cd0d59-9569-2958-9cc7-c971139881f4@suse.com> (raw)
In-Reply-To: <20170406164309.GM4372@olila.local.net-space.pl>

On 06/04/17 18:43, Daniel Kiper wrote:
> On Thu, Apr 06, 2017 at 06:22:44PM +0200, Juergen Gross wrote:
>> On 06/04/17 18:06, Daniel Kiper wrote:
>>> Hi Julien,
>>>
>>> On Thu, Apr 06, 2017 at 04:39:13PM +0100, Julien Grall wrote:
>>>> Hi Daniel,
>>>>
>>>> On 06/04/17 16:20, Daniel Kiper wrote:
>>>>> 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:
>>>>>
>>>>> --- 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())
>>>>>
>>>>>
>>>>> 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.
>>>>
>>>> This sounds good for power off (I haven't tried to power off DOM0
>>>> yet). But this will not solve the restart problem (see
>>>> machine_restart in arch/arm64/kernel/process.c) which call directly
>>>> efi_reboot.
>>>
>>> Hmmm... It seems to me that efi.reset_system override with empty function
>>> in arch/arm/xen/efi.c is the best solution. So, I see three patches here.
>>> One for drivers/firmware/efi/reboot.c, one for arch/arm/xen/efi.c and one
>>> for arch/arm64/kernel/efi.c. Does it make sense?
>>
>> I still think the empty function should be in drivers/xen/efi.c and we
>> should use it in arch/x86/xen/efi.c, too.
> 
> If you wish we can go that way too. Though I thing that we should fix
> drivers/firmware/efi/reboot.c:efi_shutdown_init() too. Just in case.

Sure, go ahead. I won't object.


Juergen

  reply	other threads:[~2017-04-06 17:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 18:14 [PATCH] arm64: xen: Implement EFI reset_system callback Julien Grall
2017-04-05 19:49 ` Boris Ostrovsky
2017-04-06  6:23   ` Juergen Gross
2017-04-06  8:32     ` Julien Grall
2017-04-06  8:37       ` Juergen Gross
2017-04-06 14:27       ` Daniel Kiper
2017-04-06 14:32         ` Julien Grall
2017-04-06 14:37           ` Boris Ostrovsky
2017-04-06 14:38         ` Juergen Gross
2017-04-06 15:20           ` Daniel Kiper
2017-04-06 15:39             ` Julien Grall
2017-04-06 15:55               ` Mark Rutland
2017-04-18 13:46                 ` Matt Fleming
2017-04-19 19:29                   ` Daniel Kiper
2017-04-19 19:37                     ` Matt Fleming
2017-04-19 19:43                       ` Daniel Kiper
2017-04-06 16:06               ` Daniel Kiper
2017-04-06 16:22                 ` Juergen Gross
2017-04-06 16:43                   ` Daniel Kiper
2017-04-06 17:39                     ` Juergen Gross [this message]
2017-04-18 18:37                       ` Stefano Stabellini
2017-04-18 18:43                         ` Juergen Gross
2017-04-18 18:46                           ` Stefano Stabellini
2017-04-18 18:51                             ` Juergen Gross
2017-04-20 18:09                               ` Julien Grall
2017-04-05 21:26 ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6cd0d59-9569-2958-9cc7-c971139881f4@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=daniel.kiper@oracle.com \
    --cc=julien.grall@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).