[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/kexec: Fix kexec-reboot with CET active


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Mar 2022 09:15:37 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X1s6mjjH7R8wg503B6pqhzr81HIXl+9NtbdwV2yhnIg=; b=fpLCTemt12KKu+ZZnuaHkrOGOx2cLrUysqoqq2Z9NaM95BbIAbnJk6OrEasXlRoXNj48Ioh2Qmdu2vzt6On0uqwiU/dmtIcnP1KE+t6WfD5Ibf5m/3u0zAB/oTNIqnT5kHPGAI8uJsCaHZDaNUstoWzU/wMZFHQYUXoMKYSz4PKA+jj87bnVvuyxyMjw0AF/ze0HzkDz6+dOGzhnd8HRm8gTFbPuM5qV/m5O2KQVh7bzglkb8aRbUaklATUFT/WST55B8vUQHGhcHRnIg+x8xvxqjkf4oitS6pzKuWusx4UMLGb9RMlfcShoM6UA7mxYMRg4NcqOBFvi5w6zeNKrcQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QhtA1B4gj7hzXngsYzu6NeGToxyTa9vxMxhUhHqU5woEeiC0u+IvhSBBbyOjDjSumeJoLGZAUSuuoQOUkZlgXXuEF0hIJXEoGdwI1E3SkuvNx1U+U6HNUJ8Vz9GTadraXjlLerl5/XcKa2XgSEaszy54Ba8BwznUQbTTDy8E7TFaO3LyySuJUYWsMehFcOZS5P+PsQpjPkCpvdzk3E/fSUSd8FFx0xAZ4++9PcBs49sw2CXmJVkSnJD1qGvAfel7nV97cq9DA/SEAy8UKcNweMKa1D5Vj+Nd4OF3SFGz58GDzbXkENJh+idjkIiDqphJuSHiSPaWwvdMyLjut2tAvA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, David Vrabel <dvrabel@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 08 Mar 2022 08:15:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.