From 3b8909ded7cf51d486e42dfb29d246ecb60cf7e9 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 13 Aug 2008 17:28:07 +0000 Subject: [PATCH] update test git-svn-id: http://ltt.polymtl.ca/svn@3017 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/tests/kernel/test-nop-speed.c | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/trunk/tests/kernel/test-nop-speed.c b/trunk/tests/kernel/test-nop-speed.c index 957bf055..49085c2f 100644 --- a/trunk/tests/kernel/test-nop-speed.c +++ b/trunk/tests/kernel/test-nop-speed.c @@ -65,6 +65,34 @@ void fivebytespsixnop(void) var *= var2; } +/* + * GENERIC_NOP1 GENERIC_NOP4, + * 1: nop + * _not_ nops in 64-bit mode. + * 4: leal 0x00(,%esi,1),%esi + */ +void genericfivebytesonefournops(void) +{ + asm volatile (".byte 0x90,0x8d,0x74,0x26,0x00\n\t"); + var += 50; + var /= 10; + var *= var2; +} + +/* + * K7_NOP4 ASM_NOP1 + * 1: nop + * assumed _not_ to be nops in 64-bit mode. + * leal 0x00(,%eax,1),%eax + */ +void k7fivebytesonefournops(void) +{ + asm volatile (".byte 0x90,0x8d,0x44,0x20,0x00\n\t"); + var += 50; + var /= 10; + var *= var2; +} + void perform_test(const char *name, void (*callback)(void)) { unsigned int i; @@ -95,6 +123,10 @@ static int my_open(struct inode *inode, struct file *file) perform_test("3/2 nops", threetwonops); perform_test("5-bytes nop with long prefix", fivebytesnop); perform_test("5-bytes P6 nop", fivebytespsixnop); +#ifdef CONFIG_X86_32 + perform_test("Generic 1/4 5-bytes nops", genericfivebytesonefournops); + perform_test("K7 1/4 5-bytes nops", k7fivebytesonefournops); +#endif return -EPERM; } -- 2.34.1