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 7E1B3C433FE for ; Tue, 15 Mar 2022 17:12:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAB988D0002; Tue, 15 Mar 2022 13:12:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5B358D0001; Tue, 15 Mar 2022 13:12:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D42F8D0002; Tue, 15 Mar 2022 13:12:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 8B2A18D0001 for ; Tue, 15 Mar 2022 13:12:26 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 54D8E81191 for ; Tue, 15 Mar 2022 17:12:26 +0000 (UTC) X-FDA: 79247264292.04.B116B0A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 989444000F for ; Tue, 15 Mar 2022 17:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647364345; 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=IDMoM6GQW/ashfKW/MEVa2kq3WdnPXUbjIFcEa4dk9o=; b=Ik2T97zw5TswMIXavcrlLg0W0OmHx42ZGXQjpIb2Jc0V6MNrx529wgcUFTSaRpF3p/IH74 E/FkoPmZTaRIoItu16a8BjfkGTjkRb2pWm5we7Nw0jGPqdQmstIBUEFmhGbifPw+Esv1hz qE5qR3CgzUUUWJfKk/9m+EYXcTy9RQA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-15-8cJGuE7sPRWVz0PrZ4j8bA-1; Tue, 15 Mar 2022 13:12:24 -0400 X-MC-Unique: 8cJGuE7sPRWVz0PrZ4j8bA-1 Received: by mail-wr1-f72.google.com with SMTP id o9-20020adfca09000000b001ea79f7edf8so5526259wrh.16 for ; Tue, 15 Mar 2022 10:12:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:organization:in-reply-to :content-transfer-encoding; bh=IDMoM6GQW/ashfKW/MEVa2kq3WdnPXUbjIFcEa4dk9o=; b=dVO1rBPAdPZQwzZcMcR33dM3hNf8JryUQeULvBICMaF12KLw1bRK0TM+jKHi3BrJpP msuUHFVc2g6exUHRYZVSDhhJexAS17SxXQtL6bkd7R21ruuSc8o20OaXUoclWbf6btRa M2YSWWHyYYVwAxkd9cM7mWijlZHNm4cNeyAyNdkZv+alt2+HPZn9Xe342tG6iUJovRRO 4ax0/AKdxcX5WFOnSCiARhvsheXu0DjCYR7D7GimYAbSS0lbtRdi1iT2QI4q9cN/NY3T 81kWkPKpLwbRthwHIwPwIiT2zBFxUglOooLO+vNYR6UR2FtHmwsMLl+v2rb2ytiqRH1R cYxw== X-Gm-Message-State: AOAM531UfzFShz8UYgtDyxQ70rh1oWvJRGByMmYNpKCZ+0aqt4ftHezk STkg4KDs2mjBU1ZIvMzekwSwUh1a8Elb+rzLDUgsiRFB6acr9XayhKG0vR4aEmZrm0QNSVhxYCG LSUyT1v3Y/yE= X-Received: by 2002:a1c:29c3:0:b0:350:9797:b38f with SMTP id p186-20020a1c29c3000000b003509797b38fmr4263063wmp.22.1647364339698; Tue, 15 Mar 2022 10:12:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRo6lxRuqE6aanoJAKbCAqJh0bxhE/UJ0/yn9fJg724PQPYvjcnNj2cfHsSRmdNHPQTYNmsA== X-Received: by 2002:a1c:29c3:0:b0:350:9797:b38f with SMTP id p186-20020a1c29c3000000b003509797b38fmr4263013wmp.22.1647364339387; Tue, 15 Mar 2022 10:12:19 -0700 (PDT) Received: from ?IPV6:2003:cb:c708:1800:42bd:3cac:d22a:3c62? (p200300cbc708180042bd3cacd22a3c62.dip0.t-ipconnect.de. [2003:cb:c708:1800:42bd:3cac:d22a:3c62]) by smtp.gmail.com with ESMTPSA id i8-20020a1c5408000000b00389bf11ba0csm2759190wmb.38.2022.03.15.10.12.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Mar 2022 10:12:18 -0700 (PDT) Message-ID: <55b6b582-51ca-b869-2055-674fe4c563e6@redhat.com> Date: Tue, 15 Mar 2022 18:12:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v1 5/7] s390/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE From: David Hildenbrand To: Gerald Schaefer Cc: linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , Linus Torvalds , David Rientjes , Shakeel Butt , John Hubbard , Jason Gunthorpe , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Matthew Wilcox , Vlastimil Babka , Jann Horn , Michal Hocko , Nadav Amit , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Jan Kara , Liang Zhang , Pedro Gomes , Oded Gabbay , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , linux-mm@kvack.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org References: <20220315141837.137118-1-david@redhat.com> <20220315141837.137118-6-david@redhat.com> <20220315172102.771bd2cf@thinkpad> <8b13b6c0-78d4-48e3-06f0-ec0680d013a9@redhat.com> Organization: Red Hat In-Reply-To: <8b13b6c0-78d4-48e3-06f0-ec0680d013a9@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 989444000F X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ik2T97zw; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf27.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: yihs7q75jd7ss8ssp7uz7rkfcmmznqh3 X-Rspamd-Server: rspam04 X-HE-Tag: 1647364345-262038 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 15.03.22 17:58, David Hildenbrand wrote: > >>> This would mean that it is not OK to have bit 52 not zero for swap PTEs. >>> But if I read the POP correctly, all bits except for the DAT-protection >>> would be ignored for invalid PTEs, so maybe this comment needs some update >>> (for both bits 52 and also 55). >>> >>> Heiko might also have some more insight. >> >> Indeed, I wonder why we should get a specification exception when the >> PTE is invalid. I'll dig a bit into the PoP. > > SA22-7832-12 6-46 ("Translation-Specification Exception") is clearer > > "The page-table entry used for the translation is > valid, and bit position 52 does not contain zero." > > "The page-table entry used for the translation is > valid, EDAT-1 does not apply, the instruction-exe- > cution-protection facility is not installed, and bit > position 55 does not contain zero. It is model > dependent whether this condition is recognized." > I wonder if the following matches reality: diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 008a6c856fa4..6a227a8c3712 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1669,18 +1669,16 @@ static inline int has_transparent_hugepage(void) /* * 64 bit swap entry format: * A page-table entry has some bits we have to treat in a special way. - * Bits 52 and bit 55 have to be zero, otherwise a specification - * exception will occur instead of a page translation exception. The - * specification exception has the bad habit not to store necessary - * information in the lowcore. * Bits 54 and 63 are used to indicate the page type. * A swap pte is indicated by bit pattern (pte & 0x201) == 0x200 - * This leaves the bits 0-51 and bits 56-62 to store type and offset. - * We use the 5 bits from 57-61 for the type and the 52 bits from 0-51 - * for the offset. - * | offset |01100|type |00| + * | offset |XX1XX|type |S0| * |0000000000111111111122222222223333333333444444444455|55555|55566|66| * |0123456789012345678901234567890123456789012345678901|23456|78901|23| + * + * Bits 0-51 store the offset. + * Bits 57-62 store the type. + * Bit 62 (S) is used for softdirty tracking. + * Bits 52, 53, 55 and 56 (X) are unused. */ #define __SWP_OFFSET_MASK ((1UL << 52) - 1) I'm not sure why bit 53 was indicated as "1" and bit 55 was indicated as "0". At least for 52 and 55 there was a clear description. -- Thanks, David / dhildenb