Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4261457imm; Wed, 30 May 2018 02:08:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIo9Xk69a0KLKlRpSm1HVr0LYzaxQvkouXBQ5q5X8lYjlrxWeGmO1RwMKqSdhMBFrddNCX7 X-Received: by 2002:a63:81c7:: with SMTP id t190-v6mr1549998pgd.378.1527671290517; Wed, 30 May 2018 02:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527671290; cv=none; d=google.com; s=arc-20160816; b=afCHu5GHLnTe4qp4BwYWXRZVXuUmIv9blSASQxMd24jY6dpOh2ZftzPxKQv9NUQS2z CiU7vF69vxGitTy9wqy1dSFSD2oo4B8dURkzXmyKF5Ad3ycZbz342YFPP+T0NBB6gfJs 3HBwQX0U22aMH7N2/qYVRlhy75A2qYIYYkJlMpc6/nYiKcp5/tGW6SN0/ptDKypcBb0l IJ3WeKnzvgZJf9lLfrM7vsDEYrHPCUn5egZp3OX1R9ldNMPku06p3ZDvCtYrYMGtNV/D 69L+994rJydrFLhhE/IUZUPKeiVPWem0342TxEsuJvMuc6xhFqRlnbCHaACuwL19Z/z9 qZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=VY68i3ZdPlXQ/Bgh6lvUKGkPXvq9fpWQGe0tHH5S4io=; b=QySAz4TVjcZNHQHGdpUPj1zp76rX0SECq1k3RtskZ3h1prVglgNciskp9LCpsMGMWP F8/sWvO8NJvM/l6/hBfcLE01nKDa3Xx2MPKZXsz2JLboGwHXSOU/XK//bJ799y7KBr0Q es6cFIYBFF4+WhnM6pse2luvjPd53aCXgwk6tVIIyc9aHKW/NRO6CGuEYdqZPTWDOsv2 Ru0hJcxnVBvEMsei93pLVF+h3WxpsWseAtR+4NAkvFnTfmEQSwEpPAobcyHstY1ivNXW 6Gw9JuhyFPDbaw4V+m00760jr84YCZ72vUufbBgHqYUAe3+dcvuC2rAu2bCm259Sti6q 9glQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6-v6si17300634pgp.482.2018.05.30.02.07.26; Wed, 30 May 2018 02:08:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030246AbeE3JGD convert rfc822-to-8bit (ORCPT + 99 others); Wed, 30 May 2018 05:06:03 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5932 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964791AbeE3JGA (ORCPT ); Wed, 30 May 2018 05:06:00 -0400 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 8BD4E69FBBB2E; Wed, 30 May 2018 17:05:56 +0800 (CST) Received: from DGGEMM421-HUB.china.huawei.com (10.1.198.38) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.382.0; Wed, 30 May 2018 17:05:57 +0800 Received: from DGGEMM507-MBX.china.huawei.com ([169.254.1.166]) by dggemm421-hub.china.huawei.com ([10.1.198.38]) with mapi id 14.03.0382.000; Wed, 30 May 2018 17:05:52 +0800 From: Nixiaoming To: Mark Rutland , Ard Biesheuvel , Ingo Molnar , Will Deacon , Greg KH CC: Will Deacon , "catalin.marinas@arm.com" , "ard.biesheuvel@linaro.org" , "marc.zyngier@arm.com" , "james.morse@arm.com" , "kristina.martsenko@arm.com" , "steve.capper@arm.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "akpm@linux-foundation.org" , "vbabka@suse.cz" , "mhocko@suse.com" , "dave.hansen@linux.intel.com" , "dan.j.williams@intel.com" , "kirill.shutemov@linux.intel.com" , "zhang.jia@linux.alibaba.com" , "schwidefsky@de.ibm.com" , "heiko.carstens@de.ibm.com" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "x86@kernel.org" , "linux-s390@vger.kernel.org" Subject: RE: [PATCH 1/3] arm64:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro Thread-Topic: [PATCH 1/3] arm64:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro Thread-Index: AQHT91VOSqz8jbk29Ua9aMsejfLmPaRGU1YAgAFJszD//8jpAIAAlWvw Date: Wed, 30 May 2018 09:05:51 +0000 Message-ID: References: <20180529133615.26889-1-nixiaoming@huawei.com> <20180529154523.GK17159@arm.com> <20180530080816.f74elebj4demiohl@salmiak> In-Reply-To: <20180530080816.f74elebj4demiohl@salmiak> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.57.88.168] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because CONFIG_STRICT_KERNEL_RWX=n cannot be set by make menuconfig on arm64/x86/s390 architecture So, these three patches should not be necessary Sorry to disturb everyone Thank you for your guidance Thanks -----Original Message----- From: Mark Rutland [mailto:mark.rutland@arm.com] Sent: Wednesday, May 30, 2018 4:08 PM To: Nixiaoming Cc: Will Deacon ; catalin.marinas@arm.com; ard.biesheuvel@linaro.org; marc.zyngier@arm.com; james.morse@arm.com; kristina.martsenko@arm.com; steve.capper@arm.com; tglx@linutronix.de; mingo@redhat.com; hpa@zytor.com; akpm@linux-foundation.org; vbabka@suse.cz; mhocko@suse.com; dave.hansen@linux.intel.com; dan.j.williams@intel.com; kirill.shutemov@linux.intel.com; zhang.jia@linux.alibaba.com; schwidefsky@de.ibm.com; heiko.carstens@de.ibm.com; gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; x86@kernel.org; linux-s390@vger.kernel.org Subject: Re: [PATCH 1/3] arm64:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro On Wed, May 30, 2018 at 03:31:38AM +0000, Nixiaoming wrote: > Unable to set CONFIG_STRICT_KERNEL_RWX=n by make menuconfig ARCH=arm64 Indeed. Making this mandatory was a deliberate decision, in part because this allows simplification of code (e.g. removal of #ifdef guards). > When reading the code, I feel it is more appropriate to add macro control > here. I must disagree. I do not think it makes sense to add an #ifdef for a configuration option that is mandatory. There are other places in the kernel that should behave differently if CONFIG_STRICT_KERNEL_RWX were disabled, so this wouldn't be sufficient even if we were to make CONFIG_STRICT_KERNEL_RWX optional. i.e. the #ifdef would give the misleading impression that STRICT_KERNEL_RWX *could* be made optional, even though this might not function correctly. Having an #ifdef here makes the code more complicated and confusing, for the benefit of a case which cannot occur. Thanks, Mark. > -----Original Message----- > From: Will Deacon [mailto:will.deacon@arm.com] > Sent: Tuesday, May 29, 2018 11:45 PM > To: Nixiaoming > Cc: catalin.marinas@arm.com; ard.biesheuvel@linaro.org; marc.zyngier@arm.com; james.morse@arm.com; kristina.martsenko@arm.com; steve.capper@arm.com; tglx@linutronix.de; mingo@redhat.com; hpa@zytor.com; akpm@linux-foundation.org; vbabka@suse.cz; mhocko@suse.com; dave.hansen@linux.intel.com; dan.j.williams@intel.com; kirill.shutemov@linux.intel.com; zhang.jia@linux.alibaba.com; schwidefsky@de.ibm.com; heiko.carstens@de.ibm.com; gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; x86@kernel.org; linux-s390@vger.kernel.org > Subject: Re: [PATCH 1/3] arm64:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro > > On Tue, May 29, 2018 at 09:36:15PM +0800, nixiaoming wrote: > > mark_rodata_ro is only called by the function mark_readonly when > > CONFIG_STRICT_KERNEL_RWX=y, > > if CONFIG_STRICT_KERNEL_RWX is not set > > a compile warning may be triggered: unused function > > How are you achieving this configuration? In our Kconfig we select this > unconditionally. > > Will