From nobody Tue Nov 29 21:59:50 2022 X-Original-To: freebsd-ppc@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 4NMGTw0lv1z4hdVZ for ; Tue, 29 Nov 2022 22:00:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 4NMGTt5xxPz3l7v for ; Tue, 29 Nov 2022 22:00:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b="v/95roQJ"; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::635) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ej1-x635.google.com with SMTP id b2so20795544eja.7 for ; Tue, 29 Nov 2022 14:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tNc2JIaR3xyN/rXjdSSmKv9SL6uXrT0ODj45ZOgBMOY=; b=v/95roQJEQVxBGejEyHRXnUl1s4EZx8D5HVBZlchSa6Ow2JgZ2oy3vHeio2MwKmn4b 8njoIDVGyJFb8sO19whbPvpokHzn1T6uJTT5dm1kpNbyXDHi4toFTNQF5nIA5LK70/QK G/Dg1mVNDsSVF3XivTSEt8aSt0DqEE5S1DKvfuhHG0VWLmSLUvuq6V6mMlD9iSBeoKj7 NI2Rhc85nQUvNsDCcloNZwB35YCypnkzQTOHvtPwazir3lhGJ5TjdgWla8kADCbRR8qp zaWiJk7gz2kZoeXDhofrDHX1ZqC8Hh4E7FLQo3PuQ5haoKdXhocSgscDbWupculNWda0 bktw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tNc2JIaR3xyN/rXjdSSmKv9SL6uXrT0ODj45ZOgBMOY=; b=niNj1D1xUw56DORtEa9EXuiSJkF1xPOOA+aMz/ilFMksYKlDH1EQbl/boriMKmeeSQ UccZX9KhBhMZ4Mcz0Sfn9dCEbPAVTWSa+GLSvZyFRj+n55GHE7yJrNCAoxt5MAV1exWL YbVQPBfuRYDRqj5TLZviodH33xeC1HsllPadN8pizHDUIGGR4biaFZ7aoN3N0nUR7Ivn dpyRAsP50AMskpp9eoP9MM9n5kh+ij0FtL+0b6cwVoPK5+MViVhroasRz0JrDQSYUsAo oCrK3Mjay+3jnaNA5LQRZClX5srLBAwvWU6fU+guaH8pP7hyNZdqLzrXJfbqremr48Cu Yavw== X-Gm-Message-State: ANoB5pkM2zqfI0uMR3vCPGvNXI2R3F77RSl9rPf4J0EbEbfSvSkTK5OW l73CxJmqnh1i7OgEuCReVD00+d6ktSrYawDDjDjfoQ== X-Google-Smtp-Source: AA0mqf7pot654jhbJe9MWBjqmQvn87ZQtGzyeDNcTQZvteZa/wHdmyjEsGUkuBuL9f9akKyLnTwZkjyxOH2gzr3xh+E= X-Received: by 2002:a17:906:f84d:b0:7b9:631b:7dfb with SMTP id ks13-20020a170906f84d00b007b9631b7dfbmr31026376ejb.32.1669759201508; Tue, 29 Nov 2022 14:00:01 -0800 (PST) List-Id: Porting FreeBSD to the PowerPC List-Archive: https://lists.freebsd.org/archives/freebsd-ppc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Tue, 29 Nov 2022 14:59:50 -0700 Message-ID: Subject: Re: Boot Loader: OFW network booting support To: Alexey Dokuchaev Cc: "freebsd-arch@freebsd.org" , FreeBSD PowerPC ML Content-Type: multipart/alternative; boundary="000000000000111b5805eea31c1f" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-ppc@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::635:from]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_TLS_LAST(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; RCPT_COUNT_THREE(0.00)[3]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4NMGTt5xxPz3l7v X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N --000000000000111b5805eea31c1f Content-Type: text/plain; charset="UTF-8" On Sun, Nov 20, 2022 at 9:47 PM Alexey Dokuchaev wrote: > On Tue, Nov 15, 2022 at 10:04:12AM -0700, Warner Losh wrote: > > ... > > So here's the deal. If someone has the ability to test and shows that > it's > > working today and promises to test my changes and help me debug it, then > > I'll keep it and add the new code that's needed to continue to support > this > > feature. > > I'd happily test anything on my venerable Mac mini G4 (which I currently > use to ensure ports' endian-cleanness and 32-bit compliance). > OK. There's a patch-train available at https://reviews.freebsd.org/D37560, but I don't know if you'll be able to easily apply it (there's 22 reviews). Alternatively, you can try the boot-devs branch at https://github.com/bsdimp/freebsd.git which is the same thing. > > Alternatively, if someone has the recipe for FreeBSD/powerpc on QEMU that > > includes OpenFirmware for disks and networking, I'll do the testing and > > legwork to get my netboot setup locally. > > I'll play with that as well. I recall last time I needed it, finding that > our Wiki doesn't have much working examples of different systems' emuation > was frustrating, so at the very least I could probably expand it. > Yea. I've managed to get mac99 emulation on qemu-system-powerpc working well enough to do the test boot, at least for disks. Still haven't found the secret decoder ring for netbooting with openfirmware, though. There's a network stack in the current Open BIOS used by qemu, though, so there may be hope. Warner --000000000000111b5805eea31c1f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Nov 20, 2022 at 9:47 PM Alexe= y Dokuchaev <danfe@freebsd.org&= gt; wrote:
On Tu= e, Nov 15, 2022 at 10:04:12AM -0700, Warner Losh wrote:
> ...
> So here's the deal. If someone has the ability to test and shows t= hat it's
> working today and promises to test my changes and help me debug it, th= en
> I'll keep it and add the new code that's needed to continue to= support this
> feature.

