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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 95082C433E0 for ; Wed, 5 Aug 2020 16:38:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AC2E21744 for ; Wed, 5 Aug 2020 16:38:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgHEQil (ORCPT ); Wed, 5 Aug 2020 12:38:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:58318 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgHEQfh (ORCPT ); Wed, 5 Aug 2020 12:35:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A4C6FB619; Wed, 5 Aug 2020 14:17:24 +0000 (UTC) Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers To: peterz@infradead.org, Marco Elver Cc: bp@alien8.de, dave.hansen@linux.intel.com, fenghua.yu@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, tony.luck@intel.com, x86@kernel.org, yu-cheng.yu@intel.com, sdeep@vmware.com, virtualization@lists.linux-foundation.org, kasan-dev@googlegroups.com, syzbot References: <0000000000007d3b2d05ac1c303e@google.com> <20200805132629.GA87338@elver.google.com> <20200805134232.GR2674@hirez.programming.kicks-ass.net> <20200805135940.GA156343@elver.google.com> <20200805141237.GS2674@hirez.programming.kicks-ass.net> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: Date: Wed, 5 Aug 2020 16:17:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200805141237.GS2674@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed 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 05.08.20 16:12, peterz@infradead.org wrote: > On Wed, Aug 05, 2020 at 03:59:40PM +0200, Marco Elver wrote: >> On Wed, Aug 05, 2020 at 03:42PM +0200, peterz@infradead.org wrote: > >>> Shouldn't we __always_inline those? They're going to be really small. >> >> I can send a v2, and you can choose. For reference, though: >> >> ffffffff86271ee0 : >> ffffffff86271ee0: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271ee5: 48 83 3d 43 87 e4 01 cmpq $0x0,0x1e48743(%rip) # ffffffff880ba630 >> ffffffff86271eec: 00 >> ffffffff86271eed: 74 0d je ffffffff86271efc >> ffffffff86271eef: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271ef4: ff 14 25 30 a6 0b 88 callq *0xffffffff880ba630 >> ffffffff86271efb: c3 retq >> ffffffff86271efc: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271f01: 0f 0b ud2 > >> ffffffff86271a90 : >> ffffffff86271a90: 53 push %rbx >> ffffffff86271a91: 48 89 fb mov %rdi,%rbx >> ffffffff86271a94: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271a99: 48 83 3d 97 8b e4 01 cmpq $0x0,0x1e48b97(%rip) # ffffffff880ba638 >> ffffffff86271aa0: 00 >> ffffffff86271aa1: 74 11 je ffffffff86271ab4 >> ffffffff86271aa3: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271aa8: 48 89 df mov %rbx,%rdi >> ffffffff86271aab: ff 14 25 38 a6 0b 88 callq *0xffffffff880ba638 >> ffffffff86271ab2: 5b pop %rbx >> ffffffff86271ab3: c3 retq >> ffffffff86271ab4: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) >> ffffffff86271ab9: 0f 0b ud2 > > > Blergh, that's abysmall. In part I suspect because you have > CONFIG_PARAVIRT_DEBUG, let me try and untangle that PV macro maze. > Probably. I have found the following in my kernel: fffffff81540a5f : ffffffff81540a5f: ff 14 25 40 a4 23 82 callq *0xffffffff8223a440 ffffffff81540a66: c3 retq Juergen