From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23D72C43381 for ; Fri, 22 Feb 2019 18:10:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA78C205C9 for ; Fri, 22 Feb 2019 18:10:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HBb2e6f3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA78C205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ec0TEQCQHh924x+AfOzgKkFF9LZ9DVe2DDzUo3R9k1M=; b=HBb2e6f36bhgP+ n9UJ1MtDloGJxLM2zfz4HvIlOo3AyJXVtzPm+ZQY1BeYc2s7nSWO/cePL5hmF2TRc2wGVAdw+KQlK W9l4eRB6xHbzfanBzxtY+uVeiZOh8IN3gbQJvtgwul7NcKUjqakuyPkidMnnJ419gpgEUe38D8K5N HND5oKVtEoXITWmarXeifNBBUx2l7rsdR2/BvjPClMDxGPS2hgKjO7C6f0YN9nkob/daPi/W2VlPv wXypGdJqFZCY/kKY5UTb4v1Dd3Rx52pyzuLZLD1t7jIBCEnSGjs6jEQXR7PH4t4pr9c8wIr0lkYHh Uk4PmmIN6AjgFggsYV+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxFHb-00045e-OJ; Fri, 22 Feb 2019 18:10:47 +0000 Received: from galois.linutronix.de ([2a01:7a0:2:106d:700::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxFHY-00045I-4z for linux-arm-kernel@lists.infradead.org; Fri, 22 Feb 2019 18:10:46 +0000 Received: from p5492e0d8.dip0.t-ipconnect.de ([84.146.224.216] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gxFHP-0001bj-HF; Fri, 22 Feb 2019 19:10:35 +0100 Date: Fri, 22 Feb 2019 19:10:34 +0100 (CET) From: Thomas Gleixner To: Linus Torvalds Subject: Re: [PATCH] sched/x86: Save [ER]FLAGS on context switch In-Reply-To: Message-ID: References: <20190213144145.GY32494@hirez.programming.kicks-ass.net> <20190213154532.GQ32534@hirez.programming.kicks-ass.net> <20190213222146.GC32494@hirez.programming.kicks-ass.net> <20190214101429.GD32494@hirez.programming.kicks-ass.net> <20ABBED1-E505-45F6-8520-FB93786DF9A9@zytor.com> <20190216103044.GR32494@hirez.programming.kicks-ass.net> <9e037d68-75e7-1beb-0c9c-33a7ffeced1b@zytor.com> <20190219090409.GW32494@hirez.programming.kicks-ass.net> <20190219124808.GG8501@fuggles.cambridge.arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190222_101044_337186_E5E62C7E X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Josh Poimboeuf , Denys Vlasenko , Brian Gerst , Julien Thierry , Peter Zijlstra , Catalin Marinas , valentin.schneider@arm.com, Will Deacon , Linux List Kernel Mailing , Andy Lutomirski , Ingo Molnar , James Morse , Andrew Lutomirski , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , "linux-alpha@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 21 Feb 2019, Linus Torvalds wrote: > On Thu, Feb 21, 2019 at 1:35 PM Thomas Gleixner wrote: > > > > IMNSHO any call inside a AC region is a bug lurking round the corner. The > > only thing which is tolerable is an exception of some sort. > > > > Enforce that with objtool. End of story. > > Not quite that simple. But correct :) > Right now "filldir()" messes with AC a total of *six* times. It sets > four field values, and then does a "copy_to_user()", all of which > set/clear AC right now. It's wasting hundreds of cycles on this, > because AC is so slow to set/clear. > > If AC was cheap, this wouldn't be much of an issue. But AC is really > really expensive. I think it's microcode and serializes the pipeline > or something. > > Anyway. We already have a possible call site, and there are good > reasons for future ones too. But they are hopefully all very > controlled. I agree, that a function which is doing the actual copy should be callable, but random other functions? NO! The problem is that once you open that can of worms the people who think their problem is special will come around and do begin() copy_to_user_unsafe(uptr, collect_data()) end() just because they can. That's the stuff, I'm worried about, not the well defined copy_to/from_user() invocation. We can deal with that and make sure that it's safe even with tracing and annotate with some special magic. It's simpler to find and check a new '__safe_inside_ac' annotation than chasing randomly added code within a gazillion of begin/end sections. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel