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 4A5D3D801DE for ; Wed, 10 Apr 2024 06:08:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4ly9tDWN3IJgpZezO9+MBVvT5VQVNhFXEez71s6zw8g=; c=relaxed/simple; d=groups.io; h=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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712729333; v=1; b=etCLXKopgBvL9eIYMu2aqDDoQvszDG2+9OY7Vr4sF+ibB8nT8IParlqBwvfX12wK/VB3BBkF UyJEZ2aT/TtECvEkF5HTlUwZy5qQx5YFaxcxb9JTmuibk5voWeFmdTlkkVBBovAStbSxNkgo3F6 qksefVBCa9VS7VEDZIcJBIcDZNz9DOqtOe/VdA6nPfWyyLGxk9bxn6DuOcDVz4dVum605bTQ8X3 845E+h+veEVfZ6Dp9/VSiVf0HYsINRGJpY2e2tRduQFdHAx27YV7l3R7O/fFKtcMqtW2VGO2s3/ e9ZB02yQkNBeNufH/T5vhk7R5nB6dHhhdT2vYgI4Nf3RA== X-Received: by 127.0.0.2 with SMTP id 78ZlYY7687511xxTvUpc9DRd; Tue, 09 Apr 2024 23:08:53 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mx.groups.io with SMTP id smtpd.web10.159162.1712729332857708756 for ; Tue, 09 Apr 2024 23:08:53 -0700 X-CSE-ConnectionGUID: 31cUioasTDeEwuuk8fMkvQ== X-CSE-MsgGUID: zFgxGlZ4SYyKISGpuAYYrA== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="8198605" X-IronPort-AV: E=Sophos;i="6.07,190,1708416000"; d="scan'208";a="8198605" X-Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 23:08:52 -0700 X-CSE-ConnectionGUID: +j+GEjr4SDKMmTPiMKd14Q== X-CSE-MsgGUID: wubTxSh6TUi2fBRnyT7F0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,190,1708416000"; d="scan'208";a="51662870" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 09 Apr 2024 23:08:51 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Apr 2024 23:08:50 -0700 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Apr 2024 23:08:50 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 9 Apr 2024 23:08:50 -0700 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 9 Apr 2024 23:08:49 -0700 X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com (2603:10b6:510:13f::19) by SJ1PR11MB6083.namprd11.prod.outlook.com (2603:10b6:a03:48a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.25; Wed, 10 Apr 2024 06:08:48 +0000 X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::932:a430:2415:6a7b]) by PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::932:a430:2415:6a7b%4]) with mapi id 15.20.7452.019; Wed, 10 Apr 2024 06:08:47 +0000 From: "Jayaprakash, N" To: "devel@edk2.groups.io" , "Jayaprakash, N" CC: Rebecca Cran , "Kinney, Michael D" Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function available in edk2module is not working as expected Thread-Topic: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function available in edk2module is not working as expected Thread-Index: AQHahnUxGmTCf/S5/EKMwNVWSplk7LFhDdvw Date: Wed, 10 Apr 2024 06:08:47 +0000 Message-ID: References: <20240404094426.1636-1-n.jayaprakash@intel.com> <17C30A8D5FBBA882.4513@groups.io> In-Reply-To: <17C30A8D5FBBA882.4513@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_|SJ1PR11MB6083:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: GOVLGPJm6fL81pU1CNUCxZ2aNAu4j4VK8gTES+c+bZV5HoZD5Ce3pGxznSKl/iJlzJY2ZTskMaKECS2jtrCqG1biuOI9yTK3O6DZ/6XpMLTLO3RZWcLH+TLpeL0KszwEhSs0n82vmGeckX9HAk/39hbepkTVcyMIEFzAJB2M1/uak+IwLYFjspMqO5jFlTDnZA8EM6Oli+isNeQTE87vcYIlt81m3+fen2rqcsCiAl8etre8TmudacmbNDDAeZaxtzhOKT/jRR82WcniTDptZp0SkIk9HPsHAAOd5utSI7atEvc/GKEBsKL6s1qL580Qan4TOyVwSDsf8qEeLFK/Dg32T/IgHMqL7EVREEOu8fOMFzuOYf9pl/S8c5NhEct0+oFUwGEste0d5UQ1GnUpImwfrYiWRyX5xboYhg8nV9Yd5Wuy0ql/9AMZ8OmiUSQDP/5DoMt3joZIRPsL70/LTABeW10oODDSd7VBdWrRVBzyPGNjMrlm7y9Sxq6lpfiNF7lw8QDn4HJLqKyPQ7m8+Cc39stNHBHWPFOkqjei8D/3XA4zzGTBz5pMO87ewhXor1VgkMCdiVjc7cLClj5Pnc2skvotLMc0TIPmiMyg/H5rt4y0gKnD8GH4is0gA2KH x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bG+G/MvHujsSDX275sMx5xXDcK+5Wu4iwVwcQSxcdGpg6Yt51OisONOMZz2/?= =?us-ascii?Q?8W8KXVr3eOIwrANg5XrWwde5o/n5fRCk3YPWsdlRxF7aQsvCk5kE64Mz0BUC?= =?us-ascii?Q?sAsGwIUSZ9Q8l9TRP8ljUmj5ZJzowKcrwgKrcr0ivOlpuUBJNeybcuPlFOGm?= =?us-ascii?Q?xGn6rEUqk7k71yrHuvEPYcje6YXd17sYddA13MHyrHzYAHS4U+01vY4WncUU?= =?us-ascii?Q?p+92mzM/U4FAp3TA/lO2eigJOf0Yf3lZnJsz7UdcgffPYV+EJREwD7BGisVm?= =?us-ascii?Q?M/heiQYB3+nt3FOKSmc1we2HU+t2XOghgfoc5iRwCh8MZk7sX9PV3HGINr2p?= =?us-ascii?Q?2yv6hD3JT5axC5SuaKSbUoBsjXDmXnWFdlmOevENpEZHNNOWungxhQz6FjwV?= =?us-ascii?Q?UdUzd4yeD31IRD9mFdmiS53J0mMNvqNjtltLBAC06iyQ8R3FCkamjQ+2Yg/L?= =?us-ascii?Q?rIqp4XjtIhL2dUmzSAu2b+5mq+XvZUxfDbMUt1xExVNgOMF0om7hnF/z0ZIR?= =?us-ascii?Q?584W68HZ/XEpU5mafhzC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us-ascii?Q?Yf6hg8lCu1B+6WOaknGkIwQ2dcnWny+ykXiV7n5Vr2XYVLchsk5HjTd+ZKh4?= =?us-ascii?Q?5BIsd4Mz4HFUQTgbJ/A1dH5Wx9SaX/+SoW1LuYDpl9End34Bri0zXr9EO7hT?= =?us-ascii?Q?anSRsG+4voNaHPRQzGOtSmphcyonuj0YbPoNcCl1?= 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: aff728d4-7979-4095-d434-08dc5924af98 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2024 06:08:47.9004 (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: msR4b3sUpoeKKyd9EEeNYVXFEomuulTk0Eq/8PYpqzSJ4njIf7y7VTwg+XSZJ0oXv3HSNjnzT99F1Sdw2EtVYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6083 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 Resent-Date: Tue, 09 Apr 2024 23:08:53 -0700 Resent-From: n.jayaprakash@intel.com Reply-To: devel@edk2.groups.io,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: IKp5I8RfLDaLCnkFDPJ3w2ufx7686176AA= 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=20240206 header.b=etCLXKop; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) Reviewed-by : Jayaprakash N -----Original Message----- From: devel@edk2.groups.io On Behalf Of Jayaprakash,= N Sent: Thursday, April 4, 2024 3:14 PM To: devel@edk2.groups.io Cc: Jayaprakash, N ; Rebecca Cran ; Kinney, Michael D Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function avail= able in edk2module is not working as expected REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4745 This commit fixes the issue reported in the BZ4745. The wrmsr function was always writing 0 to the higher 32 bits of the msr re= gister. This was due to a logical flaw in the code, where the input variabl= e of type unsigned int was left shitted by 32 bits without explicitly conve= rting to a 64 bit value. Problematic statement in the function edk2_wrmsr code: data =3D vedx << 32 | veax; Where the vedx an unsigned int, after left shifting by 32 bits its value wi= ll be set to 0. Because of this the higher 32 bits of the MSR are always se= t to 0. This statement has been modified as below: data =3D (((UINT64)vedx) << 32) | veax; Verified the function by making this change and could see that the wrmsr is= working as expected. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Jayaprakash N --- .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/ed= k2module.c b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/ed= k2module.c index d6af8da..cec4332 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2modul= e.c +++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2mo +++ dule.c @@ -3886,7 +3886,7 @@ edk2_wrmsr(PyObject *self, PyObject *args) UINT64 data =3D 0; if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx)) return NULL; - data =3D vedx << 32 | veax; + data =3D (((UINT64)vedx) << 32) | veax; Py_BEGIN_ALLOW_THREADS AsmWriteMsr64(vecx, data); Py_END_ALLOW_THREADS -- 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 (#117568): https://edk2.groups.io/g/devel/message/117568 Mute This Topic: https://groups.io/mt/105437258/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-