From nobody Wed Jun 01 22:46:22 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 7AD9D1B677F4 for ; Wed, 1 Jun 2022 22:46:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) (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 4LD45C4CRTz3GWh for ; Wed, 1 Jun 2022 22:46:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x933.google.com with SMTP id l12so1039231uan.5 for ; Wed, 01 Jun 2022 15:46:39 -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=g1tcFuYNa48JSaBOESgkSSTgoSvu2uUsPUOINVLsjGg=; b=6ObeoAUcPx70kyASvz0dq7WxRaV/gowYZBXF/Q/CguMsTGC8EQnbAL7MYrpK76E3JG lKhqczZKE3FRuEHWxdRIX+qPgy1Q18rC36o1Q+UXZPg3Me+Xe52xGUM92W5kSVq//ms1 FVDBn8CtEHnKFESYnUmEwVV7uJutDlsXZr5R6tXHfF1UbcjVsZIPkKcupvR8F3CCJ03I wcbcw3qzofM6f+e9BpDddy0jD2oDuW+sl9zjApENP1Y14w9PMdyZnEioGy+AFRBXNnb3 vfwd/1EldVhX1WvZRbYMjipGTC0i45eHocnSTHv0hFzOhmq8WBhQnovX0gYocWUa0PeB aZVw== 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=g1tcFuYNa48JSaBOESgkSSTgoSvu2uUsPUOINVLsjGg=; b=UYnfLXF33JGE290dZLdqtm1qZCZhASSkNG+XARVYRLYAfZSuomRD416KNqe8U/IjAg RpN2yVvBV9RcRnSR2sLJFaj3wXVYEDMvq/akyiM1WRqZAPgSTy1Df/xKU8tP7OdIcH+V c6yIJCzInBViUiYIj0PxFg7f93mUyBLmSW0PeGb1D0diXni8bVwZ345fGLpCOFT+JGha RT/AtThX/7+0135HGQcflieySx7MdIvHtL1BxmCgTA9O7anOWiCYqj5DtelX2N0CXZVL 67QwDpiAxmsRIfmBSRpOoNLUuxBs9qVS+xIr98qHafxw+yV95qF23bqPAa1U9zZIROSI RDMg== X-Gm-Message-State: AOAM530DwWfMgfWDlWxOPjM2VcesIadXZmabEWTa/1zKaY2XpCeAYEQK Xln7X/Xrk01EZmWdMhIqYGp1DwtaqNK3WEMlYkuC9g== X-Google-Smtp-Source: ABdhPJyeFK0FfLbzrs2VpyrvUYdynRoZSS/G14vIilLjIGo70HOmGp6S6WmE0L3yLtedUHPmKLrkMFof31RXMJ9hogg= X-Received: by 2002:a9f:3806:0:b0:369:34d2:e3bc with SMTP id p6-20020a9f3806000000b0036934d2e3bcmr11667486uad.2.1654123593255; Wed, 01 Jun 2022 15:46:33 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Wed, 1 Jun 2022 16:46:22 -0600 Message-ID: Subject: Re: [EXTERNAL] Re: serial console and comconsole in FreeBSD arm64 To: Souradeep Chakrabarti Cc: "freebsd-arm@FreeBSD.org" , "tsoome@FreeBSD.org" , Wei Hu Content-Type: multipart/alternative; boundary="00000000000030e05305e06aa9cf" X-Rspamd-Queue-Id: 4LD45C4CRTz3GWh X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=6ObeoAUc; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::933) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.94 / 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)[-1.000]; 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(-0.94)[-0.944]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::933: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 --00000000000030e05305e06aa9cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 1, 2022 at 4:03 PM Souradeep Chakrabarti < schakrabarti@microsoft.com> wrote: > Hi Warner, > > Thanks for pointing boot_multicons, and yes it has solved the problem of > FreeBSD kernel boot logs > > not coming in Putty in both x86 and arm64. > > Regarding FreeBSD 13, yes loader.efi logs are not coming in Putty mostly > because of EFI gfx usage > > which is not supported in Putty. > > Now we can overcome it in x86 by setting set console=3D=E2=80=9Dcomconsol= e=E2=80=9D, as it > is using the different > > uart implementation of comconsole of loader, which is not the same in > arm64. The implementation > > of comconsole in arm64 loader.efi is not supported in Hyper-V looks like. > As Hyper-V only supports > > ttyAMA0 for serial console in ARM64 but supports uart in x86. > How is that connected to the system? Does it appear in dmesg? in fact, a full dmesg wouldn't be bad to have. > Regarding ConOut, I have got it from x86 FreeBSD13, (as arm64 is in the > process of bringing up and > ConOut is same for arm64 and x86, confirmed by using efishell binary and > Linux shell). > > > efivar --device-path 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut > > 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut > > : > AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,02780ada77e3ac= 4a8e770558eb1073f8c7e020566280ce4daeb7520c7ef76171) > Thanks! That confirms what I thought I knew... Warner > > 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 i= s > 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 -number 1 -path > \\.\pipe\Testpipe > > >>2) In another Powershell with Admin privilege run following: > > >>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=3DYES 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=3D0x931f24 data=3D0x187450 data=3D0x0+0x2d095e > syms=3D[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. > > > > Thanks & Regards, > Souradeep > > --00000000000030e05305e06aa9cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jun 1, 2022 at 4:03 PM Sourad= eep Chakrabarti <schakraba= rti@microsoft.com> wrote:
Hi Warner,

Thanks for pointing boot_multicons, and yes it has solved the problem = of FreeBSD kernel boot logs

not coming in Putty in both x86 and arm64.

Regarding FreeBSD 13, =C2=A0yes loader.efi logs are not coming in Putt= y mostly because of EFI gfx usage

which is not supported in Putty.

Now we can overcome it in x86 by setting set console=3D=E2=80=9Dcomcon= sole=E2=80=9D, as it is using the different

uart implementation of comconsole of loader, which is not the same in = arm64. The implementation

of comconsole in arm64 loader.efi is not supported in Hyper-V looks li= ke. As Hyper-V only supports

ttyAMA0 for serial console in ARM64 but supports uart in x86.

How is that connected to the syst= em? Does it appear in dmesg? in fact, a full dmesg wouldn't be bad to h= ave.
=C2=A0
Regarding ConOut, I have got it from x86 FreeBSD13, (as arm64 is in th= e process of bringing up and
ConOut is same for arm64 and x86, confirmed by using efishell binary a= nd Linux shell).


efivar --device-path 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut

8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut

: AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,02780ada7= 7e3ac4a8e770558eb1073f8c7e020566280ce4daeb7520c7ef76171)
<= /blockquote>

