Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4169097pxj; Tue, 25 May 2021 01:49:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo5XZGnSRBHdmOqnWN3hP3A3g9XrFs3Fp6sGLlyVNeqE4kHs8FgMxGClHrF2Xd9H4ZKEqC X-Received: by 2002:a05:6638:21a:: with SMTP id e26mr29311661jaq.58.1621932575971; Tue, 25 May 2021 01:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621932575; cv=none; d=google.com; s=arc-20160816; b=FelPpwqg0oA8aBlqC96E7xKF8nPz8i9KdOGwV1Q+HCGzJ0xbdOWv/M1b9mq4JMCC1y 9Yn2uk6S0+u1dmEAIMFoGHrotf9ZzgqWrzFn77ECg3vnI2g/h3mnfI1bAM0KqrMMEHS7 pgywHvwpthBbJeJ4bO/dj+He1Eusc0JmE6KMd9U1dy0g/5p+INKuJsIDIzs0Qz+m3gLV WMVGk6WzhDggCgU8e68kGGkLbYhAN+p6DSiiBA5GTZ2+FbVXzm6pBrvA3rlVbEN0qu1k JGBwwxniROPPlYXQlMo+0K6si3/GTmFx+KtOaD6hx70vc/FOG5IX64GkcmbSKmYG+rdc aF8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=33WehLefsaCs8mzrnxUBokX91qQhEQO8tRtqWO8+uRo=; b=M8q3QVhNWJPQzdhyKrtSnO/2JdApkmY6BVL8zvojzc/bKc8xt2pCA08beX7jUlaQ1u urVrce60dXEr6PeD6qR5p7ovHCcenqLVixgw57mN5BEs+qpuwHD/mFrwauBpwDmmXfQ4 A4jQMrDvgM6yt8bUnsB8HPr0Jqu5V9m954GsZD3QegRd3SN8lFPKJIyGnC+1UCoii0oM BdGL6CVWh1rCyzVrcijEgzPf/Ew/weuanWLF1bKIGT1RBla8VhL5uUdspPZ5x0pa+pgi cjao0GTBS8PTfdabc5WWiyV37SqWeFsM5QqX25eukgKASgvuC+rpITHZBfQ18c9eDIkh pv8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="t/lQVQ3l"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si16214902jam.26.2021.05.25.01.49.23; Tue, 25 May 2021 01:49:35 -0700 (PDT) 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=@suse.de header.s=susede2_rsa header.b="t/lQVQ3l"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232253AbhEYIWO (ORCPT + 99 others); Tue, 25 May 2021 04:22:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:34300 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbhEYIWN (ORCPT ); Tue, 25 May 2021 04:22:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1621930843; h=from:from:reply-to: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=33WehLefsaCs8mzrnxUBokX91qQhEQO8tRtqWO8+uRo=; b=t/lQVQ3lCBCGFEeJZbepLGbJ7ZtWPvnIv58iYyPJmu9nlp0PQwgaWqpsE4WhmFubLs4I3k w1acVXlUcqMJisu+YxE55jtPcsc9ACG+rotjvUss84r8XzoE6zupOLa8QbzV7V/Ec3ne+k /WOhD6VLnZUKRFQYyWRLIJNYsZUAANw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1621930843; h=from:from:reply-to: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=33WehLefsaCs8mzrnxUBokX91qQhEQO8tRtqWO8+uRo=; b=aq8jZKe/CGd0TlTEQ6IRtlA6LXEukQZ/9rkTezLfByteZUnmh7UuVzfA87csX5o/tc48Iy FbM4nWnzmGk6v4Cg== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3203BAE92; Tue, 25 May 2021 08:20:42 +0000 (UTC) Date: Tue, 25 May 2021 10:20:36 +0200 From: Oscar Salvador To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , "Michael S. Tsirkin" , Jason Wang , Alexey Dobriyan , Mike Rapoport , "Matthew Wilcox (Oracle)" , Michal Hocko , Roman Gushchin , Alex Shi , Steven Price , Mike Kravetz , Aili Yao , Jiri Bohac , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Naoya Horiguchi , linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 5/6] virtio-mem: use page_offline_(start|end) when setting PageOffline() Message-ID: <20210525082036.GC3300@linux> References: <20210514172247.176750-1-david@redhat.com> <20210514172247.176750-6-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210514172247.176750-6-david@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 07:22:46PM +0200, David Hildenbrand wrote: > Let's properly use page_offline_(start|end) to synchronize setting > PageOffline(), so we won't have valid page access to unplugged memory > regions from /proc/kcore. > > Existing balloon implementations usually allow reading inflated memory; > doing so might result in unnecessary overhead in the hypervisor, which > is currently the case with virtio-mem. > > For future virtio-mem use cases, it will be different when using shmem, > huge pages, !anonymous private mappings, ... as backing storage for a VM. > virtio-mem unplugged memory must no longer be accessed and access might > result in undefined behavior. There will be a virtio spec extension to > document this change, including a new feature flag indicating the > changed behavior. We really don't want to race against PFN walkers > reading random page content. > > Acked-by: Michael S. Tsirkin > Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE L3