Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbbDGTHe (ORCPT ); Tue, 7 Apr 2015 15:07:34 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:35772 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbbDGTHc (ORCPT ); Tue, 7 Apr 2015 15:07:32 -0400 MIME-Version: 1.0 In-Reply-To: References: <1428326234-10067-1-git-send-email-kuleshovmail@gmail.com> <20150407095228.GA13093@gmail.com> <20150407102445.GA13658@gmail.com> Date: Tue, 7 Apr 2015 12:07:31 -0700 X-Google-Sender-Auth: K_adOKspn6XB9g9ShpT_GmjA5E0 Message-ID: Subject: Re: [PATCH] x86/earlyprintk: setup earlyprintk as early as possible From: Yinghai Lu To: Alexander Kuleshov Cc: Ingo Molnar , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Greg Kroah-Hartman , LKML Content-Type: multipart/mixed; boundary=001a1141bd006a41cb051327204d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7090 Lines: 112 --001a1141bd006a41cb051327204d Content-Type: text/plain; charset=UTF-8 On Tue, Apr 7, 2015 at 3:31 AM, Alexander Kuleshov wrote: > > As i already wrote, i tested it for x86_64 and it works. I will put earlyprintk > setup in the start of the i386_start_kernel, will test it with 32-bit > and resend two > patches if they will be good. No, that is not enough. early_printk would handle not only serial console with io port accessing. You need to make sure all other path including pciserial/dbgp/efi is safe. They are using early_ioremap, and you can not call early_ioremap() before early_ioremap. otherwise you may need to just search "serial string in boot command line" like i did in moving earlycon early patch. Yinghai --001a1141bd006a41cb051327204d Content-Type: text/x-patch; charset=US-ASCII; name="setup_early_console_x1_pa_symbol_before_earlcon.patch" Content-Disposition: attachment; filename="setup_early_console_x1_pa_symbol_before_earlcon.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i87o9jr70 U3ViamVjdDogW1BBVENII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aGVhZC5jCkBAIC02OSwzICs2OSwy OSBAQCB2b2lkIF9faW5pdCByZXNlcnZlX2ViZGFfcmVnaW9uKHZvaWQpCiAJLyogcmVzZXJ2ZSBh bGwgbWVtb3J5IGJldHdlZW4gbG93bWVtIGFuZCB0aGUgMU1CIG1hcmsgKi8KIAltZW1ibG9ja19y ZXNlcnZlKGxvd21lbSwgMHgxMDAwMDAgLSBsb3dtZW0pOwogfQorCit2b2lkIF9faW5pdCBzZXR1 cF9lYXJseV9jb25zb2xlKHZvaWQpCit7CisjaWZkZWYgQ09ORklHX1NFUklBTF84MjUwX0NPTlNP TEUKKwljaGFyIGNvbnN0cls2NF0sICpwLCAqcTsKKworCS8qIENhbiBub3QgaGFuZGxlIG1taW8g dHlwZSA4MjUwIHVhcnQgeWV0LCB0b28gZWFybHkgKi8KKwlwID0gc3Ryc3RyKGJvb3RfY29tbWFu ZF9saW5lLCAiY29uc29sZT11YXJ0ODI1MCxpbywiKTsKKwlpZiAoIXApCisJCXAgPSBzdHJzdHIo Ym9vdF9jb21tYW5kX2xpbmUsICJjb25zb2xlPXVhcnQsaW8sIik7CisJaWYgKCFwKQorCQlyZXR1 cm47CisKKwlwICs9IDg7CS8qIHNpemVvZiAiY29uc29sZT0iICovCisJcSA9IHN0cmNocm51bChw LCAnICcpOworCWlmICgocSAtIHApID49IHNpemVvZihjb25zdHIpKQorCQlyZXR1cm47CisKKwlt ZW1zZXQoY29uc3RyLCAwLCBzaXplb2YoY29uc3RyKSk7CisJbWVtY3B5KGNvbnN0ciwgcCwgcSAt IHApOworCisJbG9ja2RlcF9pbml0KCk7CisKKwlzZXR1cF9lYXJseV9zZXJpYWw4MjUwX2NvbnNv bGUoY29uc3RyKTsKKyNlbmRpZgorfQpJbmRleDogbGludXgtMi42L2FyY2gveDg2L2tlcm5lbC9o ZWFkMzIuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09Ci0tLSBs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NjRfc3RhcnRfcmVzZXJ2 YXRpb25zKGNoYXIgKnJlYWxfbW9kZV9kYXRhKQogewogCS8qIHZlcnNpb24gaXMgYWx3YXlzIG5v dCB6ZXJvIGlmIGl0IGlzIGNvcGllZCAqLwotCWlmICghYm9vdF9wYXJhbXMuaGRyLnZlcnNpb24p CisJaWYgKCFib290X3BhcmFtcy5oZHIudmVyc2lvbikgewogCQljb3B5X2Jvb3RkYXRhKF9fdmEo cmVhbF9tb2RlX2RhdGEpKTsKKwkJc2V0dXBfZWFybHlfY29uc29sZSgpOworCX0KIAogCXJlc2Vy dmVfZWJkYV9yZWdpb24oKTsKIApJbmRleDogbGludXgtMi42L2tlcm5lbC9wcmludGsvcHJpbnRr LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQotLS0gbGludXgtMi42Lm9yaWcva2VybmVsL3ByaW50ay9wcmludGsuYwor KysgbGludXgtMi42L2tlcm5lbC9wcmludGsvcHJpbnRrLmMKQEAgLTI0MDksMTEgKzI0MDksMTQg QEAgdm9pZCByZWdpc3Rlcl9jb25zb2xlKHN0cnVjdCBjb25zb2xlICpuZQogCXN0cnVjdCBjb25z b2xlX2NtZGxpbmUgKmM7CiAKIAlpZiAoY29uc29sZV9kcml2ZXJzKQotCQlmb3JfZWFjaF9jb25z b2xlKGJjb24pCi0JCQlpZiAoV0FSTihiY29uID09IG5ld2NvbiwKLQkJCQkJImNvbnNvbGUgJyVz JWQnIGFscmVhZHkgcmVnaXN0ZXJlZFxuIiwKLQkJCQkJYmNvbi0+bmFtZSwgYmNvbi0+aW5kZXgp KQorCQlmb3JfZWFjaF9jb25zb2xlKGJjb24pIHsKKwkJCS8qIG5vdCBhZ2FpbiAqLworCQkJaWYg KGJjb24gPT0gbmV3Y29uKSB7CisJCQkJcHJpbnRrKEtFUk5fSU5GTyAiY29uc29sZSAnJXMlZCcg YWxyZWFkeSByZWdpc3RlcmVkXG4iLAorCQkJCQliY29uLT5uYW1lLCBiY29uLT5pbmRleCk7CiAJ CQkJcmV0dXJuOworCQkJfQorCX0KIAogCS8qCiAJICogYmVmb3JlIHdlIHJlZ2lzdGVyIGEgbmV3 IENPTl9CT09UIGNvbnNvbGUsIG1ha2Ugc3VyZSB3ZSBkb24ndAo= --001a1141bd006a41cb051327204d-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/