From patchwork Tue May 16 03:49:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 762787 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wRk8b19K1z9s7B for ; Tue, 16 May 2017 13:54:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H8d0RZiT"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wRk8Z6wN1zDqcx for ; Tue, 16 May 2017 13:54:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H8d0RZiT"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wRk3T0m1zzDqbg for ; Tue, 16 May 2017 13:49:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H8d0RZiT"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id h64so14917234pge.3 for ; Mon, 15 May 2017 20:49:41 -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:in-reply-to:references; bh=JpUzpdJZZN+xArUCTHCtWDnhHR6U3dGcEkB/TaZ39RI=; b=H8d0RZiT8YyfbRpoqO0cKEmIEgUBFAPhqjK6v0DsfB186Qjk6QpGz7vFW2XSEVZiUq rvgpH/mYNI/Q/UTjobl/OvsD8nv9BSUJ1WGEH5hoBddjThErHwdv1umGe2/1zelnc1+j pUpWTTp+F1O70UmNHdTtGqwwno4LHZ0fsbv0ibb9JyxmzTYk8tbp6FgepRZ5YxX4jZmj GIn9IFBsAm+j/5mS6W3earFUana3JYDYq2ceCMlIncIyGE9Ve6avhoGinM07oDeNE0s+ VEt08iI+dHedlslH9YZHMiGD11cEwilgSnlPGsVtCvPUJ7mUjMBDahjGjyEHnjwK3YZj agKA== 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:in-reply-to :references; bh=JpUzpdJZZN+xArUCTHCtWDnhHR6U3dGcEkB/TaZ39RI=; b=l3AUOMZvmg0AsOvPWLKutmF5jO0TDkV0yZtkxxdw+JmdxujVl+ZLFRhfstRM+2mu+j xtTJJ/VYkZTwR/il3EwuWd6ZdSHBHmNX9PajEOZn3vkK1cURyhQqehM24s7XjDEDTsHc PnzdMzG+AGenMgS6TaBBqUjj7TM6mTTT3orx8y0UGH/Z95AwFUhbJM57EYIRnRM3sbHq R5aREIEXqxQ4o+65+Ktf2L4+ZPoWuTOGrXHHCgdxLkz6DM1n27Gt1O5nTBiHH7iffEJs 1VdGvISYylTBq/e4YfUe9OdhK8Arn12O6djLf6Z5DQP1Ph6HTKglMowGk/GS2BJyGLr6 KeGw== X-Gm-Message-State: AODbwcDE0y/ZhEp5l3n4GkMp/iatOaPpPBYxfZZUZ4ee+3n+uxC28Z20 4Rt6k3dBjT6ijzmwYqY= X-Received: by 10.84.217.91 with SMTP id e27mr13210117plj.87.1494906578783; Mon, 15 May 2017 20:49:38 -0700 (PDT) Received: from MiWiFi-R3-srv.au.ibm.com (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id n71sm26031334pfg.46.2017.05.15.20.49.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 20:49:37 -0700 (PDT) From: Balbir Singh To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au Subject: [RFC 2/2] powerpc/kprobes: Move kprobes over to patch_instruction Date: Tue, 16 May 2017 13:49:13 +1000 Message-Id: <20170516034913.21163-3-bsingharora@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170516034913.21163-1-bsingharora@gmail.com> References: <20170516034913.21163-1-bsingharora@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: naveen.n.rao@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" arch_arm/disarm_probe use direct assignment for copying instructions, replace them with patch_instruction Signed-off-by: Balbir Singh --- arch/powerpc/kernel/kprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 160ae0f..5e1fa86 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c @@ -158,7 +158,7 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe); void arch_arm_kprobe(struct kprobe *p) { - *p->addr = BREAKPOINT_INSTRUCTION; + patch_instruction(p->addr, BREAKPOINT_INSTRUCTION); flush_icache_range((unsigned long) p->addr, (unsigned long) p->addr + sizeof(kprobe_opcode_t)); } @@ -166,7 +166,7 @@ NOKPROBE_SYMBOL(arch_arm_kprobe); void arch_disarm_kprobe(struct kprobe *p) { - *p->addr = p->opcode; + patch_instruction(p->addr, BREAKPOINT_INSTRUCTION); flush_icache_range((unsigned long) p->addr, (unsigned long) p->addr + sizeof(kprobe_opcode_t)); }