Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp103490ybl; Tue, 13 Aug 2019 16:50:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbb6dwNNRGvTjnZvz9VoxBKu1oBCr4KQ61tbIkIZ6dL3moHPYdnIU9RoPKhKa9oACLl9rm X-Received: by 2002:a65:4b89:: with SMTP id t9mr35895960pgq.55.1565740225425; Tue, 13 Aug 2019 16:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565740225; cv=none; d=google.com; s=arc-20160816; b=VzWyPODmG3P63QSRpeQ0vzHuzzJjZcSqnWCgRzhI0LSMWjTq50lnkOUvvfaswLDfEc 6hZ/one1IXLcHHwJOt3GIk7twkO5bA+zd9oxlw2vbs0wOkpI8efMOKgyJQs5d7jd8yF/ yhk66bAaXPaqciGV9ltDTY8zKMFYKuFIRC80pQeZgqnue2bnJSQFGcU7Ki0z1L8DKf0j n3P84G7htB5NECwcLI5Z/yiEisdNYScU6p8yMQdYz3XDwJ9v/rDcVGUZU9mQ8ws/J0SX 4F96//jS+AYgMlyCamKdoTbOA15EHvkjCSw6vZeOSIpKk6IegRwSJEWSRqFhKbfL2BUn KJEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=yL2GiSxONyR1+wf+cPEJ785qgYB8kzY/mss0H7pGC9M=; b=Jf07R8DxF8TseHJEkjqap49uD6JTPney6uHliNgGUjQXXEnRniOCyKOWwvPBCoM8OA Fzx5KjrkQ63BwQ+sPVDpR/yulslSqx8oLhT3U1fYwnDyQViToAEFhfwb6iERb1qrWqNG kKXHQT74mOZshfyhry+9ZnS5/lhScqa+BkSeXkThGmtCyfRWzaI5I/h+ANSI62xi5N7r 9jBYtYquBpxWKlOzZk8LwiHb+/7orPz2Pfk0XhQDDw+HBVKnFOP6gneguPO69+ryHRyv bF6ynXsQpy7FaDXl5U7wKVmp6DoxXsofYl5AN70oo31Z+y2UXUvOiM3ZqvBT/XoDFoBL vzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Wt6ztQ2X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z124si48180990pfb.208.2019.08.13.16.50.07; Tue, 13 Aug 2019 16:50:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Wt6ztQ2X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726533AbfHMXtc (ORCPT + 99 others); Tue, 13 Aug 2019 19:49:32 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40318 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbfHMXtb (ORCPT ); Tue, 13 Aug 2019 19:49:31 -0400 Received: by mail-pl1-f195.google.com with SMTP id a93so49868006pla.7 for ; Tue, 13 Aug 2019 16:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yL2GiSxONyR1+wf+cPEJ785qgYB8kzY/mss0H7pGC9M=; b=Wt6ztQ2X+fWJO0FTPgcX9A+51Mq8+dTZ9Ad+A3iCM8ClCkHgqKWJ2Drcvb3RRKr7tY erf0TC5YpqS2Portj7ZVBheih5czwyWoynvvG+OcmmO4kYKcTGfe2f3XrwTEAsq4mi21 F50sQEzYTRfQKIDH+vxbJVarJg8gOG8ti6o2Fc+g1ZQKwAv93sQYllOrj4oWJ0zUPD+X OhZHWL3rBvb7RYeJg5DrjtfulYBGFzk0abwLsjlwIA2YbLnzPETAHKm0OIYnmu8wnuCN S6zZGySHxEitvDXRzvENqoZpHDohSYEySTt2GO05uL68b4/lXRsTldj/46PsM5r7KGQH nhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yL2GiSxONyR1+wf+cPEJ785qgYB8kzY/mss0H7pGC9M=; b=QFG2Xw8HnSvEcTRuWqQXuwz6r++Vq5QrXIabGVqbB/eDA4w9Jh5doNq+nNN/PfUutE Ybqm9HVCnemSGTzwpj0FiL/a6a/PaWJQEjNPhDXEV0UNR59nFMSrTLqj/u5uoFpRIhe4 nI+cYKbC7g75bgX0OQ1/Z/SyWe0WvCquCGpPiNX1t/5sB1z6TuIn5uaGK1gvzbn+kyZ5 3RJUSFkpO0ZwaVHV3zyK6E7Mm4B+1w94VTag++AAPgejm0FOAngJ7tLcTQfC+Wb//Cph 3DjPB3aZhqlYN/XMhB00r19u5fJjFx1n1Q4tErOiclAbblga99m9tsAliI+pRhWk52Jk eoaw== X-Gm-Message-State: APjAAAXqrARVHnF2ImSY8POio736f1Y3/IwIenhlHAu6TdIN+E3vCOAV 5Rg/Bjxvh59paRwxg61VDZuhAg== X-Received: by 2002:a17:902:2ac7:: with SMTP id j65mr40372077plb.242.1565740171253; Tue, 13 Aug 2019 16:49:31 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:6cf1:fbba:cb42:db60? ([2601:646:c200:1ef2:6cf1:fbba:cb42:db60]) by smtp.gmail.com with ESMTPSA id bt18sm3110564pjb.1.2019.08.13.16.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 16:49:30 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW From: Andy Lutomirski X-Mailer: iPhone Mail (16G77) In-Reply-To: Date: Tue, 13 Aug 2019 16:49:29 -0700 Cc: Yu-cheng Yu , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Content-Transfer-Encoding: quoted-printable Message-Id: <08A983E6-7B9C-4BDF-887A-F57734FADC9E@amacapital.net> References: <20190813205225.12032-1-yu-cheng.yu@intel.com> <20190813205225.12032-12-yu-cheng.yu@intel.com> To: Dave Hansen Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Aug 13, 2019, at 4:02 PM, Dave Hansen wrote: >>=20 >> static inline pte_t pte_mkwrite(pte_t pte) >> { >> + pte =3D pte_move_flags(pte, _PAGE_DIRTY_SW, _PAGE_DIRTY_HW); >> return pte_set_flags(pte, _PAGE_RW); >> } >=20 > It also isn't clear to me why this *must* move bits here. Its doubly > unclear why you would need to do this on systems when shadow stacks are > compiled in but disabled. Why is it conditional at all? ISTM, in x86, RO+dirty has been effectively r= epurposed. To avoid having extra things that can conditionally break, I thin= k this code should be unconditional.=20 That being said, I=E2=80=99m not at all sure that pte_mkwrite on a shadow st= ack page makes any sense. > >=20 > Same comments for pmds and puds. Wasn=E2=80=99t Kirill working on a rework if the whole page table system to j= ust have integer page table levels?=