Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382965 > unrolled thread

Re: [PATCH v11 5/9] arm64: Kprobes with single stepping support

Started byLi Bin <huawei.libin@huawei.com>
First post2016-04-20 03:40 +0200
Last post2016-04-20 03:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v11 5/9] arm64: Kprobes with single stepping support Li Bin <huawei.libin@huawei.com> - 2016-04-20 03:40 +0200

#1382965 — Re: [PATCH v11 5/9] arm64: Kprobes with single stepping support

FromLi Bin <huawei.libin@huawei.com>
Date2016-04-20 03:40 +0200
SubjectRe: [PATCH v11 5/9] arm64: Kprobes with single stepping support
Message-ID<rpPhw-8ai-3@gated-at.bofh.it>
Hi David,

on 2016/3/9 13:32, David Long wrote:
> +int __kprobes arch_prepare_kprobe(struct kprobe *p)
> +{
> +	unsigned long probe_addr = (unsigned long)p->addr;

Here should verify the addr alignment:

	if (probe_addr & 0x3)
		return -EINVAL;

Thanks,
Li Bin

> +
> +	/* copy instruction */
> +	p->opcode = le32_to_cpu(*p->addr);
> +
> +	if (in_exception_text(probe_addr))
> +		return -EINVAL;
> +
> +	/* decode instruction */
> +	switch (arm_kprobe_decode_insn(p->addr, &p->ainsn)) {
> +	case INSN_REJECTED:	/* insn not supported */
> +		return -EINVAL;
> +
> +	case INSN_GOOD_NO_SLOT:	/* insn need simulation */
> +		return -EINVAL;
> +
> +	case INSN_GOOD:	/* instruction uses slot */
> +		p->ainsn.insn = get_insn_slot();
> +		if (!p->ainsn.insn)
> +			return -ENOMEM;
> +		break;
> +	};
> +
> +	/* prepare the instruction */
> +	arch_prepare_ss_slot(p);
> +
> +	return 0;
> +}
> +

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web