All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: "open list:EFIFB FRAMEBUFFER DRIVER"
	<linux-fbdev@vger.kernel.org>,
	kexec@lists.infradead.org,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	kernel@gpiccoli.net, kasong@redhat.com,
	"Baoquan He" <bhe@redhat.com>,
	"Samuel Iglesias Gonsálvez" <siglesias@igalia.com>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	pjones@redhat.com, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"Dave Young" <dyoung@redhat.com>,
	"Christian Koenig" <christian.koenig@amd.com>,
	"Vivek Goyal" <vgoyal@redhat.com>
Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb)
Date: Thu, 9 Dec 2021 12:31:50 -0500	[thread overview]
Message-ID: <CADnq5_O8x3_8f7GZ=tme55-QW+nqMJ2YoqvROjDPg2YZP2catQ@mail.gmail.com> (raw)
In-Reply-To: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com>

On Thu, Dec 9, 2021 at 12:04 PM Guilherme G. Piccoli
<gpiccoli@igalia.com> wrote:
>
> Hi all, I have a question about the possibility of reusing a framebuffer
> after a regular (or panic) kexec - my case is with amdgpu (APU, aka, not
> a separate GPU hardware), but I guess the question is kinda generic
> hence I've looped most of the lists / people I think does make sense
> (apologies for duplicates).
>
>
> The context is: we have a hardware that has an amdgpu-controlled device
> (Vangogh model) and as soon as the machine boots, efifb is providing
> graphics - I understand the UEFI/GRUB outputs rely in EFI framebuffer as
> well. As soon amdgpu module is available, kernel loads it and it takes
> over the GPU, providing graphics. The kexec_file_load syscall allows to
> pass a valid screen_info structure, so by kexec'ing a new kernel, we
> have again efifb taking over on boot time, but this time I see nothing
> in the screen. I've manually blacklisted amdgpu in this new kexec'ed
> kernel, I'd like to rely in the simple framebuffer - the goal is to have
> a tiny kernel kexec'ed. I'm using kernel version 5.16.0-rc4.
>
> I've done some other experiments, for exemple: I've forced screen_info
> model to match VLFB, so vesafb took over after the kexec, with the same
> result. Also noticed that BusMaster bit was off after kexec, in the AMD
> APU PCIe device, so I've set it on efifb before probe, and finally
> tested the same things in qemu, with qxl, all with the same result
> (blank screen).
> The most interesting result I got (both with amdgpu and qemu/qxl) is
> that if I blacklist these drivers and let the machine continue using
> efifb since the beginning, after kexec the efifb is still able to
> produce graphics.
>
> Which then led me to think that likely there's something fundamentally
> "blocking" the reuse of the simple framebuffer after kexec, like maybe
> DRM stack is destroying the old framebuffer somehow? What kind of
> preparation is required at firmware level to make the simple EFI VGA
> framebuffer work, and could we perform this in a kexec (or "save it"
> before the amdgpu/qxl drivers take over and reuse later)?
>

Once the driver takes over, none of the pre-driver state is retained.
You'll need to load the driver in the new kernel to initialize the
displays.  Note the efifb doesn't actually have the ability to program
any hardware, it just takes over the memory region that was used for
the pre-OS framebuffer and whatever display timing was set up by the
GOP driver prior to the OS loading.  Once that OS driver has loaded
the area is gone and the display configuration may have changed.

Alex


> Any advice is greatly appreciated!
> Thanks in advance,
>
>
> Guilherme

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: "open list:EFIFB FRAMEBUFFER DRIVER"
	<linux-fbdev@vger.kernel.org>, "xinhui pan" <Xinhui.Pan@amd.com>,
	kasong@redhat.com, "Baoquan He" <bhe@redhat.com>,
	"Samuel Iglesias Gonsálvez" <siglesias@igalia.com>,
	kernel@gpiccoli.net, kexec@lists.infradead.org,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	pjones@redhat.com,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"Dave Young" <dyoung@redhat.com>,
	"Christian Koenig" <christian.koenig@amd.com>,
	"Vivek Goyal" <vgoyal@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb)
Date: Thu, 9 Dec 2021 12:31:50 -0500	[thread overview]
Message-ID: <CADnq5_O8x3_8f7GZ=tme55-QW+nqMJ2YoqvROjDPg2YZP2catQ@mail.gmail.com> (raw)
In-Reply-To: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com>

