From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E19A3876D7 for ; Tue, 9 Jun 2026 09:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780998863; cv=none; b=qUlVXj1e90a62gL+0sLyMDZ0hmejr50QYNSEavrQW5xp7IQ35Lyb4iSFj2sevsbh8De++p6HvZiyO41xjTRmkhxbrGVauM5FeDQaLuCNyyvWOXc123W4xH+ZGsz1Jhwt+4dQG/dYH0qjvyy1BohUOy2yfCbYViCNhG35uzOcRhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780998863; c=relaxed/simple; bh=2HeW6yQPBT2PrIoTxjqfHMyOQDJQngsMJVK//XX7fOU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GEp6/FEdHGjUX4YIPkWUrGLkb6bNPAhl9XFJUBDwYjg9wSGiKF2LuiJSmTuq/KxUe1GR2pgKTF4t1HPybHYg21V8p8vQdl298UxQpP6HRbp/XqpENrbrgIMWU1XTDNF1+eikVksc7uLeXey9mtFe3Hv7dB1Wwpn8KWftFixPRCw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ej6ibhkk; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=LYiTCsud; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ej6ibhkk"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="LYiTCsud" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780998861; 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=W5AGHJKl709rDF75fggz2CPtkzpWxiGnDcPVzzKSTGA=; b=ej6ibhkk24p4B81ovWD5se+ihyWGwXMzq69SC7/bXqSqaJKgpVELYW1CmhJoYu/w2cMxAd yZ5jqRdTkgXvAnEDByCe/qgtLeojWM+92uQAtnth7KyPdK9e64HF8OQhEAPbmg4QwVXt/3 ikH6SuiAOPag6AWLtgL9vBvxO0E0VLs= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-l3RaZRdgPEWcxhHk804hTw-1; Tue, 09 Jun 2026 05:54:20 -0400 X-MC-Unique: l3RaZRdgPEWcxhHk804hTw-1 X-Mimecast-MFC-AGG-ID: l3RaZRdgPEWcxhHk804hTw_1780998859 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-bf4ba05fd18so415354866b.1 for ; Tue, 09 Jun 2026 02:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780998859; x=1781603659; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=W5AGHJKl709rDF75fggz2CPtkzpWxiGnDcPVzzKSTGA=; b=LYiTCsudd+bLk+bljrPOoRKTfsC4dq+JmMckEupmo4KIn1DQpHYGbJTDytaJSEAFdV W9HqUFKCer4NGhXiGJk4Yz6lkSW3uLEvm9A2it50zFrRCfOC4Pukf3nkOa73y64Z/Pje jgIEseGNa/ZntL0SypRIAY99hOEqlDYDl2N3r8K9xC9SDWOtLZBZLQ/LVDExnDY7qKun fW7e+3eoF3CFvYC6HkgtyxMlCOa5y+jZN0YxXptWavfDYTEkmjVBO54ht7PQshOEF30n b+l7Pxg20/acio10OlsZQWs4dFRBidARFJNPz9hNIkLxNd1/KMezIIJs/FvmJTH6gYvC Q6xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780998859; x=1781603659; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W5AGHJKl709rDF75fggz2CPtkzpWxiGnDcPVzzKSTGA=; b=hSNdOM3ERLp5+vRwMae+HCUgIKQABe0TQkDxkQS763LpeRSARtmgTOL2b+9ViW2NIn 6mJEYCFJmhyCiRNhBLuqpwe6Px7BMMk5rMJAE0uTM8DHs87hQQCJy+a/kDo/E9aF5Cx+ WWSND6HEm9XnjIGSu9mcqENT6zwrxXQjCW/5XhNnqzUt4J6h+JVUYsdiwJ/5sAPXYR6b iunyi4aBKcP/vut0TG5sA0Gze9597EFn1wJa9J9tZtYm4I6gUGW1RnO344Diwkwg+w8N wVh77AjcSpOa9bhVfdmWs5DjAvE7PDdIxhUxCfnP2ZxP7r/9S6/fkKc92FQ3Viz+TGia /fXA== X-Forwarded-Encrypted: i=1; AFNElJ/7ZVA9Bylrs7cXdI+9Il695NC9jJGqhwqltbO6XtiGGrxTTHiWZrhZIrLLZ9lexiXYO6zdmQTJOBoEheo=@vger.kernel.org X-Gm-Message-State: AOJu0YxUuIb9giTsqGjhoIuQXR4QCiedgMXgTjBZfMNGVskr8Qqcnvpz IgAiANpBFyyru3U+a6+t1IOS15R+Jto/k1q8dPiWu7Pwblk1JpYKxu6yviA94uoiD8keqxE26qF WXdzrwf7Zk+9errVByzCkCgOTQ0FPaMIRBL5spGVWFdHfczkhq9W6KXoSviCsIC/F/X0aeU8fjN R/ X-Gm-Gg: Acq92OFon7TriF2xuimQsoQz3heYqm50+VzmMlzfeOvsfQY/ZtiIOj9XhyN1rI0YpCn 6an9HUSP06g77FRI2/GjZV5bVXw03kOYAAIGicRWZSj6bpyP81meGqDn27SxqBDL3pCmnOBugu9 bAhLA3KlNyV1mcHPgJyyUWrFgeTzhoVk+EoaVbABjeDE1UdAAuysFtzte3Q1W2mCVcKdc08y+ay 8VDlKD27yIOqGkuNUzdtjT6LnPqs6XKRzIXoLcJs8hSW1UPc6c/RuZ6GHh3u++R0MJz42hpVkS9 7Ss948I5X9k1yHlKIwr1izATdXaCc+I7D8K4oLJqPKt7/72br6lLGB+Vq/UV4xtFjXrxhUXo7yS NtJhdCzzOI352Nb1lbnzMf5JLdx6vdkeGDQM8oT7x9TcaJLE+GeerLw== X-Received: by 2002:a17:907:ca84:b0:bee:f72a:28d6 with SMTP id a640c23a62f3a-bf37096c195mr956583066b.14.1780998858702; Tue, 09 Jun 2026 02:54:18 -0700 (PDT) X-Received: by 2002:a17:907:ca84:b0:bee:f72a:28d6 with SMTP id a640c23a62f3a-bf37096c195mr956576466b.14.1780998858161; Tue, 09 Jun 2026 02:54:18 -0700 (PDT) Received: from redhat.com (IGLD-80-230-85-71.inter.net.il. [80.230.85.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf051e9aa33sm1010527766b.24.2026.06.09.02.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 02:54:17 -0700 (PDT) Date: Tue, 9 Jun 2026 05:54:11 -0400 From: "Michael S. Tsirkin" To: "David Hildenbrand (Arm)" Cc: Matthew Wilcox , Lorenzo Stoakes , linux-kernel@vger.kernel.org, Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Muchun Song , Oscar Salvador , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Hugh Dickins , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , Axel Rasmussen , Yuanchu Xie , Wei Xu , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , virtualization@lists.linux.dev, linux-mm@kvack.org, Andrea Arcangeli Subject: Re: [PATCH v10 07/37] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: <20260609055317-mutt-send-email-mst@kernel.org> References: <50d410b47fe3f45327783e05bd306d5eaab75e65.1780906288.git.mst@redhat.com> <68ac0163-865a-452e-b643-351e094cb2ba@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <68ac0163-865a-452e-b643-351e094cb2ba@kernel.org> On Mon, Jun 08, 2026 at 04:55:19PM +0200, David Hildenbrand (Arm) wrote: > On 6/8/26 16:44, Matthew Wilcox wrote: > > On Mon, Jun 08, 2026 at 04:37:03PM +0200, David Hildenbrand (Arm) wrote: > >> On 6/8/26 16:31, Matthew Wilcox wrote: > >>> > >>> What I don't understand is how the kernel page allocator needs to know > >>> the user address in order to effectively zero it, but the hypervisor is > >>> able to zero the page without knowing the user address. It feels like > >>> somebody has x86-centric thinking where cache colouring doesn't matter. > >> > >> (not commenting on the icache dache mess we have to drag along) > > > > Well, that was kind of the point of this email ... I did ask the > > question you're answering in a different email so let me respond > > to that too. > > Now I'm confused :) > > > > >> The thing is that with free-page-reporting the memory is already zeroed by the > >> hypervisor as part of discarding that memory previously (e.g., MADV_DONTNEED) > >> and allocating fresh pages on re-access. > >> > >> So it's not a question of "why is the hypervisor zeroing less efficiently", as > >> zeroing is just a side-product of reclaiming that memory in the first place. > > > > We definitely have users who don't want the guest to trust the > > hypervisor. So how do they disable this optimisation? > > Right, I don't think we currently have a toggle to disable free page reporting. > So IIUC, this optimization would similarly automatically get enabled if the > hypervisor advertises it. > > -- > Cheers, > > David Not as the patchset stands: [PATCH v10 35/37] virtio_balloon: disable reporting zeroed optimization for confidential guests disables it. -- MST