Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1375475imm; Thu, 4 Oct 2018 12:33:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60S68YKS2+qorP914Q3ImSs19S6Aikwr8uoP72ZPNebvvCQUhjdlEcjeCtLTL31Vfg3bNiz X-Received: by 2002:a63:d048:: with SMTP id s8-v6mr6932670pgi.311.1538681630493; Thu, 04 Oct 2018 12:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538681630; cv=none; d=google.com; s=arc-20160816; b=KOsraTepdz1Jwd/kPFcmqSpWQecQXn4Ca69KdNMLu7eu+bI29JUJ1qweYkI1Day7FM SDWL3Q4shAlfqBntRiDTCa3amdoylDp+NO9fU6aQcGjt4uuGJsCkO2bUSiWchBCSk/sA nNakZb3eoLncP5RmgjmR9+NQUHYTRZeaE0r/c4cMZ7vWgyXXmre35IJETW2TpcQ3zDjU BeN+3bySd4r0yuclyWMH8rEBPf9mSFP9uJ4JHcVlVGSpOP/fK1/2U5ASTw/9hsX0kNrr aOW+VRJouDCjKoy1TNy2yKd0+PGluSN3m5ci26vEaHeXbepd1ppe993+tJ0sguCwlN/g xBGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EXuRj+/ab/qKp4qJ8r6k264K+jghqGHeDw+nTnMca0o=; b=xApJRvPQtJIGPCLrrgA26G4cr79Bzrq4CJN2eWNE/WOXOk/3oH99UZduORzIHw1ce5 ncBxubtpAtP2VPyuluLMfJod4rEEfXfr+53XvqhHk2XeFhBefS/B7VLI2LWcD3E0L1Zk BZ4cgDe+Hz0iy3XV1kud5tFHswxqR35+LLjc5HeixQRn5WnIEbGaHaIolA2pxZbrEhmd VeZy0fmFVJpnEuDjhLo3/WmU1UPqMueB3RDshGIns5WGH/26al/PozWGaV0oOB6pkNm3 zZ3BrVud1162ZRSwl4xIMc8I0o10B2G6K1AURKYHD+SQbDnOx0ETIulAqs9BEd8NgE5l Ypnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9-v6si6593982plf.345.2018.10.04.12.33.34; Thu, 04 Oct 2018 12:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727648AbeJEC2J (ORCPT + 99 others); Thu, 4 Oct 2018 22:28:09 -0400 Received: from terminus.zytor.com ([198.137.202.136]:41763 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJEC2J (ORCPT ); Thu, 4 Oct 2018 22:28:09 -0400 Received: from hanvin-mobl2.amr.corp.intel.com (jfdmzpr05-ext.jf.intel.com [134.134.139.74]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w94JXC5N2860076 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 4 Oct 2018 12:33:13 -0700 Subject: Re: [PATCH v9 04/10] x86: refcount: prevent gcc distortions To: Ingo Molnar Cc: Nadav Amit , Ingo Molnar , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Thomas Gleixner , Jan Beulich , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Andy Lutomirski References: <20181003213100.189959-1-namit@vmware.com> <20181003213100.189959-5-namit@vmware.com> <20181004075755.GA3353@gmail.com> <20181004083333.GA9802@gmail.com> <10D29A50-C352-4407-A824-0C3C06CD8592@zytor.com> <36D6F606-6922-4057-B1F8-2B30993962AE@zytor.com> <20181004091651.GB21151@gmail.com> From: "H. Peter Anvin" Message-ID: Date: Thu, 4 Oct 2018 12:33:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181004091651.GB21151@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/18 02:16, Ingo Molnar wrote: > > * hpa@zytor.com wrote: > >> Ingo: I wasn't talking necessarily about the specifics of each bit, but rather the general >> concept about being able to use macros in inlines... > > Ok, agreed about that part - and some of the patches did improve readability. > > Also, the 275 lines macros.s is a lot nicer than the 4,200 lines macros.S. > > Also, I'm not against using workarounds when the benefits are larger than the costs, but I am > against *hiding* the fact that these are workarounds and that for some of them there are costs. > Agreed, of course. >> I can send you something I have been working on in the background, but have been holding off >> on because of this, in the morning my time. > > BTW., I have applied most of the series to tip:x86/kbuild already, and will push them out later > today after some testing. I didn't apply the final 3 patches as they have dependencies, but > applied the basics and fixed up the changelogs. > > So you can rely on this. > Wonderful. Here is the horrible code I mentioned yesterday. This is about implementing the immediate-patching framework that Linus and others have discussed (it helps both performance and kernel hardening): Warning: this stuff can cause serious damage to your eyes, and this is a just a small chunk of the whole mess; and relying on gas macros, as brain damaged as they are, really is much, much cleaner than not: http://www.zytor.com/~hpa/foo.S -hpa