From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 25FB72097F544 for ; Tue, 17 Jul 2018 19:35:58 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 19:35:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,368,1526367600"; d="scan'208";a="67781709" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 17 Jul 2018 19:35:50 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Jul 2018 19:35:46 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Jul 2018 19:35:45 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.100]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.57]) with mapi id 14.03.0319.002; Wed, 18 Jul 2018 10:35:44 +0800 From: "Wang, Jian J" To: Laszlo Ersek , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Yao, Jiewen" , "Zeng, Star" Thread-Topic: [PATCH] UefiCpuPkg/CpuDxe: fix incorrect check of SMM mode Thread-Index: AQHUHdufwGp+E2riAUa6h0EGAqnJh6SUOoFw Date: Wed, 18 Jul 2018 02:35:43 +0000 Message-ID: References: <20180713055357.4196-1-jian.j.wang@intel.com> <2b6a7d47-8d72-0a06-a41e-945226d57bf4@redhat.com> In-Reply-To: <2b6a7d47-8d72-0a06-a41e-945226d57bf4@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzNiOTQ2MGEtODk5ZC00Njc5LTlmM2MtZTEwNWI2YWNjZGVjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNU9iT3gyN3l0M2JjWWNVMXdrazVkOUNIMkFYK3JHVjY2S0dFb2d0bityVEtmaGRNbFBoRE1JYW00cDZFQW9seCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] UefiCpuPkg/CpuDxe: fix incorrect check of SMM mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 02:35:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgTGFzemxvLA0KDQoNClJlZ2FyZHMsDQpKaWFuDQoNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3Nh Z2UtLS0tLQ0KPiBGcm9tOiBMYXN6bG8gRXJzZWsgW21haWx0bzpsZXJzZWtAcm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