All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] xen/manage: enable C_A_D to force reboot
@ 2020-05-13 23:34 ` Dongli Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Dongli Zhang @ 2020-05-13 23:34 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: boris.ostrovsky, jgross, sstabellini, joe.jin, rose.wang

The systemd may be configured to mask ctrl-alt-del via "systemctl mask
ctrl-alt-del.target". As a result, the pv reboot would not work as signal
is ignored.

This patch always enables C_A_D before the call of ctrl_alt_del() in order
to force the reboot.

Reported-by: Rose Wang <rose.wang@oracle.com>
Cc: Joe Jin <joe.jin@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/xen/manage.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index cd046684e0d1..3190d0ecb52e 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -204,6 +204,13 @@ static void do_poweroff(void)
 static void do_reboot(void)
 {
 	shutting_down = SHUTDOWN_POWEROFF; /* ? */
+	/*
+	 * The systemd may be configured to mask ctrl-alt-del via
+	 * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
+	 * would not work. To enable C_A_D would force the reboot.
+	 */
+	C_A_D = 1;
+
 	ctrl_alt_del();
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/1] xen/manage: enable C_A_D to force reboot
@ 2020-05-13 23:34 ` Dongli Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Dongli Zhang @ 2020-05-13 23:34 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: jgross, rose.wang, boris.ostrovsky, sstabellini, joe.jin

The systemd may be configured to mask ctrl-alt-del via "systemctl mask
ctrl-alt-del.target". As a result, the pv reboot would not work as signal
is ignored.

This patch always enables C_A_D before the call of ctrl_alt_del() in order
to force the reboot.

Reported-by: Rose Wang <rose.wang@oracle.com>
Cc: Joe Jin <joe.jin@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/xen/manage.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index cd046684e0d1..3190d0ecb52e 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -204,6 +204,13 @@ static void do_poweroff(void)
 static void do_reboot(void)
 {
 	shutting_down = SHUTDOWN_POWEROFF; /* ? */
+	/*
+	 * The systemd may be configured to mask ctrl-alt-del via
+	 * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
+	 * would not work. To enable C_A_D would force the reboot.
+	 */
+	C_A_D = 1;
+
 	ctrl_alt_del();
 }
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] xen/manage: enable C_A_D to force reboot
  2020-05-13 23:34 ` Dongli Zhang
@ 2020-05-15  7:01   ` Jürgen Groß
  -1 siblings, 0 replies; 6+ messages in thread
From: Jürgen Groß @ 2020-05-15  7:01 UTC (permalink / raw)
  To: Dongli Zhang, xen-devel, linux-kernel
  Cc: boris.ostrovsky, sstabellini, joe.jin, rose.wang

On 14.05.20 01:34, Dongli Zhang wrote:
> The systemd may be configured to mask ctrl-alt-del via "systemctl mask
> ctrl-alt-del.target". As a result, the pv reboot would not work as signal
> is ignored.
> 
> This patch always enables C_A_D before the call of ctrl_alt_del() in order
> to force the reboot.

Hmm, I'm not sure this is a good idea.

Suppose a guest admin is doing a critical update and wants to avoid a
sudden reboot in between. By masking the reboot this would be possible,
with your patch it isn't.

In case a reboot is really mandatory it would still be possible to just
kill the guest.

I'm not completely opposed to the patch, but I think this is a change
which should not be done easily.


Juergen

> 
> Reported-by: Rose Wang <rose.wang@oracle.com>
> Cc: Joe Jin <joe.jin@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
>   drivers/xen/manage.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index cd046684e0d1..3190d0ecb52e 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -204,6 +204,13 @@ static void do_poweroff(void)
>   static void do_reboot(void)
>   {
>   	shutting_down = SHUTDOWN_POWEROFF; /* ? */
> +	/*
> +	 * The systemd may be configured to mask ctrl-alt-del via
> +	 * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
> +	 * would not work. To enable C_A_D would force the reboot.
> +	 */
> +	C_A_D = 1;
> +
>   	ctrl_alt_del();
>   }
>   
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] xen/manage: enable C_A_D to force reboot
@ 2020-05-15  7:01   ` Jürgen Groß
  0 siblings, 0 replies; 6+ messages in thread
From: Jürgen Groß @ 2020-05-15  7:01 UTC (permalink / raw)
  To: Dongli Zhang, xen-devel, linux-kernel
  Cc: rose.wang, boris.ostrovsky, sstabellini, joe.jin

On 14.05.20 01:34, Dongli Zhang wrote:
> The systemd may be configured to mask ctrl-alt-del via "systemctl mask
> ctrl-alt-del.target". As a result, the pv reboot would not work as signal
> is ignored.
> 
> This patch always enables C_A_D before the call of ctrl_alt_del() in order
> to force the reboot.

Hmm, I'm not sure this is a good idea.

Suppose a guest admin is doing a critical update and wants to avoid a
sudden reboot in between. By masking the reboot this would be possible,
with your patch it isn't.

In case a reboot is really mandatory it would still be possible to just
kill the guest.

I'm not completely opposed to the patch, but I think this is a change
which should not be done easily.


Juergen

> 
> Reported-by: Rose Wang <rose.wang@oracle.com>
> Cc: Joe Jin <joe.jin@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
>   drivers/xen/manage.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index cd046684e0d1..3190d0ecb52e 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -204,6 +204,13 @@ static void do_poweroff(void)
>   static void do_reboot(void)
>   {
>   	shutting_down = SHUTDOWN_POWEROFF; /* ? */
> +	/*
> +	 * The systemd may be configured to mask ctrl-alt-del via
> +	 * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
> +	 * would not work. To enable C_A_D would force the reboot.
> +	 */
> +	C_A_D = 1;
> +
>   	ctrl_alt_del();
>   }
>   
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] xen/manage: enable C_A_D to force reboot
  2020-05-15  7:01   ` Jürgen Groß