On Thu, Dec 9, 2021 at 12:04 PM Guilherme G. Piccoli
<gpiccoli@igalia.com> wrote:
>
> Hi all, I have a question about the possibility of reusing a framebuffer
> after a regular (or panic) kexec - my case is with amdgpu (APU, aka, not
> a separate GPU hardware), but I guess the question is kinda generic
> hence I've looped most of the lists / people I think does make sense
> (apologies for duplicates).
>
>
> The context is: we have a hardware that has an amdgpu-controlled device
> (Vangogh model) and as soon as the machine boots, efifb is providing
> graphics - I understand the UEFI/GRUB outputs rely in EFI framebuffer as
> well. As soon amdgpu module is available, kernel loads it and it takes
> over the GPU, providing graphics. The kexec_file_load syscall allows to
> pass a valid screen_info structure, so by kexec'ing a new kernel, we
> have again efifb taking over on boot time, but this time I see nothing
> in the screen. I've manually blacklisted amdgpu in this new kexec'ed
> kernel, I'd like to rely in the simple framebuffer - the goal is to have
> a tiny kernel kexec'ed. I'm using kernel version 5.16.0-rc4.
>
> I've done some other experiments, for exemple: I've forced screen_info
> model to match VLFB, so vesafb took over after the kexec, with the same
> result. Also noticed that BusMaster bit was off after kexec, in the AMD
> APU PCIe device, so I've set it on efifb before probe, and finally
> tested the same things in qemu, with qxl, all with the same result
> (blank screen).
> The most interesting result I got (both with amdgpu and qemu/qxl) is
> that if I blacklist these drivers and let the machine continue using
> efifb since the beginning, after kexec the efifb is still able to
> produce graphics.
>
> Which then led me to think that likely there's something fundamentally
> "blocking" the reuse of the simple framebuffer after kexec, like maybe
> DRM stack is destroying the old framebuffer somehow? What kind of
> preparation is required at firmware level to make the simple EFI VGA
> framebuffer work, and could we perform this in a kexec (or "save it"
> before the amdgpu/qxl drivers take over and reuse later)?
>

Once the driver takes over, none of the pre-driver state is retained.
You'll need to load the driver in the new kernel to initialize the
displays.  Note the efifb doesn't actually have the ability to program
any hardware, it just takes over the memory region that was used for
the pre-OS framebuffer and whatever display timing was set up by the
GOP driver prior to the OS loading.  Once that OS driver has loaded
the area is gone and the display configuration may have changed.

Alex


> Any advice is greatly appreciated!
> Thanks in advance,
>
>
> Guilherme

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: "open list:EFIFB FRAMEBUFFER DRIVER"
	<linux-fbdev@vger.kernel.org>,
	kexec@lists.infradead.org,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	kernel@gpiccoli.net, kasong@redhat.com,
	"Baoquan He" <bhe@redhat.com>,
	"Samuel Iglesias Gonsálvez" <siglesias@igalia.com>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	pjones@redhat.com, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"Dave Young" <dyoung@redhat.com>,
	"Christian Koenig" <christian.koenig@amd.com>,
	"Vivek Goyal" <vgoyal@redhat.com>
Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb)
Date: Thu, 9 Dec 2021 12:31:50 -0500	[thread overview]
Message-ID: <CADnq5_O8x3_8f7GZ=tme55-QW+nqMJ2YoqvROjDPg2YZP2catQ@mail.gmail.com> (raw)
In-Reply-To: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com>

On Thu, Dec 9, 2021 at 12:04 PM Guilherme G. Piccoli
<gpiccoli@igalia.com> wrote:
>
> Hi all, I have a question about the possibility of reusing a framebuffer
> after a regular (or panic) kexec - my case is with amdgpu (APU, aka, not
> a separate GPU hardware), but I guess the question is kinda generic
> hence I've looped most of the lists / people I think does make sense
> (apologies for duplicates).
>
>
> The context is: we have a hardware that has an amdgpu-controlled device
> (Vangogh model) and as soon as the machine boots, efifb is providing
> graphics - I understand the UEFI/GRUB outputs rely in EFI framebuffer as
> well. As soon amdgpu module is available, kernel loads it and it takes
> over the GPU, providing graphics. The kexec_file_load syscall allows to
> pass a valid screen_info structure, so by kexec'ing a new kernel, we
> have again efifb taking over on boot time, but this time I see nothing
> in the screen. I've manually blacklisted amdgpu in this new kexec'ed
> kernel, I'd like to rely in the simple framebuffer - the goal is to have
> a tiny kernel kexec'ed. I'm using kernel version 5.16.0-rc4.
>
> I've done some other experiments, for exemple: I've forced screen_info
> model to match VLFB, so vesafb took over after the kexec, with the same
> result. Also noticed that BusMaster bit was off after kexec, in the AMD
> APU PCIe device, so I've set it on efifb before probe, and finally
> tested the same things in qemu, with qxl, all with the same result
> (blank screen).
> The most interesting result I got (both with amdgpu and qemu/qxl) is
> that if I blacklist these drivers and let the machine continue using
> efifb since the beginning, after kexec the efifb is still able to
> produce graphics.
>
> Which then led me to think that likely there's something fundamentally
> "blocking" the reuse of the simple framebuffer after kexec, like maybe
> DRM stack is destroying the old framebuffer somehow? What kind of
> preparation is required at firmware level to make the simple EFI VGA
> framebuffer work, and could we perform this in a kexec (or "save it"
> before the amdgpu/qxl drivers take over and reuse later)?
>

