Re: EFI stub boots only with setup_efi_pc() commented

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> Could you try the attached patch and let me know what you observe?

Using the patch below, I get a whole bunch of numbers. I hope you do
not need the entire sequence as they scroll off screen too quickly to
read. When the scrolling stops, the screen appears as follows:

11
8
9
10
11
8
9
10
<pattern then repeats several times>
11
25
26
_

What does that mean exactly? That is, why doesn't it ever get to 12?

>>> ---
>>>
>>> diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
>>> index b7388a4..f4a966d 100644
>>> --- a/arch/x86/boot/compressed/eboot.c
>>> +++ b/arch/x86/boot/compressed/eboot.c
>>> @@ -261,30 +261,37 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
>>>         int i;
>>>         struct setup_data *data;
>>>
>>> +       efi_printk("1\n");
>>>         data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
>>>
>>>         while (data && data->next)
>>>                 data = (struct setup_data *)(unsigned long)data->next;
>>>
>>> +       efi_printk("2\n");
>>>         status = efi_call_phys5(sys_table->boottime->locate_handle,
>>>                                 EFI_LOCATE_BY_PROTOCOL, &pci_proto,
>>>                                 NULL, &size, pci_handle);
>>>
>>> +       efi_printk("3\n");
>>>         if (status == EFI_BUFFER_TOO_SMALL) {
>>>                 status = efi_call_phys3(sys_table->boottime->allocate_pool,
>>>                                         EFI_LOADER_DATA, size, &pci_handle);
>>>
>>> +               efi_printk("4\n");
>>>                 if (status != EFI_SUCCESS)
>>>                         return status;
>>>
>>> +               efi_printk("5\n");
>>>                 status = efi_call_phys5(sys_table->boottime->locate_handle,
>>>                                         EFI_LOCATE_BY_PROTOCOL, &pci_proto,
>>>                                         NULL, &size, pci_handle);
>>> +               efi_printk("6\n");
>>>         }
>>>
>>>         if (status != EFI_SUCCESS)
>>>                 goto free_handle;
>>>
>>> +       efi_printk("7\n");
>>>         nr_pci = size / sizeof(void *);
>>>         for (i = 0; i < nr_pci; i++) {
>>>                 void *h = pci_handle[i];
>>> @@ -297,13 +304,16 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
>>>                 if (status != EFI_SUCCESS)
>>>                         continue;
>>>
>>> +               efi_printk("8\n");
>>>                 if (!pci)
>>>                         continue;
>>>
>>> +               efi_printk("9\n");
>>>  #ifdef CONFIG_X86_64
>>>                 status = efi_call_phys4(pci->attributes, pci,
>>>                                         EfiPciIoAttributeOperationGet, 0,
>>>                                         &attributes);
>>> +               efi_printk("10\n");
>>>  #else
>>>                 status = efi_call_phys5(pci->attributes, pci,
>>>                                         EfiPciIoAttributeOperationGet, 0, 0,
>>> @@ -312,43 +322,54 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
>>>                 if (status != EFI_SUCCESS)
>>>                         continue;
>>>
>>> +               efi_printk("11\n");
>>>                 if (!pci->romimage || !pci->romsize)
>>>                         continue;
>>>
>>> +               efi_printk("12\n");
>>>                 size = pci->romsize + sizeof(*rom);
>>>
>>>                 status = efi_call_phys3(sys_table->boottime->allocate_pool,
>>>                                 EFI_LOADER_DATA, size, &rom);
>>>
>>> +               efi_printk("13\n");
>>>                 if (status != EFI_SUCCESS)
>>>                         continue;
>>>
>>> +               efi_printk("14\n");
>>>                 rom->data.type = SETUP_PCI;
>>>                 rom->data.len = size - sizeof(struct setup_data);
>>>                 rom->data.next = 0;
>>>                 rom->pcilen = pci->romsize;
>>>
>>> +               efi_printk("15\n");
>>>                 status = efi_call_phys5(pci->pci.read, pci,
>>>                                         EfiPciIoWidthUint16, PCI_VENDOR_ID,
>>>                                         1, &(rom->vendor));
>>> +               efi_printk("16\n");
>>>
>>>                 if (status != EFI_SUCCESS)
>>>                         goto free_struct;
>>>
>>> +               efi_printk("17\n");
>>>                 status = efi_call_phys5(pci->pci.read, pci,
>>>                                         EfiPciIoWidthUint16, PCI_DEVICE_ID,
>>>                                         1, &(rom->devid));
>>>
>>> +               efi_printk("18\n");
>>>                 if (status != EFI_SUCCESS)
>>>                         goto free_struct;
>>>
>>> +               efi_printk("19\n");
>>>                 status = efi_call_phys5(pci->get_location, pci,
>>>                                         &(rom->segment), &(rom->bus),
>>>                                         &(rom->device), &(rom->function));
>>>
>>> +               efi_printk("20\n");
>>>                 if (status != EFI_SUCCESS)
>>>                         goto free_struct;
>>>
>>> +               efi_printk("21\n");
>>>                 memcpy(rom->romdata, pci->romimage, pci->romsize);
>>>
>>>                 if (data)
>>> @@ -358,13 +379,18 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
>>>
>>>                 data = (struct setup_data *)rom;
>>>
>>> +               efi_printk("22\n");
>>>                 continue;
>>>         free_struct:
>>> +               efi_printk("23\n");
>>>                 efi_call_phys1(sys_table->boottime->free_pool, rom);
>>> +               efi_printk("24\n");
>>>         }
>>>
>>>  free_handle:
>>> +       efi_printk("25\n");
>>>         efi_call_phys1(sys_table->boottime->free_pool, pci_handle);
>>> +       efi_printk("26\n");
>>>         return status;
>>>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux