<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AMD Archives &#8211; Structured Procrastination</title>
	<atom:link href="https://blog.adamspiers.org/tag/amd/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.adamspiers.org/tag/amd/</link>
	<description>because there&#039;s always something more interesting than what you should be doing</description>
	<lastBuildDate>Wed, 18 Sep 2019 11:32:40 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://blog.adamspiers.org/wp-content/uploads/2018/12/cropped-IMG_20160907_193859-PANO-c-7-32x32.jpg</url>
	<title>AMD Archives &#8211; Structured Procrastination</title>
	<link>https://blog.adamspiers.org/tag/amd/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Improving trust in the cloud with OpenStack and AMD SEV</title>
		<link>https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/</link>
					<comments>https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/#respond</comments>
		
		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Fri, 13 Sep 2019 12:00:00 +0000</pubDate>
				<category><![CDATA[front page]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[coopetition]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[SEV]]></category>
		<guid isPermaLink="false">https://blog.adamspiers.org/?p=1871</guid>

					<description><![CDATA[<p>This post contains an exciting announcement, but first I need to provide some context! Ever heard that joke &#8220;the cloud is just someone else&#8217;s computer&#8221;? Of course it&#8217;s a gross over-simplification, but there&#8217;s more than a grain of truth in it. And that raises the question: if your applications are running in someone else&#8217;s data-centre, [&#8230;]</p>
<p>The post <a href="https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/">Improving trust in the cloud with OpenStack and AMD SEV</a> appeared first on <a href="https://blog.adamspiers.org">Structured Procrastination</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p> This post contains an exciting announcement, but first I need to provide some context! </p>
<p> Ever heard that joke &#8220;the cloud is just someone else&#8217;s computer&#8221;? </p>
<div class="figure">
<p><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/no-cloud-coffee-mug.jpg" alt="Coffee mug saying &quot;There is no cloud. It's just someone else's computer&quot;" title="There are T-shirts too ..." style="width: 50%; margin: 0 auto; display: block;" /> </p>
</p></div>
<p> Of course it&#8217;s a gross over-simplification, but there&#8217;s more than a grain of truth in it.  And that raises the question: <b>if your applications are running in someone else&#8217;s data-centre, how can you trust that they&#8217;re not being snooped upon, or worse, invasively tampered with?</b> </p>
<p> Until recently, the answer was &#8220;you can&#8217;t&#8221;.  Well, that&#8217;s another over-simplification.  You could design your workload to be tamperproof; for example even if individual mining nodes in Bitcoin or Ethereum are compromised, the blockchain as a whole will resist the attack just fine.  But there&#8217;s still the snooping problem. </p>
<div id="outline-container-org4c32b9b" class="outline-2">
<h2 id="org4c32b9b">Hardware to the rescue?</h2>
<div class="outline-text-2" id="text-org4c32b9b">
<p> However, there&#8217;s some good news on this front.  Intel and AMD realised this was a problem, and have both introduced new hardware capabilities to help improve the level to which cloud users can trust the environment in which their workloads are executed, e.g.: </p>
<ul class="org-ul">
<li>
<p> <a href="https://en.wikipedia.org/wiki/Zen_(microarchitecture)#Enhanced_security_and_virtualization_support">AMD SEV (Secure Encrypted Virtualization)</a> which can encrypt the memory of a running VM with a key which is only accessible to the owner of that VM.  This is done on-chip so that even if you have physical access to the machine, it makes it a lot harder to snoop in on the running VM<sup><a id="fnr.1" name="fnr.1" class="footref" href="#fn.1">1</a></sup>. </p>
<p> It can also provide the guest owner with an attestation which cryptographically proves that the memory was encrypted correctly and can only be decrypted by the owner. </p>
</li>
<li><a href="https://www.tomshardware.co.uk/intel-mktme-amd-memory-encryption,news-60766.html">Intel MKTME (Multi-Key Total Memory Encryption)</a> which is a similar approach.</li>
</ul>
<p> But even with that hardware support, there is the question to what degree anyone can trust public clouds run on proprietary technology. There is a growing awareness that Free (Libre) / Open Source Software tends to be inherently more secure and trustworthy, since its transparency enables unlimited peer review, and its openness allows anyone to contribute improvements. </p>
<p> And these days, <a href="https://www.openstack.org">OpenStack</a> is pretty much the undisputed king of the Open Source cloud infrastructure world. </p>
</div>
</div>
<div id="outline-container-org85d715d" class="outline-2">
<h2 id="org85d715d">An exciting announcement</h2>
<div class="outline-text-2" id="text-org85d715d">
<p> So I&#8217;m delighted to be able to announce a significant step forward in trustworthy cloud computing: as of this week, <b>OpenStack is now able to launch VMs with SEV enabled!</b> (Given the appropriate AMD hardware, of course.) </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-flavor-metadata-2.png" title="The new hw:mem_encryption flavor extra spec. Click for full size." alt="The new hw:mem_encryption flavor extra spec" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-flavor-metadata-2-1.png" alt="The new hw:mem_encryption flavor extra spec" title="The new hw:mem_encryption flavor extra spec. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> The core functionality is all merged and will be in the imminent Train release.  You can read <a href="https://docs.openstack.org/nova/latest/admin/configuration/hypervisor-kvm.html#amd-sev-secure-encrypted-virtualization">the documentation</a>, and you will also find it mentioned in <a href="https://docs.openstack.org/releasenotes/nova/">the Nova Release Notes</a>. </p>
<p> While this is &#8220;only&#8221; an <a href="https://en.wikipedia.org/wiki/Minimum_viable_product">MVP</a> and far from the end of the journey (see below), it&#8217;s an important milestone in a strong partnership between my employer <a href="http://suse.com/">SUSE</a> and <a href="https://www.amd.com/">AMD</a>.  We started work on adding SEV support into OpenStack around a year ago: </p>
<div class="figure">
<p><a href="https://blueprints.launchpad.net/nova/+spec/amd-sev-libvirt-support" title="The original blueprint for integrating AMD SEV into nova. Click for full size." alt="The original blueprint for integrating AMD SEV into nova" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-launchpad-blueprint-implemented.png" alt="The original blueprint for integrating AMD SEV into nova" title="The original blueprint for integrating AMD SEV into nova. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> This resulted in <a href="http://specs.openstack.org/openstack/nova-specs/specs/train/approved/amd-sev-libvirt-support.html">one of the most in-depth technical specification documentations I&#8217;ve ever had to write</a>, plus many months of intense collaboration on the code and several changes in design along the way. </p>
<div class="figure">
<p><a href="https://review.opendev.org/#/q/topic:bp/amd-sev-libvirt-support+status:merged" title="SEV code reviews. Click to view in Gerrit!" alt="SEV code reviews. Click to view in Gerrit!" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Gerrit-merged-patches.png" alt="SEV code reviews. Click to view in Gerrit!" title="SEV code reviews. Click to view in Gerrit!" style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> I&#8217;d like to thank not only my colleagues at SUSE and AMD for all their work so far, but also many members of the upstream OpenStack community, especially the <a href="https://wiki.openstack.org/wiki/Nova">Nova</a> team.  In particular I enjoyed fantastic support from the PTL (Project Technical Lead) Eric Fried, and several developers at Red Hat, which I think speaks volumes to how well <a href="https://en.wikipedia.org/wiki/Coopetition">the &#8220;coopetition&#8221; model</a> works in the Open Source world. </p>
<p> The rest of this post gives a quick tour of the implementation via screenshots and brief explanations, and then concludes with what&#8217;s planned next. </p>
<p><span id="more-1871"></span></p>
<p> OpenStack&#8217;s Compute service (nova) will automatically detect the presence of the SEV feature on any compute node which is configured to support it.  You can optionally configure how many slots are available on the memory controller for encryption keys.  One is used for each guest, so this effectively acts as the maximum number of guest VMs which can concurrently use SEV.  Here you can see the configuration of <a href="https://docs.openstack.org/nova/latest/configuration/config.html#libvirt.num_memory_encrypted_guests">this option</a>, and how nova handles the inventory.  Note that it also registers an SEV trait on the compute host, so that in the future if the cloud has a mix of hardware offering different guest memory encryption technologies, you&#8217;ll be able to choose which one you want for any given guest, if you need to. </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-compute-inventory-trait.png" title="Inventorying the SEV feature. Click for full size." alt="Inventorying the SEV feature." style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-compute-inventory-trait.png" alt="Inventorying the SEV feature." title="Inventorying the SEV feature. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> SEV can be enabled by the operator by adding a new <code>hw:mem_encryption</code> &#8220;extra spec&#8221; which is a property on nova&#8217;s <a href="https://docs.openstack.org/nova/latest/user/flavors.html">flavors</a>.  As already shown in the screenshot above, this can be done through Horizon, OpenStack&#8217;s web dashboard.  However it can also be set per-image via a similarly-named property <code>hw_mem_encryption</code>: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-image-metadata-4.png" title="Enabling SEV via image property in Horizon. Click for full size." alt="Enabling SEV via image property in Horizon." style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-image-metadata-4.png" alt="Enabling SEV via image property in Horizon." title="Enabling SEV via image property in Horizon. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> and of course this can all be done via the command-line too: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-flavor-image.png" title="Enabling SEV via CLI. Click for full size." alt="Enabling SEV via CLI. Click for full size." style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-flavor-image.png" alt="Enabling SEV via CLI. Click for full size." title="Enabling SEV via CLI. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> Notice the presence of a few other image properties which are crucial for SEV to function correctly.  (These are explained fully in the documentation.) </p>
<p> Once booted, an SEV VM instance looks and behaves pretty much like any other OpenStack VM: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-instances.png" title="SEV instances listed in Horizon. Click for full size." alt="SEV instances listed in Horizon" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-Horizon-instances.png" alt="SEV instances listed in Horizon" title="SEV instances listed in Horizon. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> However there are <a href="https://docs.openstack.org/nova/latest/admin/configuration/hypervisor-kvm.html#impermanent-limitations">some limitations</a>, e.g. it cannot <i>yet</i> be live-migrated or suspended: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-live-migrate-suspend-forbidden.png" title="Enabling SEV via flavor extra spec or image property. Click for full size." alt="Enabling SEV via flavor extra spec or image property" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-live-migrate-suspend-forbidden.png" alt="Enabling SEV via flavor extra spec or image property" title="Enabling SEV via flavor extra spec or image property. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> Behind the scenes, nova takes care of quite a few important details in how the VM is configured in libvirt.  Firstly it performs sanity checks on the flavor and image properties.  Then it adds a crucial new <code>&lt;launchSecurity&gt;</code> element: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-server-launchSecurity-XML.png" title="Enabling SEV via flavor extra spec or image property. Click for full size." alt="Enabling SEV via flavor extra spec or image property" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-server-launchSecurity-XML.png" alt="Enabling SEV via flavor extra spec or image property" title="Enabling SEV via flavor extra spec or image property. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
<p> and also enables IOMMU for <code>virtio</code> devices: </p>
<div class="figure">
<p><a href="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-server-iommu-XML.png" title="Enabling IOMMU for virtio devices. Click for full size." alt="Enabling IOMMU for virtio devices" style="width: 98%; margin: 0 auto; display: block;"><img decoding="async" src="https://blog.adamspiers.org/wp-content/uploads/2019/09/SEV-CLI-server-iommu-XML.png" alt="Enabling IOMMU for virtio devices" title="Enabling IOMMU for virtio devices. Click for full size." style="width: 98%; margin: 0 auto; display: block;" /></a> </p>
</p></div>
</div>
</div>
<div id="outline-container-orgb46ad8b" class="outline-2">
<h2 id="orgb46ad8b">What&#8217;s next?</h2>
<div class="outline-text-2" id="text-orgb46ad8b">
<p> This area of technology is new and rapidly evolving, so there is still plenty of work left to be done, especially on the software side. </p>
<p> Of course we&#8217;ll be adding this functionality to <a href="https://www.suse.com/products/suse-openstack-cloud/">SUSE OpenStack Cloud</a>, initially as a technical preview for our customers to try out. </p>
<p> Probably the most important feature needed next on the SEV side is the ability to verify the attestation which cryptographically proves that the memory was encrypted correctly and can only be decrypted by the owner.  In addition specification of the work required to add support to OpenStack for Intel&#8217;s MKTME already <a href="https://review.opendev.org/#/c/666769/">started</a>, so I would expect that to continue. </p>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">
<div class="footdef"><sup><a id="fn.1" name="fn.1" class="footnum" href="#fnr.1">1</a></sup> </p>
<div class="footpara">
<p class="footpara"> There are still potential attacks, e.g. snooping unencrypted memory cache or CPU registers.  Work by AMD and others is ongoing to address these. </p>
</div>
</div>
</div>
</div>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.adamspiers.org%2F2019%2F09%2F13%2Fimproving-trust-in-the-cloud-with-openstack-and-amd-sev%2F&#038;title=Improving%20trust%20in%20the%20cloud%20with%20OpenStack%20and%20AMD%20SEV" data-a2a-url="https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/" data-a2a-title="Improving trust in the cloud with OpenStack and AMD SEV"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/">Improving trust in the cloud with OpenStack and AMD SEV</a> appeared first on <a href="https://blog.adamspiers.org">Structured Procrastination</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.adamspiers.org/2019/09/13/improving-trust-in-the-cloud-with-openstack-and-amd-sev/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
