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.100; helo=mga07.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 E99F421B02845 for ; Wed, 27 Jun 2018 23:25:37 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2018 23:25:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,282,1526367600"; d="scan'208";a="68384560" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 27 Jun 2018 23:25:35 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 23:25:25 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 23:25:25 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.223]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.51]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 14:25:23 +0800 From: "Zeng, Star" To: Brijesh Singh , Laszlo Ersek , "edk2-devel@lists.01.org" CC: Tom Lendacky , "Dong, Eric" , "Justen, Jordan L" , "Zeng, Star" Thread-Topic: [edk2] [RFC PATCH 1/1] OvmfPkg/QemuFlash: Fix Runtime variable access when SEV is enabled Thread-Index: AQHUDYZkbjwQo2y44E66eDtVlTyMLqRziq6AgAA9oQCAAAbqgIAADgMAgAFW/xA= Date: Thu, 28 Jun 2018 06:25:23 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB5E096@shsmsx102.ccr.corp.intel.com> References: <1530042365-9979-1-git-send-email-brijesh.singh@amd.com> <272c4a0f-fcc1-2899-e31d-a3207feb51ed@redhat.com> <2a662245-bb03-e742-1403-4d0a47bffda7@amd.com> In-Reply-To: <2a662245-bb03-e742-1403-4d0a47bffda7@amd.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [RFC PATCH 1/1] OvmfPkg/QemuFlash: Fix Runtime variable access when SEV is enabled X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 06:25:38 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 TXkgdW5kZXJzdGFuZGluZyBpcyBNTUlPIGlzIG5vdCBtYW5hZ2VkIGJ5IFVFRkkgbWVtb3J5IHNl cnZpY2VzLCBidXQgR0NEIHNlcnZpY2VzLg0KUEkgc3BlYyBzYXlzICIgSWYgdGhlIG1lbW9yeSBy YW5nZSBzcGVjaWZpZWQgYnkgQmFzZUFkZHJlc3MgYW5kIExlbmd0aCBpcyBvZiB0eXBlIEVmaUdj ZE1lbW9yeVR5cGVTeXN0ZW1NZW1vcnkgb3IgRWZpR2NkTWVtb3J5VHlwZU1vcmVSZWxpYWJsZSwg dGhlbiB0aGUgbWVtb3J5IHJhbmdlIG1heSBiZSBhdXRvbWF0aWNhbGx5ICphbGxvY2F0ZWQqIGZv ciB1c2UgYnkgdGhlICpVRUZJIG1lbW9yeSBzZXJ2aWNlcyouIiBpbiBBZGRNZW1vcnlTcGFjZSgp IGRlc2Nya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