All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <Andrew.Cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
	David Vrabel <dvrabel@cantab.net>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/kexec: Fix kexec-reboot with CET active
Date: Tue, 8 Mar 2022 16:22:12 +0000	[thread overview]
Message-ID: <d6112602-b488-0b63-0131-fedd39c05eae@citrix.com> (raw)
In-Reply-To: <c3d9a1db-bda0-22f4-6733-11dfbb1bebfb@suse.com>

On 08/03/2022 08:15, Jan Beulich wrote:
> On 07.03.2022 21:53, Andrew Cooper wrote:
>> --- a/xen/arch/x86/machine_kexec.c
>> +++ b/xen/arch/x86/machine_kexec.c
>> @@ -156,6 +156,16 @@ void machine_kexec(struct kexec_image *image)
>>       */
>>      local_irq_disable();
>>  
>> +    /* Reset CPUID masking and faulting to the host's default. */
>> +    ctxt_switch_levelling(NULL);
>> +
>> +    /* Disable CET. */
>> +    if ( read_cr4() & X86_CR4_CET )
>> +    {
>> +        wrmsrl(MSR_S_CET, 0);
>> +        write_cr4(read_cr4() & ~X86_CR4_CET);
>> +    }
>> +
>>      /* Now regular interrupts are disabled, we need to reduce the impact
>>       * of interrupts not disabled by 'cli'.
>>       *
> Besides introducing somewhat of a disconnect between the comment in
> context here and the earlier local_irq_disable(), is it really
> necessary to do both actions with IRQs off?

We are a handful of instructions away from discarding Xen's context
entirely.  IRQs are not a relevant concern.

If we're nitpicking, irqs want to be off before kexecing gets set,
because absolutely nothing good can come of handling interrupts later
than that point.

~Andrew

  reply	other threads:[~2022-03-08 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 20:53 [PATCH] x86/kexec: Fix kexec-reboot with CET active Andrew Cooper
2022-03-07 22:11 ` David Vrabel
2022-03-08  8:15 ` Jan Beulich
2022-03-08 16:22   ` Andrew Cooper [this message]
2022-03-08 16:48     ` Jan Beulich
2022-03-30  9:00 ` Jan Beulich

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=d6112602-b488-0b63-0131-fedd39c05eae@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=dvrabel@cantab.net \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.