Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2205810yba; Fri, 19 Apr 2019 14:28:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6BeRpAa8OG3Li04/i1w2qA4EijAj3mkyHP+R7jdejWwzQD8DwmrW6DkiLrAo8zUL+Z0WZ X-Received: by 2002:a65:5089:: with SMTP id r9mr5971462pgp.14.1555709297664; Fri, 19 Apr 2019 14:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555709297; cv=none; d=google.com; s=arc-20160816; b=hM7ixJqgPeB3Fl5B5yXeLrIUYNUs03gIZwALDKaDuPlopv9ocxolqr1miD1YrcnO8j CcjsglOx5sP/yqHXTG/IWMRo13jk5NjB3p15XbUfSkItm8OexofdgW1z7bbkPNSQ5PX6 aPNSnO64f+H1WQDnavW4LpBKqP6Hbg2i+kGkWWQBP1vFf6usbtbdtAAWIK7yiLjDmgac 2oh4S5O46GhsBDnoDnofDnHUPiylEZfRBsNKuCyoYx3S0m0DaK47LD+2695wka+oT8Dc ddQBphFWBWQC9ikvZiKnWvTIAfp35EG+nycFVwM85Iz/sS++nykWcBs7rW1xsibevnhU rreg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=lcnCEi0UZBNAodSbqYPkular+B3EQNEOMdQDOptVfmw=; b=Zda5LRbGYPDRXQyQlQ/04A/EmdvZ+00/z85uywkxKtyNzoQtu3/SfAAvVjo5tPAlWG IIVp0UKVr55/8Vd+XMBJ67A4CWQL29D1sn0G0tBYkMyZdVMaqZeWu9I/y/Rot2Owv0lm FePCJQeAhaySkQ+tvu8Z7ErBYyxMYb+maco0btyZcVZzLL2gyYeM71X8Fdd0n7dVP7cz IA9nsnpdd0jivj8tOYDOUWAA79yoj5mepC92PNNpaC9glnbhN9l82xJRYlBbs+kpy0D9 saRwI50bfb7sN+1Zodf/swX9KNQYwpj4ptOraIoO0Ad58LPhVnF/hvWtsLKGm8SUwJhP NOGA== 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 s20si5776626pgs.509.2019.04.19.14.28.02; Fri, 19 Apr 2019 14:28:17 -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 S1727349AbfDSV04 (ORCPT + 99 others); Fri, 19 Apr 2019 17:26:56 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42520 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbfDSV04 (ORCPT ); Fri, 19 Apr 2019 17:26:56 -0400 Received: from pd9ef12d2.dip0.t-ipconnect.de ([217.239.18.210] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hHb23-0001JB-Ca; Fri, 19 Apr 2019 23:26:51 +0200 Date: Fri, 19 Apr 2019 23:26:50 +0200 (CEST) From: Thomas Gleixner To: Andi Kleen cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH v2 3/9] x86/paravirt: Replace paravirt patches with data In-Reply-To: <20190330004743.29541-3-andi@firstfloor.org> Message-ID: References: <20190330004743.29541-1-andi@firstfloor.org> <20190330004743.29541-3-andi@firstfloor.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Mar 2019, Andi Kleen wrote: > For LTO all top level assembler statements need to be global because > LTO might put it into a different assembler file than the referencing > C code. > > To avoid making all the paravirt patch snippets global replace them > with data containing the patch instructions. Since these are unlikely > to change this shouldn't be a significant maintenance burden. s/with data containing/with unparseable, inconsistent and broken mess/ Unparseable: ------------ > +static const unsigned char patch_irq_save_fl[] = { 0x9c, 0x58 }; /* pushf; pop %eax */ > +static const unsigned char patch_cpu_iret[] = { 0xcf }; /* iret */ > +static const unsigned char patch_mmu_read_cr2[] = { 0x0f, 0x20, 0xd0 }; /* mov %cr2, %eax */ > +static const unsigned char patch_mmu_write_cr3[] = { 0x0f, 0x22, 0xd8 };/* mov %eax, %cr3 */ > +static const unsigned char patch_mmu_read_cr3[] = { 0x0f, 0x20, 0xd8 }; /* mov %cr3, %eax */ Overlong lines, spaces and tabs mixed, no formatting which allows easy reading and review. Inconsistent and unparseable: ----------------------------- > #define PATCH_SITE(ops, x) \ > case PARAVIRT_PATCH(ops.x): \ > - return paravirt_patch_insns(ibuf, len, start_##ops##_##x, end_##ops##_##x) > + return paravirt_patch_insns(ibuf, len, \ > + patch_##ops##_##x, patch_##ops##_##x+sizeof(patch_##ops##_x)); vs. > + return paravirt_patch_insns(ibuf, len, start_##ops##_##x, \ > + patch_##ops##_##x + sizeof(patch_##ops##_##x)); Broken: ------- > +static const unsigned char patch_irq_restore_fl[] = { 0x50, 0x9d}; /* pushq %rdi; popfq */ Can you spot the fail? That probably works because Intel CPUs are so good at executing crappy code, right? That's at least what you told me recently. If that's the proof then I should really stop reviewing patches. Thanks, tglx