Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2546591imm; Thu, 9 Aug 2018 15:08:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyYBsEhdPQvYZHxY11iJuDG30+jUB1jwMarlMsCjKfx1tUyTdnYZywepKjOSdiU+64EmCWE X-Received: by 2002:a62:ea05:: with SMTP id t5-v6mr4152878pfh.228.1533852537679; Thu, 09 Aug 2018 15:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533852537; cv=none; d=google.com; s=arc-20160816; b=bGPbxPUVfr8GccVupkiPebiD7uSkJbITs9kdV0nonyuhTKoTO9S1r2Ze2cmTlkN+T0 +kWUPt7o9aECZOMWkz1c3gJVCqRnb0XVyB1fekIJuNX+asEjxYowfinWTAmzUZxCIYLI l6JsH3Pq7OvLqTyNegZ4iFRZK7y8Ddz8Dw0sB1bfkqTvtKwtWnFUslmQeFldBuOzzX4E 0l1ZIYBR+NFMzlbzrwNaOW4wc1HJ/KIVhKOTmBpnFP6K5JG578vlPN1QSx3u3plGDajK 68WkY50RRFJnsnjrPMVUDTuOEXdMDUltvG5Aif1R90LTm/lzLICPNcYFxY3B05ASs6D4 z1HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=E8lMEHHp1XpQp1GSl3+driojV4qNti5pVY7ThXl0HL8=; b=eM7RldIAANwlbJhKnbyhy7axrCHLBWdxSNFFNdYroenKCrvoPU5m7/yCkMjYCSkjD8 htz85IpcT0a1WC/KKYk1FYoFB6cw3xOezhyRKBoTnCIK8cSPs9fAc79nw8JLfWoeVq1G AbrwanRPXoicwaeRdzX31dqx3G2I1I6su3ktbOIKpdjC0PQUdXK01b0RDG66IghZ4GHr fulgqsWuxCDHci/5j9/8F8LxJVrEPzlWs++cUtbMf9rcXeWQKWOixFxf6h/pa5YBGKiM hWiaFeAMBlhlI2va+AXw1px0CGRIZheKGH1xMRljLCm4+NoRXXHzrTWh03JlhuFEIyJR OlHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SMpLycfI; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16-v6si6662734pgv.78.2018.08.09.15.08.40; Thu, 09 Aug 2018 15:08:57 -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=@chromium.org header.s=google header.b=SMpLycfI; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727335AbeHJAea (ORCPT + 99 others); Thu, 9 Aug 2018 20:34:30 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33242 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726890AbeHJAe3 (ORCPT ); Thu, 9 Aug 2018 20:34:29 -0400 Received: by mail-pf1-f195.google.com with SMTP id d4-v6so3504286pfn.0 for ; Thu, 09 Aug 2018 15:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:to:from:in-reply-to:cc :references:message-id:user-agent:subject:date; bh=E8lMEHHp1XpQp1GSl3+driojV4qNti5pVY7ThXl0HL8=; b=SMpLycfInSV/+Xtp7t8X+4nXWpZiNGqHDrwNX2WouIfeJZthF0Y1/Z8xeWg8rWx+Ck mK4NJcyd9yhKzysCN+exB3hEyDCmtIGh478Ruh+nzDKwSEofFg3chwaOt7RuEb/20xIY OdY3mDsOB1JQuvHWmzwcRw6GKfgEU/rF7TbGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:to:from :in-reply-to:cc:references:message-id:user-agent:subject:date; bh=E8lMEHHp1XpQp1GSl3+driojV4qNti5pVY7ThXl0HL8=; b=T/c8fK+WBatur54p+j6LiUTg3zcekcC8gnVzB0YMqqc4GhCyyLGkpTAB0wLXB+jC3x keQ+lU19VyAZqZuH6tY1LXi0qkyKOoKqQbUC8QDK/juIG4mlWOF7QH0s8rjGS2y8BTWP TUDvLCsaKndOOTABylL7HJtc3+ojmmXE2FY3zR9BKBgjCLTj9s/iNXXsujTHhNdx2PXh pYknHwb0oFJLacj38Vb23HsuFoUeXegcFjhVVhkUq/KEd3mohVSY9y330ixRg89fqeXl qVaggsEixbMyMRvWL8ysqmQQ4QRSAq3tOul6uOetvJo+pzYaAXZCqgdjydVnPid06WOh ovSQ== X-Gm-Message-State: AOUpUlE808XVYnPcfwLitgEHrr+iCsX7tQiacz5nXnXFz045AXU+/z+4 dN1EhuojVKUN6HLyDNAYm0HFvZ5/xyySQQ== X-Received: by 2002:aa7:8118:: with SMTP id b24-v6mr4153885pfi.78.1533852459332; Thu, 09 Aug 2018 15:07:39 -0700 (PDT) Received: from localhost ([2620:15c:202:201:7e28:b9f3:6afc:5326]) by smtp.gmail.com with ESMTPSA id r81-v6sm12244041pfa.18.2018.08.09.15.07.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 15:07:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Aaron Durbin , Julius Werner From: Stephen Boyd In-Reply-To: Cc: Greg Kroah-Hartman , LKML , Wei-Ning Huang , Julius Werner , Brian Norris , samuel@sholland.org References: <20180809171722.144325-1-swboyd@chromium.org> <20180809171722.144325-6-swboyd@chromium.org> Message-ID: <153385245791.220756.10097093170204882190@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v3 5/7] firmware: coreboot: Remap RAM with memremap() instead of ioremap() Date: Thu, 09 Aug 2018 15:07:37 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Julius Werner (2018-08-09 11:24:29) > One thing to note is that we still want this space to be mappable by > userspace applications via /dev/mem, so we need to make sure that > there's no weird memory type mismatch that causes problems with that. > Adding Aaron to see if he has any concerns here, since I think he's > seen something like that in the past (not sure if it was related to > what this kernel driver does). > = > Can you please test this on an x86 Chromebook and run the 'cbmem' > userspace utility, make sure it doesn't fail after this? Sure! > = > Also, stupid question after taking a step back and looking at this > again: why do we keep a mapping alive for the lifetime of the driver > at all? It used to be necessary when this driver was > find-entry-on-demand, but nowadays it just goes through all entries > once at probe time and immediately memcpy_fromio()s out all the > relevant information into (struct coreboot_device)s. After that we're > done accessing the "real" coreboot table, forever. Why not just unmap > it again at the end of coreboot_table_init()? Yes, we just copy everything over so it makes it simpler to just unmap at the end of coreboot_table_init(). Then userspace is free to make a questionable mapping into system RAM to find the table itself. I'll make this change.