x86/EFI: simplify PCI option ROM retrieval
authorJan Beulich <jbeulich@suse.com>
Mon, 4 Feb 2013 11:10:26 +0000 (12:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Feb 2013 11:10:26 +0000 (12:10 +0100)
While putting together the kernel side of this I realized that c/s
26397:d9c7b82aa7b1 went a little too far in requiring a buffer for the
option ROM contents - all that is really needed is handing Dom0
physical address and size of the data block.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/efi/runtime.c
xen/include/public/platform.h

index c5b03bfe2ccf3f4685ac563b7073a53ca8fb2113..73aa15eb9a4902ff85e02ed91c25ae809ca5bb9a 100644 (file)
@@ -189,16 +189,9 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
                  info->pci_rom.vendor == ent->vendor &&
                  info->pci_rom.devid == ent->devid )
             {
-                int rc = 0;
-
-                if ( info->pci_rom.size < ent->size )
-                    rc = -ENOSPC;
-                else if ( copy_to_guest(info->pci_rom.data,
-                                        ent->data, ent->size) )
-                    rc = -EFAULT;
+                info->pci_rom.address = __pa(ent->data);
                 info->pci_rom.size = ent->size;
-
-                return rc;
+                return 0;
             }
         return -ESRCH;
     }
index 16e08aae574e8cae922d3a412bee1ac69f232d2f..c24463fb550cfdbc6872d05b135fb7c3adb728a7 100644 (file)
@@ -274,9 +274,9 @@ struct xenpf_firmware_info {
                 uint8_t devfn;
                 uint16_t vendor;
                 uint16_t devid;
-                /* IN/OUT variables */
+                /* OUT variables */
+                uint64_t address;
                 xen_ulong_t size;
-                XEN_GUEST_HANDLE(void) data;
             } pci_rom;
         } efi_info; /* XEN_FW_EFI_INFO */