From nobody Mon May 30 13:59:58 2022
X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EFDD81B51EFA
	for <freebsd-arm@mlmmj.nyi.freebsd.org>; Mon, 30 May 2022 14:00:10 +0000 (UTC)
	(envelope-from wlosh@bsdimp.com)
Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4LBcVd6Fkgz3kk6
	for <freebsd-arm@freebsd.org>; Mon, 30 May 2022 14:00:09 +0000 (UTC)
	(envelope-from wlosh@bsdimp.com)
Received: by mail-ua1-x934.google.com with SMTP id 90so3844170uam.8
        for <freebsd-arm@freebsd.org>; Mon, 30 May 2022 07:00:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bsdimp-com.20210112.gappssmtp.com; s=20210112;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=48d6Co8mGoWYlNoakaMKZdHRZ1HTejHCLw0hHlG+gHo=;
        b=TKOd3ih1cwAJ10qg7ZxKWqGM6OMk5TMAt7WICZEcOWT7LLPS4uCLWG7sPbm7JqdZOy
         7IANkxGNgps3UaIPjt0p6YBs72j+ZjqQhYOlnWqqc3W/omKCH8RscrPDIC13YEZQJw1r
         6d9w7LVrd8Ydkpawf9c+FlLCm+Z6JX24+A2/tZAOOmRRrSzPs2j+aJCESXmf/vwqON1V
         Hk8wGVujoKqMjBVpCrg7t9rvtrOYhHCDFky55CuiH04rCOh1JWXz16HmVu6Eer5g68h3
         rTc+cgflHlPZc1geAik2x4R/rnqglw/5X8od5BMHaEIGuQmK/yUn7NVUOsr5s6ZXhEdC
         VXNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20210112;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=48d6Co8mGoWYlNoakaMKZdHRZ1HTejHCLw0hHlG+gHo=;
        b=r6Jpo06ebsTDRwOPcS2dAOv0z08KwAkBltan82KYiINjG+Q8fB6GLxZmS4i5UJ72ey
         nnQqCpUGE0fFTuoH5GrQ1FfaXh8tN0M6XzH5LQj8Ve0gPGtqFtOYl9591nADmmqj5L9a
         e62zJgLdlYQ4icTBvwsikX9KHj4lM6zFJHbIT5zfxHNR9Wln3s6n+i54cpkHU4ODqxe7
         i8+p9y4lAjgm58w+dLflnMrdSV8K4aLB2nnUaan1U/SpOFbN256cL10zUExOT0QC7Y46
         MI3JJFVFyZVJR9xL6VI8ebZnhCVY9UuRulAHZHe7LhKdvh3shWjA5cT7T+Y9v2PsLp1i
         c27Q==
X-Gm-Message-State: AOAM531ZFI0ad4Q6pjpZQRt+mluS54B+Z9QVSJI66DHL02gU67EygYpy
	e+y4laG/ElrGCNr/9nNCZZ3dYV5mFKy46IwmMEN6pA==
X-Google-Smtp-Source: ABdhPJzdz5C4Wp97HRCpdUugx7ok3hBuscDw+YHtl6FCQo0MkVcaWJwTrxCnVUdUwW1vtb/H7r34zpX5qCR6j7GDryw=
X-Received: by 2002:a9f:3109:0:b0:368:c346:6203 with SMTP id
 m9-20020a9f3109000000b00368c3466203mr19317926uab.28.1653919209224; Mon, 30
 May 2022 07:00:09 -0700 (PDT)
List-Id: Porting FreeBSD to ARM processors <freebsd-arm.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-arm
List-Help: <mailto:freebsd-arm+help@freebsd.org>
List-Post: <mailto:freebsd-arm@freebsd.org>
List-Subscribe: <mailto:freebsd-arm+subscribe@freebsd.org>
List-Unsubscribe: <mailto:freebsd-arm+unsubscribe@freebsd.org>
Sender: owner-freebsd-arm@freebsd.org
MIME-Version: 1.0
References: <PSAP153MB05367C6802D76EC6BA352431CCDD9@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
In-Reply-To: <PSAP153MB05367C6802D76EC6BA352431CCDD9@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
From: Warner Losh <imp@bsdimp.com>
Date: Mon, 30 May 2022 07:59:58 -0600
Message-ID: <CANCZdfpjPrXZk15+3oFiYa_4VGkJmDC40-EndVry5WnVXKp05g@mail.gmail.com>
Subject: Re: serial console and comconsole in FreeBSD arm64
To: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Cc: "freebsd-arm@FreeBSD.org" <freebsd-arm@freebsd.org>, "tsoome@FreeBSD.org" <tsoome@freebsd.org>, 
	Wei Hu <weh@microsoft.com>
