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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7FCEAC43603 for ; Wed, 18 Dec 2019 15:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52BEB218AC for ; Wed, 18 Dec 2019 15:07:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbfLRPHy (ORCPT ); Wed, 18 Dec 2019 10:07:54 -0500 Received: from foss.arm.com ([217.140.110.172]:49406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbfLRPHy (ORCPT ); Wed, 18 Dec 2019 10:07:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5533C30E; Wed, 18 Dec 2019 07:07:53 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 554673F719; Wed, 18 Dec 2019 07:07:51 -0800 (PST) Subject: Re: [PATCH 7/7] KVM: arm/arm64: Elide CMOs when unmapping a range To: Marc Zyngier Cc: Julien Thierry , Suzuki K Poulose , James Hogan , Paul Mackerras , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , 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 References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-8-maz@kernel.org> From: James Morse Message-ID: <0c832b27-7041-a6c8-31c0-d71a25c6f5b8@arm.com> Date: Wed, 18 Dec 2019 15:07:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191213182503.14460-8-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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) > 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) 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?) Thanks, James 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 1BBB2C2D0C3 for ; Wed, 18 Dec 2019 15:07:58 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id A0800218AC for ; Wed, 18 Dec 2019 15:07:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0800218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 288494A597; Wed, 18 Dec 2019 10:07:57 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WNymI56onAYS; Wed, 18 Dec 2019 10:07:56 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 08AB64A52C; Wed, 18 Dec 2019 10:07:56 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E8FE74A500 for ; Wed, 18 Dec 2019 10:07:54 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VLLIDFp2QXh7 for ; Wed, 18 Dec 2019 10:07:53 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BB0C44A418 for ; Wed, 18 Dec 2019 10:07:53 -0500 (EST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5533C30E; Wed, 18 Dec 2019 07:07:53 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 554673F719; Wed, 18 Dec 2019 07:07:51 -0800 (PST) Subject: Re: [PATCH 7/7] KVM: arm/arm64: Elide CMOs when unmapping a range To: Marc Zyngier References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-8-maz@kernel.org> From: James Morse Message-ID: <0c832b27-7041-a6c8-31c0-d71a25c6f5b8@arm.com> Date: Wed, 18 Dec 2019 15:07:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191213182503.14460-8-maz@kernel.org> Content-Language: en-GB Cc: kvm-ppc@vger.kernel.org, Wanpeng Li , kvm@vger.kernel.org, James Hogan , Joerg Roedel , linux-mips@vger.kernel.org, Sean Christopherson , Paul Mackerras , linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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) > 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) 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?) Thanks, James _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 CE5E4C43603 for ; Wed, 18 Dec 2019 15:08:01 +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 9075B218AC for ; Wed, 18 Dec 2019 15:08:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A/fcezKw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9075B218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IUJrxx8w6js/NCAbhci6JTdsDzX+sU+lN/ywhtcj18c=; b=A/fcezKw8C/PR/ ovG9aCZ5LIeZcI3P+gfM27YWGDALxyqQJcOtyNJj7WjRjzItnOi1DwyOgpFmxUygWbMmWxkqEI5Kv oMvY+kCTIXMIxnnYbUfml7U8DqTeMukc9x3bjGUb0g1fZmcNTgoXX9svAq6z3DWiUKpsHsk86DDtv xHwYV81lVzW5LMlFP+xK0JhIqkjXqvhfOJ9UO3qfboQNieYQFDz48sxqPMRpQNYWPHY2hNpAo+dpm 8qQu4ei57MDQMad9X6G7/0VIAQ9okgb14UWE3hWDZKLoA38jxmSQ9dvBrUSNe1DSg+vFUrLALLz7Q YrPKYdS6rNHVh2jx9rTQ==; 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 1ihave-0006tN-Fo; Wed, 18 Dec 2019 15:07:58 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihavb-0006sZ-MC for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2019 15:07:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5533C30E; Wed, 18 Dec 2019 07:07:53 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 554673F719; Wed, 18 Dec 2019 07:07:51 -0800 (PST) Subject: Re: [PATCH 7/7] KVM: arm/arm64: Elide CMOs when unmapping a range To: Marc Zyngier References: <20191213182503.14460-1-maz@kernel.org> <20191213182503.14460-8-maz@kernel.org> From: James Morse Message-ID: <0c832b27-7041-a6c8-31c0-d71a25c6f5b8@arm.com> Date: Wed, 18 Dec 2019 15:07:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191213182503.14460-8-maz@kernel.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191218_070755_771680_B5074CE0 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. 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?B?UmFkaW0gS3LEjW3DocWZ?= , 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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) > 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) 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?) Thanks, James _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel