kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: kexec@lists.infradead.org
Subject: [PATCH v2 07/12] x86/sev: Setup code to park APs in the AP Jump Table
Date: Wed, 26 Jan 2022 15:26:01 +0100	[thread overview]
Message-ID: <YfFZ+SRutJhDoAkz@suse.de> (raw)
In-Reply-To: <YYv1TPawuorQv1PR@zn.tnic>

On Wed, Nov 10, 2021 at 05:37:32PM +0100, Borislav Petkov wrote:
> On Mon, Sep 13, 2021 at 05:55:58PM +0200, Joerg Roedel wrote:
> >  extern unsigned char real_mode_blob[];
> > diff --git a/arch/x86/include/asm/sev-ap-jumptable.h b/arch/x86/include/asm/sev-ap-jumptable.h
> > new file mode 100644
> > index 000000000000..1c8b2ce779e2
> > --- /dev/null
> > +++ b/arch/x86/include/asm/sev-ap-jumptable.h
> 
> Why a separate header? arch/x86/include/asm/sev.h looks small enough.

The header is included in assembly, so I made a separate one.

> > +void __init sev_es_setup_ap_jump_table_data(void *base, u32 pa)
> 
> Why is this a separate function?
> 
> It is all part of the jump table setup.

Right, but the sev_es_setup_ap_jump_table_blob() function is already
pretty big and I wanted to keep things readable.

> 
> > +		return 0;
> 
> Why are you returning 0 here and below?

This is in an initcall and it returns just 0 when the environment is not
ready to setup the ap jump table. Returning non-zero would create a
warning message in the caller for something that is not a bug in the
kernel.

> > + * This file contains the source code for the binary blob which gets copied to
> > + * the SEV-ES AP Jumptable to park APs while offlining CPUs or booting a new
> 
> I've seen "Jumptable", "Jump Table" and "jump table" at least. I'd say, do
> the last one everywhere pls.

Fair, sorry for my english being too german :) I changed everything to
'jump table'.

> > +	/* Reset remaining registers */
> > +	movl	$0, %esp
> > +	movl	$0, %eax
> > +	movl	$0, %ebx
> > +	movl	$0, %edx
> 
> All 4: use xor

XOR changes EFLAGS, can not use them here.

> > +
> > +	/* Reset CR0 to get out of protected mode */
> > +	movl	$0x60000010, %ecx
> 
> Another magic naked number.

This is the CR0 reset value. I have updated the comment to make this
more clear.

Thanks,

-- 
J?rg R?del
jroedel at suse.de

SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 N?rnberg
Germany
 
(HRB 36809, AG N?rnberg)
Gesch?ftsf?hrer: Ivo Totev



  reply	other threads:[~2022-01-26 14:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210913155603.28383-1-joro@8bytes.org>
2021-09-13 16:02 ` [PATCH v2 00/12] x86/sev: KEXEC/KDUMP support for SEV-ES guests Dave Hansen
2021-09-13 16:14   ` Joerg Roedel
2021-09-13 16:21     ` Dave Hansen
     [not found] ` <20210913155603.28383-2-joro@8bytes.org>
2021-11-01 16:10   ` [PATCH v2 01/12] kexec: Allow architecture code to opt-out at runtime Borislav Petkov
2021-11-01 21:11     ` Eric W. Biederman
2021-11-02 16:37       ` Joerg Roedel
2021-11-02 17:00       ` Joerg Roedel
2021-11-02 18:17         ` Eric W. Biederman
2021-11-02 17:17       ` Borislav Petkov
     [not found] ` <20210913155603.28383-4-joro@8bytes.org>
2021-11-03 14:27   ` [PATCH v2 03/12] x86/sev: Save and print negotiated GHCB protocol version Borislav Petkov
2022-01-26  9:27     ` Joerg Roedel
     [not found] ` <20210913155603.28383-6-joro@8bytes.org>
2021-11-03 16:05   ` [PATCH v2 05/12] x86/sev: Use GHCB protocol version 2 if supported Borislav Petkov
     [not found] ` <20210913155603.28383-7-joro@8bytes.org>
2021-11-08 18:14   ` [PATCH v2 06/12] x86/sev: Cache AP Jump Table Address Borislav Petkov
     [not found] ` <20210913155603.28383-8-joro@8bytes.org>
2021-11-10 16:37   ` [PATCH v2 07/12] x86/sev: Setup code to park APs in the AP Jump Table Borislav Petkov
2022-01-26 14:26     ` Joerg Roedel [this message]
     [not found] ` <20210913155603.28383-9-joro@8bytes.org>
2021-11-12 16:33   ` [PATCH v2 08/12] x86/sev: Park APs on AP Jump Table with GHCB protocol version 2 Borislav Petkov
2022-01-27  9:01     ` Joerg Roedel
     [not found] ` <20210913155603.28383-10-joro@8bytes.org>
2021-11-15 18:44   ` [PATCH v2 09/12] x86/sev: Use AP Jump Table blob to stop CPU Borislav Petkov

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=YfFZ+SRutJhDoAkz@suse.de \
    --to=jroedel@suse.de \
    --cc=kexec@lists.infradead.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).