mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3] x86/boot: skip realmode init code when running as Xen PV guest
Date: Thu, 24 Nov 2022 14:30:39 +0100	[thread overview]
Message-ID: <a1fc1d88-2112-2b81-52bc-cbfb6736edf0@suse.com> (raw)
In-Reply-To: <Y39xcnKCkbYQZjaE@zn.tnic>


[-- Attachment #1.1.1: Type: text/plain, Size: 1967 bytes --]

On 24.11.22 14:28, Borislav Petkov wrote:
> On Wed, Nov 23, 2022 at 12:45:23PM +0100, Juergen Gross wrote:
>> When running as a Xen PV guest there is no need for setting up the
>> realmode trampoline, as realmode isn't supported in this environment.
>>
>> Trying to setup the trampoline has been proven to be problematic in
>> some cases, especially when trying to debug early boot problems with
>> Xen requiring to keep the EFI boot-services memory mapped (some
>> firmware variants seem to claim basically all memory below 1M for boot
>> services).
>>
>> Introduce new x86_platform_ops operations for that purpose, which can
>> be set to a nop by the Xen PV specific kernel boot code.
>>
>> Fixes: 084ee1c641a0 ("x86, realmode: Relocator for realmode code")
> 
> This text and Fixes: tag sounds like this needs to go to Linus and
> stable now?

Looking at the date when 084ee1c641a0 went in I don't think it _needs_
to go in now, but I wouldn't complain ...

> 
>> diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
>> index 41d7669a97ad..247aca9f8ed1 100644
>> --- a/arch/x86/realmode/init.c
>> +++ b/arch/x86/realmode/init.c
>> @@ -200,14 +200,18 @@ static void __init set_real_mode_permissions(void)
>>   	set_memory_x((unsigned long) text_start, text_size >> PAGE_SHIFT);
>>   }
>>   
>> -static int __init init_real_mode(void)
>> +void __init init_real_mode(void)
>>   {
>>   	if (!real_mode_header)
>>   		panic("Real mode trampoline was not allocated");
>>   
>>   	setup_real_mode();
>>   	set_real_mode_permissions();
>> +}
>>   
>> +static int __init call_init_real_mode(void)
>> +{
>> +	x86_platform.realmode_init();
>>   	return 0;
>>   }
>> -early_initcall(init_real_mode);
>> +early_initcall(call_init_real_mode);
> 
> I'll name that one "do_init_real_mode" as "call init" sounds weird.

Fine with me.

> 
> Otherwise, it is as straightforward as it gets.

Thanks,


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2022-11-24 13:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 11:45 Juergen Gross
2022-11-24 13:28 ` Borislav Petkov
2022-11-24 13:30   ` Juergen Gross [this message]
2022-11-24 15:35     ` Borislav Petkov
2022-11-24 15:36       ` Juergen Gross
2022-11-25 11:11 ` [tip: x86/boot] x86/boot: Skip " tip-bot2 for Juergen Gross

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=a1fc1d88-2112-2b81-52bc-cbfb6736edf0@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®