From patchwork Mon Oct 14 15:13:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 13835197 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 765E4D18123 for ; Mon, 14 Oct 2024 15:13:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72C4F6B0093; Mon, 14 Oct 2024 11:13:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B2C86B0095; Mon, 14 Oct 2024 11:13:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 507CF6B0096; Mon, 14 Oct 2024 11:13:54 -0400 (EDT) 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 325F46B0093 for ; Mon, 14 Oct 2024 11:13:54 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3B9F8C101D for ; Mon, 14 Oct 2024 15:13:45 +0000 (UTC) X-FDA: 82672552662.18.FA58B3D Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf06.hostedemail.com (Postfix) with ESMTP id 4E8FD18001E for ; Mon, 14 Oct 2024 15:13:47 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728918759; a=rsa-sha256; cv=none; b=4XtK2jDqjAdHywMzfMHM3Ed6Icaeuz2EoEaNCYDD6783KmLB4+iO4fqBdZ9agKh0TLzO86 Odno81Td6uVc+jLmgo8JTTqTjYlsbmmTNrFehyzWsEB12iY5t749WNZdpwAle1qElA3eMO zqYEyCxCYv1kA0qLTofSWve+ecAJWEQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728918759; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FYu7b9Ml88deMr2lbkabUNzP4rCTRqsPMAgnyBoYRTs=; b=vzJ5NgMs2mKcLn5MUS56gwIJScXoxOogBz6e9xJEI3/8ZI8cK423TVcdLeUTnodzQANLTU 3biZ/dJQwvSV8010oMWw09COX3tZSG0DQsDUhjvDoUg+4vX4TBhPbc2UeXkzo5Hlo4aMZP 9lo2xR4JavmlHlDQBx7aPmqpKsmCrG8= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7E661007; Mon, 14 Oct 2024 08:14:20 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F4793F51B; Mon, 14 Oct 2024 08:13:49 -0700 (PDT) From: Vincenzo Frascino To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Vincenzo Frascino , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , "Jason A . Donenfeld" , kernel test robot Subject: [PATCH v5 3/3] s390: Remove remaining _PAGE_* macros Date: Mon, 14 Oct 2024 16:13:40 +0100 Message-Id: <20241014151340.1639555-4-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241014151340.1639555-1-vincenzo.frascino@arm.com> References: <20241014151340.1639555-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-Stat-Signature: occuu37a4wz39ofobnzt69bxhernbupb X-Rspamd-Queue-Id: 4E8FD18001E X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1728918827-675131 X-HE-Meta: U2FsdGVkX18X8iY5gl1HJBPxte1Tm3jdtxXSkQ82HiLmBT76KuDbrQ+uTzKXQvKr0eMAx8KhtL9TA9Rcz+bftWCV9GXwk6RBBvlSIEB4LhaydTQxUh3ayQTNLJ/e4CdDNEbLCcK+6m3zOCzergt187imc668huiaORttAHwa4Hv1lyd5npfwqz3WdyGP+r2VhoNquedVUknaYVn3jaBY0z4NJz3qVlJiRvi+LnrEMzyXNUXA+YOUR2erRf/1U3vzThn/JVTHvYWJXf171LiOZ1D2YqfcGU/2md1C9fewXS0V7Dj3p1GWiC1Tq3f9ofGwmG5Wx4WFwz/F75raihUAEANWFZeV1As9iY3Dtsa1i3gk+sFbHpXmWDnV+lnmDCEguY8EPzAnF04opDzV/FywRT/mkAAHcYHAAHnZp6TO0ZjReOPU1mZiCQ7IpTVx2A9qNNIWeKE/Oxg+h+5XreYET4wy8G7tAVgtzyRynB8FesNLmnP4zqJFn+/3yqnUUTBznq2EvRCNvqI53yVnakkqkc3A7e2MkZy9+PQ4P6hXopiaYbB8IkSPcLhdGcG2Ie4tH3dfxNCOLgVyX6cqYqXQ+UHw1kbrusFt3X6//Gh5amzVBxY9ohh4MQZNTNXrjiroJ5Zewi7+Pt86GRuHgH55bdCzwIcqigu0A3a1eiLgYPWwz7h7bnewagnHNSXk5nAhX69ITQJq7IhgEoxe3erPwlWFEl3nIh3o5Rfpfv4nI62t3zq7MPeBPbF13+lKlqLMxM7WvhKz8LFWvVm9g76Cw7p3Ky678pg9f2CUaTs1n17UqFqG8GTyQfoVn8FOTQyZr74E4g+AfimFRbiVzQZ4f01VXZv9lbTXZ7YPpsX9oJTRle9pzEudunZ5re6h3n+Te/fehpf7UKgwv5t2I2JgDF7TU208I12DV8gHhTQyHdZN03OYB3Yj0l2DSbDH8Lc4vRZsc6FQweargcGlrkH RDD2Ks37 8D1HJGjHYmoVCPXTans/HEVSyDx8kr5k6wJG3+uaX3QTtBuw223BRNYg9Z29xvSwWsS/Mx+noX2dSw5Z4ppCQJFsrlUh6CDUVptXwn+/jpcZ5zcH7lVqg7k7KbJz2nCxsD+7WhUchnqTQn9FJv17JeO6cauDMkdwLEUcwqfeU4Jh9oUigiJIG2fhJPCe8roGb7A20sLp6k2MiktNcDuAY7itOLxt7IP5Q+Au4zmIKMaHS71m+f71LnNQm/ghYHblMfbrle7xd3xX8N1fnFuZWMDBX7yUdFOnR+rk55+B5Oqyl2JBNG9CehPnhImm/0tSofWxjMB2F9rRA3SM= 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: The introduction of vdso/page.h made redundant the definition of _PAGE_SHIFT, _PAGE_SIZE, _PAGE_MASK. Refactor the code to remove the macros. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Arnd Bergmann Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Jason A. Donenfeld Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202410112106.mvc2U2p0-lkp@intel.com/ Signed-off-by: Vincenzo Frascino --- arch/s390/include/asm/page.h | 3 --- arch/s390/include/asm/pgtable.h | 2 +- arch/s390/mm/fault.c | 2 +- arch/s390/mm/gmap.c | 6 +++--- arch/s390/mm/pgalloc.c | 4 ++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index dbc25dc5fa0a..b7ba87f89761 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h @@ -13,9 +13,6 @@ #include -#define _PAGE_SHIFT PAGE_SHIFT -#define _PAGE_SIZE PAGE_SIZE -#define _PAGE_MASK PAGE_MASK #define PAGE_DEFAULT_ACC _AC(0, UL) /* storage-protection override */ #define PAGE_SPO_ACC 9 diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 0ffbaf741955..8b67036edb69 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -338,7 +338,7 @@ static inline int is_module_addr(void *addr) #define _REGION2_INDEX (0x7ffUL << _REGION2_SHIFT) #define _REGION3_INDEX (0x7ffUL << _REGION3_SHIFT) #define _SEGMENT_INDEX (0x7ffUL << _SEGMENT_SHIFT) -#define _PAGE_INDEX (0xffUL << _PAGE_SHIFT) +#define _PAGE_INDEX (0xffUL << PAGE_SHIFT) #define _REGION1_SIZE (1UL << _REGION1_SHIFT) #define _REGION2_SIZE (1UL << _REGION2_SHIFT) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index ad8b0d6b77ea..12e10269dfcd 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -147,7 +147,7 @@ static void dump_pagetable(unsigned long asce, unsigned long address) goto out; table = __va(entry & _SEGMENT_ENTRY_ORIGIN); } - table += (address & _PAGE_INDEX) >> _PAGE_SHIFT; + table += (address & _PAGE_INDEX) >> PAGE_SHIFT; if (get_kernel_nofault(entry, table)) goto bad; pr_cont("P:%016lx ", entry); diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index eb0b51a36be0..346ec059c8bd 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -851,7 +851,7 @@ static inline unsigned long *gmap_table_walk(struct gmap *gmap, if (*table & _REGION_ENTRY_INVALID) return NULL; table = __va(*table & _SEGMENT_ENTRY_ORIGIN); - table += (gaddr & _PAGE_INDEX) >> _PAGE_SHIFT; + table += (gaddr & _PAGE_INDEX) >> PAGE_SHIFT; } return table; } @@ -1317,7 +1317,7 @@ static void gmap_unshadow_page(struct gmap *sg, unsigned long raddr) table = gmap_table_walk(sg, raddr, 0); /* get page table pointer */ if (!table || *table & _PAGE_INVALID) return; - gmap_call_notifier(sg, raddr, raddr + _PAGE_SIZE - 1); + gmap_call_notifier(sg, raddr, raddr + PAGE_SIZE - 1); ptep_unshadow_pte(sg->mm, raddr, (pte_t *) table); } @@ -1335,7 +1335,7 @@ static void __gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr, int i; BUG_ON(!gmap_is_shadow(sg)); - for (i = 0; i < _PAGE_ENTRIES; i++, raddr += _PAGE_SIZE) + for (i = 0; i < _PAGE_ENTRIES; i++, raddr += PAGE_SIZE) pgt[i] = _PAGE_INVALID; } diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index f691e0fb66a2..58696a0c4e4a 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c @@ -278,7 +278,7 @@ static inline unsigned long base_##NAME##_addr_end(unsigned long addr, \ return (next - 1) < (end - 1) ? next : end; \ } -BASE_ADDR_END_FUNC(page, _PAGE_SIZE) +BASE_ADDR_END_FUNC(page, PAGE_SIZE) BASE_ADDR_END_FUNC(segment, _SEGMENT_SIZE) BASE_ADDR_END_FUNC(region3, _REGION3_SIZE) BASE_ADDR_END_FUNC(region2, _REGION2_SIZE) @@ -302,7 +302,7 @@ static int base_page_walk(unsigned long *origin, unsigned long addr, if (!alloc) return 0; pte = origin; - pte += (addr & _PAGE_INDEX) >> _PAGE_SHIFT; + pte += (addr & _PAGE_INDEX) >> PAGE_SHIFT; do { next = base_page_addr_end(addr, end); *pte = base_lra(addr);