Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1616100 > unrolled thread
| Started by | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| First post | 2017-04-04 17:30 +0200 |
| Last post | 2017-04-05 12:20 +0200 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
[GIT PULL 0/2] EFI fixes for v4.11 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-04-04 17:30 +0200
[PATCH 2/2] efifb: Avoid reconfiguration of BAR that covers the framebuffer Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-04-04 17:30 +0200
[tip:efi/urgent] efi/fb: Avoid reconfiguration of BAR that covers the framebuffer tip-bot for Ard Biesheuvel <tipbot@zytor.com> - 2017-04-05 10:10 +0200
[tip:efi/urgent] efi/fb: Avoid reconfiguration of BAR that covers the framebuffer tip-bot for Ard Biesheuvel <tipbot@zytor.com> - 2017-04-05 12:40 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-04-05 12:20 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Ingo Molnar <mingo@kernel.org> - 2017-04-05 12:30 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-04-05 12:40 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-04-05 12:50 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-04-05 12:50 +0200
Re: [GIT PULL 0/2] EFI fixes for v4.11 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-04-05 12:20 +0200
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2017-04-04 17:30 +0200 |
| Subject | [GIT PULL 0/2] EFI fixes for v4.11 |
| Message-ID | <tsyz8-6Dw-3@gated-at.bofh.it> |
Hello all,
Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
----------------------------------------------------------------
Two fixes related to the EFI framebuffer driver:
- Ignore Graphics Output Protocol (GOP) implementations that are marked as
BLT-only -- the framebuffer base address is invalid in this case, and the
Blt() method is not accessible to the kernel.
- If the GOP framebuffer base address coincides with a memory BAR of a PCI
device that has memory decoding enabled, claim the memory resource so that
the PCI core will not attempt to move it later on.
----------------------------------------------------------------
Ard Biesheuvel (1):
efifb: Avoid reconfiguration of BAR that covers the framebuffer
Cohen, Eugene (1):
efi/libstub: Skip GOP with PIXEL_BLT_ONLY format
drivers/firmware/efi/libstub/gop.c | 6 ++--
drivers/video/fbdev/efifb.c | 66 +++++++++++++++++++++++++++++++++++++-
2 files changed, 69 insertions(+), 3 deletions(-)
[toc] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2017-04-04 17:30 +0200 |
| Subject | [PATCH 2/2] efifb: Avoid reconfiguration of BAR that covers the framebuffer |
| Message-ID | <tsyz8-6Dw-11@gated-at.bofh.it> |
| In reply to | #1616100 |
On UEFI systems, the PCI subsystem is enumerated by the firmware,
and if a graphical framebuffer is exposed by a PCI device, its base
address and size are exposed to the OS via the Graphics Output
Protocol (GOP).
On arm64 PCI systems, the entire PCI hierarchy is reconfigured from
scratch at boot. This may result in the GOP framebuffer address to
become stale, if the BAR covering the framebuffer is modified. This
will cause the framebuffer to become unresponsive, and may in some
cases result in unpredictable behavior if the range is reassigned to
another device.
So add a non-x86 quirk to the EFI fb driver to find the BAR associated
with the GOP base address, and claim the BAR resource so that the PCI
core will not move it.
Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...")
Cc: <stable@vger.kernel.org> # v4.7+
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
drivers/video/fbdev/efifb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 65 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 8c4dc1e1f94f..758960b6aec9 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -10,6 +10,7 @@
#include <linux/efi.h>
#include <linux/errno.h>
#include <linux/fb.h>
+#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/screen_info.h>
#include <video/vga.h>
@@ -143,6 +144,8 @@ static struct attribute *efifb_attrs[] = {
};
ATTRIBUTE_GROUPS(efifb);
+static bool pci_dev_disabled; /* FB base matches BAR of a disabled device */
+
static int efifb_probe(struct platform_device *dev)
{
struct fb_info *info;
@@ -152,7 +155,7 @@ static int efifb_probe(struct platform_device *dev)
unsigned int size_total;
char *option = NULL;
- if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || pci_dev_disabled)
return -ENODEV;
if (fb_get_options("efifb", &option))
@@ -360,3 +363,64 @@ static struct platform_driver efifb_driver = {
};
builtin_platform_driver(efifb_driver);
+
+#ifndef CONFIG_X86
+
+static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
+
+static void claim_efifb_bar(struct pci_dev *dev, int idx)
+{
+ u16 word;
+
+ pci_bar_found = true;
+
+ pci_read_config_word(dev, PCI_COMMAND, &word);
+ if (!(word & PCI_COMMAND_MEMORY)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: assigned to efifb but device is disabled!\n",
+ idx);
+ return;
+ }
+
+ if (pci_claim_resource(dev, idx)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: failed to claim resource for efifb!\n", idx);
+ return;
+ }
+
+ dev_info(&dev->dev, "BAR %d: assigned to efifb\n", idx);
+}
+
+static void efifb_fixup_resources(struct pci_dev *dev)
+{
+ u64 base = screen_info.lfb_base;
+ u64 size = screen_info.lfb_size;
+ int i;
+
+ if (pci_bar_found || screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ return;
+
+ if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
+ base |= (u64)screen_info.ext_lfb_base << 32;
+
+ if (!base)
+ return;
+
+ for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+ struct resource *res = &dev->resource[i];
+
+ if (!(res->flags & IORESOURCE_MEM))
+ continue;
+
+ if (res->start <= base && res->end >= base + size - 1) {
+ claim_efifb_bar(dev, i);
+ break;
+ }
+ }
+}
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY,
+ 16, efifb_fixup_resources);
+
+#endif
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ard Biesheuvel <tipbot@zytor.com> |
|---|---|
| Date | 2017-04-05 10:10 +0200 |
| Subject | [tip:efi/urgent] efi/fb: Avoid reconfiguration of BAR that covers the framebuffer |
| Message-ID | <tsOaR-5c-19@gated-at.bofh.it> |
| In reply to | #1616101 |
Commit-ID: 5a8997342183bb792fe2c15cecf371665d784dd7
Gitweb: http://git.kernel.org/tip/5a8997342183bb792fe2c15cecf371665d784dd7
Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
AuthorDate: Tue, 4 Apr 2017 16:27:44 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 5 Apr 2017 09:20:18 +0200
efi/fb: Avoid reconfiguration of BAR that covers the framebuffer
On UEFI systems, the PCI subsystem is enumerated by the firmware,
and if a graphical framebuffer is exposed via a PCI device, its base
address and size are exposed to the OS via the Graphics Output
Protocol (GOP).
On arm64 PCI systems, the entire PCI hierarchy is reconfigured from
scratch at boot. This may result in the GOP framebuffer address to
become stale, if the BAR covering the framebuffer is modified. This
will cause the framebuffer to become unresponsive, and may in some
cases result in unpredictable behavior if the range is reassigned to
another device.
So add a non-x86 quirk to the EFI fb driver to find the BAR associated
with the GOP base address, and claim the BAR resource so that the PCI
core will not move it.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: <stable@vger.kernel.org> # v4.7+
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Jones <pjones@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: leif.lindholm@linaro.org
Cc: linux-efi@vger.kernel.org
Cc: lorenzo.pieralisi@arm.com
Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...")
Link: http://lkml.kernel.org/r/20170404152744.26687-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
drivers/video/fbdev/efifb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 65 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 8c4dc1e..758960b 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -10,6 +10,7 @@
#include <linux/efi.h>
#include <linux/errno.h>
#include <linux/fb.h>
+#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/screen_info.h>
#include <video/vga.h>
@@ -143,6 +144,8 @@ static struct attribute *efifb_attrs[] = {
};
ATTRIBUTE_GROUPS(efifb);
+static bool pci_dev_disabled; /* FB base matches BAR of a disabled device */
+
static int efifb_probe(struct platform_device *dev)
{
struct fb_info *info;
@@ -152,7 +155,7 @@ static int efifb_probe(struct platform_device *dev)
unsigned int size_total;
char *option = NULL;
- if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || pci_dev_disabled)
return -ENODEV;
if (fb_get_options("efifb", &option))
@@ -360,3 +363,64 @@ static struct platform_driver efifb_driver = {
};
builtin_platform_driver(efifb_driver);
+
+#ifndef CONFIG_X86
+
+static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
+
+static void claim_efifb_bar(struct pci_dev *dev, int idx)
+{
+ u16 word;
+
+ pci_bar_found = true;
+
+ pci_read_config_word(dev, PCI_COMMAND, &word);
+ if (!(word & PCI_COMMAND_MEMORY)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: assigned to efifb but device is disabled!\n",
+ idx);
+ return;
+ }
+
+ if (pci_claim_resource(dev, idx)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: failed to claim resource for efifb!\n", idx);
+ return;
+ }
+
+ dev_info(&dev->dev, "BAR %d: assigned to efifb\n", idx);
+}
+
+static void efifb_fixup_resources(struct pci_dev *dev)
+{
+ u64 base = screen_info.lfb_base;
+ u64 size = screen_info.lfb_size;
+ int i;
+
+ if (pci_bar_found || screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ return;
+
+ if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
+ base |= (u64)screen_info.ext_lfb_base << 32;
+
+ if (!base)
+ return;
+
+ for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+ struct resource *res = &dev->resource[i];
+
+ if (!(res->flags & IORESOURCE_MEM))
+ continue;
+
+ if (res->start <= base && res->end >= base + size - 1) {
+ claim_efifb_bar(dev, i);
+ break;
+ }
+ }
+}
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY,
+ 16, efifb_fixup_resources);
+
+#endif
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ard Biesheuvel <tipbot@zytor.com> |
|---|---|
| Date | 2017-04-05 12:40 +0200 |
| Subject | [tip:efi/urgent] efi/fb: Avoid reconfiguration of BAR that covers the framebuffer |
| Message-ID | <tsQw1-1s1-5@gated-at.bofh.it> |
| In reply to | #1616101 |
Commit-ID: 55d728a40d368ba80443be85c02e641fc9082a3f
Gitweb: http://git.kernel.org/tip/55d728a40d368ba80443be85c02e641fc9082a3f
Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
AuthorDate: Tue, 4 Apr 2017 16:27:44 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 5 Apr 2017 12:25:53 +0200
efi/fb: Avoid reconfiguration of BAR that covers the framebuffer
On UEFI systems, the PCI subsystem is enumerated by the firmware,
and if a graphical framebuffer is exposed via a PCI device, its base
address and size are exposed to the OS via the Graphics Output
Protocol (GOP).
On arm64 PCI systems, the entire PCI hierarchy is reconfigured from
scratch at boot. This may result in the GOP framebuffer address to
become stale, if the BAR covering the framebuffer is modified. This
will cause the framebuffer to become unresponsive, and may in some
cases result in unpredictable behavior if the range is reassigned to
another device.
So add a non-x86 quirk to the EFI fb driver to find the BAR associated
with the GOP base address, and claim the BAR resource so that the PCI
core will not move it.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: <stable@vger.kernel.org> # v4.7+
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Jones <pjones@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: leif.lindholm@linaro.org
Cc: linux-efi@vger.kernel.org
Cc: lorenzo.pieralisi@arm.com
Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...")
Link: http://lkml.kernel.org/r/20170404152744.26687-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
drivers/video/fbdev/efifb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 65 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 8c4dc1e..b827a81 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -10,6 +10,7 @@
#include <linux/efi.h>
#include <linux/errno.h>
#include <linux/fb.h>
+#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/screen_info.h>
#include <video/vga.h>
@@ -143,6 +144,8 @@ static struct attribute *efifb_attrs[] = {
};
ATTRIBUTE_GROUPS(efifb);
+static bool pci_dev_disabled; /* FB base matches BAR of a disabled device */
+
static int efifb_probe(struct platform_device *dev)
{
struct fb_info *info;
@@ -152,7 +155,7 @@ static int efifb_probe(struct platform_device *dev)
unsigned int size_total;
char *option = NULL;
- if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || pci_dev_disabled)
return -ENODEV;
if (fb_get_options("efifb", &option))
@@ -360,3 +363,64 @@ static struct platform_driver efifb_driver = {
};
builtin_platform_driver(efifb_driver);
+
+#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
+
+static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
+
+static void claim_efifb_bar(struct pci_dev *dev, int idx)
+{
+ u16 word;
+
+ pci_bar_found = true;
+
+ pci_read_config_word(dev, PCI_COMMAND, &word);
+ if (!(word & PCI_COMMAND_MEMORY)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: assigned to efifb but device is disabled!\n",
+ idx);
+ return;
+ }
+
+ if (pci_claim_resource(dev, idx)) {
+ pci_dev_disabled = true;
+ dev_err(&dev->dev,
+ "BAR %d: failed to claim resource for efifb!\n", idx);
+ return;
+ }
+
+ dev_info(&dev->dev, "BAR %d: assigned to efifb\n", idx);
+}
+
+static void efifb_fixup_resources(struct pci_dev *dev)
+{
+ u64 base = screen_info.lfb_base;
+ u64 size = screen_info.lfb_size;
+ int i;
+
+ if (pci_bar_found || screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
+ return;
+
+ if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
+ base |= (u64)screen_info.ext_lfb_base << 32;
+
+ if (!base)
+ return;
+
+ for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+ struct resource *res = &dev->resource[i];
+
+ if (!(res->flags & IORESOURCE_MEM))
+ continue;
+
+ if (res->start <= base && res->end >= base + size - 1) {
+ claim_efifb_bar(dev, i);
+ break;
+ }
+ }
+}
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY,
+ 16, efifb_fixup_resources);
+
+#endif
[toc] | [prev] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2017-04-05 12:20 +0200 |
| Message-ID | <tsQcG-1lq-9@gated-at.bofh.it> |
| In reply to | #1616100 |
On 5 April 2017 at 11:08, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
>
> Hi,
>
> On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote:
>> Hello all,
>>
>> Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
>>
>> The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
>>
>> efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
>>
>> are available in the git repository at:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
>>
>> for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
>>
>> efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
>>
>> ----------------------------------------------------------------
>> Two fixes related to the EFI framebuffer driver:
>> - Ignore Graphics Output Protocol (GOP) implementations that are marked as
>> BLT-only -- the framebuffer base address is invalid in this case, and the
>> Blt() method is not accessible to the kernel.
>> - If the GOP framebuffer base address coincides with a memory BAR of a PCI
>> device that has memory decoding enabled, claim the memory resource so that
>> the PCI core will not attempt to move it later on.
>>
>> ----------------------------------------------------------------
>> Ard Biesheuvel (1):
>> efifb: Avoid reconfiguration of BAR that covers the framebuffer
>
> This patch breaks build if PCI support is not enabled:
>
> drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’:
> drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration]
>
> (x86 ifdefs are not enough, the patch should also check for PCI support)
>
> Also please cc: linux-fbdev mailing list & me on fbdev related patches.
>
Thanks for the report. The patch was tested successfully on an
impressive list of configurations by kbuild test robot, but
apparently, none of those has PCI disabled.
Ingo, since you have queued this already, how would you like to
proceed? I don't think we need anything beyond
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 758960b6aec9..b827a8113e26 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -364,7 +364,7 @@ static struct platform_driver efifb_driver = {
builtin_platform_driver(efifb_driver);
-#ifndef CONFIG_X86
+#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
--
Ard.
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-04-05 12:30 +0200 |
| Message-ID | <tsQmn-1oW-23@gated-at.bofh.it> |
| In reply to | #1616785 |
* Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 5 April 2017 at 11:08, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
> >
> > Hi,
> >
> > On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote:
> >> Hello all,
> >>
> >> Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
> >>
> >> The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
> >>
> >> efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
> >>
> >> are available in the git repository at:
> >>
> >> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
> >>
> >> for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
> >>
> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
> >>
> >> ----------------------------------------------------------------
> >> Two fixes related to the EFI framebuffer driver:
> >> - Ignore Graphics Output Protocol (GOP) implementations that are marked as
> >> BLT-only -- the framebuffer base address is invalid in this case, and the
> >> Blt() method is not accessible to the kernel.
> >> - If the GOP framebuffer base address coincides with a memory BAR of a PCI
> >> device that has memory decoding enabled, claim the memory resource so that
> >> the PCI core will not attempt to move it later on.
> >>
> >> ----------------------------------------------------------------
> >> Ard Biesheuvel (1):
> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer
> >
> > This patch breaks build if PCI support is not enabled:
> >
> > drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’:
> > drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration]
> >
> > (x86 ifdefs are not enough, the patch should also check for PCI support)
> >
> > Also please cc: linux-fbdev mailing list & me on fbdev related patches.
> >
>
> Thanks for the report. The patch was tested successfully on an
> impressive list of configurations by kbuild test robot, but
> apparently, none of those has PCI disabled.
>
> Ingo, since you have queued this already, how would you like to
> proceed? I don't think we need anything beyond
>
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index 758960b6aec9..b827a8113e26 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -364,7 +364,7 @@ static struct platform_driver efifb_driver = {
>
> builtin_platform_driver(efifb_driver);
>
> -#ifndef CONFIG_X86
> +#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
I've rebased it all, it's still pretty fresh (two hours old) and the delta fix
would look pretty ugly in the urgent branch.
Thanks,
Ingo
[toc] | [prev] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2017-04-05 12:40 +0200 |
| Message-ID | <tsQw2-1s1-15@gated-at.bofh.it> |
| In reply to | #1616806 |
On 5 April 2017 at 11:26, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
>> On 5 April 2017 at 11:08, Bartlomiej Zolnierkiewicz
>> <b.zolnierkie@samsung.com> wrote:
>> >
>> > Hi,
>> >
>> > On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote:
>> >> Hello all,
>> >>
>> >> Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
>> >>
>> >> The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
>> >>
>> >> efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
>> >>
>> >> are available in the git repository at:
>> >>
>> >> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
>> >>
>> >> for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
>> >>
>> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
>> >>
>> >> ----------------------------------------------------------------
>> >> Two fixes related to the EFI framebuffer driver:
>> >> - Ignore Graphics Output Protocol (GOP) implementations that are marked as
>> >> BLT-only -- the framebuffer base address is invalid in this case, and the
>> >> Blt() method is not accessible to the kernel.
>> >> - If the GOP framebuffer base address coincides with a memory BAR of a PCI
>> >> device that has memory decoding enabled, claim the memory resource so that
>> >> the PCI core will not attempt to move it later on.
>> >>
>> >> ----------------------------------------------------------------
>> >> Ard Biesheuvel (1):
>> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer
>> >
>> > This patch breaks build if PCI support is not enabled:
>> >
>> > drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’:
>> > drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration]
>> >
>> > (x86 ifdefs are not enough, the patch should also check for PCI support)
>> >
>> > Also please cc: linux-fbdev mailing list & me on fbdev related patches.
>> >
>>
>> Thanks for the report. The patch was tested successfully on an
>> impressive list of configurations by kbuild test robot, but
>> apparently, none of those has PCI disabled.
>>
>> Ingo, since you have queued this already, how would you like to
>> proceed? I don't think we need anything beyond
>>
>> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
>> index 758960b6aec9..b827a8113e26 100644
>> --- a/drivers/video/fbdev/efifb.c
>> +++ b/drivers/video/fbdev/efifb.c
>> @@ -364,7 +364,7 @@ static struct platform_driver efifb_driver = {
>>
>> builtin_platform_driver(efifb_driver);
>>
>> -#ifndef CONFIG_X86
>> +#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
>
> I've rebased it all, it's still pretty fresh (two hours old) and the delta fix
> would look pretty ugly in the urgent branch.
>
Thanks for cleaning that up.
--
Ard.
[toc] | [prev] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2017-04-05 12:50 +0200 |
| Message-ID | <tsQFH-1vp-11@gated-at.bofh.it> |
| In reply to | #1616785 |
On 5 April 2017 at 11:44, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> On Wednesday, April 05, 2017 11:14:06 AM Ard Biesheuvel wrote:
>> On 5 April 2017 at 11:08, Bartlomiej Zolnierkiewicz
>> <b.zolnierkie@samsung.com> wrote:
>> >
>> > Hi,
>> >
>> > On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote:
>> >> Hello all,
>> >>
>> >> Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
>> >>
>> >> The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
>> >>
>> >> efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
>> >>
>> >> are available in the git repository at:
>> >>
>> >> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
>> >>
>> >> for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
>> >>
>> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
>> >>
>> >> ----------------------------------------------------------------
>> >> Two fixes related to the EFI framebuffer driver:
>> >> - Ignore Graphics Output Protocol (GOP) implementations that are marked as
>> >> BLT-only -- the framebuffer base address is invalid in this case, and the
>> >> Blt() method is not accessible to the kernel.
>> >> - If the GOP framebuffer base address coincides with a memory BAR of a PCI
>> >> device that has memory decoding enabled, claim the memory resource so that
>> >> the PCI core will not attempt to move it later on.
>> >>
>> >> ----------------------------------------------------------------
>> >> Ard Biesheuvel (1):
>> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer
>> >
>> > This patch breaks build if PCI support is not enabled:
>> >
>> > drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’:
>> > drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration]
>> >
>> > (x86 ifdefs are not enough, the patch should also check for PCI support)
>> >
>> > Also please cc: linux-fbdev mailing list & me on fbdev related patches.
>> >
>>
>> Thanks for the report. The patch was tested successfully on an
>> impressive list of configurations by kbuild test robot, but
>> apparently, none of those has PCI disabled.
>
> Well, it has been found by looking at the patch itself and since
> none of defconfigs contains such configuration currently the issue
> is rather minor one.
>
> [ Also sorry for the late report but this is the first time I see
> these patches. They were never posted to linux-fbdev or me. ]
>
Apologies for that. I did cc Peter but no other fbdev maintainers.
>> Ingo, since you have queued this already, how would you like to
>> proceed? I don't think we need anything beyond
>
> I see that Ingo fixed the patch himself so it is all fine now,
> thanks!
>
>> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
>> index 758960b6aec9..b827a8113e26 100644
>> --- a/drivers/video/fbdev/efifb.c
>> +++ b/drivers/video/fbdev/efifb.c
>> @@ -364,7 +364,7 @@ static struct platform_driver efifb_driver = {
>>
>> builtin_platform_driver(efifb_driver);
>>
>> -#ifndef CONFIG_X86
>> +#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
>>
>> static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
>
[toc] | [prev] | [next] | [standalone]
| From | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> |
|---|---|
| Date | 2017-04-05 12:50 +0200 |
| Message-ID | <tsQFH-1vp-13@gated-at.bofh.it> |
| In reply to | #1616785 |
On Wednesday, April 05, 2017 11:14:06 AM Ard Biesheuvel wrote:
> On 5 April 2017 at 11:08, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
> >
> > Hi,
> >
> > On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote:
> >> Hello all,
> >>
> >> Please pull these fixes for EFI framebuffer support on ARM/arm64 systems.
> >>
> >> The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe:
> >>
> >> efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000)
> >>
> >> are available in the git repository at:
> >>
> >> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent
> >>
> >> for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e:
> >>
> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100)
> >>
> >> ----------------------------------------------------------------
> >> Two fixes related to the EFI framebuffer driver:
> >> - Ignore Graphics Output Protocol (GOP) implementations that are marked as
> >> BLT-only -- the framebuffer base address is invalid in this case, and the
> >> Blt() method is not accessible to the kernel.
> >> - If the GOP framebuffer base address coincides with a memory BAR of a PCI
> >> device that has memory decoding enabled, claim the memory resource so that
> >> the PCI core will not attempt to move it later on.
> >>
> >> ----------------------------------------------------------------
> >> Ard Biesheuvel (1):
> >> efifb: Avoid reconfiguration of BAR that covers the framebuffer
> >
> > This patch breaks build if PCI support is not enabled:
> >
> > drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’:
> > drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration]
> >
> > (x86 ifdefs are not enough, the patch should also check for PCI support)
> >
> > Also please cc: linux-fbdev mailing list & me on fbdev related patches.
> >
>
> Thanks for the report. The patch was tested successfully on an
> impressive list of configurations by kbuild test robot, but
> apparently, none of those has PCI disabled.
Well, it has been found by looking at the patch itself and since
none of defconfigs contains such configuration currently the issue
is rather minor one.
[ Also sorry for the late report but this is the first time I see
these patches. They were never posted to linux-fbdev or me. ]
> Ingo, since you have queued this already, how would you like to
> proceed? I don't think we need anything beyond
I see that Ingo fixed the patch himself so it is all fine now,
thanks!
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index 758960b6aec9..b827a8113e26 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -364,7 +364,7 @@ static struct platform_driver efifb_driver = {
>
> builtin_platform_driver(efifb_driver);
>
> -#ifndef CONFIG_X86
> +#if defined(CONFIG_PCI) && !defined(CONFIG_X86)
>
> static bool pci_bar_found; /* did we find a BAR matching the efifb base? */
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
[toc] | [prev] | [next] | [standalone]
| From | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> |
|---|---|
| Date | 2017-04-05 12:20 +0200 |
| Message-ID | <tsQcG-1lq-13@gated-at.bofh.it> |
| In reply to | #1616100 |
Hi, On Tuesday, April 04, 2017 04:27:42 PM Ard Biesheuvel wrote: > Hello all, > > Please pull these fixes for EFI framebuffer support on ARM/arm64 systems. > > The following changes since commit 822f5845f710e57d7e2df1fd1ee00d6e19d334fe: > > efi/esrt: Cleanup bad memory map log messages (2017-03-17 18:53:12 +0000) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent > > for you to fetch changes up to e73c2811538bd36ec1340d01bafdc080af31914e: > > efifb: Avoid reconfiguration of BAR that covers the framebuffer (2017-04-04 15:56:43 +0100) > > ---------------------------------------------------------------- > Two fixes related to the EFI framebuffer driver: > - Ignore Graphics Output Protocol (GOP) implementations that are marked as > BLT-only -- the framebuffer base address is invalid in this case, and the > Blt() method is not accessible to the kernel. > - If the GOP framebuffer base address coincides with a memory BAR of a PCI > device that has memory decoding enabled, claim the memory resource so that > the PCI core will not attempt to move it later on. > > ---------------------------------------------------------------- > Ard Biesheuvel (1): > efifb: Avoid reconfiguration of BAR that covers the framebuffer This patch breaks build if PCI support is not enabled: drivers/video/fbdev/efifb.c: In function ‘claim_efifb_bar’: drivers/video/fbdev/efifb.c:386:2: error: implicit declaration of function ‘pci_claim_resource’ [-Werror=implicit-function-declaration] (x86 ifdefs are not enough, the patch should also check for PCI support) Also please cc: linux-fbdev mailing list & me on fbdev related patches. > Cohen, Eugene (1): > efi/libstub: Skip GOP with PIXEL_BLT_ONLY format > > drivers/firmware/efi/libstub/gop.c | 6 ++-- > drivers/video/fbdev/efifb.c | 66 +++++++++++++++++++++++++++++++++++++- > 2 files changed, 69 insertions(+), 3 deletions(-) Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web