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 1025CC64ED6 for ; Tue, 28 Feb 2023 15:55:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 760EE6B0073; Tue, 28 Feb 2023 10:55:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E9DA6B0074; Tue, 28 Feb 2023 10:55:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 562906B0075; Tue, 28 Feb 2023 10:55:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 474486B0073 for ; Tue, 28 Feb 2023 10:55:51 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0D84540190 for ; Tue, 28 Feb 2023 15:55:51 +0000 (UTC) X-FDA: 80517151302.13.65C06B9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id D069040005 for ; Tue, 28 Feb 2023 15:55:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GvJyNdqW; spf=pass (imf17.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677599748; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xBghEncF8boHA8ERPg4saQyYB+zKBnxfff7p7OTCduA=; b=vZrdpOccvI8VEJAQlGOFbxbk5rmddnAmkraHATPqsjAqo74KG7Z0JXap3ntL2wCtxfNS0a ZGUSZaqDx92tHpxkfQWVx+renxuDVQZXBdWd/VPbEOuk530YJu7J1nen0orC4puFRTD3Tb PPaRO+crzqndOA4rE6Jj7js9CKIuG+A= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GvJyNdqW; spf=pass (imf17.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677599748; a=rsa-sha256; cv=none; b=U2ZAvsslUZZe67YvtUg9wgGOVzoRzaaVhCmbez2S2InJh0rr0HcEpJ7Bcp7wziRpVs0zj1 NAH4l/fFDcbKmn5s38OQw/0zKBtfEGZX3TF4ZKdOQEqvlttIaHqOBRIT54UZPGOdVHdHBz I6A079k9ZENaWR73iToOiBHUFNKOIkk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677599748; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBghEncF8boHA8ERPg4saQyYB+zKBnxfff7p7OTCduA=; b=GvJyNdqWoURfJiyWEmHXu4FnrV9TGq3LtTfckKPCzrQqLnI/STOgP9RocIBD1q6GmyYy06 aNaplsie23L/tzKfmcW5IC1NJ7rvU9+Vbr8mPyIWGRb3nXQpc14ngYkpaIZn80Ej+e+LWs 10l2WQbv+60T6K9PgdcO8fyyTahpUxM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-212-et8IdcKVNTyl--rXD_fPXw-1; Tue, 28 Feb 2023 10:55:44 -0500 X-MC-Unique: et8IdcKVNTyl--rXD_fPXw-1 Received: by mail-wm1-f69.google.com with SMTP id x18-20020a1c7c12000000b003e1e7d3cf9fso7077479wmc.3 for ; Tue, 28 Feb 2023 07:55:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xBghEncF8boHA8ERPg4saQyYB+zKBnxfff7p7OTCduA=; b=PHMhD0Kh93q9MOFJnUXFDYt0hZBjn6JW2SVb7JiCJgGe8QVMkkJz0rtcn5bKwvlfrq xlQxDW8uuu2pA40YibHXc9BVEF6Ne3I50FpP32kXYdTkcDcmVxzJJJZRgTBji/Do0ww5 hXm3zRq+hfQDkPLE0XVT915PKt43dBVZjmA/wd1q/eyEO31NbgoRKM/tVwHDAQIGhqge OkIyRAPXHvILI31BY2zzY8SlMaX2kuaG2dX4OUr6B3tQb2Q+c/jYJAaJkqTW4KS6/z/l FjulN0EB/kqnrDtDriZ1FMH1VS9rgZEeTdSS/rEnk0deHpT57Ynu4mkBt0nOIY9IApOR DwAw== X-Gm-Message-State: AO0yUKVgBT/GRUKP56+1UAGIAl1ct5EoVhG3bIYlbIBnkIAp35XDkVAp QC8xa8mHVJuwooOxqEtKNoJKK1MjRxnxIJwXsI/bttdT/iYezqED8Q48xbFVvb0snrACAFDHqqM VO+sRMfYwWuE= X-Received: by 2002:a05:600c:350f:b0:3eb:3945:d400 with SMTP id h15-20020a05600c350f00b003eb3945d400mr2593176wmq.6.1677599743557; Tue, 28 Feb 2023 07:55:43 -0800 (PST) X-Google-Smtp-Source: AK7set+wnf2WDMcprxngEfzcv3vYTz2vjDLBbvltb+8+t+ERFjJxQhjmdzxRvt+YBcvxcSrV4CC0jA== X-Received: by 2002:a05:600c:350f:b0:3eb:3945:d400 with SMTP id h15-20020a05600c350f00b003eb3945d400mr2593150wmq.6.1677599743200; Tue, 28 Feb 2023 07:55:43 -0800 (PST) Received: from ?IPV6:2003:cb:c706:b800:3757:baed:f95e:20ac? (p200300cbc706b8003757baedf95e20ac.dip0.t-ipconnect.de. [2003:cb:c706:b800:3757:baed:f95e:20ac]) by smtp.gmail.com with ESMTPSA id o25-20020a05600c511900b003dfe549da4fsm18407191wms.18.2023.02.28.07.55.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Feb 2023 07:55:42 -0800 (PST) Message-ID: <5d99c731-c47a-c525-76e5-4578d9dfc9ee@redhat.com> Date: Tue, 28 Feb 2023 16:55:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH mm-unstable v1 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE To: Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , John Hubbard , Jason Gunthorpe , Mike Rapoport , Yang Shi , Vlastimil Babka , Nadav Amit , Andrea Arcangeli , Peter Xu , linux-mm@kvack.org, x86@kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, Michal Simek References: <20230113171026.582290-1-david@redhat.com> <20230113171026.582290-12-david@redhat.com> <9ed766a6-cf06-535d-3337-ea6ff25c2362@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Stat-Signature: x96dgys4j9wfaxas5b9pqecmkfeo5q4o X-Rspam-User: X-Rspamd-Queue-Id: D069040005 X-Rspamd-Server: rspam06 X-HE-Tag: 1677599748-138191 X-HE-Meta: U2FsdGVkX1+i2nERTzAum0k/Y21FVTDJpBEQ4vcleLjRQuR/3labTWIjqVK3KkRsjc7jyM/rOfKQ6k5ROmBwLHT9y58PEap7yfhNMKKHM+aZxSo7yyEvI6u2+FzULI0fankKnMNOXfDGoJ1Extg50DVM5GlJjqJqSZF9Zrfa2SVaeIc53XD0EpcPn/ybCiJpmKKW+QK2u4W1OtBg+DfV/LBhRdFfkQf6mMrMWanvRv8Mf7xqPktL6voh3HwZBeUBP73FrYN4R5EDp/imoz6q7dJtEAhjM7ckBNyhcfHX/Ecpw/dyV3bLib6dNpl6lLEu3YkIRALlU8eXu/zGIbH6VT3X47ALsb0QhNICQDq1oB6028WydVvqjmlhdp3enzRSVOy0FN/PAHeuTosqGK/8fvKNB2IN3kbAlPIXRZwDUcoc4dHg3Y0fK+eThYjuifThgAMi1OlFWGtBfE7pw1OgwM3vEOGauxIYdh0/1CbKwxGyPI8k1hpPmdWIeDZ1Hcbhv0+54X8ljh08wkdXd8pZKwXSgw5kwkIhNHM7w1C1g+YUo8roVs34QaeI6YHzvgf0YGq6uFro2w62ja8IAPZVH66L0bJifwUDE9wAPQwJeDSaiUSLHv2VogExN0cdfBrR9j3zifs2XIQSjL6meINpvlQN1TTnqdigLV2WTV8qDmSoCYlXOOwgBry0DjaCiav9sXNNK7NHqLapydMYLg2z5zKGTvSuwfU0AiC3V5JdikWjVUCgfpW2kFDFaTDQbRy4q1+IX3jQ7WHBXpUlZHo7r1KCv/3SCacrF4Oc/kHTmSp+jgg7kQt/FZjiMzYoSnkhZAbeJl/TstcP4wlgAL6q2VQ7UXJXsiq20mKTMqFb2MOn+xXomq9Ze4KUaRkIqV9mQoaBlpsxi/PC6wgEGwJlQ8dEme1VYdeq8ieLRr6U4xVqX2oE3pM+QtM1a+rTFcv7Na2tRY56eoTcv2U+r1M H2fvq2E0 zwWG2uTd3LDPHI6gwzt4TZ0H92xx7ivZT5R2wiM/whB/QrZL9HvbBgW9DqlUJW7fF0QWsLh+3mm01m5W/XqRZvJ5XQKCt9Umr1pZmoOyfOuikKiNN7BGkcqFLY5zAki0KCC4rv0ehp2c1BK8LhPvbzWzW35qQESm76YGBUxlUsbN73GH7cnsfm+PqzYKpfrUeMnPKY21tY6jnl74fs96zUhbLNjFy6iIxlKRKm8524gILhbntQUt2gtJDDrIkDQPMevpyK7Ugf5F8s4IxNLCOnIxYMP6awyny/eyukeKHU4DrWmlWAMHWqOxyFN/sSvH6hWxD7jvTDycqYh3SPQCeme4abVCCvdPQrx7TeioMDVCKCLXX6K1ETLwtKMyPvKk9l7URvncVJHbCFpTnI4uUqvfj7PI2U34J4CKoxRnLxlBBIWs+jMod/+iE5YfW5npuVNsCurhDkQCnZ/ko+BBbXaWsrq/JUMlV4Ss+++ECxmzGd+yqEwjatHZoMGmf+Xwpb/6oVNFSxGUjkpk= 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: On 27.02.23 20:46, Geert Uytterhoeven wrote: > Hi David, > > On Mon, Feb 27, 2023 at 6:01 PM David Hildenbrand wrote: >>>>>> /* >>>>>> * Externally used page protection values. >>>>>> diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h >>>>>> index 42f5988e998b..7e3de54bf426 100644 >>>>>> --- a/arch/microblaze/include/asm/pgtable.h >>>>>> +++ b/arch/microblaze/include/asm/pgtable.h > >>>>>> * - All other bits of the PTE are loaded into TLBLO without >>>>>> * * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for >>>>>> * software PTE bits. We actually use bits 21, 24, 25, and >>>>>> @@ -155,6 +155,9 @@ extern pte_t *va_to_pte(unsigned long address); >>>>>> #define _PAGE_ACCESSED 0x400 /* software: R: page referenced */ >>>>>> #define _PMD_PRESENT PAGE_MASK >>>>>> >>>>>> +/* We borrow bit 24 to store the exclusive marker in swap PTEs. */ >>>>>> +#define _PAGE_SWP_EXCLUSIVE _PAGE_DIRTY >>>>> >>>>> _PAGE_DIRTY is 0x80, so this is also bit 7, thus the new comment is >>>>> wrong? >>>> >>>> In the example, I use MSB-0 bit numbering (which I determined to be >>>> correct in microblaze context eventually, but I got confused a couple a >>>> times because it's very inconsistent). That should be MSB-0 bit 24. >>> >>> Thanks, TIL microblaze uses IBM bit numbering... >> >> I assume IBM bit numbering corresponds to MSB-0 bit numbering, correct? > > Correct, as seen in s370 and PowerPC manuals... Good, I have some solid s390x background, but thinking about the term "IBM PC" made me double-check that we're talking about the same thing ;) > >> I recall that I used the comment above "/* Definitions for MicroBlaze. >> */" as an orientation. >> >> 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 >> RPN..................... 0 0 EX WR ZSEL....... W I M G > > Indeed, that's where I noticed the "unconventional" numbering... > >> So ... either we adjust both or we leave it as is. (again, depends on >> what the right thing to to is -- which I don't know :) ) > > It depends whether you want to match the hardware documentation, > or the Linux BIT() macro and friends... The hardware documentation, so we should be good. Thanks! -- Thanks, David / dhildenb