Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp881429imm; Fri, 22 Jun 2018 06:56:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKISFAUT9t5HQIxjyL+vUXfLK9wf81Pb5hhRdVR+N4wmysOwWDj73/M+D57NQvYuEPvxrOiP X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr1828555plz.34.1529675781991; Fri, 22 Jun 2018 06:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529675781; cv=none; d=google.com; s=arc-20160816; b=yW74mD6IfJHyK438WbGyP7vMufVb6toPziwFh8VN1Jnu7WbhZNVw+dhzHecdqBz/LO SsLB7T3ylAyYRs7Zd7OkC6ZUvc0hT3awWAAhPhkaDghDeige7YrCbsXEVZmi5U28cz3Q U+RtJlv8EpM1UEdhN4s/fa8tgum5mu2Tn1fsblFXy0wqcV6qEHx1Ws0KDoRkHKhGHWy1 FZFV5K7lWS04wJIOsSBq9ZT776SPqyQ8M7rms9ZkC9l46ua3KT687T6MkjA2UL3SFqqt NoXhDGvELfNck5278mPW08N7SeTi0D2RG7+tqfo7WD0redBhiX56iLQCZ1RKdurraAYw 2MLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=wksJ9WfOU/30g8pLMLAOLM9Wm/VsFzNBIYpGo7Bf6Us=; b=hwWR4/7BLDaHrsvch+BoS9EDqxeWJedEt0TNd1JXPLc9ZuESnZF+cpWp8WW2qfaf7F hYc/vSMbTrnoJW6mOTn7lOzX5stDOkVsux/AfvO0U5U/v6L6WqFvlcmEOBI/gbVXpdxI CgwUyQVWP+g+YBvBi1Kouuk9+yPa/mYBiTdFE5Zbec7r10haGLV83m5RIP7hQORvLEgN 9oIKhzCun0J/xjULR41VHWqK99e9BLz9qMuyTpe3K0NKLBxjhjW+lCpBFJsoH1rnN1Mg hQpUOZP6TEdMLlZgeTMgZjqej51WDzg9XvecObEUgeL9dy4L7MMiv6jDRKBcODSQ4Vky aWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c99D5l6b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22-v6si7573886pll.353.2018.06.22.06.56.07; Fri, 22 Jun 2018 06:56:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c99D5l6b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933130AbeFVNzW (ORCPT + 99 others); Fri, 22 Jun 2018 09:55:22 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:56129 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715AbeFVNzU (ORCPT ); Fri, 22 Jun 2018 09:55:20 -0400 Received: by mail-it0-f67.google.com with SMTP id 16-v6so2926473itl.5 for ; Fri, 22 Jun 2018 06:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wksJ9WfOU/30g8pLMLAOLM9Wm/VsFzNBIYpGo7Bf6Us=; b=c99D5l6b5eLkKWInarxrX1t+CaBy/QqP1mXGs8LCnJi10ni+XGSR8nomDbcY2R6Fhd CBZC+Sw3zdkcEMGkwMPUBGuSgJ//h5PuGxk7oFdrKETwLq3aAJM3w0hilWheJeoi7e3J FeuXVLzuBnJKzSce0kioNGZM31jFIRL66bwtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wksJ9WfOU/30g8pLMLAOLM9Wm/VsFzNBIYpGo7Bf6Us=; b=F0ajdts6h6LVwXTbJenJ+sLGP0QcpCTI8dhEFHElzHCYLyLNG4Jgy6S/hLZdoZqkYV GB/Vb5Ugx+L3k9DYKkadQdBX4U807pgi4dMeCEPYhUNF918rrmnkqn3G2ng2VVQp+ooX ZTuEMDD2yUQ1+7RkOHNx5r2YOst4O73Ox7YbcZupTaKtMO+EA/+ae+mQBFelt2xdc9SX yKJGBzLlia1lNHjeh9kfIcqVRNI6MWbdCi5OB5BhuS6XkGZYeG4qcWE7jTTB2wru8gzb inlLeQgh0kmPK4wRGtMBeE8MVi+OH0kS5S50Nw/Mxh7zBnhEYEBZtcsOUFbA/1k6+Etf /jzQ== X-Gm-Message-State: APt69E340rqGZGCBYDdZV9teXpZKmqj2ZdItZkxY7yZ0CJ7uUaHdxKl8 6RU+dR3RZZVKgnP5Li2ZXJ4RpzswD8BScZ0bwzCpuw== X-Received: by 2002:a24:3105:: with SMTP id y5-v6mr1633262ity.138.1529675719896; Fri, 22 Jun 2018 06:55:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Fri, 22 Jun 2018 06:55:19 -0700 (PDT) In-Reply-To: <2a805337-c0b5-e134-7695-5a543ecaa26a@codeaurora.org> References: <1526653072-7153-1-git-send-email-okaya@codeaurora.org> <1526653072-7153-2-git-send-email-okaya@codeaurora.org> <20180619222921.GA90490@bhelgaas-glaptop.roam.corp.google.com> <2a805337-c0b5-e134-7695-5a543ecaa26a@codeaurora.org> From: Ard Biesheuvel Date: Fri, 22 Jun 2018 15:55:19 +0200 Message-ID: Subject: Re: [PATCH V2 2/2] efi/fb: Convert PCI bus address to resource if translated by the bridge To: Sinan Kaya Cc: Bjorn Helgaas , "open list:EFIFB FRAMEBUFFER DRIVER" , Bartlomiej Zolnierkiewicz , linux-arm-msm@vger.kernel.org, Timur Tabi , open list , "open list:FRAMEBUFFER LAYER" , Peter Jones , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22 June 2018 at 15:52, Sinan Kaya wrote: > Hi Ard, > > On 6/22/2018 7:21 AM, Ard Biesheuvel wrote: >> Apologies for only bringing this up now, but I think this patch is >> wrong after all. >> >> screen_info.lfb_base is supposed to be a CPU address, and so >> translating it like this is wrong. If you end up with a PCI address >> here, you have made a mistake in hacking support for PCI outbound >> translations into UEFI. Other users such as UEFI itself or GRUB will >> treat this as a CPU physical address as well, so the kernel should not >> treat it any differently. > > The behavior I'm seeing is from a UEFI BIOS vendor. I did not write the > code for it... > > I was asked to debug it. > > I'd like to dive into your statement about UEFI and GRUB using this address > as physical addresses. > > AFAIK, all PCI outbound requests go through PCI IO protocol in UEFI and the > translation information is hidden inside the UEFI PCI Host Bridge driver. > Drivers are not allowed to access PCI resources directly especially as a > memory mapped address. > > This particular vendor is programming the BAR address into the GOP protocol. > Since the host bridge driver is doing a translation, we are hitting this > issue. > > Is there a UEFI spec reference about the definition of this field? > Yes, it is part of the PCI I/O protocol definition. FrameBufferBase is described as """ Base address of graphics linear frame buffer. Info contains information required to allow software to draw directly to the frame buffer without using Blt().Offset zero in FrameBufferBase represents the upper left pixel of the display. """