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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0520C64EC7 for ; Tue, 28 Feb 2023 15:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l0NSqSReTVFw7rSnPw6QNHwK3fN4+AliJjc2msHNvkU=; b=V4gR+sNL73n9a2 v6WDNXK3xLsR8we1upyBqovBZ1ZtiT6VBqSWUlVcDr2WBaqW0l3aVClnuNwKyvUkhdI8PKMTrbNLR wZmbc9eAytWMXvXKfSaQMn+1/8Iujjd2rgCFp2GG8maUYxsHcIbdMpanH5oU+xX1g0SI3lk84U5oH GAj0OFUsfgX7gx2IU7kRiQ7Y6a1CHATms4x5vaMdnIzIZ040wanfvQbcdt3uNefBTe8MtpDqfRNSf dESE0nwLAHmxqj2c5XTkFs2ad/fgMGDkSfij6vcO3piGtpdYnmAveuSPAUdanY6qK1OralDiFC33R r53Fe9Kuh8+9w2apma2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX2KV-00Dh7s-B5; Tue, 28 Feb 2023 15:55:51 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX2KS-00Dh5W-6A for linux-snps-arc@lists.infradead.org; Tue, 28 Feb 2023 15:55:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677599746; 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=Wdgp+ShpR8oPuIbIv1cMoHGdwz7Hnu20fhoZlHfN2R/kfNQL6IkNYln1IUd2Bi/bR82QNh ZHn9DyhkhN9QAM/A8kGkbZNm2W6ssr3y9+8YxDG1QLMuewtdfcswLXSoQ2L2rcehvdI01Q H1TWHUlClGhOhyU3hn3xkxlrqJSN3pE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-417-m9qc9fOGOYGZOcZ9vRn7sw-1; Tue, 28 Feb 2023 10:55:44 -0500 X-MC-Unique: m9qc9fOGOYGZOcZ9vRn7sw-1 Received: by mail-wm1-f72.google.com with SMTP id c7-20020a7bc847000000b003e00be23a70so7084815wml.2 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=taCqSZMg+8CwGgDIr2Xg6ZVxtZy95xg/77vVH7ALNHXLmprDNA4wAO+o6x9aQ4McM8 2sigDZIDVFQe894OiQgqDAazQZjiEOGNdwpNucJeQiztpiltv0huEkankJQMRXy6VLaW yDHF9Mj1pI8G5v8y6dDd8u2kKnYTUqhCwTcIBK5P8Cg8+1zy6Qdui/Sofox+jUiqOT/b kyWcyI58+0i1+InX0meNNe5NkIZ8WzOLjZN8gKR8dxdHFQQ3wkd0EqdKqv4nHwZbSRI4 El9OYK+ihuvbc1M4tz38L6OSkHjbVCemAaqeCgdmV1i4n9ayfZQeDayfnN3FMw76Tv2Q 0Rig== X-Gm-Message-State: AO0yUKX9oUPEG0dkRu4Gx2IA0L0m7bSZ6+Pqynq0Ritwq0pfvityQktQ fQLvJDYWnHEbkNWlbc0mXNqODap5r1ba1l6jzGA5UjOVxSz0joZ2epC1g+ZMSSjl50viAmoVLND m3iqAmIi9umVkoaXj+0zHdXmxDaX35k76 X-Received: by 2002:a05:600c:350f:b0:3eb:3945:d400 with SMTP id h15-20020a05600c350f00b003eb3945d400mr2593181wmq.6.1677599743559; 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_075548_351660_A7660541 X-CRM114-Status: GOOD ( 17.98 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc