]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioRngDxe/VirtioRng.c
OvmfPkg/Virtio: Fix few typos
[mirror_edk2.git] / OvmfPkg / VirtioRngDxe / VirtioRng.c
index 4e679978810563b90b47a41a3b3b1cbb5285d535..4e2b710f9e491207cdb796e6b540e9f08db2de16 100644 (file)
 \r
   Copyright (C) 2016, Linaro Ltd.\r
 \r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  distribution. The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
-  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -162,7 +156,7 @@ VirtioRngGetRNG (
 \r
   Dev = VIRTIO_ENTROPY_SOURCE_FROM_RNG (This);\r
   //\r
-  // Map Buffer's system phyiscal address to device address\r
+  // Map Buffer's system physical address to device address\r
   //\r
   Status = VirtioMapAllBytesInSharedBuffer (\r
              Dev->VirtIo,\r
@@ -279,7 +273,7 @@ VirtioRngInit (
     goto Failed;\r
   }\r
 \r
-  Features &= VIRTIO_F_VERSION_1;\r
+  Features &= VIRTIO_F_VERSION_1 | VIRTIO_F_IOMMU_PLATFORM;\r
 \r
   //\r
   // In virtio-1.0, feature negotiation is expected to complete before queue\r
@@ -360,7 +354,7 @@ VirtioRngInit (
   // step 5 -- Report understood features and guest-tuneables.\r
   //\r
   if (Dev->VirtIo->Revision < VIRTIO_SPEC_REVISION (1, 0, 0)) {\r
-    Features &= ~(UINT64)VIRTIO_F_VERSION_1;\r
+    Features &= ~(UINT64)(VIRTIO_F_VERSION_1 | VIRTIO_F_IOMMU_PLATFORM);\r
     Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);\r
     if (EFI_ERROR (Status)) {\r
       goto UnmapQueue;\r
@@ -435,6 +429,7 @@ VirtioRngExitBoot (
 {\r
   VIRTIO_RNG_DEV *Dev;\r
 \r
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));\r
   //\r
   // Reset the device. This causes the hypervisor to forget about the virtio\r
   // ring.\r
@@ -444,12 +439,6 @@ VirtioRngExitBoot (
   //\r
   Dev = Context;\r
   Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);\r
-\r
-  //\r
-  // Unmap the ring buffer so that hypervisor will not be able to get readable\r
-  // data after device reset.\r
-  //\r
-  Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, Dev->RingMap);\r
 }\r
 \r
 \r