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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 ADE61C55ABD for ; Tue, 10 Nov 2020 13:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4193820797 for ; Tue, 10 Nov 2020 13:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="zxvxfOWV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730903AbgKJNm1 (ORCPT ); Tue, 10 Nov 2020 08:42:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730044AbgKJNm0 (ORCPT ); Tue, 10 Nov 2020 08:42:26 -0500 Received: from localhost (unknown [176.177.120.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8FFD320731; Tue, 10 Nov 2020 13:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605015746; bh=+NH93rVvGxyY03JD5Zll1bmvk3NHXkPunXz2z/0OIbI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zxvxfOWV6a5UejjfKLERU87WKn3CUEM2NFjGcYHbxaAjhddFiRfXTDFuHaTPCoEQx 9TFU169KBmXbXHjw3OohlXeHEAalvbsdrPnaNHrbaVy+/8QFQQp7jQNabtZmcMkc9k crnf2QSeaRAs/wqDUPLo199JxRT+XBp+kQ0Gct1U= Date: Tue, 10 Nov 2020 14:42:23 +0100 From: Frederic Weisbecker To: Peter Zijlstra Cc: LKML , Mel Gorman , Michal Hocko , Thomas Gleixner , "Paul E . McKenney" , Ingo Molnar , Michal Hocko Subject: Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0() Message-ID: <20201110134223.GB48886@lothringen> References: <20201110005609.40989-1-frederic@kernel.org> <20201110005609.40989-2-frederic@kernel.org> <20201110095515.GA2594@hirez.programming.kicks-ass.net> <20201110101307.GO2651@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110101307.GO2651@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 11:13:07AM +0100, Peter Zijlstra wrote: > On Tue, Nov 10, 2020 at 10:55:15AM +0100, Peter Zijlstra wrote: > > On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > > > > > [fweisbec: s/disp16/data16, integrate into text_get_insn(), elaborate > > > comment on the resulting insn, emulate on int3 trap, provide validation, > > > uninline __static_call_return0() for HAVE_STATIC_CALL] > > > Why did you add full emulation of this? The patch I send to you used the > > text_poke_bp(.emulate) argument to have it emulate an actual call to the > > out-of-line version of that function. > > > > That should work fine and is a lot less code. > > For reference; the below is what I send you. Actually doing the > __static_call_return0() call while we poke the magic XOR instruction is > much simpler. Ok I'll get back to that. I'll just tweak a bit static_call_validate() so that it is aware of that instruction. Thanks.