Submitter | Bao, Zheng |
---|---|
Date | 2009-11-03 03:23:17 |
Message ID | <DD1CC71B621B004FA76856E5129D6B170329FFA7@sbjgexmb1.amd.com> |
Download | mbox | patch |
Permalink | /patch/528/ |
State | Accepted |
Headers | show |
Comments
Am 03.11.2009 04:23, schrieb Bao, Zheng: > If the coreboot and filo overlap, it will "slice off" a piece at the > beginning or end. In the beginning case, a new segment is inserted > before the current one. The ptr will move forward and doesn't seem to > have any chance to process the "new" segment. > You are aware that your patch only has an effect for non-compressed payloads? Patrick
On Tue, Nov 3, 2009 at 9:12 AM, Patrick Georgi <patrick@georgi-clan.de> wrote: > Am 03.11.2009 04:23, schrieb Bao, Zheng: >> >> If the coreboot and filo overlap, it will "slice off" a piece at the >> beginning or end. In the beginning case, a new segment is inserted >> before the current one. The ptr will move forward and doesn't seem to >> have any chance to process the "new" segment. >> > > You are aware that your patch only has an effect for non-compressed > payloads? > Patrick and Zheng, I'm struggling to understand the bug. If the payload is uncompressed, it can put a segment before coreboot in the bouncebuffer (this seems to be the bug?). Then the loop needs to be re-run on the newly split/added segment. If it is compressed, It will skip all of the coreboot area and not allocate a segment before coreboot (put the entire thing in the bounce buffer?). Does this get back to the CONFIG_RAMBASE=0x00200000 on fam10? Marc
Marc and Patrick, The LZMA compressing way doesn't work on my board. I haven't found any solution to resolve the overlapping in current code. ulzma() doesn't seem to know that overlapping happens. It is a problem that has to be solved. Do you guys agree that my patch anyway fix the bug for non-compressed payloads? Zheng -----Original Message----- From: Marc Jones [mailto:marcj303@gmail.com] Sent: Wednesday, November 04, 2009 6:42 AM To: Patrick Georgi Cc: Bao, Zheng; coreboot@coreboot.org Subject: Re: [coreboot] [PATCH] The filo crashes if the filo and coreboot overlap. On Tue, Nov 3, 2009 at 9:12 AM, Patrick Georgi <patrick@georgi-clan.de> wrote: > Am 03.11.2009 04:23, schrieb Bao, Zheng: >> >> If the coreboot and filo overlap, it will "slice off" a piece at the >> beginning or end. In the beginning case, a new segment is inserted >> before the current one. The ptr will move forward and doesn't seem to >> have any chance to process the "new" segment. >> > > You are aware that your patch only has an effect for non-compressed > payloads? > Patrick and Zheng, I'm struggling to understand the bug. If the payload is uncompressed, it can put a segment before coreboot in the bouncebuffer (this seems to be the bug?). Then the loop needs to be re-run on the newly split/added segment. If it is compressed, It will skip all of the coreboot area and not allocate a segment before coreboot (put the entire thing in the bounce buffer?). Does this get back to the CONFIG_RAMBASE=0x00200000 on fam10? Marc
Am 04.11.2009 03:34, schrieb Bao, Zheng: > Marc and Patrick, > The LZMA compressing way doesn't work on my board. I haven't found any solution to resolve the overlapping in current code. ulzma() doesn't seem to know that overlapping happens. It is a problem that has to be solved. > Thanks for your fix, but I'd like to come back to the ulzma issue. What do you mean, that LZMA compression doesn't work on your board? There is a known problem that decompression takes _very_ long (several minutes for a moderately sized payload such as FILO). If it looks like the boards was stuck in the decompression phase, please try again and wait to see if it moves on eventually (15 minutes should be enough with some safety margin), so we know if you ran into that known issue, or if you found another bug. If it's something entirely different, I'd also like to hear about it, of course :-) As for ulzma(): ulzma really doesn't know about the overlap, but the compression related code compensates for that. The bounce buffer function returns the start address of the bounce buffer. The location that is used for decompression is (segment_start - RAMBASE + bouncebuffer_base). If the segment starts before the rambase, the segment is decompressed to the bounce buffer and the memory region before it. Right after decompression, the memory region before the bounce buffer is copied. That solution has its own share of problems, but the bounce buffer handling code is quite nasty, and I wanted to keep the changes as small as possible. Thanks, Patrick Georgi
Patch
Index: src/boot/selfboot.c =================================================================== --- src/boot/selfboot.c (revision 4892) +++ src/boot/selfboot.c (working copy) @@ -211,19 +211,21 @@ return !((end <= lb_start) || (start >= lb_end)); } -static void relocate_segment(unsigned long buffer, struct segment *seg) +static int relocate_segment(unsigned long buffer, struct segment *seg) { /* Modify all segments that want to load onto coreboot * to load onto the bounce buffer instead. */ - unsigned long start, middle, end; + /* ret: 1 : A new segment is inserted before the seg. + * 0 : A new segment is inserted after the seg, or no new one. */ + unsigned long start, middle, end, ret = 0; printk_spew("lb: [0x%016lx, 0x%016lx)\n", lb_start, lb_end); /* I don't conflict with coreboot so get out of here */ if (!overlaps_coreboot(seg)) - return; + return 0; start = seg->s_dstaddr;