From: "Lendacky, Thomas" Subject: Re: [PATCH 2/2] Allow SEV firmware to be chosen based on Family and Model Date: Wed, 19 Sep 2018 13:29:30 +0000 Message-ID: <85155459-44ef-b200-f442-fc5fde75a1ae@amd.com> References: <5c58c32c0ce89c35a95e151734f5d43a3ed0dca0.1536959537.git.Janakarajan.Natarajan@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: "Hook, Gary" , Herbert Xu , "David S . Miller" , "Singh, Brijesh" To: "Natarajan, Janakarajan" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" Return-path: In-Reply-To: <5c58c32c0ce89c35a95e151734f5d43a3ed0dca0.1536959537.git.Janakarajan.Natarajan@amd.com> Content-Language: en-US Content-ID: <4730B51C1681B44AAC99B2A4747D6F9A@namprd12.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org DQoNCk9uIDA5LzE0LzIwMTggMDU6MzIgUE0sIEphbmFrYXJhamFuIE5hdGFyYWphbiB3cm90ZToN Cj4gRHVyaW5nIFBTUCBpbml0aWFsaXphdGlvbiwgdGhlcmUgaXMgYW4gYXR0ZW1wdCB0byB1cGRh dGUgdGhlIFNFViBmaXJtd2FyZQ0KPiBieSBsb29raW5nIGluIC9saWIvZmlybXdhcmUvYW1kLy4g Q3VycmVudGx5LCBzZXYuZncgaXMgdGhlIGV4cGVjdGVkIG5hbWUNCj4gb2YgdGhlIGZpcm13YXJl IGJsb2IuDQo+IA0KPiBUaGlzIHBhdGNoIHdpbGwgYWxsb3cgZm9yIGZpcm13YXJlIGZpbGVuYW1l cyBiYXNlZCBvbiB0aGUgZmFtaWx5IGFuZA0KPiBtb2RlbCBvZiB0aGUgcHJvY2Vzc29yLg0KPiAN Cj4gTW9kZWwgc3BlY2lmaWMgZmlybXdhcmUgZmlsZXMgYXJlIGdpdmVuIGhpZ2hlc3QgcHJpb3Jp dHkuIEZvbGxvd2VkIGJ5DQo+I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