Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8901853rwb; Thu, 24 Nov 2022 05:47:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf7WpabvZo2BdOYmLF9A9LI2IS2FaDz8WPRmIGlhSb/gpKES6cAkQDIQGJTE6DTlSMRWiQoR X-Received: by 2002:a17:902:ce04:b0:187:3a54:9b93 with SMTP id k4-20020a170902ce0400b001873a549b93mr22343224plg.2.1669297661799; Thu, 24 Nov 2022 05:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669297661; cv=none; d=google.com; s=arc-20160816; b=O67/jMZ4FOoHXH8SKiY1q/yaYD2VD/lTm6gS/hWjDV72sgaZzna9iBMthYWoe4jdVP HpGv3wBdnnyy4IW8PmhhIVbgWixgs3mdFdGce98PtjRQzbMNicUe3hByvzxbLvCHeS02 j9UNDvmv+zCWyaSxWPM9bn02W/CjmO9z5p821W2uh+uQFgooBK0HbVWZFEgbvOTjdfS3 jCGy05obQl2dPMxk2KM2R8bOnkTpSmQrNJUpizwlbyPRLR8/jJgnoPgW4vHKGLWFisxF 8OYEqk3wdhK6f2Mb8YmOxGu1ENOSCq3EgZv711U1/gPrC+MWyNjZxLLRCbhw/ydHs0NK BOuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TaewtBDqu/25yf994GoEuh2zYLDng8qjigaVQ1a0K4s=; b=Wl9gnznwIFBR927OcQbFMkD/oUKg23YzK3XUBKeYdT6MTpY68izztZOkKYXTQd6YUf d6oGNYzZFkG/+roQNY9z2YsZrEj5xvRylzA4qxsRQqNM84f711mwrzAGdo2nk5df6eqb +YS5yjXwwuPwczLCHGlPtzk221F9lCSg0P0sumjlXtQPJk/dbH5lJX+RFoxClWmc63sG YBN1MX5vWmY57Z9MMCeCDkijZBYw3pZ22NJ4bIZL854GqXuGny++NQuSOr6UVIaI9f0R /uZxqJ+qcbHcSQ22VIDGIGxZm49zghfydKJDCQ0Vp8p/io3DhfteEnMVZlX6KDamIm2f quyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=SbVhENha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a170902b49400b00179f9521d08si1046163plr.149.2022.11.24.05.47.30; Thu, 24 Nov 2022 05:47:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=SbVhENha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbiKXN2Z (ORCPT + 86 others); Thu, 24 Nov 2022 08:28:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbiKXN2Y (ORCPT ); Thu, 24 Nov 2022 08:28:24 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A84EE0EB for ; Thu, 24 Nov 2022 05:28:23 -0800 (PST) Received: from zn.tnic (p200300ea9733e75b329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e75b:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3032A1EC0495; Thu, 24 Nov 2022 14:28:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1669296502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=TaewtBDqu/25yf994GoEuh2zYLDng8qjigaVQ1a0K4s=; b=SbVhENhafFgnim1V36S6iVUKMezXbe45j39COpUhd1soYaGLp7QFv0k7XjQFy0RmES4RxU j5JjT1hwld9O5UxgxOdbN4h+IWSAzYsTIL+/dRqJiPnk0QngX+Nfx5c7y/bH4esqY4K1s4 rPW3eB3RyGATypLILLooN+oN8KNmlow= Date: Thu, 24 Nov 2022 14:28:18 +0100 From: Borislav Petkov To: Juergen Gross Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Boris Ostrovsky , xen-devel@lists.xenproject.org Subject: Re: [PATCH v3] x86/boot: skip realmode init code when running as Xen PV guest Message-ID: References: <20221123114523.3467-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221123114523.3467-1-jgross@suse.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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. Otherwise, it is as straightforward as it gets. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette