From patchwork Wed Apr 15 05:42:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jing xia X-Patchwork-Id: 11489761 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 173D581 for ; Wed, 15 Apr 2020 05:43:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7FC62074F for ; Wed, 15 Apr 2020 05:43:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z6tyGJ46" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7FC62074F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2AD738E0001; Wed, 15 Apr 2020 01:43:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2372D8E0005; Wed, 15 Apr 2020 01:43:00 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132D48E0001; Wed, 15 Apr 2020 01:43:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id EF67E8E0001 for ; Wed, 15 Apr 2020 01:42:59 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A5B35181AEF1A for ; Wed, 15 Apr 2020 05:42:59 +0000 (UTC) X-FDA: 76708995678.21.salt62_3734b8c51671f X-Spam-Summary: 2,0,0,d9f4f6836eacfbf1,d41d8cd98f00b204,jing.xia.mail@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1042:1260:1345:1437:1534:1542:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2892:3138:3139:3140:3141:3142:3352:3369:3865:3866:3868:3870:3872:4321:5007:6261:6653:7576:7875:7903:9413:10004:10489:11026:11232:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:13095:13161:13229:14181:14394:14721:21080:21433:21444:21627:21666:21772:30054:30056:30075:30080,0,RBL:209.85.216.65:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: salt62_3734b8c51671f X-Filterd-Recvd-Size: 4678 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Apr 2020 05:42:59 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id o1so5384655pjs.4 for ; Tue, 14 Apr 2020 22:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=CYNgjV9miUJh8498GJp/E0H6GBvf4hXm8dM5oc2Z5rg=; b=Z6tyGJ46RDxT/TEh9zaYlzuWjvowL2tuWTe+Upk1M/TX7J11fGxgxoR0KXY3O9LKw5 XlrSOpH8Chfgvu1AldMlRXvyNc0tUXjN30v9y3sCalPbdI2Gm/xD/rJtanqDuBzl0wrK SQU9nF/5ldVvce4d72M9Cnf0S01oCQx88oO7BxT977DNEbfGeapzJQIgCGhygd/I+SP1 doJ/IuKY65j5V6fF+nKtl7KXU2s3SjgNRBIno2vb2qNTVGEN9VNtd3LuCvQuWNIy6vf5 WYrEf/3QpXeytcqmNfs7FhZmNVER1DRByjcwapmiHS/evraq4X6wC0a4oiLE0MOez8GF Pjsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CYNgjV9miUJh8498GJp/E0H6GBvf4hXm8dM5oc2Z5rg=; b=lJCP8/xAB5UTXz6duw5E0tzbtFt4NgjQ8pqoUvHoqa/4id7dHg+E/umTKMTMerehMe PzUpwUEHOIuYfExCyBXks4lf9SEiEGHoi1hNWq2Dsf8ag9nn3e6JdGH1SIbjbcOxnQf8 /+N7tX4d5S7kVOkngByvR94rbg/uKhz9nB/lxZAZAveb2uczeO19AA0bYfHVtzZWHkuZ DD+k8z60bhwko+OFBFh7iFVRwnDWYulOJXOzrRWHwgZPnFEEmcSamK6qKQ3TNALSDP7W PZFmylAoIFw2b8GQVDou2K2veeogQgrBrZAfBApWWPb8RApgi5VqI2GiU5TCg6G2/ah6 bkCw== X-Gm-Message-State: AGi0PubEULSM74f24prm4QldJzdpzl0UVjJLp3T/3Z9S+VLDq59wfF8U ttvm9kknF70sxjq7paAyaDc= X-Google-Smtp-Source: APiQypKdTaBGZjKti0ZzPJkOWvvDkU+t/nJ6vMx78hCq0ogYRaQDFdcrKjXO8E6OYCXLdLw6NyENCQ== X-Received: by 2002:a17:90a:32ea:: with SMTP id l97mr4282291pjb.50.1586929378325; Tue, 14 Apr 2020 22:42:58 -0700 (PDT) Received: from bj08259pcu1.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id x25sm10456254pfm.203.2020.04.14.22.42.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2020 22:42:57 -0700 (PDT) From: jing.xia.mail@gmail.com To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, chunyan.zhang@unisoc.com, orson.zhai@unisoc.com, Jing Xia Subject: [PATCH] mm: init: report kasan-tag information stored in page->flags Date: Wed, 15 Apr 2020 13:42:50 +0800 Message-Id: <1586929370-10838-1-git-send-email-jing.xia.mail@gmail.com> X-Mailer: git-send-email 1.9.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000313, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Jing Xia The pagefalgs_layout_usage shows incorrect message by means of mminit_loglevel when Kasan runs in the mode of software tag-based enabled with CONFIG_KASAN_SW_TAGS. This patch corrects it and reports kasan-tag information. Signed-off-by: Jing Xia --- mm/mm_init.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 7da6991..435e5f7 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -67,26 +67,30 @@ void __init mminit_verify_pageflags_layout(void) unsigned long or_mask, add_mask; shift = 8 * sizeof(unsigned long); - width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH - LAST_CPUPID_SHIFT; + width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH + - LAST_CPUPID_SHIFT - KASAN_TAG_WIDTH; mminit_dprintk(MMINIT_TRACE, "pageflags_layout_widths", - "Section %d Node %d Zone %d Lastcpupid %d Flags %d\n", + "Section %d Node %d Zone %d Lastcpupid %d Kasantag %d Flags %d\n", SECTIONS_WIDTH, NODES_WIDTH, ZONES_WIDTH, LAST_CPUPID_WIDTH, + KASAN_TAG_WIDTH, NR_PAGEFLAGS); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts", - "Section %d Node %d Zone %d Lastcpupid %d\n", + "Section %d Node %d Zone %d Lastcpupid %d Kasantag %d\n", SECTIONS_SHIFT, NODES_SHIFT, ZONES_SHIFT, - LAST_CPUPID_SHIFT); + LAST_CPUPID_SHIFT, + KASAN_TAG_WIDTH); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_pgshifts", - "Section %lu Node %lu Zone %lu Lastcpupid %lu\n", + "Section %lu Node %lu Zone %lu Lastcpupid %lu Kasantag %lu\n", (unsigned long)SECTIONS_PGSHIFT, (unsigned long)NODES_PGSHIFT, (unsigned long)ZONES_PGSHIFT, - (unsigned long)LAST_CPUPID_PGSHIFT); + (unsigned long)LAST_CPUPID_PGSHIFT, + (unsigned long)KASAN_TAG_PGSHIFT); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_nodezoneid", "Node/Zone ID: %lu -> %lu\n", (unsigned long)(ZONEID_PGOFF + ZONEID_SHIFT),