Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp757201pxb; Thu, 19 Nov 2020 13:04:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7TWLqIvhdfPRhqkqevAG7z0upNaT7YsaNEv75UtHNeiXW0/fQtx3vjhFEvLSwPVMIC8vy X-Received: by 2002:a50:ab07:: with SMTP id s7mr33138582edc.287.1605819859178; Thu, 19 Nov 2020 13:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605819859; cv=none; d=google.com; s=arc-20160816; b=Aq/TN5s89rXd+v1bX4/x7uQLlHFh1ud6E098AF8Xu8YPr+1URUgT3uQ/mfdDV3yjsm nNFa5px91eG9GtDOgPxLAIYXiMdXYZoa6v1liPSDp4moG9qwC916JVvwgG/96IOCVear LV8h1DnDWqhnnoFcBXz1Q8xv8G3GgpN2x2r0fVcb69PveQ8Wrd7ZBRhNtgEaezTkmCjn 6J9PxMTYJWEZU6lOJDvfg+R8xM/xDcoyAr6FWsQaWM7RhPQIvKR2Y+xTnM2LrcbhrS20 743xmQ4qxH0ocBDUAOjS24VADSdFDTS0bQI8kYP3e7ggvWaK7IUCGjcRihGm3dZ1ABp8 qiYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=M4FLMJAfT7rzxFEGo9W4VWVDKp3gYsmZQ2etIBAJk+E=; b=bXftkMIzKcucWLmLfiZo8FvPl/4SWeAPlj3+r+E3hmLCoWtc6eG13TTVo7bClbOqc9 qHDjERl72pdi85Wc+juL3M3DCysAlU5IJJQhR9+Z77LvkG/tw7srXWqFtsYqF6qSW6zD ob0w0IJJy/qlgjoZlQe5uFnMpJGd2UHbpQ5HXG91qaDbF1Y9oShl+bBcybuXrNBVJ5e6 LnIj8+KOwOyHo2eqLsMlx5mpAgXDzE0BQjWxTPkXqbRc5eh1fM67E5BOjTlW08QDmGg6 FmmLeeT45DwfzX2QmdLXTZEwhlbDp9QGGycUPWiATSFJ7GJhReD5YoSu8UppFn4LaGi9 b+Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dTNzyZQN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=rSH85lXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj25si507625ejb.337.2020.11.19.13.03.55; Thu, 19 Nov 2020 13:04:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dTNzyZQN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=rSH85lXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726297AbgKSVBE (ORCPT + 99 others); Thu, 19 Nov 2020 16:01:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbgKSVBE (ORCPT ); Thu, 19 Nov 2020 16:01:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C3FC0613CF for ; Thu, 19 Nov 2020 13:01:04 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605819662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M4FLMJAfT7rzxFEGo9W4VWVDKp3gYsmZQ2etIBAJk+E=; b=dTNzyZQN2DTlDYTke/KZeFvdiXdpktntXm6/nMzucEfk9MbYec/ZwpntuaAJsuEX8y0EdP bl+M9fovhzxHsvpPNnoE5tVKBytIpnr5bPrDnfyq6tZXj6zjXLRIipTDeurWIOxbUZXYcS ie/3AhhfrNe5MCZGUqIEiI3Vl/Hs+1B3gZOEPqOhOcujMuacRzsqo2Ei4T6p00K8TJnt3/ LNLx+YBBoHSN5HSE/vYOwBkV30A6aIFehlq+5wHyqEOv9Wi4+v1GxeKott7IHIpm8z4yWm WphFUzuDjQIcAW0vM3RZUMGBbbA5BU16LbYtfPoAoAwsPqyWuNeqE5euHdei9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605819662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M4FLMJAfT7rzxFEGo9W4VWVDKp3gYsmZQ2etIBAJk+E=; b=rSH85lXCV+xlwUkxHno1s4mD8QBIYKLO74vdaghRoy1U8BgxqgdhlGMNWKhfdGAibSGw1V gfQ/jrctio/b/WCA== To: Andrea Arcangeli , Ingo Molnar Cc: Andi Kleen , Rafael Aquini , Waiman Long , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] x86: restore the write back cache of reserved RAM in iounmap() In-Reply-To: <20201119175902.17394-2-aarcange@redhat.com> References: <20201119175902.17394-1-aarcange@redhat.com> <20201119175902.17394-2-aarcange@redhat.com> Date: Thu, 19 Nov 2020 22:01:02 +0100 Message-ID: <875z61oycx.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19 2020 at 12:59, Andrea Arcangeli wrote: > If reserved memory is mapped with ioremap_noncache() or ioremap_wc(), > the kernel correctly splits the direct mapping and marks the PAGE_SIZE > granular region uncached, so both the virtual direct mapping and the > second virtual mapping in vmap space will be both marked uncached or > write through (i.e. _PAGE_PCD/PWT set on the pagetable). > > However when iounmap is called later, nothing restores the direct > mapping write back memtype. Darn. This was discussed in 2008 already and survived that long? https://lore.kernel.org/lkml/20080205011357.GA14712@linux-os.sc.intel.com/ No idea how that happened to slip through... Thanks, tglx