Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3664649pxu; Sun, 11 Oct 2020 19:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaG3bogE+LJj5dF10Q9tmUgQH8ykT2mALRPJ3eqZt4aIVZB4GYCb9FTJl6k1/a4E6b+F3k X-Received: by 2002:a50:e447:: with SMTP id e7mr11966536edm.263.1602469369754; Sun, 11 Oct 2020 19:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602469369; cv=none; d=google.com; s=arc-20160816; b=KbfH1IlcqbeJvxJqo0K4wRks8i9rmFtKJnqBbSA9tmo+hvS5n+PYgBa74h7JnCQ6Rw U1ykaxbpPRZQMg8sMYXbi+GkbUhRCoqJzsHfkPUrTjvIoToj9uQqDu5ua+0Ew91JVY9f hb7D97W4OBXoStIKXGtaAlj5hw9BLp2CmIt8PTZ1psi0WpwG/RRb/zXKXXDqCik7I/Mh DR4zA50q+qZBNCSBXDS0yGz552T8C3bqloqA3aHzmw9/bMTJDnQjRZKkzRnEJ9R8kM3R yon2lOdj0ND3fazKH17FhYcekNnl/zqcWSqharw6vsVUZhRevutzIOu4KUcG/5oiSky1 hU6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=++gbq6bHGdZ/VJfA0p5F3gwuHJRX7rAlAjR8Id/tUK4=; b=mOLQ5uyIseeqEFVwo6hiqSxblsjq4WUaU6TAQuywQWq9N0cYED4ZQMJv0EA3lHHRGg POArOgu2vk+RQIxIa+M6nPHcmKxG6F/j0xkqicDi0PS1FarG+divlWDrhEcHIx4BqMRJ t/m8RZuUj2ezBhzkmiU1TaFzWfuJrg+etUe3Jq9phL9hD8cC8YHR7B0WOTAXFzVuoBRm bLfEuCDkm3UN4CoIVn3ZNiEVEp/q0OrSO0UF/2AqQdL7lXZH2LNv1oU/FgSB8bECAuRr 99G1OMlxCFfTZw/YyqKb3bvZyE+YEGsGLN9Mc9CtvIPuPNyG7UcOg+rz4y3aASgsNRMb pqhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh27si12162683edb.28.2020.10.11.19.22.27; Sun, 11 Oct 2020 19:22:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727214AbgJLBJa (ORCPT + 99 others); Sun, 11 Oct 2020 21:09:30 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33894 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727132AbgJLBJa (ORCPT ); Sun, 11 Oct 2020 21:09:30 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 68EE0DFF88410E0B8066; Mon, 12 Oct 2020 09:09:27 +0800 (CST) Received: from huawei.com (10.174.187.17) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 12 Oct 2020 09:09:19 +0800 From: l00484210 To: , , , , CC: , , , , , , , , , "MingWang Li" Subject: [PATCH] arm64: KVM: marking pages as XN in Stage-2 does not care about CTR_EL0.DIC Date: Mon, 12 Oct 2020 09:08:52 +0800 Message-ID: <20201012010852.15932-1-limingwang@huawei.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.187.17] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: MingWang Li When testing the ARMv8.2-TTS2UXN feature, setting bits of XN is unavailable. Because the control bit CTR_EL0.DIC is set by default on system. But when CTR_EL0.DIC is set, software does not need to flush icache actively, instead of clearing XN bits.The patch, the commit id of which is 6ae4b6e0578886eb36cedbf99f04031d93f9e315, has implemented the function of CTR_EL0.DIC. Signed-off-by: MingWang Li Signed-off-by: Henglong Fan --- arch/arm64/include/asm/pgtable-prot.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index 4d867c6446c4..5feb94882bf7 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -79,17 +79,7 @@ extern bool arm64_use_ng_mappings; __val; \ }) -#define PAGE_S2_XN \ - ({ \ - u64 __val; \ - if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC)) \ - __val = 0; \ - else \ - __val = PTE_S2_XN; \ - __val; \ - }) - -#define PAGE_S2 __pgprot(_PROT_DEFAULT | PAGE_S2_MEMATTR(NORMAL) | PTE_S2_RDONLY | PAGE_S2_XN) +#define PAGE_S2 __pgprot(_PROT_DEFAULT | PAGE_S2_MEMATTR(NORMAL) | PTE_S2_RDONLY | PTE_S2_XN) #define PAGE_S2_DEVICE __pgprot(_PROT_DEFAULT | PAGE_S2_MEMATTR(DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_S2_XN) #define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN) -- 2.19.1