Content-Type: multipart/alternative; boundary="000000000000f40f0205e03b12ac"
X-Rspamd-Queue-Id: 4LBcVd6Fkgz3kk6
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=TKOd3ih1;
	dmarc=none;
	spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::934) smtp.mailfrom=wlosh@bsdimp.com
X-Spamd-Result: default: False [-3.00 / 15.00];
	 TO_DN_EQ_ADDR_SOME(0.00)[];
	 ARC_NA(0.00)[];
	 R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112];
	 NEURAL_HAM_MEDIUM(-1.00)[-0.996];
	 FROM_HAS_DN(0.00)[];
	 RCPT_COUNT_THREE(0.00)[4];
	 TO_DN_SOME(0.00)[];
	 NEURAL_HAM_LONG(-1.00)[-1.000];
	 MIME_GOOD(-0.10)[multipart/alternative,text/plain];
	 PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org];
	 DMARC_NA(0.00)[bsdimp.com];
	 TO_MATCH_ENVRCPT_SOME(0.00)[];
	 DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+];
	 NEURAL_HAM_SHORT(-1.00)[-1.000];
	 RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::934:from];
	 MLMMJ_DEST(0.00)[freebsd-arm];
	 FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com];
	 R_SPF_NA(0.00)[no SPF record];
	 MIME_TRACE(0.00)[0:+,1:+,2:~];
	 ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
	 FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com];
	 RCVD_TLS_ALL(0.00)[];
	 RCVD_COUNT_TWO(0.00)[2]
X-ThisMailContainsUnwantedMimeParts: N
Status: O
Content-Length: 7093
Lines: 197

--000000000000f40f0205e03b12ac
Content-Type: text/plain; charset="UTF-8"

On Mon, May 30, 2022, 3:31 AM Souradeep Chakrabarti <
schakrabarti@microsoft.com> wrote:

> Hi,
>
>
>
> I am trying to access virtual serial console via Putty and in 13.0 it is
> not working
>
> for both x86 and arm64.
>
>
>
> It is very easy to reproduce:
>
> 1) In Windows Hyper-V set a  FreeBSD 13.0 VM
>
> 2) Use Powershell in Admin privileged mode and run following:
>
>                 Set-VMComPort -VMName <vm_name> -number 1 -path
> \\.\pipe\Testpipe
>
> 2) In another Powershell with Admin privilege run following:
>
>                 Set-VMFirmware -VMName <VM name>  --ConsoleMode COM1
>
> 3) start the VM and open putty to connect the \\.\pipe\Testpipe in serial
> mode.
>
> No output will be seen on putty.
>
Not even from the boot loader? That sure sounds like the automatic fallback
to simple text output isn't happening.