Once the driver takes over, none of the pre-driver state is retained.
You'll need to load the driver in the new kernel to initialize the
displays.  Note the efifb doesn't actually have the ability to program
any hardware, it just takes over the memory region that was used for
the pre-OS framebuffer and whatever display timing was set up by the
GOP driver prior to the OS loading.  Once that OS driver has loaded
the area is gone and the display configuration may have changed.

Alex


> Any advice is greatly appreciated!
> Thanks in advance,
>
>
> Guilherme

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2021-12-09 17:32 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 16:00 Reuse framebuffer after a kexec (amdgpu / efifb) Guilherme G. Piccoli
2021-12-09 16:00 ` Guilherme G. Piccoli
2021-12-09 16:00 ` Guilherme G. Piccoli
2021-12-09 16:09 ` Christian König
2021-12-09 16:09   ` Christian König
2021-12-09 16:09   ` Christian König
2021-12-09 17:31 ` Alex Deucher [this message]
2021-12-09 17:31   ` Alex Deucher
2021-12-09 17:31   ` Alex Deucher
2021-12-09 17:59   ` Guilherme G. Piccoli
2021-12-09 17:59     ` Guilherme G. Piccoli
2021-12-09 17:59     ` Guilherme G. Piccoli
2021-12-09 18:06     ` Alex Deucher
2021-12-09 18:06       ` Alex Deucher
2021-12-09 18:06       ` Alex Deucher
2021-12-09 18:17       ` Guilherme G. Piccoli
2021-12-09 18:17         ` Guilherme G. Piccoli
2021-12-09 18:17         ` Guilherme G. Piccoli
2021-12-09 19:20         ` Alex Deucher
2021-12-09 19:20           ` Alex Deucher
2021-12-09 19:20           ` Alex Deucher
2021-12-10  7:19         ` Gerd Hoffmann
2021-12-10  7:19           ` Gerd Hoffmann
2021-12-10  7:19           ` Gerd Hoffmann
2021-12-10  7:19           ` Gerd Hoffmann
2021-12-10  8:24         ` Thomas Zimmermann
2021-12-10  8:24           ` Thomas Zimmermann
2021-12-10 14:08           ` Guilherme G. Piccoli
2021-12-10 14:08             ` Guilherme G. Piccoli
2021-12-10 14:08             ` Guilherme G. Piccoli
2021-12-10 14:16             ` Alex Deucher
2021-12-10 14:16               ` Alex Deucher
2021-12-10 14:16               ` Alex Deucher
2021-12-10 14:25               ` Guilherme G. Piccoli
2021-12-10 14:25                 ` Guilherme G. Piccoli
2021-12-10 14:25                 ` Guilherme G. Piccoli
2021-12-10 15:13                 ` Christian König
2021-12-10 15:13                   ` Christian König
2021-12-10 15:13                   ` Christian König
2021-12-10 15:24                   ` Guilherme G. Piccoli
2021-12-10 15:24                     ` Guilherme G. Piccoli
2021-12-10 15:24                     ` Guilherme G. Piccoli
2021-12-10 15:32                     ` Christian König
2021-12-10 15:32                       ` Christian König
2021-12-10 15:32                       ` Christian König
2021-12-10 19:11                     ` Alex Deucher
2021-12-10 19:11                       ` Alex Deucher
2021-12-10 19:11                       ` Alex Deucher
2021-12-11  0:54                   ` Felix Kuehling
2021-12-11  0:54                     ` Felix Kuehling
2021-12-11  0:54                     ` Felix Kuehling
2021-12-11  9:20                     ` Gerd Hoffmann
2021-12-11  9:20                       ` Gerd Hoffmann
2021-12-11  9:20                       ` Gerd Hoffmann
2021-12-11  9:20                       ` Gerd Hoffmann
2021-12-10 19:05                 ` Alex Deucher
2021-12-10 19:05                   ` Alex Deucher
2021-12-10 19:05                   ` Alex Deucher

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='CADnq5_O8x3_8f7GZ=tme55-QW+nqMJ2YoqvROjDPg2YZP2catQ@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhe@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dyoung@redhat.com \
    --cc=gpiccoli@igalia.com \
    --cc=kasong@redhat.com \
    --cc=kernel@gpiccoli.net \
    --cc=kexec@lists.infradead.org \
    --cc=kraxel@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=pjones@redhat.com \
    --cc=siglesias@igalia.com \
    --cc=vgoyal@redhat.com \
    /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.