From: Gary R Hook Subject: Re: [PATCH 2/2] Allow SEV firmware to be chosen based on Family and Model Date: Wed, 19 Sep 2018 13:41:19 +0000 Message-ID: <1ac0bcb0-92fd-ea8c-691f-7b80fff5e251@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: "Lendacky, Thomas" , "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: <7EC152EDB77D3A43BDE544759DB4093C@namprd12.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org T24gMDkvMTQvMjAxOCAwNTozMiBQTSwgSmFuYWthcmFqYW4gTmF0YXJhamFuIHdyb3RlOg0KPiBE dXJpbmcgUFNQIGluaXRpYWxpemF0aW9uLCB0aGVyZSBpcyBhbiBhdHRlbXB0IHRvIHVwZGF0ZSB0 aGUgU0VWIGZpcm13YXJlDQo+IGJ5IGxvb2tpbmcgaW4gL2xpYi9maXJtd2FyZS9hbWQvLiBDdXJy ZW50bHksIHNldi5mdyBpcyB0aGUgZXhwZWN0ZWQgbmFtZQ0KPiBvZiB0aGUgZmlybXdhcmUgYmxv Yi4NCj4gDQo+IFRoaXMgcGF0Y2ggd2lsbCBhbGxvdyBmb3IgZmlybXdhcmUgZmlsZW5hbWVzIGJh c2VkIG9uIHRoZSBmYW1pbHkgYW5kDQo+IG1vZGVsIG9mIHRoZSBwcm9jZXNzb3IuDQo+IA0KPiBN b2RlbCBzcGVjaWZpYyBmaXJtd2FyZSBmaWxlcyBhcmUgZ2l2ZW4gaGlnaGVzdCBwcmlvcml0eS4g Rm9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