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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 738BEC2BBCA for ; Sun, 23 Jun 2024 15:42:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAF916B04E8; Sun, 23 Jun 2024 11:42:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B39066B04E9; Sun, 23 Jun 2024 11:42:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B5CD6B04EA; Sun, 23 Jun 2024 11:42:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7ACD66B04E8 for ; Sun, 23 Jun 2024 11:42:33 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 031E7140751 for ; Sun, 23 Jun 2024 15:42:32 +0000 (UTC) X-FDA: 82262570586.12.270E5AE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id B1C1FC0012 for ; Sun, 23 Jun 2024 15:42:30 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ToptW+fC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719157341; a=rsa-sha256; cv=none; b=F/si1GNlD39728MKeYgm4zHC7xiMyNl5Hc55/rs2bMsSHL9CvvVmk3b7NvzR3t1pfY7K5D SYKv5QFBAEe5fX/G7CQC/oUpEljjpAuEknWvm4l+hqXVZ8YjTcRho7D6YVeUb+MQElqePX 7dfMAQqDWwL19YLoG0c+vrsuKlzFZXc= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ToptW+fC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719157341; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=49HpQTD2yqwpDIdZGHTzCNAJyeZfRMkM4BNUXs9LRBk=; b=GQkvum+tj/9MP6hV6XYpfXjh/9daekRp9oQYFJxUf9Y7vT6tBiBY02fwBhPaRyO7tQfAY/ 8EBAtKMIwpKH2P/YnjrtblG8hr8WN1YNIgtAVMTcPy6ISolgcJw7Qt4AhfG7WW6qwNXHEz KPIYuBzunpLdcyCFB2+Sm/GyzY7VYR8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719157349; 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=49HpQTD2yqwpDIdZGHTzCNAJyeZfRMkM4BNUXs9LRBk=; b=ToptW+fCiUotwg+NXo+8RE+lsTtrm3UZ0Qw70e2QD6RHW/bpsgaSXK08HrxtA7b+jYO8dm N1OCTeZyHl714ZFdQg0huj5A03+YMxumyzdQ1LT32YbJNyL7v7fX29TQwpugk4uzTJSdIy bWvcsL9JVKYY7Yx2avGKfmkUvfOxW+s= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-kSZgVVtpPiejBdZJc9BkbA-1; Sun, 23 Jun 2024 11:42:28 -0400 X-MC-Unique: kSZgVVtpPiejBdZJc9BkbA-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-4434eb073a0so329311cf.3 for ; Sun, 23 Jun 2024 08:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719157347; x=1719762147; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=49HpQTD2yqwpDIdZGHTzCNAJyeZfRMkM4BNUXs9LRBk=; b=fmDt9tL2Xxrnqd7pqrvPxToxrUrQ1c4hwhDe6mTtA77fJvpE3W8zlUwltgNd5WO3jx MmTDrkqmRD4Th4CIEby8uD9KC8XySddndSfyzs8HxDyAOQ2r/J+W5U/msJttz/5/xmoS 7OSJfOirAvDC09CqKh7cwxCM3JWM5E02ZWGChjoPU8er1HrAeF9wQBSVg50uiWvVcsZW zq9TTMFmndxiA2zfjlFNlOfavGj1IZWu6oxEIx+QHs5lc+Oqlq4n2fkxJpcHuJNwWHr3 B1//GnpvqjSYlLevQ5usQgQoOE0IHd67eGYaCiO1piccy8SdCDWjp7HqSEaBvtMUsyMR vNLQ== X-Forwarded-Encrypted: i=1; AJvYcCWUxMTDydfGDP1NVxmKcZcI0Gdy8J0YqMjE4JP66lJccM7HTkrwR9m6JUodQaMSSagLWFx1K0WzexpBpv90A3F1YCA= X-Gm-Message-State: AOJu0Yx530GC8K8Aal3CFZQVE1UPFRL8ofx/sEn8I7uTMjWM2rtF471l 3oDN6yfc6iuKWkFwljBlZsMwihJrT7/ldPqKvjZ+dgIwENA/YqtlBa9CcxNMzpZwXFFfwTFT9zl 8x0N5DkgKCA5xgDc/sSPFRkbACg+5YimKVr/sdM2CwqTzMQhx X-Received: by 2002:ac8:5748:0:b0:440:565a:920a with SMTP id d75a77b69052e-444cf710e9dmr46703441cf.2.1719157347320; Sun, 23 Jun 2024 08:42:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDWtNbBGBpmQxIF+5cLIUwj0ebBIF6aR+2q9TF+Eqc5ywm7H5/7hWNuQ8dMyVTY79V+vfiyQ== X-Received: by 2002:ac8:5748:0:b0:440:565a:920a with SMTP id d75a77b69052e-444cf710e9dmr46703081cf.2.1719157346867; Sun, 23 Jun 2024 08:42:26 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-444c3b4b42asm31681401cf.91.2024.06.23.08.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jun 2024 08:42:26 -0700 (PDT) Date: Sun, 23 Jun 2024 11:42:23 -0400 From: Peter Xu To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Borislav Petkov , Dave Jiang , "Kirill A . Shutemov" , Ingo Molnar , Oscar Salvador , Matthew Wilcox , Vlastimil Babka , Dan Williams , Andrew Morton , Hugh Dickins , Michael Ellerman , Dave Hansen , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Christophe Leroy , Rik van Riel , Mel Gorman , "Aneesh Kumar K . V" , Nicholas Piggin , Huang Ying , "Edgecombe, Rick P" Subject: Re: [PATCH 6/7] mm/x86: Add missing pud helpers Message-ID: References: <20240621142504.1940209-1-peterx@redhat.com> <20240621142504.1940209-7-peterx@redhat.com> <4fb4b087-cae2-4516-a34e-cb4c72be13eb@intel.com> <5daa82f5-b5ea-42d7-a074-122734ad99db@intel.com> MIME-Version: 1.0 In-Reply-To: <5daa82f5-b5ea-42d7-a074-122734ad99db@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: B1C1FC0012 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 175nuams1zi559i1qm9ybacs5dgt7ghw X-HE-Tag: 1719157350-792085 X-HE-Meta: U2FsdGVkX18ehOy9QjSnuK9A6cojxMGvwoLPZgCodjVXxTtE465eVf1sofEFndrCKI72xwR+qjCKYlP7RKItDnats7MtQLQltOtWKruNpVQuf++w7lQBUAaYD1Oz7hupqunu4VHwO4hKicy742G16ixlbJXMkyfVOi/1Tl4Z6msSM28WDTJIMmWf+UTC002QO47cNKlUWdiZlcrJsJY1c4Cify7hLUBLwbdZA/1kipP89k+KLLU+6hz1bjKKKPIUKsBGZ3lYIKmDE4QYPJK+292zVFUBTYM2WY0q8qCspqHTmmIR/tBBmCf5jfdqVQ9/rS5Sq5c8P0SRIjT5MZSCLPvYdqhx6UIs7MLycfyAclJbsqYUudVs58qngUwVXtT2MNHp3DbaCg5P3PzZ67AQcr1n9HVLN3IiiJEhFG4G4ykEEO6ICDF5DwRTcrt1i232pu4hTENu/FDXBHfjcUhwymIv7w8IarPNZNUTkZjFwdMNG/Ni5WBfSSD2DEXPtMd8yW3yEzF62eHCuQmh1AtAXwCs/XmQdSxuxdD+TtOqunZ+PlNjtKWOZTHDtNr/N1Xr+B7Waq3cxCPTYN2DMdgMY+W8YWSbSoCUT3qn1DeHoYl0XrEMNqIRDIZ0LdKPSiVKzdYWIJ0ZbB/7s2fxc7M8fi3wrdLZy2o+lGIlUowv5bJpIP3Xt65J5XRBqmobBC1/ieylUd3+JcgvAxsUQyr0i1u9wpcMO5jdm+oKmL87n+4jD0iH/1qONIZBTFjMZy4v55YcAhL8b2ImK882hxsVyoyWprXCZQMGSP6aH2ialk4YfRMQ155OrszSomTAZ1ZNP+HtcxihbMZmmJYJyAWyeWC38lrJpwHPYKtx8LFZnVi+GJAaHN0lWz9roEInv6imibYIxvSBiGZ5VOPCfGp2PQ8W9I7TNqQ8G7wi8NvSw1M6H5P2Xt7YUpkQxscyT5xEtOV1Nlk3ZglmbDfhMtj JthrOMaL SyZrpwhaZ8g5HbID0vFf4qDRbgUnNqvZaPukZAHjHMQek269hyBlAKBovJJ4Joramu3m40pNGp/Pr1YkhznEBJmjP0qnJF2is3Z26fljszwZnF5cUqRZucpMHd1f77bEp5CmuJXyPL0/i6ndD1reD9f9HhOCcZDiIOkveFlx0rmTZDCy7UsY0AT8jzjD3UB60luubjB8dRZfyDpHO/hy1Uo9U1cuygVW/B2sBhLeJ5MdriuoUNmilcrXWZ4OQ6HulAwYm6oMclFPdEu5PaFvQU3DgKjVRcxfni9pQv4BJ0b+vA96qK0gbt7xWeULMobkQ7Y+vlOWoH8pTlQg8HhE+ogkKq68gm3urzgVw X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Jun 21, 2024 at 09:11:56AM -0700, Dave Hansen wrote: > It's in the "Determination of Access Rights" section. > > A linear address is a shadow-stack address if the following are > true of the translation of the linear address: (1) the R/W flag > (bit 1) is 0 and the dirty flag (bit 6) is 1 in the paging- > structure entry that maps the page containing the linear > address; and (2) the R/W flag is 1 in every other paging- > structure entry controlling the translation of the linear > address. Thanks. It'll be nice if this can be referenced in the pgtable definitions too in some way. [...] > One big thing I did in this review was make sure that the PMD and PUD > helpers were doing the same thing. Would you mind circling back and > double-checking the same before you repost this? Sure, I'll make sure I'll at least add a comment if it doesn't match and explain why. I actually did it already e.g. in the _modify path for shadow stack, but I failed this spot. The page table check thing is really rare that I overlooked, could be relevant to what I used to hit a bug but fixed around this area, so I forgot to add it back, but I really can't remember. I'll keep an extra eye on that. Thanks, -- Peter Xu