lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C58833F.1080409@caviumnetworks.com>
Date:	Tue, 03 Aug 2010 13:59:43 -0700
From:	David Daney <ddaney@...iumnetworks.com>
To:	"Maciej W. Rozycki" <macro@...ux-mips.org>
CC:	linux-mips@...ux-mips.org, ralf@...ux-mips.org, ananth@...ibm.com,
	anil.s.keshavamurthy@...el.com, davem@...emloft.net,
	masami.hiramatsu.pt@...achi.com, linux-kernel@...r.kernel.org,
	hschauhan@...ltrace.org
Subject: Re: [PATCH 2/5] MIPS: Add instrunction format for BREAK and SYSCALL

On 08/03/2010 01:54 PM, Maciej W. Rozycki wrote:
> On Tue, 3 Aug 2010, David Daney wrote:
>
>> diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
>> index 6489f00..444ff71 100644
>> --- a/arch/mips/include/asm/inst.h
>> +++ b/arch/mips/include/asm/inst.h
>> @@ -247,6 +247,12 @@ struct ma_format {	/* FPU multipy and add format (MIPS IV) */
>>   	unsigned int fmt : 2;
>>   };
>>
>> +struct b_format { /* BREAK and SYSCALL */
>> +	unsigned int opcode:6;
>> +	unsigned int code:20;
>> +	unsigned int func:6;
>> +};
>> +
>>   #elif defined(__MIPSEL__)
>>
>>   struct j_format {	/* Jump format */
>
>   Please note the code field of the BREAK instruction is by toolchain
> convention (bug-compatibility with the original MIPS assembler or
> suchlike) treated as a pair of swapped 10-bit fields -- you may want to
> double-check consistency of interpretation with usage elsewhere.
>

Indeed, I am familiar with that fact.  From patch 3/5 we have:

.
.
.
+void __kprobes jprobe_return(void)
+{
+	/* Assembler quirk necessitates this '0,code' business.  */
+	asm volatile(
+		"break 0,%0\n\t"
+		".globl jprobe_return_end\n"
+		"jprobe_return_end:\n"
+		: : "n" (BRK_KPROBE_BP) : "memory");
+}
.
.
.

The 'break 0,code' construct causes gas to emit values that are 
compatible with the other use of struct b_format in the patch set.

David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