I'd happily test anything on my venerable Mac mini G4 (which I currentl= y
use to ensure ports' endian-cleanness and 32-bit compliance).

OK. There's a patch-train available at https://reviews.freebsd.org/D3756= 0, but I don't know if you'll be able to easily apply it (there= 's 22 reviews).

Alternatively, you can try the= boot-devs branch at http= s://github.com/bsdimp/freebsd.git which is the same thing.
= =C2=A0
> Alternatively, if someone has the recipe for FreeBSD/powerpc on QEMU t= hat
> includes OpenFirmware for disks and networking, I'll do the testin= g and
> legwork to get my netboot setup locally.

I'll play with that as well.=C2=A0 I recall last time I needed it, find= ing that
our Wiki doesn't have much working examples of different systems' e= muation
was frustrating, so at the very least I could probably expand it.

Yea. I've managed to get mac99 emulation on = qemu-system-powerpc working well enough to do the test boot, at least for d= isks. Still haven't found the secret decoder ring for netbooting with o= penfirmware, though. There's a network stack in the current Open BIOS u= sed by qemu, though, so there may be hope.

Warner= =C2=A0
--000000000000111b5805eea31c1f-- From nobody Sat Feb 4 15:55:48 2023 X-Original-To: freebsd-ppc@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 4P8HDm3zyYz3nXc2 for ; Sat, 4 Feb 2023 15:55:52 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic317-32.consmr.mail.ne1.yahoo.com (sonic317-32.consmr.mail.ne1.yahoo.com [66.163.184.43]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4P8HDl2nlHz41HV for ; Sat, 4 Feb 2023 15:55:51 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=MkggXBn5; spf=softfail (mx1.freebsd.org: 66.163.184.43 is neither permitted nor denied by domain of pfg@freebsd.org) smtp.mailfrom=pfg@freebsd.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1675526149; bh=CIKvYP6/9GcTVJYIUGCIe63sjJaGuW2Lo/1VgnnBd/k=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=MkggXBn5Iypm/rcMxhvPUZoGV2HUuvhMsMulH8gsa6DnafZV6krdhXo4e11KN94rgImrN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r014gzpPnP4GmysqZHZi2.dv1EBoBIySjpnkfPRjH6Xm4H8l8tW.Py2idRINTxELoKu c_O8cfYrdQa86welSdFWYtEUPYhylqIUg8at_PqrS5tlIU07A7KNK9eGm3msc9N0s3b4u92G5uc4 81DG_6rbJOZL3wEIqRGSEN3M22J2d7xYJ5Xl9e2k9cFqRW_FXzWCWiYwu7dTgClOGkEdTRw3o.tC uEkEJbT1vrZAcgr2biv7X_qLxz2FJz36mSvOZgksowEumgOOd18WPMtPoJltjsCdxem.z6U1yHrR MYo1HKrRmlIVmRUcqQOCrm13b8jtfRIHd5xUeuaTR6LNp1ONKBdBUF8g3UGYXKUNfIyr5loTfRaO BE7YxHfnPsniXqxL9licEA85X6BX9Xlf0bSxoTM2jY.jKXaENqABJ8eqNOMm0rZbpLXpxOYOEipz rv10SeS0GBkoX.sqYOFVSLUzPyfJGSDwz0qdZB1uZKWg_z5keOO9QFAVYVWgu6AwfCm2IFUZYfDR .AFGKhPUjmfJLEwMGDhb361muF5.YgnzGN4I7C48mfBPw8ADbXrTtErl0rQn353.Hct4qo0R9QgU DSOAn3jTI3VlB2rr5XENJ_RCL0WAfXjirbWj4q70Ev.Y.0NXhhhn7rhTOA6SCT0BcVXMph3MzPiJ L.yRnzwbUB865RiIbWW5tp0HsdjcEZ6CcVOitz7bCvuHgcVWpaYFmXvdgK0MOoVRFZGEtUaxtYFU zGl41i_N43RVO6qrvCC_nPMdaoMduGF73K8mpqqwP0fxZpdwO.SU7Bb8T7YvTA4oYTSC__PZVcSX wTB45j0TzSxOl9Qq_fSaLYtoQJUs8kfdScPtHGURYbokA92QupAjNb1Y- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Sat, 4 Feb 2023 15:55:49 +0000 Date: Sat, 4 Feb 2023 15:55:48 +0000 (UTC) From: Pedro Giffuni To: "freebsd-ppc@FreeBSD.org" Message-ID: <1967210382.221190.1675526148958@mail.yahoo.com> In-Reply-To: <202302030714.3137EVRQ088519@gitrepo.freebsd.org> References: <202302030714.3137EVRQ088519@gitrepo.freebsd.org> Subject: Does hastd work on Big Endian? Fw: git: 6998572a74a9 - main - hastd: use zlib's crc32 implementation. List-Id: Porting FreeBSD to the PowerPC List-Archive: https://lists.freebsd.org/archives/freebsd-ppc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_221189_1075028453.1675526148956" X-Mailer: WebService/1.1.21161 YMailNorrin X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-ppc@FreeBSD.org]; TO_DN_EQ_ADDR_ALL(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.184.43:from]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_HAS_QUESTION(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[pfg]; DKIM_TRACE(0.00)[yahoo.com:+]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Queue-Id: 4P8HDl2nlHz41HV X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N ------=_Part_221189_1075028453.1675526148956 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi; Not really concerned about the commit here .. but about the last comment. C= hecksums may need adjustments for endianness. Cheers, Pedro.=C2=A0 ----- Forwarded Message ----- From: Xin LI To: "src= -committers@freebsd.org" ; "dev-commits-src-all= @freebsd.org" ; "dev-commits-src-main@free= bsd.org" Sent: Friday, February 3, 2023 a= t 02:14:34=E2=80=AFAM GMT-5Subject: git: 6998572a74a9 - main - hastd: use z= lib's crc32 implementation. The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=3D6998572a74a98721781ecd5b6829= 435259f9825a commit 6998572a74a98721781ecd5b6829435259f9825a Author:=C2=A0 =C2=A0 Xin LI AuthorDate: 2023-02-03 07:14:21 +0000 Commit:=C2=A0 =C2=A0 Xin LI CommitDate: 2023-02-03 07:14:21 +0000 =C2=A0 =C2=A0 hastd: use zlib's crc32 implementation. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 pjd =C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks =C2=A0 =C2=A0 Differential Revision: https://reviews.freebsd.org/D35767 --- ......diff --git a/sbin/hastd/hast_checksum.c b/sbin/hastd/hast_check= sum.c index f7ef6a64b4e1..dccba3752cb1 100644 --- a/sbin/hastd/hast_checksum.c +++ b/sbin/hastd/hast_checksum.c @@ -33,10 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include =20 -#include #include #include #include +#include #include =20 #include "hast_checksum.h" @@ -49,7 +49,9 @@ hast_crc32_checksum(const unsigned char *data, size_t siz= e, { =C2=A0=C2=A0=C2=A0 uint32_t crc; =20 -=C2=A0=C2=A0=C2=A0 crc =3D crc32(data, size); +=C2=A0=C2=A0=C2=A0 crc =3D crc32(0L, Z_NULL, 0); +=C2=A0=C2=A0=C2=A0 crc =3D crc32(crc, data, size); + =C2=A0=C2=A0=C2=A0 /* XXXPJD: Do we have to use htole32() on crc first? */ =C2=A0=C2=A0=C2=A0 bcopy(&crc, hash, sizeof(crc)); =C2=A0=C2=A0=C2=A0 *hsizep =3D sizeof(crc); =20 ------=_Part_221189_1075028453.1675526148956 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi;

Not re= ally concerned about the commit here .. but about the last comment. Checksu= ms may need adjustments for endianness.

Cheers,

Pedro.
 
<= div>
=20
----- Forwarded Message -----
From: Xin LI <delphij@freebsd.org>
<= div>To: "src-committers@freebsd.org" <src-committers@freebsd.org&= gt;; "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org&= gt;; "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.or= g>
Sent: Friday, February 3, 2023 at 02:14:34=E2=80=AFA= M GMT-5
Subject: git: 6998572a74a9 - main - hastd: use zli= b's crc32 implementation.

The branch main has been updated by d= elphij:


commit 6998572a74a98721781ecd5b682943= 5259f9825a
Author:    Xin LI <delphi= j@FreeBSD.org>
AuthorDate: 2023-02-03 07:1= 4:21 +0000
Commit:    Xin LI <delphi= j@FreeBSD.org>
CommitDate: 2023-02-03 07:1= 4:21 +0000

  &nbs= p; hastd: use zlib's crc32 implementation.
 =  
    Reviewed by:    = pjd
    MFC after:      = 2 weeks
    Differential Revision: https://reviews.freebsd.org/D35767
---
=
...
<= snip>
...
diff --git a/sbin/hastd/hast_checksum.c b/sbin/hastd/hast_checksum.c
index f7ef6a64b4e1..dccba3752cb1 100644
--- a/sbin/hastd/hast_checksum.c
+= ++ b/sbin/hastd/hast_checksum.c
@@ -33,10 +33,10 = @@ __FBSDID("$FreeBSD$");
#include <string.h&= gt;
#include <strings.h>

-#include <crc32.h>
#include <hast.h>
#include = <nv.h>
#include <sha256.h>
=
+#include <zlib.h>
#inclu= de <pjdlog.h>

= #include "hast_checksum.h"
@@ -49,7 +49,9 @@ hast= _crc32_checksum(const unsigned char *data, size_t size,
{
    uint32_t crc;
=

-    crc = =3D crc32(data, size);
+    crc = =3D crc32(0L, Z_NULL, 0);
+    crc= =3D crc32(crc, data, size);
+
    /* XXXPJD: Do we have to use htole32() on crc = first? */
    bcopy(&crc, has= h, sizeof(crc));
    *hsizep =3D = sizeof(crc);
------=_Part_221189_1075028453.1675526148956--