All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
To: Yinghai Lu <yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "Matt Fleming"
	<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Ingo Molnar" <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Mantas Mikulėnas"
	<grawity-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Anders Darander"
	<anders-7UjN0b3lYz2SbKU13Z4Etw@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Linux Kernel Mailing List"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] x86: only load initrd above 4g on second try
Date: Wed, 27 Aug 2014 10:49:31 -0700	[thread overview]
Message-ID: <53FE1A2B.80204@zytor.com> (raw)
In-Reply-To: <CAE9FiQUF4THLRfzbnhK61QHpM2zyox4E8LTmyzVF7PnPdpb7jQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 08/26/2014 03:05 PM, Yinghai Lu wrote:
> 
> The firmware has bug and can use buffer above 4G to read files.
> and if the file size is 512 bytes alignment, then reading could go through.
> 

File size, or alignment?  Different things.  Again, your patch
description is not just incomplete, but seems to be actively misleading.

This does, however, suggest at least two possible solutions:

1. We can read the initramfs into a temporary buffer and memcpy() it to
the target.

2. We might be able to align the initramfs buffer to a 512-byte section
and then round up the size.

The 512 bytes here is probably a hardware sector, I'm not sure how this
will play on 4K-hard-sectored media, although those are few and far between.

	-hpa

WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "Matt Fleming" <matt.fleming@intel.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Mantas Mikulėnas" <grawity@gmail.com>,
	"Anders Darander" <anders@chargestorm.se>,
	linux-efi@vger.kernel.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: only load initrd above 4g on second try
Date: Wed, 27 Aug 2014 10:49:31 -0700	[thread overview]
Message-ID: <53FE1A2B.80204@zytor.com> (raw)
In-Reply-To: <CAE9FiQUF4THLRfzbnhK61QHpM2zyox4E8LTmyzVF7PnPdpb7jQ@mail.gmail.com>

On 08/26/2014 03:05 PM, Yinghai Lu wrote:
> 
> The firmware has bug and can use buffer above 4G to read files.
> and if the file size is 512 bytes alignment, then reading could go through.
> 

File size, or alignment?  Different things.  Again, your patch
description is not just incomplete, but seems to be actively misleading.

This does, however, suggest at least two possible solutions:

1. We can read the initramfs into a temporary buffer and memcpy() it to
the target.

2. We might be able to align the initramfs buffer to a 512-byte section
and then round up the size.

The 512 bytes here is probably a hardware sector, I'm not sure how this
will play on 4K-hard-sectored media, although those are few and far between.

	-hpa


  parent reply	other threads:[~2014-08-27 17:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 21:45 [PATCH] x86: only load initrd above 4g on second try Yinghai Lu
2014-08-26 21:45 ` Yinghai Lu
     [not found] ` <1409089544-24221-1-git-send-email-yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-08-26 21:53   ` H. Peter Anvin
2014-08-26 21:53     ` H. Peter Anvin
     [not found]     ` <53FD01D0.8020203-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2014-08-26 22:05       ` Yinghai Lu
2014-08-26 22:05         ` Yinghai Lu
     [not found]         ` <CAE9FiQUF4THLRfzbnhK61QHpM2zyox4E8LTmyzVF7PnPdpb7jQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-26 22:16           ` Mantas Mikulėnas
2014-08-26 22:16             ` Mantas Mikulėnas
     [not found]             ` <CAPWNY8WG3E7oZdZDdYsrnGM5pG4kWAKkEq0Eh5Hc_uXJ_8zD5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-26 22:58               ` Yinghai Lu
2014-08-26 22:58                 ` Yinghai Lu
2014-08-27 17:49           ` H. Peter Anvin [this message]
2014-08-27 17:49             ` H. Peter Anvin
     [not found]             ` <53FE1A2B.80204-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2014-08-27 18:50               ` Yinghai Lu
2014-08-27 18:50                 ` Yinghai Lu
2014-08-27 10:59   ` Matt Fleming
2014-08-27 10:59     ` Matt Fleming
     [not found]     ` <20140827105901.GC28116-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-08-27 17:13       ` Yinghai Lu
2014-08-27 17:13         ` Yinghai Lu
     [not found]         ` <CAE9FiQWrPtEe3tkJjgOzyJJPPzX=AtMYgR4c91pDHL3q3ZLLKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-30 11:24           ` Matt Fleming
2014-08-30 11:24             ` Matt Fleming
     [not found]             ` <20140830112426.GA2911-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-09-02  6:57               ` Anders Darander
2014-09-02  6:57                 ` Anders Darander

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=53FE1A2B.80204@zytor.com \
    --to=hpa-ymnouzjc4hwavxtiumwx3w@public.gmane.org \
    --cc=anders-7UjN0b3lYz2SbKU13Z4Etw@public.gmane.org \
    --cc=grawity-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.