All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Anders Darander <anders@chargestorm.se>,
	Yinghai Lu <yinghai@kernel.org>,
	Matt Fleming <matt@console-pimps.org>
Cc: "Mantas Mikulėnas" <grawity@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Matt Fleming" <matt.fleming@intel.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v4] x86: only load initrd above 4g on second try
Date: Fri, 05 Sep 2014 08:38:19 +0200	[thread overview]
Message-ID: <54095A5B.4030606@redhat.com> (raw)
In-Reply-To: <20140905054749.GA4498@ad.chargestorm.se>

On 09/05/14 07:47, Anders Darander wrote:
> * Yinghai Lu <yinghai@kernel.org> [140905 03:19]:
> 
> 
>> On Thu, Sep 4, 2014 at 2:29 PM, Matt Fleming <matt@console-pimps.org> wrote:
>>> On Thu, 04 Sep, at 01:59:05PM, H. Peter Anvin wrote:
> 
>>>> I am fine with this patch, but at the same time I do want to note that
>>>> there is an alternative to double-buffer the patch and/or (if that
>>>> applies to the buggy BIOS) round up the size of the target buffer.
> 
>>> I'm not sure that rounding up the size of the target buffer will
>>> workaround this issue correctly.
> 
>>> As far as I know, the only thing that Mantas tried was rounding up the
>>> size of the source file, by padding it.
> 
>> Can you try attached patch on top of linus tree?
> 
> I took the liberty to test the patch on my Dell XPS13 9333, and
> unfortunately I got the old hang back. 
> 
> This was tested on the current Linus' tree.

Assuming that the UEFI implementation on Mantas's and Anders's machines
use edk2's FatPkg to read the file from an EFI System Partition:

this kernel patch will have no effect, because FatPkg (the ESP
filesystem driver) checks the buffer size against the remainder of the
file, and clips the input buffer if it would overshoot the file size.

In other words, the rounding up of the kernel will be undone in a
"somewhat higher level" driver in the firmware, and the request size
that reaches DiskIo (the "lowel level driver") remains the same.

https://github.com/tianocore/edk2-FatPkg/blob/master/EnhancedFatDxe/ReadWrite.c#L306

    } else {
      //
      // Access a file
      //
      EndPosition = IFile->Position + *BufferSize;
      if (EndPosition > OFile->FileSize) {
        //
        // The position goes beyond the end of file
        //
        if (IoMode == READ_DATA) {
          //
          // Adjust the actual size read
          //
          *BufferSize -= (UINTN) EndPosition - OFile->FileSize;

Thanks
Laszlo

  reply	other threads:[~2014-09-05  6:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04  4:50 [PATCH -v4] x86: only load initrd above 4g on second try Yinghai Lu
2014-09-04  4:50 ` Yinghai Lu
2014-09-04 10:01 ` Matt Fleming
2014-09-04 20:59   ` H. Peter Anvin
2014-09-04 21:29     ` Matt Fleming
2014-09-05  1:19       ` Yinghai Lu
2014-09-05  1:19         ` Yinghai Lu
2014-09-05  5:47         ` Anders Darander
2014-09-05  5:47           ` Anders Darander
2014-09-05  6:38           ` Laszlo Ersek [this message]
2014-09-05 17:03             ` Yinghai Lu
2014-09-05 17:03               ` Yinghai Lu
2014-09-05 19:20               ` Laszlo Ersek
2014-09-05 19:20                 ` Laszlo Ersek
2014-09-05 22:16     ` Matt Fleming
2014-09-05 22:16       ` Matt Fleming
2014-09-06 19:05       ` Anders Darander
2014-09-06 19:05         ` Anders Darander
2014-09-06 20:09       ` Mantas Mikulėnas
2014-09-06 20:10         ` Mantas Mikulėnas
2014-09-08 15:58         ` Matt Fleming
2014-09-08 15:58           ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54095A5B.4030606@redhat.com \
    --to=lersek@redhat.com \
    --cc=anders@chargestorm.se \
    --cc=grawity@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=matt@console-pimps.org \
    --cc=mingo@redhat.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.