Re: Was there a Wiki on what we can do with GRUB2? And what happened to it?

2015-05-25 Thread Vladimir 'phcoder' Serbinenko
Wiki is gone because of lack of hosting. I still have last dump from it but
at that point all relevant info is probably in the manual
Le 12 mai 2015 05:54, "Gregg Levine"  a écrit :

> Hello!
> I am revisiting an issue that surfaced on or about the beginning of
> November of 2008. I found the relevant messages in my Google Mail
> store and went over them, I also read the corresponding coreboot
> messages from the same period.
>
> The responding individual then mentions that what I was interested in,
> namely using Grub2 to bring up a payload of coreboot as an Elf file
> was indeed described on a Wiki. It happens I recall studying the pages
> then, but it seems the pages are gone now, although the Archive.org
> site may remember them. But I'm asking here first.
> -
> Gregg C Levine gregg.drw...@gmail.com
> "This signature fought the Time Wars, time and again."
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: disk/ahci: Unaligned pointer with old commit as coreboot payload

2015-05-25 Thread Vladimir 'phcoder' Serbinenko
Those are not even compiled on coreboot. Unaligned pointer is bad free or
memory corruption
Le 24 mai 2015 20:52, "Andrei Borzenkov"  a écrit :

> В Sun, 24 May 2015 20:33:57 +0200
> Paul Menzel  пишет:
>
> > Dear Andrei,
> >
> >
> > Am Sonntag, den 24.05.2015, 21:23 +0300 schrieb Andrei Borzenkov:
> > > В Sun, 24 May 2015 14:30:28 +0200 Paul Menzel пишет:
> >
> > > > Am Sonntag, den 24.05.2015, 13:15 +0300 schrieb Andrei Borzenkov:
> > > > > В Sun, 24 May 2015 09:03:40 +0200 Paul Menzel пишет:
> > > > >
> > > > > > further trying to bisect the AHCI regression on, that the GRUB
> payload
> > > > > > does not detect the AHCI drive [1], I tried to build GRUB from
> commits
> > > > > > changing `grub-core/disk/ahci.c`, I built commit dc2a6c8b
> (Improve AHCI
> > > > > > detection and command issuing.), but it it fails to boot with
> > > > > >
> > > > > > Unaligned pointer …
> > > > > > Aborted.
> > > > > >
> > > > > > The same happens, when I just checkout that revision for
> `ahci.c` and
> > > > > > leave the rest as is.
> > > > > >
> > > > > > $ git checkout dc2a6c8b0e3dfe3bce78dbe0febcd9d4d9038411
> -- grub-core/disk/ahci.c
> > > > > > $ ./autogen.sh
> > > > > > $ ./configure --with-plattform=coreboot
> > > > > > $ make -j
> > > > > > $ make default_payload.elf
> > > > > >
> > > > > > I’ll attach that version of `ahci.c` to this message. Do you see
> what
> > > > > > could be causing that unaligned pointer?
> > > > > >
> > > > >
> > > > > It is not clear - do you mean that this specific revision has this
> > > > > problem and others not? Or that this problem happens since this
> > > > > revision?
> > > >
> > > > It’s happening whenever `ahci.c` from commit dc2a6c8b is used (with
> > > > commit dc2a6c8b and master).
> > >
> > > It does not really answer my question - do you get this unaligned
> access
> > > with current master?
> >
> > Sorry for the misunderstand. I do *not* get this unaligned access with
> > current master. `ahci.c` was rewritten after commit dc2a6c8b.
> >
>
> In this case my primary suspects would be several PCI accesses that had
> been removed in subsequent commits:
>
> +#ifdef GRUB_MACHINE_QEMU
> +  addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
> +  grub_pci_write_word (addr, 0x107);
> +#endif
> +
>addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG5);
> +
> +#ifdef GRUB_MACHINE_QEMU
> +  grub_pci_write (addr, 0xf400);
> +#endif
>
> Those added lines are not present anymore.
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Correct spelling of *scheduled*

2015-05-25 Thread richardvo...@gmail.com
In the same line of the comment, "miscellaneous" is also spelled
incorrectly.

On Mon, May 25, 2015 at 3:13 AM, Paul Menzel <
paulepan...@users.sourceforge.net> wrote:

