Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37881262rwd; Tue, 11 Jul 2023 23:02:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFy4nod1M6hBFuxJNdbZo3bA7cDpO+UToJL6qUCov5pjknloM7eiU3dmjbhUNO0lZ/FscTh X-Received: by 2002:a05:6358:911:b0:135:5af1:438a with SMTP id r17-20020a056358091100b001355af1438amr8783035rwi.2.1689141751499; Tue, 11 Jul 2023 23:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689141751; cv=none; d=google.com; s=arc-20160816; b=nRYBndF6i2S9mG/UDPk50VDhZeek+E6bM93gFeLkjoEkDzCtg7+nVNBws+hy0o13P+ srJG0ipfB7tMk3rSHcqBhQ/LS3UedBe2ayp7vV5SMlRC0JHB9JEXc4K0OnIRgxllOCHJ MIoy6o8nPagwzL8KJeatIf04GcYNQwXbTjR1QJShQFLl6OWGOqI/FAiVSEg3o/B27eR0 zGeBThD8QgXw6wWiypu3CoVzT7IugWrkA6VpFzmf8lfL/I/kjS46bBd8izUJUACzEwSs uEYly+ykI6+FTFTYOLgtFVodNyMpmgPOusmamQM5pA70JXmzmN7hqTcXcodFx8vzWOEx PZ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qkUipoh9LzckasQjFT3oT/cjBw23ZeCHvwm10bQ21tI=; fh=dwrG1ou+8qaC3q8LGfyOxO7SBdYEzRC4bZKAhUUMhaw=; b=Jj0tTf+ekDtw5wYjKdPjxLhXx8VQDAyog0C3ubNT0cUAlWcOHG8IAdFv+JIZH2fBSh jOWf98yrdCQ2M0/cFDdHrZcdJvrkaqZyPbWW7OpN3y5H3GwJKPT/XM6fbItMIuH+zZ+9 4R7oLsSUfiBN8QFyQoH6Tw27EbkI6nzhYrBmBatqNIlu9qKX3ZOA9sL39dKhb8jRRyyL TysR42CGp4TwtB+MkzaszGtbsVOV/NFcV4ChVAiNKLaO/NVNcQzrWyP1tvgOtfuYjRB+ eUGQfn3vp2f0pKtIy1sAtdZogbnmUxYMs6qlc5u8QVB/4F+e3AsMTFCIqMhKh0glA0ts q86A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pu63hKu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v191-20020a6389c8000000b005579f38b454si2566444pgd.846.2023.07.11.23.02.17; Tue, 11 Jul 2023 23:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pu63hKu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjGLF3d (ORCPT + 99 others); Wed, 12 Jul 2023 01:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjGLF31 (ORCPT ); Wed, 12 Jul 2023 01:29:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF9219B; Tue, 11 Jul 2023 22:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qkUipoh9LzckasQjFT3oT/cjBw23ZeCHvwm10bQ21tI=; b=pu63hKu+Y6EW+pxvwVAsG7hhWC GMMHP45auERXQ9P6kTrwFsw4uf5OompiG0bnM5muQ7WRBhb1ieo5xuw7jUN/T8j874KXD8i4Ph4Oa igN4TK0OjBRVUuSu5FweVlmBI0cf9iOJN6DSxgxiwIi13BSnTmCDXEspuZx4umFBJ5hyy+qND63yi nAwbvEHE8h0JVZSe3gWBfNFoTdJ1Y1RbvUSNZ/R3qRBxiTzNy4NNhfu9sXeKYzrqy7zoGOgCB0AOb 4iUqVmKlkGEMNC4FGJtBeJ9QQRYJas9FLvUmH18sF2Xn/lhNo6Ge0mR+0RM0itbezYj4LCM6PXNDK 9XmPq/8w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qJSPh-00GNN6-7t; Wed, 12 Jul 2023 05:29:21 +0000 Date: Wed, 12 Jul 2023 06:29:21 +0100 From: Matthew Wilcox To: Claudio Imbrenda Cc: Christian Borntraeger , Andrew Morton , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Gerald Schaefer , linux-s390 Subject: Re: [PATCH v5 00/38] New page table range API Message-ID: References: <20230710204339.3554919-1-willy@infradead.org> <8cfc3eef-e387-88e1-1006-2d7d97a09213@linux.ibm.com> <20230711172440.77504856@p-imbrenda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230711172440.77504856@p-imbrenda> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 11, 2023 at 05:24:40PM +0200, Claudio Imbrenda wrote: > On Tue, 11 Jul 2023 13:36:27 +0100 > Matthew Wilcox wrote: > > > I think we do use PG_arch_1 on s390 for our secure page handling and > > > making this perf folio instead of physical page really seems wrong > > > and it probably breaks this code. > > > > Per-page flags are going away in the next few years, so you're going to > > For each 4k physical page frame, we need to keep track whether it is > secure or not. Do you? Wouldn't it make more sense to track that per allocation instead of per page? ie if we allocate a 16kB anon folio for a VMA, don't you want the entire folio to be marked as secure vs insecure? I don't really know what secure means in this context. I think it has something to do with which of the VM or the hypervisor can access it, but it feels like something new that I've never had properly explained to me. > A bit in struct page seems the most logical choice. If that's not > possible anymore, how would you propose we should do? The plan is to shrink struct page down to a single pointer (which includes a few tag bits to say what type that pointer is -- a page table, anon mem, file mem, slab, etc). So there won't be any bits available for something like "secure or not". You could use a side structure if you really need to keep track on a per page basis.