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-next>] [day] [month] [year] [list]
Message-ID: <497A0500.3080706@gmail.com>
Date:	Fri, 23 Jan 2009 19:57:20 +0200
From:	Török Edwin <edwintorok@...il.com>
To:	"Thomas Gleixner" <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>
CC:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: inline asm semantics: output constraint width smaller than input

Hi,

I am trying to build the kernel with LLVM 2.5 prerelease (using
llvm-gcc-4.2 frontend), however I am running into some inline asm
semantics issues, and after some discussion on LLVM bugzilla I would
like to know if you would be accepting patches for this:
http://llvm.org/bugs/show_bug.cgi?id=3373

The problem is when "a" output constraint is used with a variable of
smaller width than the
"0" input constraint.

Here are 2 examples:

int __ret_pu; unsigned long __pu_val;
return   ({asm volatile("call __put_user_" "8" : "=a" (__ret_pu) :"0"
                          (__pu_val), "c"(addr) : "ebx"); __ret_pu;});


unsigned char return_code;      /* %al */         
unsigned long address;          /* %ebx */ 
unsigned long length;           /* %ecx */
unsigned long entry;            /* %edx */
unsigned long flags;
__asm__("lcall *(%%edi); cld"
                : "=a" (return_code),
                  "=b" (address),
                  "=c" (length),
                  "=d" (entry)
                : "0" (service),
                  "1" (0),
                  "D" (&bios32_indirect));

There are 2 cases:
1. output is wider than input
2. output is narrower than input

Case 2 seems to occur lots of times on 64-bit (due to sizeof(int) != sizeof(unsigned long)), 
and a few times on 32-bit as well.

Would you accept patches that increase the portability of the inline asm statements? 
(essentially by adding casts for case 1, and introducing a temporary of correct width for case 2).

Please see: 
http://llvm.org/bugs/show_bug.cgi?id=3373#c6

Best regards,
--Edwin

--
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