@ 2020-05-15 17:26     ` Boris Ostrovsky
  -1 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2020-05-15 17:26 UTC (permalink / raw)
  To: Jürgen Groß, Dongli Zhang, xen-devel, linux-kernel
  Cc: sstabellini, joe.jin, rose.wang

On 5/15/20 3:01 AM, Jürgen Groß wrote:
> On 14.05.20 01:34, Dongli Zhang wrote:
>> The systemd may be configured to mask ctrl-alt-del via "systemctl mask
>> ctrl-alt-del.target". As a result, the pv reboot would not work as
>> signal
>> is ignored.
>>
>> This patch always enables C_A_D before the call of ctrl_alt_del() in
>> order
>> to force the reboot.
>
> Hmm, I'm not sure this is a good idea.
>
> Suppose a guest admin is doing a critical update and wants to avoid a
> sudden reboot in between. By masking the reboot this would be possible,
> with your patch it isn't.
>
> In case a reboot is really mandatory it would still be possible to just
> kill the guest.
>
> I'm not completely opposed to the patch, but I think this is a change
> which should not be done easily.


I think 'xl reboot -F' should do be handling this scenario but (1) it is
currently not quite set up for this and (2) I can't see how it works at
all given that noone handles LIBXL_TRIGGER_RESET in
arch_do_domctl(XEN_DOMCTL_sendtrigger).


-boris


>
>
> Juergen
>
>>
>> Reported-by: Rose Wang <rose.wang@oracle.com>
>> Cc: Joe Jin <joe.jin@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
>> ---
>>   drivers/xen/manage.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
>> index cd046684e0d1..3190d0ecb52e 100644
>> --- a/drivers/xen/manage.c
>> +++ b/drivers/xen/manage.c
>> @@ -204,6 +204,13 @@ static void do_poweroff(void)
>>   static void do_reboot(void)
>>   {
>>       shutting_down = SHUTDOWN_POWEROFF; /* ? */
>> +    /*
>> +     * The systemd may be configured to mask ctrl-alt-del via
>> +     * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
>> +     * would not work. To enable C_A_D would force the reboot.
>> +     */
>> +    C_A_D = 1;
>> +
>>       ctrl_alt_del();
>>   }
>>  
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] xen/manage: enable C_A_D to force reboot
@ 2020-05-15 17:26     ` Boris Ostrovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2020-05-15 17:26 UTC (permalink / raw)
  To: Jürgen Groß, Dongli Zhang, xen-devel, linux-kernel
  Cc: rose.wang, sstabellini, joe.jin

On 5/15/20 3:01 AM, Jürgen Groß wrote:
> On 14.05.20 01:34, Dongli Zhang wrote:
>> The systemd may be configured to mask ctrl-alt-del via "systemctl mask
>> ctrl-alt-del.target". As a result, the pv reboot would not work as
>> signal
>> is ignored.
>>
>> This patch always enables C_A_D before the call of ctrl_alt_del() in
>> order
>> to force the reboot.
>
> Hmm, I'm not sure this is a good idea.
>
> Suppose a guest admin is doing a critical update and wants to avoid a
> sudden reboot in between. By masking the reboot this would be possible,
> with your patch it isn't.
>
> In case a reboot is really mandatory it would still be possible to just
> kill the guest.
>
> I'm not completely opposed to the patch, but I think this is a change
> which should not be done easily.


I think 'xl reboot -F' should do be handling this scenario but (1) it is
currently not quite set up for this and (2) I can't see how it works at
all given that noone handles LIBXL_TRIGGER_RESET in
arch_do_domctl(XEN_DOMCTL_sendtrigger).


-boris


>
>
> Juergen
>
>>
>> Reported-by: Rose Wang <rose.wang@oracle.com>
>> Cc: Joe Jin <joe.jin@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
>> ---
>>   drivers/xen/manage.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
>> index cd046684e0d1..3190d0ecb52e 100644
>> --- a/drivers/xen/manage.c
>> +++ b/drivers/xen/manage.c
>> @@ -204,6 +204,13 @@ static void do_poweroff(void)
>>   static void do_reboot(void)
>>   {
>>       shutting_down = SHUTDOWN_POWEROFF; /* ? */
>> +    /*
>> +     * The systemd may be configured to mask ctrl-alt-del via
>> +     * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot
>> +     * would not work. To enable C_A_D would force the reboot.
>> +     */
>> +    C_A_D = 1;
>> +
>>       ctrl_alt_del();
>>   }
>>  
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-15 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 23:34 [PATCH 1/1] xen/manage: enable C_A_D to force reboot Dongli Zhang
2020-05-13 23:34 ` Dongli Zhang
2020-05-15  7:01 ` Jürgen Groß
2020-05-15  7:01   ` Jürgen Groß
2020-05-15 17:26   ` Boris Ostrovsky
2020-05-15 17:26     ` Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.