From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.3366.1657249206054894619 for ; Thu, 07 Jul 2022 20:00:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aCawqhR9; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657249206; x=1688785206; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=pDWGSJq7FgZqyYaA/+5KubGSLUdFlw3il6m5Lm2AWXU=; b=aCawqhR9lr/TJ5VDLYg4vBaR40ASi+8GveGPc6YIKtTfFPwAJ8mW18Z0 3gK+TAxK010MpkII96cRXyxhAfmxFFYlFPQEt4CiTfcbBpXrIIWHgvlkZ HYiQLC++JzIGJjkNqNqC/4G7irin030nMwI8SFa31LhQWWm0W7vaVXJCJ a+BCnMySalLc27JlvmfV/JBs/ZP4yK7xDDRNcRthTjrgpkl8YiYtVDsTL LxhbERWbESeutUah//nelENiYgt6oxGxvI020VKY/9uqmGJx8LSAdlPss c8CWanNknxuYAY39TDRF5tJ3AWu2v5i8zYCWdMoLUYul19B2tNmZJvno1 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10401"; a="370488168" X-IronPort-AV: E=Sophos;i="5.92,254,1650956400"; d="scan'208";a="370488168" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 20:00:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,254,1650956400"; d="scan'208";a="591422102" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 07 Jul 2022 20:00:05 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 7 Jul 2022 20:00:04 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 7 Jul 2022 20:00:04 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 7 Jul 2022 20:00:04 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 7 Jul 2022 20:00:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lzAM3QBUZgK+jiB6bprOYSk+/C7tJ1CcJC+qe73wvRh1Q9wKTjQCpMrBm2dvYhbR3TBuTYkTmgXHf9AsGC2MYQraO0dYspQwrjcvPRy6czuSWhb4xBtBp10WYX/ysqmBr1Z39sKcgXKP1ymg3wOOcphqaRHwGawUA9QLtvQkgYCeV9upjR+qzsiq3x5tqFtOrnmwQJOck9l1CaL6P36lIt330G1eGVcnoI88c2wq4YV6GdeihMdfkyJKWUTLt+sSDZ/z0p85yMG/pifkjENBLvhD1j34ql0pyFMx3AzH760RE11Zc8/0gN6n/XRCUEtcGk9T4R1+ymyhWRFrcORISw== 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=BScz271tIpMhrHrII+FRL8Zvg1CAlGSV5Pvs5ggFfuQ=; b=RSA0rjBBfBbj95j4akbXlobuk+Hx9rZBlhmEz0cTvDlp1IeoFdHdnpJ6YqNBcVCce1SBZo34Ju6VlGWGXePc4h6H4FgS3qBZTZ7H9M2bAwylsh76yCVur0NQxfuMg6ZgczHZb5dokepW+vENtTMB0FiFRfHFUVVgm54j8DOwNRxSXlBnuZSA2lK6YloCVv3mCURJGGo+rcjCIH3JeP5H6h/d4gdTQTVqfNKCN654ghd0zFTmJcRJEsGhTavVod2CKJcQMVg9hMjiq10BHjTNkABFDCp1Vx9QWtUP8baXZqXrPpAw6Jm/u3RG1N7lSYPI43LwEajKtwIhVEqLPZ64eg== 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 Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by BL1PR11MB5542.namprd11.prod.outlook.com (2603:10b6:208:31d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Fri, 8 Jul 2022 03:00:02 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::991b:97a0:7836:5174]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::991b:97a0:7836:5174%10]) with mapi id 15.20.5417.019; Fri, 8 Jul 2022 03:00:02 +0000 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul1" , "De, Debkumar" , "Han, Harry" , "West, Catharine" Subject: Re: [PATCH v2] UefiCpuPkg: Fix nasm warning "signed byte value exceeds" Thread-Topic: [PATCH v2] UefiCpuPkg: Fix nasm warning "signed byte value exceeds" Thread-Index: AQHYkTnRJbYBXoDVo0islLM8wn8jO61zyv7A Date: Fri, 8 Jul 2022 03:00:02 +0000 Message-ID: References: <20220706131013.19796-1-zhiguang.liu@intel.com> In-Reply-To: <20220706131013.19796-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4099b5d5-2e33-4c8f-b339-08da608df3af x-ms-traffictypediagnostic: BL1PR11MB5542:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SYQOoeIvCTJBo+p2Na11LXRYsqxrotQOG7mKP5+XWJD5giZU0ZgmamVIoF24vnMti3cPeeLj1gPG7ZE9Y2vwZwMiqGnoMEZf2IMSegKw0w0GVk/vDEnv27k5H8c+QOX4AfcPatt4W9u8zPwmX4HCHeayFeFoJ6+3AYho3Z6ATThaJxxlGPIu83HAiFMtieEHTkZvXl7/ugo7WAw6/6Ls3uLYIP/Yz+w/TtOCkHu1OMRwedfvAOKDVseUSl3W9bB58+rHq09b0Mkiwq0Hxblkz59TXkns7HXJsdzQbVdPfrXA1Zk3KD1VhiKkFDnULec3In5tfWbl2Lx1zU5zaijZExRfMMPE7MLFzMKtv+jxEojqBgCkqXuna5kp+/PalcvBh5ZQ0/qVHpNrRGAFNf1++ztXA6GX4IWhAiHBN4PCOQvdOT3Q3Xz/1UdjdoiWj3OIHvvNtfTt8GZMkyImItcyQqlG+JjMLgygP6+8KdWbJLSwn6HuBBOZddTgi7OJXHpileudTJx+IYAhj86qaLIidOqd/EvjzyfiDrY3OrmcxHANRp2IbtF75t5HgwQL3K28w+4SbLaflFEInQg1fFEKQhsYE3B7J8hHgK78hjNA12LUbWLAy3LWRfavxXYf3O6Z9SQhxWJ17rXyLeUR8VckGYMaAJ39U4H6b3WXQ4ciXPb4bPJQOuVmIdqz2i/FGEuF07CiYFDCVf6fwVJUqa/+RkW3pYW7CYD584TvtHmUjVTEkc8btK5s0hjgO2STcmKvjpCbYB1otUIP0AjAvR8wm1JOtFHvLCA+FjB7zAt3jZHlmb3WIJUxp+ylJ2KVhgKS x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(346002)(39860400002)(136003)(396003)(366004)(316002)(110136005)(55016003)(9686003)(38100700002)(26005)(54906003)(82960400001)(122000001)(7696005)(6506007)(53546011)(52536014)(8676002)(76116006)(64756008)(83380400001)(33656002)(66946007)(107886003)(66446008)(66476007)(66556008)(86362001)(41300700001)(2906002)(38070700005)(186003)(478600001)(5660300002)(8936002)(4326008)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2bDXDucOiHRtSPiUAC1TxPwuAvpnoD+XdTXD6h6fIKlJLA6T4Eqc0itaD4zd?= =?us-ascii?Q?69GOGxEexaYFtQGCkGCJzOxq984VeIejjh7+E9eGUI88fo8WdOa9tL18buCU?= =?us-ascii?Q?joNEnJALF0skP+DD7rLHqIY3q1371DUmfWPmAZAPO5eTp2kIc0M8XxTLG469?= =?us-ascii?Q?vHLgii5gNgb1ghPbLMSrA+uhzkaGExNZM8b+TO5SZ0HMdnroSIbclPO4iEZg?= =?us-ascii?Q?Gu7XQSFsdQswJ9nfDHY5ugVs48yBZrhsonOVN0lNe/mucIMeulFR32wAG2ec?= =?us-ascii?Q?c6Zn6UJhR3VinuVTLe11jGPlup/3ailooG9IUxjzjivxLLQwj8J8S2dFlxkD?= =?us-ascii?Q?qt9jTSfM18q6RQGQiC+vQMtmFt6QpsmoKkblR3DLjlBYR8HmVG2F0UmLj1b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iKszk1UHt3fUWv/QLPY7bl07dEFgKGO/25D/?= =?us-ascii?Q?6UIBDfBHWQ2bBhVTVmJ2rVsx4bj2SQIV4EyDzaJ6+0sstsucciFzvI6Fm3Zp?= =?us-ascii?Q?XBnEWfZ45DwCoxhRIOuD4/0vukY8c+wlflX96YZUkvHKLuGeqKENjoNZkPD/?= =?us-ascii?Q?dn44tcL5XYOM+o1I69ap2oR0nxh4As/R6gPentB3h58YOCi3iyYCJtuZLnth?= =?us-ascii?Q?FE3yZL65HAZlNpmk2QkhEiYHb05lv4YsNxrMVUbPukIeb86N1qzHFk7opa/1?= =?us-ascii?Q?jIAbDHPYxtzsVAHTN3BaJYzc/gF9FcYQaTtzWQAx?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4099b5d5-2e33-4c8f-b339-08da608df3af X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2022 03:00:02.1223 (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: /dIXXAbti1/Tq0WaXCuMcditHmLUtl2KvPe9p/kG+C9fQst5CUfgoZxxw//voPfNNYBYhuoghMjvHo/HzNCDgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5542 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Liu, Zhiguang > Sent: Wednesday, July 6, 2022 9:10 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Dong, Eric ; Ni, Ray ; Kumar, > Rahul1 ; De, Debkumar ; Ha= n, Harry ; West, > Catharine > Subject: [PATCH v2] UefiCpuPkg: Fix nasm warning "signed byte value excee= ds" >=20 > Currently, "push byte %[Vector]" causes nasm warning when Vector is large= r > than 0x7F. This is because push accepts a signed value, and byte means > signed int8. Maximum signed int8 is 0x7F. > When Vector is larger the 0x7F, for example, when Vector is 255, byte 255 > turns to -1, and causes the warning "signed byte value exceeds". > To avoid such warning, use dword instead of byte, this will increase 3 by= tes > for each IdtVector. > For IA32, the size of IdtVector will increase from 10 bytes to 13 bytes. > For X64, the size of IdtVector will increase from 15 bytes to 18 bytes. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Debkumar De > Cc: Harry Han > Cc: Catharine West > Signed-off-by: Zhiguang Liu > --- > .../Library/CpuExceptionHandlerLib/CpuExceptionCommon.h | 2 +- > .../CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm | 7 +++--= -- > .../CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm | 11 +++++= ------ > 3 files changed, 9 insertions(+), 11 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon= .h > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h > index 0f012bccde..fd42c4be0f 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h > @@ -22,7 +22,7 @@ >=20 > #define CPU_EXCEPTION_NUM 32 > #define CPU_INTERRUPT_NUM 256 > -#define HOOKAFTER_STUB_SIZE 16 > +#define HOOKAFTER_STUB_SIZE 18 >=20 > // > // Exception Error Code of Page-Fault Exception > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHand= lerAsm.nasm > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm > index 8ed2b8f455..31a00449a2 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.= nasm > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.= nasm > @@ -34,7 +34,7 @@ ALIGN 8 > AsmIdtVectorBegin: > %assign Vector 0 > %rep 256 > - push byte %[Vector]; > + push strict dword %[Vector]; > push eax > mov eax, ASM_PFX(CommonInterruptEntry) > jmp eax > @@ -43,9 +43,8 @@ AsmIdtVectorBegin: > AsmIdtVectorEnd: >=20 > HookAfterStubBegin: > - db 0x6a ; push > + push strict dword 0 ; 0 will be fixed > VectorNum: > - db 0 ; 0 will be fixed > push eax > mov eax, HookAfterStubHeaderEnd > jmp eax > @@ -453,5 +452,5 @@ global ASM_PFX(AsmVectorNumFixup) > ASM_PFX(AsmVectorNumFixup): > mov eax, dword [esp + 8] > mov ecx, [esp + 4] > - mov [ecx + (VectorNum - HookAfterStubBegin)], al > + mov [ecx + (VectorNum - 4 - HookAfterStubBegin)], al > ret > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5Exceptio= nHandlerAsm.nasm > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm= .nasm > index 7c0e3d3b0b..9574785742 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandle= rAsm.nasm > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandle= rAsm.nasm > @@ -57,18 +57,17 @@ ALIGN 8 > AsmIdtVectorBegin: > %assign Vector 0 > %rep 256 > - push byte %[Vector] > + push strict dword %[Vector] ; This instruction pushes sign-extend= ed 8-byte value on stack > push rax > - mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterrup= tEntry) > + mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterrup= tEntry) > jmp rax > %assign Vector Vector+1 > %endrep > AsmIdtVectorEnd: >=20 > HookAfterStubHeaderBegin: > - db 0x6a ; push > -@VectorNum: > - db 0 ; 0 will be fixed > + push strict dword 0 ; 0 will be fixed > +VectorNum: > push rax > mov rax, strict qword 0 ; mov rax, HookAfterStubHeaderEn= d > JmpAbsoluteAddress: > @@ -478,6 +477,6 @@ ASM_PFX(AsmGetTemplateAddressMap): > global ASM_PFX(AsmVectorNumFixup) > ASM_PFX(AsmVectorNumFixup): > mov rax, rdx > - mov [rcx + (@VectorNum - HookAfterStubHeaderBegin)], al > + mov [rcx + (VectorNum - 4 - HookAfterStubHeaderBegin)], al > ret >=20 > -- > 2.16.2.windows.1