From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 97F31941550 for ; Fri, 25 Aug 2023 10:15:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5TvPbIUMwjd48Pj4HO0rRueAKp1lcmzKi5/7ic9CKl0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692958510; v=1; b=AtwSHNxxY0XMuMqoNYTdx+3xTmeC2fshWoYzQ57L19IHVv3k1FqOPl1IE0maU0De6TdiffDx SQgDGjzSsYJkEPueGZvtZ00YkIYL30pA+hh+DpD6VXMX3qcnMx338xiHA8WbmpirwRkU/4wdhcn 4JD1ldJ1BX6YKsVtZtBHTOjw= X-Received: by 127.0.0.2 with SMTP id GuzrYY7687511xhQhAF09zzL; Fri, 25 Aug 2023 03:15:10 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.10317.1692958509455347926 for ; Fri, 25 Aug 2023 03:15:09 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10812"; a="405681662" X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="scan'208";a="405681662" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2023 03:15:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10812"; a="714306670" X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="scan'208";a="714306670" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 25 Aug 2023 03:15:07 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 25 Aug 2023 03:15:06 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Fri, 25 Aug 2023 03:15:06 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Fri, 25 Aug 2023 03:15:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ynh5vNq2Gb236pIrRbIdOSR+AocVkjvO2bIYOxHKxwfwnSxG/8BoNDX4YnFFeOMXgQx8uklIdwUjcP0QRGuk96weKcktHt/EY/+mcTFSzXLLBs84eSoJgdN78HEUKxiN5yiOtUr+Kb8v36R8hKUhpa+Znxy1UqleOfD6geAZif4nMIHFebqHEBtGg2+mjIktQNw23C01Uq0bwXTMO1JpALYoI8V2Jj7hBNamwZMuFMPT2PAD0zdzEkGVpuAR+loDe70O70JkeTsw25emyBnWFxJ5B3PXtA4fP+LNDhtK+pDM2aXPNsbnbePRCvMisvD0jMzHKtUVEXUbrIgL21f/mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gr/TFiEXxa4FwkYmb+LCcI1z7Vkm/EC9TWQKC8/ZneQ=; b=M+T4tJqNEbXRaRbS2WPFH9amarylF5yfwrxv/Tlvvfi5nDRCOq6Hf+eQKmN6Hg/57lvpVMUwQZg4CXA5jaytA5npAnMjg3wy0+PW31FJ9b3KISo0ytGaOxzcCOWmumAFAR1gePOG9QlJk53Wa0QDI9Zv1R5E98NXyCQ65fy9mCV15HAUUz4AqsVyLK03DBCwoNyslYTqlSFkyseUIlrYHc20C7ZBlOK1QJmM20TdIsH44KOJ8xtnOkyBgIfTliiYu7yT+KaMFzmvc/8vjAFFIwzL+JJcuJCi5Rdu6lN37mdVhlxQiqXN2B/qZ8BMipO11PBSowWLFs8Z76s1CgAk+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com (2603:10b6:510:13f::19) by SJ1PR11MB6107.namprd11.prod.outlook.com (2603:10b6:a03:48a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Fri, 25 Aug 2023 10:15:02 +0000 X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::4148:3ffb:428d:c14e]) by PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::4148:3ffb:428d:c14e%4]) with mapi id 15.20.6699.027; Fri, 25 Aug 2023 10:15:02 +0000 From: "Jayaprakash, N" To: "devel@edk2.groups.io" , "Jayaprakash, N" CC: Rebecca Cran , "Kinney, Michael D" , "Kloper, Dimitry" Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console jump to 0, 0 issue in lseek() Thread-Topic: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console jump to 0, 0 issue in lseek() Thread-Index: AQHZ1qljo2VPuFk9lUqMscKbBsPHGq/6zAWg Date: Fri, 25 Aug 2023 10:15:02 +0000 Message-ID: References: <20230824163405.1386-1-n.jayaprakash@intel.com> <177E5EE7D234A063.10408@groups.io> In-Reply-To: <177E5EE7D234A063.10408@groups.io> Accept-Language: en-IN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB5943:EE_|SJ1PR11MB6107:EE_ x-ms-office365-filtering-correlation-id: 6c87ec93-a5cd-4a0a-c4c7-08dba5542573 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: y/nZ9Nw8ylf1AqGgco1CC7ZnmGSaxL5W2bBbjfZ66YbzpA7OKoMhGXrUHTce7N+RedAh6uXPrBjZPx9Wr1N9actvlOmlxBiEDvHBL1cKr00CDBWd3J8PnULMaSRW5rqgGwn91RlHu1q2qdmljO5F9rCuNFWAmNd+Tz/JtTufPyy/yCYPOq2BCUSKBEMmizIOWBYwYMwbDVSr2Myv0Ksx1yPu1mJ3bfMXbzU7d44iYDGH+RVxvV0yhNYS4kDDhc/YZ1btyZU4+GFp1TZJYiVh8edmzx3DTxp57AAMyhQkYmaXRdFx+01bRuoiiyWjoxKyg+Hnjx3j1x7BHKt6S/UgTityOfbJ9PBMUOJAXiirjIx+nrSJzZMkpwOGF2HpxzHXbt7bIImnJKH3VoRlW2KrZrO92I7pFObkp9ZUY+TxHDKJ9KEttwiLDNYMAWm1GwOxdahHzLBCg1nu9nXKVAqXXU4dhIKDKLw1L7KdDGoxe3G/ofL1VwQpwmuhtFZEWsC25rGJy15ltqpVpzxrnoLpSngsuK1utwemsrMgsdSEThYkvYVW9TxCKs8TXs/NdpqCagkNceWPFFXnX+bnL/9zJ4eapUBNHd5F8d6n/bWGsSesM5X5d9weHJUatfSkMbWjpGhWmjkS7EciQ+4uGpunGg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-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q93/jwbm4g8K5VKCjfb79v9fDljLsmbseWg37iSyIRa/scKQWZg+Hv+3PRYG?= =?us-ascii?Q?B7SsnZza0IxzMO5z3DQMVdAwf2W/2VqUCMOw7VF0YocZzVaSsQgI9qvTuuj9?= =?us-ascii?Q?u3uV6qIm/AtRuA4Z/uCmg/OP9y+t7kFSp2iKNjF/vBbQkAYQdjm3QuX9UdUL?= =?us-ascii?Q?JFhl4QT5ZOzcfe1Vli6aOwSzkvv/8RdxOCaTi4AONenmwp6WQzsPCpQVkQCF?= =?us-ascii?Q?FD+4OddfV4guWlzk8LExaek6b9S35xcd6AB5AxwxmnaKZUSO+cFHRx8BTTfb?= =?us-ascii?Q?0TlElPIp8x7ZRNGxICo/3JXvsfmn7ee9ltYHt3QPYiM4nh/sVgpPsib3ahFr?= =?us-ascii?Q?QxgJTKBo5eybrJj6HHasvSdMmrtz0x14kevS54ZOqWgsLbidkjDPhhj4FMw0?= =?us-ascii?Q?CyMKpWaDbrAUKinAxpVmJPLNyaWr5O51yeN3JycaOKfrj0mEVOLK3lFdKQVF?= =?us-ascii?Q?FqcOPCtiGiF5AvONysXfPCBtL6H4YhMODvMApB/w7Qqk/OjEeIiJ/5J26mUs?= =?us-ascii?Q?oS+P8wFMatbNq5YQuqBFjDya0Hr7VSZQzbRm1vP1rCjU+m6qnist2DW2pgLQ?= =?us-ascii?Q?3e9RsqG36TwIH1VqL1AVARabn1RHeCO/6agsWcI4Xuk1C9O0SovmLmKRnHiM?= =?us-ascii?Q?9GWjJjIH92FetesVQ78LX2n+TIoOFrI58xFuga04rPzuo+j0g7R9pnZvdzxS?= =?us-ascii?Q?kl3mJPAm4JLBN5V20QjYqvMF25LQ1Mbd+gU0sJQ3?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c87ec93-a5cd-4a0a-c4c7-08dba5542573 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2023 10:15:02.7098 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eomlw47vlyQtIqI9zshsjHQam3nlcV5UsrxW9g9e5L6o4jrrd52IzbZxRTgkcAVynUC1PVmv7cQFfQsP4cROnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6107 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tGynzWRsQuEgjiyMzAcoP9Jyx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=AtwSHNxx; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed the changes and it looks good. Also verified that the fix solves the problem. Reviewed-by : Jayaprakash N -----Original Message----- From: devel@edk2.groups.io On Behalf Of Jayaprakash,= N Sent: Thursday, August 24, 2023 10:04 PM To: devel@edk2.groups.io Cc: Jayaprakash, N ; Rebecca Cran ; Kinney, Michael D ; Kloper, Dimitry Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console j= ump to 0, 0 issue in lseek() REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4531 Python code opens console file descriptor and uses lseek() with position = =3D=3D 0 and SEEK_CUR as 'do nothing, check console is alive' operation. Current implementation of daConsole ignores whence argument, this is wrong = in case lseek(0, SEEK_CUR) will send cursor to (0,0). This fix is not generic, but solves the particular situation. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Kloper Dimitry --- StdLib/LibC/Uefi/Devices/Console/daConsole.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/StdLib/LibC/Uefi/Devices/Console/daConsole.c b/StdLib/LibC/Uef= i/Devices/Console/daConsole.c index 56571af..ba031d6 100644 --- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c +++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c @@ -141,8 +141,16 @@ da_ConSeek( EFIerrno =3D RETURN_UNSUPPORTED; return -1; } - // Everything is OK to do the final verification and "seek". + Proto =3D (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)Stream->Dev; + + if(Position =3D=3D 0 && whence =3D=3D SEEK_CUR) { + CursorPos.XYpos.Column =3D (UINT32)Proto->Mode->CursorColumn; + CursorPos.XYpos.Row =3D (UINT32)Proto->Mode->CursorRow; + return CursorPos.Offset; + } + + // Everything is OK to do the final verification and "seek". CursorPos.Offset =3D Position; =20 EFIerrno =3D Proto->SetCursorPosition(Proto, -- 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108035): https://edk2.groups.io/g/devel/message/108035 Mute This Topic: https://groups.io/mt/100952873/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-