From owner-svn-src-all@freebsd.org Thu Jul 4 12:40:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B737E15D4D5B; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 587C7906EF; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 326A123073; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64CedsA005636; Thu, 4 Jul 2019 12:40:39 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64CedlO005635; Thu, 4 Jul 2019 12:40:39 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201907041240.x64CedlO005635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 4 Jul 2019 12:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349724 - stable/12/stand/ofw/libofw X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/stand/ofw/libofw X-SVN-Commit-Revision: 349724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 587C7906EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2019 12:40:39 -0000 Author: luporl Date: Thu Jul 4 12:40:38 2019 New Revision: 349724 URL: https://svnweb.freebsd.org/changeset/base/349724 Log: MFC r349188 [PPC] Fix loader input with newer QEMU versions At least since version 4.0.0, QEMU became bug-compatible with PowerVM's vty, by inserting a \0 after every \r. As this confuses loader's interpreter and as a \0 coming from the console doesn't seem reasonable, it's now being filtered at OFW console input. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20676 Modified: stable/12/stand/ofw/libofw/ofw_console.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/ofw/libofw/ofw_console.c ============================================================================== --- stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:31:24 2019 (r349723) +++ stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:40:38 2019 (r349724) @@ -97,7 +97,11 @@ ofw_cons_getchar() return l; } - if (OF_read(stdin, &ch, 1) > 0) + /* At least since version 4.0.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * As this confuses loader's interpreter and as a \0 coming + * from the console doesn't seem reasonable, it's filtered here. */ + if (OF_read(stdin, &ch, 1) > 0 && ch != '\0') return (ch); return (-1);