> Date: Sun, 24 May 2015 23:27:46 +0200
>
> Run the command below
>
> $ git grep -l schedulded | xargs sed -i 's/schedulded/scheduled/g'
>
> and revert the change in `ChangeLog-2015`.
> ---
>  gentpl.py | 2 +-
>  grub-core/disk/ahci.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gentpl.py b/gentpl.py
> index f177883..b0ef79f 100644
> --- a/gentpl.py
> +++ b/gentpl.py
> @@ -82,7 +82,7 @@ GROUPS["softdiv"] = GROUPS["arm"] + ["ia64_efi"]
>  GROUPS["no_softdiv"]   = GRUB_PLATFORMS[:]
>  for i in GROUPS["softdiv"]: GROUPS["no_softdiv"].remove(i)
>
> -# Miscelaneous groups schedulded to disappear in future
> +# Miscelaneous groups scheduled to disappear in future
>  GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot",
> "i386_multiboot", "i386_qemu"]
>  GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc")
>
> diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c
> index 7f75724..4e8619c 100644
> --- a/grub-core/disk/ahci.c
> +++ b/grub-core/disk/ahci.c
> @@ -1002,7 +1002,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device
> *dev,
>if (parms->write)
>  grub_memcpy ((char *) grub_dma_get_virt (bufc), parms->buffer,
> parms->size);
>
> -  grub_dprintf ("ahci", "AHCI command schedulded\n");
> +  grub_dprintf ("ahci", "AHCI command scheduled\n");
>grub_dprintf ("ahci", "AHCI tfd = %x\n",
> dev->hba->ports[dev->port].task_file_data);
>grub_dprintf ("ahci", "AHCI inten = %x\n",
> --
> 2.1.4
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


AHCI: SATA drive not detected by GRUB payload for coreboot

2015-05-25 Thread Paul Menzel
Dear GRUB folks,


as already mentioned, currently using coreboot with the GRUB payload on
the ASRock E350M1, the HDD connected over Serial ATA (SATA) at port 2,
or any other port, is not detected. Using an SSD instead it’s also *not*
detected.

This issue is present since at least last year and probably since the
rewrite of `grub-core/disk/ahci.c`. I was able to reproduce it with
latest master, that means commit 5e74a3e6 (disk/ahci: Use defines
`GRUB_ATA_STATUS_BUSY` and `GRUB_ATA_STATUS_DRQ`).

Doing `rmmod ahci` and `insmod ahci` the connected drive is mostly
detected.

Below are my changes for debugging. I added resetting the host bus
adapter (HBA) and debug statements for port 2.

diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c
index 7f75724..cf2075b 100644
--- a/grub-core/disk/ahci.c
+++ b/grub-core/disk/ahci.c
@@ -173,6 +173,7 @@ grub_ahci_pciinit (grub_pci_device_t dev,
   grub_pci_address_t addr;
   grub_uint32_t class;
   grub_uint32_t bar;
+  grub_uint64_t endtime;
   unsigned i, nports;
   volatile struct grub_ahci_hba *hba;
 
@@ -199,7 +200,7 @@ grub_ahci_pciinit (grub_pci_device_t dev,
 
   hba = grub_pci_device_map_range (dev, bar & GRUB_PCI_ADDR_MEM_MASK,
   sizeof (*hba));
-  grub_dprintf ("ahci", "dev: %x:%x.%x\n", dev.bus, dev.device, dev.function);
+  grub_dprintf ("ahci", "dev: %x:%x.%x, (%04x,%04x)\n", dev.bus, dev.device, 
dev.function, class, class);
 
   grub_dprintf ("ahci", "tfd[0]: %x\n",
hba->ports[0].task_file_data);
@@ -219,16 +220,62 @@ grub_ahci_pciinit (grub_pci_device_t dev,
   grub_dprintf ("ahci", "err[1]: %x\n",
hba->ports[1].sata_error);
 
-  hba->ports[1].sata_error = hba->ports[1].sata_error;
+  grub_dprintf ("ahci", "tfd[2]: %x\n",
+   hba->ports[2].task_file_data);
+  grub_dprintf ("ahci", "cmd[2]: %x\n",
+   hba->ports[2].command);
+  grub_dprintf ("ahci", "st[2]: %x\n",
+   hba->ports[2].status);
+  grub_dprintf ("ahci", "err[2]: %x\n",
+   hba->ports[2].sata_error);
+
+  /* Reset host bus adapter (HBA).  */
+  grub_dprintf ("ahci", "Reset host bus adapter (HBA).\n");
+  grub_dprintf ("ahci", "GLC:%x, %4" PRIuGRUB_UINT64_T "\n", 
hba->global_control, grub_get_time_ms ());
+  hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_RESET;
+  /* Reset has to be finished after 1s. */
+  endtime = grub_get_time_ms () + 1000;
+  while ((hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_RESET)
+ && grub_get_time_ms () < endtime);
+  if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_RESET)
+{
+  grub_dprintf ("ahci", "Controller reset didn't finish within 1s.\n");
+}
+  grub_dprintf ("ahci", "GLC:%x, time: %4" PRIuGRUB_UINT64_T "\n", 
hba->global_control, grub_get_time_ms ());
+
+  grub_dprintf ("ahci", "tfd[0]: %x\n",
+   hba->ports[0].task_file_data);
+  grub_dprintf ("ahci", "cmd[0]: %x\n",
+   hba->ports[0].command);
+  grub_dprintf ("ahci", "st[0]: %x\n",
+   hba->ports[0].status);
+  grub_dprintf ("ahci", "err[0]: %x\n",
+   hba->ports[0].sata_error);
 
+  grub_dprintf ("ahci", "tfd[1]: %x\n",
+   hba->ports[1].task_file_data);
+  grub_dprintf ("ahci", "cmd[1]: %x\n",
+   hba->ports[1].command);
+  grub_dprintf ("ahci", "st[1]: %x\n",
+   hba->ports[1].status);
   grub_dprintf ("ahci", "err[1]: %x\n",
hba->ports[1].sata_error);
 
+  hba->ports[1].sata_error = hba->ports[1].sata_error;
+
+  grub_dprintf ("ahci", "tfd[2]: %x\n",
+   hba->ports[2].task_file_data);
+  grub_dprintf ("ahci", "cmd[2]: %x\n",
+   hba->ports[2].command);
+  grub_dprintf ("ahci", "st[2]: %x\n",
+   hba->ports[2].status);
+  grub_dprintf ("ahci", "err[2]: %x\n",
+   hba->ports[2].sata_error);
+
   grub_dprintf ("ahci", "BH:%x\n", hba->bios_handoff);
 
   if (! (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_OS_OWNED))
 {
-  grub_uint64_t endtime;
 
   grub_dprintf ("ahci", "Requesting AHCI ownership\n");
   hba->bios_handoff = (hba->bios_handoff & ~GRUB_AHCI_BIOS_HANDOFF_RWC)
@@ -265,7 +312,6 @@ grub_ahci_pciinit (grub_pci_device_t dev,
   grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
 
   /*  {
-  grub_uint64_t endtime;
   hba->global_control |= 1;
   endtime = grub_get_time_ms () + 1000;
   while (hba->global_control & 1)
@@ -392,7 +438,6 @@ grub_ahci_pciinit (grub_pci_device_t dev,
adevs[i]->hba->ports[adevs[i]->port].command &= 
~GRUB_AHCI_HBA_PORT_CMD_FRE;
   }
 
-  grub_uint64_t endtime;
   endtime = grub_get_time_ms () + 1000;
 
   while (grub_get_time_ms () < endtime)

With these changes the following debug output is created.

disk/ahci.c:203: dev: 0:11.0, (1060140,1060140)
disk/ahci.c:206: tfd[0]: 7f
disk/ahci.c:208: cmd[0]: 2006
disk/ahci.c:210: st[0]: 0
disk/ahci.c:212: err[0]: 0
disk/ahci.c:215: 

[PATCH] Correct spelling of *scheduled*

2015-05-25 Thread Paul Menzel
Date: Sun, 24 May 2015 23:27:46 +0200

Run the command below

$ git grep -l schedulded | xargs sed -i 's/schedulded/scheduled/g'

and revert the change in `ChangeLog-2015`.
---
 gentpl.py | 2 +-
 grub-core/disk/ahci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gentpl.py b/gentpl.py
index f177883..b0ef79f 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -82,7 +82,7 @@ GROUPS["softdiv"] = GROUPS["arm"] + ["ia64_efi"]
 GROUPS["no_softdiv"]   = GRUB_PLATFORMS[:]
 for i in GROUPS["softdiv"]: GROUPS["no_softdiv"].remove(i)
 
-# Miscelaneous groups schedulded to disappear in future
+# Miscelaneous groups scheduled to disappear in future
 GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", 
"i386_qemu"]
 GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc")
 
diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c
index 7f75724..4e8619c 100644
--- a/grub-core/disk/ahci.c
+++ b/grub-core/disk/ahci.c
@@ -1002,7 +1002,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
   if (parms->write)
 grub_memcpy ((char *) grub_dma_get_virt (bufc), parms->buffer, 
parms->size);
 
-  grub_dprintf ("ahci", "AHCI command schedulded\n");
+  grub_dprintf ("ahci", "AHCI command scheduled\n");
   grub_dprintf ("ahci", "AHCI tfd = %x\n",
dev->hba->ports[dev->port].task_file_data);
   grub_dprintf ("ahci", "AHCI inten = %x\n",
-- 
2.1.4


signature.asc
Description: This is a digitally signed message part
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel