From patchwork Fri Jun 15 10:48:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 138668 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp678295lji; Fri, 15 Jun 2018 03:48:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQqiu/phKGHNIH/aY15OoF6FIKZ1L5nCKUG0iHqNkYUwyY+QPu9Zu1VoOH4k3afTycw2Sn X-Received: by 2002:a62:fcb:: with SMTP id 72-v6mr1307911pfp.231.1529059707378; Fri, 15 Jun 2018 03:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529059707; cv=none; d=google.com; s=arc-20160816; b=yTzgcU2uAcynBuaE7j4rCcCDPRG42attP7OLdYtNABg9Vkt6dJSZwFIx/gi/CfQ5Ak uy0PZu2GkhBqlHaDohd4GI7ruTrEEJk3CmVDePph21wDLcyzK5R4uNW0atpAv0sspNe/ SaCmps4A34eUtyAwwmZQziGVfJnccGSUdGsdRLyJUScxC3UQIAPKkeGHI8OWFkcVDekx /EGcnB5uTjwPtHJWSz9QlYhHmlWFupjf1oTDBPkgCJcfhGQib0Q3K0Pqxjd648uf+Ocm uHeLyiCtEAsD2TjFu3vDNvDRM/9ZUJyLkuj5mCCvmncOfoZgdqdVZEiVNrESCYLC2wyS ys6w== 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=iBPQY9kMekEnNGRmYYfgSooXodn/BnY4NWjg5VtCX0A=; b=UnNHRH60JZzuG/b6C0wr+ChelhaVA/v9KWgAcdQ0zBqAX/ykp5UB5iCSGQqVmIB/Jy DieBRdsGzUSnd2NUinD0beMcFSbWxklOhXkkHFDgcw+bz/jHvpCn5kYvfps5Iow3goo/ 9W0CL2lQuJ2ye99OuwtpQeOYbNJ6l4DJkwgcUcg0jsME64Z50HwZMkjOkAJzYh4drbbA c7GBykVR0wd7Uq6j6oc1qNzrQs47fn2HAaNot6QScP8dBBhFIfiF/tFLSdlrxH1MzW0h 1ipes3kza1hl60Tysl4HfPnetJrDQwIqaaQQyhTRwNlNVehX8YmFc43JNW8VrIOyOduf BvNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VkaNis9g; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-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 m12-v6si7693135pll.461.2018.06.15.03.48.27; Fri, 15 Jun 2018 03:48:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-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=VkaNis9g; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-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 S965597AbeFOKs0 (ORCPT + 2 others); Fri, 15 Jun 2018 06:48:26 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54194 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965590AbeFOKs0 (ORCPT ); Fri, 15 Jun 2018 06:48:26 -0400 Received: by mail-wm0-f68.google.com with SMTP id x6-v6so2810277wmc.3 for ; Fri, 15 Jun 2018 03:48:25 -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=2nN3hAwe/dq1D+JeOPQbcTSaqmYYN7zohlpIL3hI0aE=; b=VkaNis9gyWN2s4URi/257cc5bdit2u1KrURdCR/bhdYKTIKDEIuzzEeWSQESA0GMb/ RePeKUyMhbrdl1soOtULr723Jf8ekSlx0OHu+C5glocjdnxuenDLHk9DTwFCZLWx0sS4 C8K9FasJVDkDSG2Jmqj8fSMQFeuLnxL5ABoDU= 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=2nN3hAwe/dq1D+JeOPQbcTSaqmYYN7zohlpIL3hI0aE=; b=VDLLnMWuO5vEgXiIfLYqZoijB7Js72WalIiq9U9sMGg6Uwe7fYeXlhqDwz537u7CIr /vmxm8DMBKeBBwtEbUrBKctBaifyBJmk1YksGiI/bH1Y3WX2rofhhiONy+Js9s4m6ZBk K7OJP0ZlsmNNuQ2reSyk8pL+yNqKIcfhcsTsq+mUrHE6LysTCkuLykpd40//FRafHTcu H1aiV4DK8LXgSKZLMIHpjE3SeFCDTdVTxlU+lJqc3Ktt7EqCvEP1c+JMc7LwzCQtq32s 8amsl25mNXsotU+ctLdiwZB94jpxTiWySCvBrIpRjntsy7cCBuXbhRnzc8P3UKj1XgTZ 72Og== X-Gm-Message-State: APt69E1ESqlrOrfixWFKxb7Tf/GHEpTlkNsmHuqn/dKKH85iIMDdncTu vQnKPQiTOA2z5QYlA199evheeIJyv0c= X-Received: by 2002:a1c:6f50:: with SMTP id k77-v6mr835315wmc.38.1529059704701; Fri, 15 Jun 2018 03:48:24 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:3805:d7d2:48be:b40a]) by smtp.gmail.com with ESMTPSA id a9-v6sm1393914wmh.38.2018.06.15.03.48.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 03:48:23 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: lersek@redhat.com, pjones@redhat.com, kraxel@redhat.com, Ard Biesheuvel Subject: [PATCH 0/2] efi: add support for cacheable efifb mappings Date: Fri, 15 Jun 2018 12:48:16 +0200 Message-Id: <20180615104818.23013-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@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. Question is how to best test this. I tried Gerd's ramfb patches against QEMU with a recent ArmVirtQemu build but I am having trouble getting my console to use the EFI framebuffer. 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-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Tested-by: Laszlo Ersek