What does:
% sudo efivar --device-path 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut
tell you? (Or run as root if you don't like sudo).

The boot loader grew a non-optional graphics mode that's disabled when the
boot code
detects we're talking to a 'serial port' between 12.x and 13.x. If you are
getting no output
from the loader at all, I suspect this is likely to blame.

> But the same works in FreeBSD 12.3 and Putty gets the output from EFI
> loader for both x86 and arm64.
>
> But during kernel booting the console output does not come in Putty, it
> only comes in vmconnect.exe.
>

So on 12.3, kernel output doesn't come out of both? Do you have
boot_multicons=YES in your loader.conf?
If not, only one of the consoles will get output from the kernel.

Warner

> Like below :
>
>
>
> Loading kernel...
>
> /boot/kernel/kernel text=0x931f24 data=0x187450 data=0x0+0x2d095e
> syms=[0x8+0x138120+0x8+0x124824]
>
> Loading configured modules...
>
> can't find '/boot/entropy'
>
> can't find '/etc/hostid'
>
> No valid device tree blob found!
>
> WARNING! Trying to fire up the kernel, but no device tree blob found!
>
> EFI framebuffer information:
>
> addr, size     0xe0000000, 0x800000
>
> dimensions     1024 x 768
>
> stride         1024
>
> masks          0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 <<<<
>
>
>
> After this log is not coming in Putty in 12.3 for both x86 and arm64.
>
>
>
>
>
>
>

--000000000000f40f0205e03b12ac
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"auto"><br><br><div class=3D"gmail_quote" dir=
=3D"auto"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, May 30, 2022, 3:31 =
AM Souradeep Chakrabarti &lt;<a href=3D"mailto:schakrabarti@microsoft.com" =
target=3D"_blank">schakrabarti@microsoft.com</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex">





<div lang=3D"EN-IN" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:b=
reak-word">
<div>
<p class=3D"MsoNormal">Hi,<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">I am trying to access virtual serial console via Put=
ty and in 13.0 it is not working
<u></u><u></u></p>
<p class=3D"MsoNormal">for both x86 and arm64.<u></u><u></u></p>
<p><u></u>=C2=A0<u></u></p>
<p>It is very easy to reproduce:<u></u><u></u></p>
<p>1) In Windows Hyper-V set a=C2=A0 FreeBSD 13.0 VM<u></u><u></u></p>
<p>2) Use Powershell in Admin privileged mode and run following:<u></u><u><=
/u></p>
<p>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 Set-VMComPort -VMName &lt;vm_name&gt; -number 1 -path
<a rel=3D"noreferrer">\\.\pipe\Testpipe</a><u></u><u></u></p>
<p>2) In another Powershell with Admin privilege run following:<u></u><u></=
u></p>
<p>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 Set-VMFirmware -VMName &lt;VM name&gt;=C2=A0 --ConsoleMo=
de COM1<u></u><u></u></p>
<p>3) start the VM and open putty to connect the <a rel=3D"noreferrer">
\\.\pipe\Testpipe</a> in serial mode.<u></u><u></u></p>
<p>No output will be seen on putty.</p></div></div></blockquote></div><div =
dir=3D"auto">Not even from the boot loader? That sure sounds like the autom=
atic fallback to simple text output isn&#39;t happening.</div><div dir=3D"a=
uto"><br></div><div>What does:</div><div>% sudo efivar --device-path 8be4df=
61-93ca-11d2-aa0d-00e098032b8c-ConOut<br></div><div>tell you? (Or run as ro=
ot if you don&#39;t like sudo).</div><div><br></div><div>The boot loader gr=
ew a non-optional graphics mode that&#39;s disabled when the boot code</div=
><div>detects we&#39;re talking to a &#39;serial port&#39; between 12.x and=
 13.x. If you are getting no output</div><div>from the loader at all, I sus=
pect this is likely to blame.</div><div class=3D"gmail_quote" dir=3D"auto">=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div lang=3D"EN-IN" link=3D"#0563C1" vlink=
=3D"#954F72" style=3D"word-wrap:break-word"><div>
<p>But the same works in FreeBSD 12.3 and Putty gets the output from EFI lo=
ader for both x86 and arm64.<u></u><u></u></p>
<p>But during kernel booting the console output does not come in Putty, it =
only comes in vmconnect.exe.</p></div></div></blockquote><div><br></div><di=
v>So on 12.3, kernel output doesn&#39;t come out of both? Do you have boot_=
multicons=3DYES in your loader.conf?=C2=A0</div><div>If not, only one of th=
e consoles will get output from the kernel.=C2=A0</div><div><br></div><div>=
Warner</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div lang=3D"EN-IN" link=3D"#056=
3C1" vlink=3D"#954F72" style=3D"word-wrap:break-word"><div><p>
<u></u><u></u></p>
<p>Like below :<u></u><u></u></p>
<p><u></u>=C2=A0<u></u></p>
<p>Loading kernel...<u></u><u></u></p>
<p>/boot/kernel/kernel text=3D0x931f24 data=3D0x187450 data=3D0x0+0x2d095e =
syms=3D[0x8+0x138120+0x8+0x124824]<u></u><u></u></p>
<p>Loading configured modules...<u></u><u></u></p>
<p>can&#39;t find &#39;/boot/entropy&#39;<u></u><u></u></p>
<p>can&#39;t find &#39;/etc/hostid&#39;<u></u><u></u></p>
<p>No valid device tree blob found!<u></u><u></u></p>
<p>WARNING! Trying to fire up the kernel, but no device tree blob found!<u>=
</u><u></u></p>
<p>EFI framebuffer information:<u></u><u></u></p>
<p>addr, size=C2=A0=C2=A0=C2=A0=C2=A0 0xe0000000, 0x800000<u></u><u></u></p=
>
<p>dimensions=C2=A0=C2=A0=C2=A0=C2=A0 1024 x 768<u></u><u></u></p>
<p>stride=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1024<u></u><u></u=
></p>
<p>masks=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00ff0000, =
0x0000ff00, 0x000000ff, 0xff000000 &lt;&lt;&lt;&lt;<u></u><u></u></p>
<p><u></u>=C2=A0<u></u></p>
<p>After this log is not coming in Putty in 12.3 for both x86 and arm64.<u>=
</u><u></u></p>
<p><u></u>=C2=A0<u></u></p>
<p><u></u>=C2=A0<u></u></p>
<p><u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
</div>

</blockquote></div></div>
</div>

--000000000000f40f0205e03b12ac--