From patchwork Fri Jun 22 07:52:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 139575 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp566048lji; Fri, 22 Jun 2018 00:52:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLcbV+zbP3dZftwNIAM8ZbLpsAIr0rugFyxoLgAWvwXGr7VkscrSONno6phGXczWw3gR+EB X-Received: by 2002:aa7:8345:: with SMTP id z5-v6mr576974pfm.251.1529653977669; Fri, 22 Jun 2018 00:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529653977; cv=none; d=google.com; s=arc-20160816; b=o2KZEKqRe1whQ0JJL4/QnRu/Hvu8CXK/6HI6i3FawcbkIg09AGPuRBT3Jg7oV+2J/7 X1slZi6J2yxdSuzxAud0fytcG5DEs7jsUhQvKJ+rl0PcKZxFs/yRgqsgG5U35VQVbWsu XdyKYean/xCwHaLR0ybepMkBn9CL73LgP43nwiBwqdqg8BD28hiMvJk+FTMgytrskhdr HT2QCtyvDXBzNw0LV1kji67ZCKv/X6g2wkcToDGX7V4enzex3Z8vIAc7fc5i34jjuS/6 /jsaI6fDvU+F6Sf8dUf9vwp6NyLTeQQclj6Lz0bci6X2SCE40VzON58eViNPQ5lPmAYQ HMng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Fpaeuiuxd4eUiw6wOaTwZ+9Zh57V15xDH/BiraShvw8=; b=cC2TuPwNnh25Lnue3t7gbxsS1A/QB9/Yt7bU3+RA9OEqI+OwQ8XEhvToheFtMtOWuk Y9Yf3B23Z/hxCYJ2A4d7j0G4n5rpSuzLb3MrbIIjNSEH8bNXQSPHJ7286b7PbsqXa0Qx 7L39rze0tgrdKLBrAOp4RMmn8KiZYJPOjVj7ERHARxJyL5KaWCAlJG8LqXUIh3MVdVaK Y9zO29HiJcQfUJnSyi8PQdpWkIP1Rh9IYJcohjSzkYHxiZLammYxf/yyrWTkHzdGZYXu wjPGVl2roUENcFkAOJZHiX7qNI9ogJi0VQKHA1eH8tHHY2jfI1vIZitGihrHq5QdqNeA STEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Yrd6Gjon; spf=pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=fail (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 k5-v6si5551493pgn.258.2018.06.22.00.52.57; Fri, 22 Jun 2018 00:52:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Yrd6Gjon; spf=pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751085AbeFVHw5 (ORCPT + 1 other); Fri, 22 Jun 2018 03:52:57 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40217 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbeFVHw4 (ORCPT ); Fri, 22 Jun 2018 03:52:56 -0400 Received: by mail-wm0-f66.google.com with SMTP id n5-v6so1337277wmc.5 for ; Fri, 22 Jun 2018 00:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Py6cR6y3XIgv4fD2iMWnQNj/tm2t1taCB6oPKm1Ky00=; b=Yrd6Gjont84e9azMjrzAULSz9OYS60b5eCpxLKnzV7U/PU1w5hHUmCUUuVMCwell1R +89SVjTn0WuAwVhYueruJf0ocGA0ZYrPY4kGDTMqLcwiUEhBv7pD0smbAjddSieDEJJr cNZ42bMYBdw4CXu8OE9FWfvS2zuztpqXHU+bU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Py6cR6y3XIgv4fD2iMWnQNj/tm2t1taCB6oPKm1Ky00=; b=QgXDYR7rEe/lzwcFgxWJKigjJjS8k/cUJLW/Jp02tAPFV/q9lATlWQWrmsYcV9Do6E T2hWbYkXGcGNUAgQ2ONGgXCLnaF1aaYdeMz9Vk67BD3I0YsmmYYOZdSSTqgS0j8lveNd cSXcZi237A6rhTN5jISYI+a64SSgClWuH5vt16xGJHL6jL8YI7/tvSEFDgzM6lA4sknZ G9xWmkzwOIPUietD0RQKwjXwanxCJb7fd3GmIrDMn30hf8yjH4YAQZ30ZqXzFvabkUam 1XpEjJ96sbqnnD59U3Hf+Vmeye464Xf/DWyepS9jRjfXxNo/zwsvNW49FlDIG3vwNtwb pquw== X-Gm-Message-State: APt69E3wIAEtv6WxEwqvMvOcLJo2DyJdh1L8bnjp+/XMcECjAO/VXwya X+N2Amw04vK6ifzQItmunGBVtw== X-Received: by 2002:a1c:6744:: with SMTP id b65-v6mr776334wmc.9.1529653975301; Fri, 22 Jun 2018 00:52:55 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:d0d9:3abb:8cc4:581c]) by smtp.gmail.com with ESMTPSA id s10-v6sm1593986wmb.12.2018.06.22.00.52.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 00:52:54 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: lersek@redhat.com, Ard Biesheuvel , linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Peter Jones Subject: [PATCH v2 0/2] efi: add support for cacheable efifb mappings Date: Fri, 22 Jun 2018 09:52:48 +0200 Message-Id: <20180622075250.14075-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org KVM guests on ARM have special requirements when it comes to mapping framebuffers: given that the host [emulating the framebuffer] uses cacheable accesses to read from the framebuffer region, the guest should uses cacheable accesses as well, or coherency is lost, i.e., the host does not see what the guest writes. Modifying PCI drivers to take this into account just for KVM on ARM is unreasonable, given that mapping BARs cacheable and still expecting side effects does not make any sense. However, doing the same for regions of system memory does make sense, since a framebuffer in DRAM could be accessed via DMA by a coherent master, and so it makes sense to take the memory attributes described by the UEFI memory map into account if it covers the efifb region. Patch #2 implements this. Patch #1 is a preparatory patch that makes efi_mem_desc_lookup() usable for us in #2. Changes since v1: - fix Peter's email address in CC tag (#1) - add Laszlo's tested-by Bartlomiej, could we please take this through the EFI tree? (with your ack) Cc: linux-fbdev@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz Cc: Peter Jones Ard Biesheuvel (2): efi: drop type and attribute checks in efi_mem_desc_lookup() fbdev/efifb: honour UEFI memory map attributes when mapping the fb arch/x86/platform/efi/quirks.c | 3 +- drivers/firmware/efi/efi.c | 8 +-- drivers/firmware/efi/esrt.c | 5 +- drivers/video/fbdev/efifb.c | 52 ++++++++++++++++---- 4 files changed, 49 insertions(+), 19 deletions(-) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html