Thanks! That confirms what I thought I knew= ...

Warner
=C2=A0
<= span style=3D"font-size:12pt">=C2=A0
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 =C2=A0FreeBSD 13.0 VM

>>2) Use Powershell in Admin privileged mode and run following:<= /div>

>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Set-VM= ComPort -VMName <vm_name> -number 1 -path \\.\pipe\Testpipe

>>2) In another Powershell with Admin privilege run following:

>>3) start the VM and open putty to connect the \\.\pipe\Testpip= e 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-C= onOut

>tell you? (Or run as root if you don't like sudo).

>

>The boot loader grew a non-optional graphics mode that's disab= led 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 Putt= y, it only comes in vmconnect.exe.

>

>So on 12.3, kernel output doesn't come out of both? Do you hav= e boot_multicons=3DYES in your loader.conf?

>If not, only one of the consoles will get output from the kernel.<= /div>

>

>Warner

>>Like below :

>>

>>Loading kernel...

>>/boot/kernel/kernel text=3D0x931f24 data=3D0x187450 data=3D0x0= +0x2d095e syms=3D[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 =C2=A0 =C2=A0 0xe0000000, 0x800000

>>dimensions =C2=A0 =C2=A0 1024 x 768

>>stride =C2=A0 =C2=A0 =C2=A0 =C2=A0 1024

>>masks =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x00ff0000, 0x0000ff00= , 0x000000ff, 0xff000000 <<<<

>>

>>After this log is not coming in Putty in 12.3 for both x86 and= arm64.



Thanks & Regards,
=C2=A0Souradeep

--00000000000030e05305e06aa9cf--