Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755276AbbG0X4q (ORCPT ); Mon, 27 Jul 2015 19:56:46 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40760 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755215AbbG0X4p (ORCPT ); Mon, 27 Jul 2015 19:56:45 -0400 User-Agent: K-9 Mail for Android In-Reply-To: References: <1438019319-19731-1-git-send-email-uros_bizjak1@t-2.net> <55B680D8.5070702@zytor.com> <55B696B2.3000702@kernel.org> <55B69CED.8050709@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: ASM flags in general From: "H. Peter Anvin" Date: Mon, 27 Jul 2015 16:56:33 -0700 To: Andy Lutomirski CC: Andy Lutomirski , Uros Bizjak , "linux-kernel@vger.kernel.org" , X86 ML , Uros Bizjak , Ingo Molnar Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1756 Lines: 56 Sure... but now you have to wrap things in stac/clac. I'm not sure I see the point since the code is already pretty much optimal. On July 27, 2015 4:49:46 PM PDT, Andy Lutomirski wrote: >On Mon, Jul 27, 2015 at 4:46 PM, H. Peter Anvin wrote: >> Sure, but that is different than getting rid of the _ex forms. >> > >If we did that and got rid of the _ex forms, though, then the code >that matters (the no-fault case) would just be a bunch of movs, right? > That's basically the same as the current _ex code. > >--Andy > >> On July 27, 2015 4:36:26 PM PDT, Andy Lutomirski > >> wrote: >>> >>> On Mon, Jul 27, 2015 at 4:22 PM, H. Peter Anvin >wrote: >>>> >>>> For that to work, gcc would have to know about the extable. >>> >>> >>> It could, I think: >>> >>> asm goto ( >>> "1: mov ...\n\t" >>> _ASM_EXTABLE(1b, %l2) /* or whatever index it is */ >>> : ... : ... : ... : efault); >>> >>> return 0; >>> >>> efault: >>> return -EFAULT; >>> >>> I think that wrmsr_safe could get this treatment with current GCC. >>> put_user plausibly could, too, if we were willing to mark it >volatile >>> and accept that we're lying a little bit about the lack of an output >>> constraint. get_user would need GCC to understand output >constraints >>> for real. >>> >>> --Andy >> >> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/