Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1797661pxv; Sat, 26 Jun 2021 00:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLCuEgvSxOwk3GiUiOF8DwfZ/MGSwlQYDFY6ip/RvmjmZQnzoO5eRbhYrLsZ+hWZl0H/vx X-Received: by 2002:a05:6402:cb0:: with SMTP id cn16mr20102967edb.165.1624692567462; Sat, 26 Jun 2021 00:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624692567; cv=none; d=google.com; s=arc-20160816; b=oDmnmbrspi0MEHRQszPwJX5HNQ5bP2PGW6OxaeXxN6/vU5HsKtcQWhHcskcJerDZbK ok3HNOpyDXPe7lMtElTD3tiUU67Tsm0UHi7h1GR/2i+f3rWPQabLLhNHApvZzzqL4ruC AQSXffufKss0Bca87iypcDgD7/IDuIodG2vKFawk1+95qH3vzMLwJf0+YjDxuEM1v7FV 8o/zJfRv8zeVwiMx36RSUJKkGNIBqah/kcbPVDpGbS/DRFyAYJB5SVOxkYvXhhizvu8A WpAk3zeJTAJ/ZbxQZ0umL0ademY5lDLOyxt04fZIZuq33HANu6QmwDFJeOwdd4eqxAgu isIA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eMFb9OLFlEaaPMw8uG+kqS/mAYUcQ2KJt/Po5soz48E=; b=rTanj47y5NmgpBVy9gPNw6JSptuIXHTE6AgrEuSInw1d/BeMTWPF6xnFVBoP+2dhj8 Qfsg9LCpHBy+Xf/kl7692vn82C2g+jX4vx28zx4aPmZdQ1axE/KEk6mkHlsk+RPt2qg0 YDe/Ly/YIiMS6J268jWfLgHQ4OsbadbOe37pF7G6BJCokRmYBeNYf7x18n3H0xmvav44 Q/A6L6bJr4TzDvfPxfKbD7/+pzHya4Gdn2CAP0JGed3oZY3b27VSFafhUrQYO9Ct6U13 tTkaU28lOCQKI9PrlDYhowuN4f5aUWGsA9WychmRzZ1LLyGBj+WK1OE9GvIKIB0jjrDN TG+A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si7677359ejf.550.2021.06.26.00.29.04; Sat, 26 Jun 2021 00:29:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbhFZH3t (ORCPT + 99 others); Sat, 26 Jun 2021 03:29:49 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5435 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhFZH32 (ORCPT ); Sat, 26 Jun 2021 03:29:28 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GBljC6cDfz74V6; Sat, 26 Jun 2021 15:23:43 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:27:01 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:27:00 +0800 From: Kefeng Wang To: Arnd Bergmann , , CC: Kefeng Wang , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Subject: [PATCH 7/9] s390: kprobes: Use is_kernel() helper Date: Sat, 26 Jun 2021 15:34:37 +0800 Message-ID: <20210626073439.150586-8-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210626073439.150586-1-wangkefeng.wang@huawei.com> References: <20210626073439.150586-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use is_kernel() helper instead of is_kernel_addr(). Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: linux-s390@vger.kernel.org Signed-off-by: Kefeng Wang --- arch/s390/kernel/kprobes.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 528bb31815c3..7e7a8d5219bb 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -92,11 +92,6 @@ static void copy_instruction(struct kprobe *p) } NOKPROBE_SYMBOL(copy_instruction); -static inline int is_kernel_addr(void *addr) -{ - return addr < (void *)_end; -} - static int s390_get_insn_slot(struct kprobe *p) { /* @@ -105,7 +100,7 @@ static int s390_get_insn_slot(struct kprobe *p) * field can be patched and executed within the insn slot. */ p->ainsn.insn = NULL; - if (is_kernel_addr(p->addr)) + if (is_kernel(p->addr)) p->ainsn.insn = get_s390_insn_slot(); else if (is_module_addr(p->addr)) p->ainsn.insn = get_insn_slot(); @@ -117,7 +112,7 @@ static void s390_free_insn_slot(struct kprobe *p) { if (!p->ainsn.insn) return; - if (is_kernel_addr(p->addr)) + if (is_kernel(p->addr)) free_s390_insn_slot(p->ainsn.insn, 0); else free_insn_slot(p->ainsn.insn, 0); -- 2.26.2