From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79404C43603 for ; Wed, 18 Dec 2019 15:30:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EAE7206CB for ; Wed, 18 Dec 2019 15:30:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qWx+G/bF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EAE7206CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:From:Date: MIME-Version:Subject:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=atc5DbzXCpCqy/WS/H+sTp5htc0Ug2y4IoAOZYMGdqY=; b=qWx+G/bFQJaT8zUjduRbN/jDp 60vVvSGxK06b2sWyyYHhROK0CX45wZD5QtO6aTOAoH4ylAsCltfOGts/4YU4qvwXu7KyjsB6U1FdS sRsRtA6bQgv4ZqeYE7LDXb9BoZoHVilpfHHn85oufD/t5tCny2t+KX0tTWim7xnI1dwsrz57AdKBS YvrskYN3tT/dQrDLHGH5QryF/urm3G5q5ZoY7Dvc7CmkBaXwJfcUEinerPnkL2pmVquelD55+LyIf z66+IdHSNe99XHEg0dohoqu9LQv7zWSNRY2tvbBWEkQl7NsGDo7C1kcUSNKiwYl+nuDO3MLvYosg8 8u/qUEWKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihbHN-00015A-H4; Wed, 18 Dec 2019 15:30:25 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihbHK-00014c-RX for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2019 15:30:24 +0000 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1ihbH2-0003tk-7u; Wed, 18 Dec 2019 16:30:04 +0100 To: James Morse Subject: Re: [PATCH 7/7] KVM: arm/arm64: Elide CMOs when unmapping a range X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Date: Wed, 18 Dec 2019 15:30:04 +0000 From: Marc Zyngier In-Reply-To: <0c832b27-7041-a6c8-31c0-d71a25c6f5b8@arm.com> References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-8-maz@kernel.org> <0c832b27-7041-a6c8-31c0-d71a25c6f5b8@arm.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, jhogan@kernel.org, paulus@ozlabs.org, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191218_073023_038316_93D2DCE3 X-CRM114-Status: GOOD ( 10.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm-ppc@vger.kernel.org, Wanpeng Li , kvm@vger.kernel.org, =?UTF-8?Q?Ra?= =?UTF-8?Q?dim_Kr=C4=8Dm=C3=A1=C5=99?= , James Hogan , Joerg Roedel , Suzuki K Poulose , linux-mips@vger.kernel.org, Sean Christopherson , Paul Mackerras , linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, Julien Thierry , Jim Mattson Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi James, On 2019-12-18 15:07, James Morse wrote: > Hi Marc, > > On 13/12/2019 18:25, Marc Zyngier wrote: >> If userspace issues a munmap() on a set of pages, there is no >> expectation that the pages are cleaned to the PoC. > > (Pedantry: Clean and invalidate. If the guest wrote through a device > mapping, we ditch any clean+stale lines with this path, meaning > swapout > saves the correct values) Indeed. >> So let's >> not do more work than strictly necessary, and set the magic >> flag that avoids CMOs in this case. > > I think this assumes the pages went from anonymous->free, so no-one > cares about the contents. > > If the pages are backed by a file, won't dirty pages will still get > written back before the page is free? (e.g. EFI flash 'file' mmap()ed > in) I believe so. Is that a problem? > What if this isn't the only mapping of the page? Can't it be swapped > out from another VMA? (tenuous example, poor man's memory mirroring?) Swap-out wouldn't trigger this code path, as it would use a different MMU notifier event (MMU_NOTIFY_CLEAR vs MMU_NOTIFY_UNMAP), I believe. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel