Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758492AbbDWWrO (ORCPT ); Thu, 23 Apr 2015 18:47:14 -0400 Received: from mail-ig0-f176.google.com ([209.85.213.176]:36736 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753648AbbDWWrM (ORCPT ); Thu, 23 Apr 2015 18:47:12 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150423213015.GA7888@google.com> Date: Thu, 23 Apr 2015 15:47:10 -0700 X-Google-Sender-Auth: p3OznMFj1jMLoxIad8_TCM1OHd0 Message-ID: Subject: Re: git pull] drm for v4.1-rc1 From: Linus Torvalds To: Matthew Garrett Cc: Bjorn Helgaas , Dave Airlie , Daniel Vetter , Jani Nikula , DRI mailing list , Linux Kernel Mailing List , intel-gfx , "linux-pci@vger.kernel.org" , Matthew Garrett Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1962 Lines: 44 On Thu, Apr 23, 2015 at 2:56 PM, Matthew Garrett wrote: > On Thu, Apr 23, 2015 at 2:30 PM, Bjorn Helgaas wrote: >> >> int pcibios_add_device(struct pci_dev *dev) >> { >> if (dev-is-default-vga-device) { >> dev->rom = 0xC0000; >> dev->romlen = 0x20000; >> } > > I don't know what we want to do here. This is, at some level, > fundamentally wrong - however, it also wouldn't surprise me if this is > also the only copy of the video ROM we have on some UEFI systems, > especially since I believe that Windows 7 still required that there be > a legacy ROM it could use for bootloader modesetting on UEFI > platforms. So simply making this conditional on BIOS may break > existing machines. But if there *is* a ROM there then we should be > able to id it from the usual video ROM signature? I'm not sure why we want that IORESOURCE_ROM_SHADOW thing at all, but yes, if what this is all about is the magic video ROM at 0xc0000, then (a) it should have nothing what-so-ever to do with the actual PCI BAR, since it's been *ages* since people actually had an expansion rom like that, and it's much more common that the video ROM comes as part of the system BIOS on laptops etc. (b) yes, the sane thing to do would be to just look for the ROM signature, 0x55 0xaa at 2kB incrementing headers (and checking the proper checksum too). There is no way to see that from the PCI device state, because as mentioned, quite often the "ROM" is entirely fake, and is not just some shadowed copy of a real underlying hardware ROM, but is fundamentally just a RAM image decompressed from some other source and then marked read-only. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/