Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3291731imm; Fri, 19 Oct 2018 08:15:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV62oIqZjpLmZ1M/UVfB5aA+zVlIGOEOUB4zxbLCK4e9FSFeeziYs0RtJBLcfi9+PXC46gXnJ X-Received: by 2002:a63:7e0d:: with SMTP id z13-v6mr5419750pgc.190.1539962126311; Fri, 19 Oct 2018 08:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539962126; cv=none; d=google.com; s=arc-20160816; b=a7v7XrANwJunRQxLdmS6utJ25V0DmH8sDB65+duGwYNyP8SuRWiUB2sUxehOuE3iTG wSculLxjz7fryoaWpFWlVgDWePtminz4QBqiaIL3qe+n/dHwTzz/jzjf7huuQrbwrMtO UjupnDlvoY48shGbm05MUvSlywIuItf/HYD2icBXhBn4Fxsjnn0pYgnN2/6KLTXhQyO/ 0HF5ZJFCdMF6zZLkvQ0Lz+XAlAPvUp2wAYQrrWDPQtWYPp0Ns+BYoLMsi+XAq6uzMbhx GzfupkvLeovod8MF8MjlFtN6i2VqmADXYmEbdNy88LDwyitY+ySSPHwVzJ1SzrDKhhjX ClcA== 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=gQKos5gC1q6MyfcxyDcblnLEQOmoOyMTDYNg5bkY5uI=; b=leDCyk2Jr+fY2qmF0xI1YR5LxMLw8bOqqTbJmc6MSwsB2yhmLF9NTPge5tJVVzeI2M 3YU48svuc1MJWqHzN+m1NaNfZvlmrw4XksSkscasL4KjFRHax6I9NBp5+hzddlKYL00c 6zmgZucuXW5gYoTbe499dQB0xvHZzfJaUK0nyHEFEPRy1pBULnvxK4hgcit+b+g84FLz GJQHKaB8QWGV7Tb5Okgb2f+nd+NRNKhcnuOWZwCk7D0B2NeT8vCu4Fid5Qw8xMPwHxdf vGudxPGmhcm+8BXvFldrKduYIHqkVQGdLABorKiSPRBT512b7GLCwQB9au/uQlvBj+wV JFzQ== 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 j24-v6si5065788pll.200.2018.10.19.08.15.10; Fri, 19 Oct 2018 08:15:26 -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 S1727042AbeJSXVN (ORCPT + 99 others); Fri, 19 Oct 2018 19:21:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:51004 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726663AbeJSXVN (ORCPT ); Fri, 19 Oct 2018 19:21:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E560AADAB; Fri, 19 Oct 2018 15:14:39 +0000 (UTC) Date: Fri, 19 Oct 2018 17:14:38 +0200 (CEST) From: Miroslav Benes To: Jessica Yu cc: Torsten Duwe , Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v3 3/4] arm64: implement live patching In-Reply-To: <20181019121847.eug4p2mxr32cebk2@linux-8ccs> Message-ID: References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141652.5478C68BE1@newverein.lst.de> <20181018125820.iw54zbirq74ulknj@linux-8ccs> <20181019121847.eug4p2mxr32cebk2@linux-8ccs> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >If I am not mistaken, we do not care for arch.init.plt in livepatch. Is > >that correct? > > I do not believe patching of __init functions is supported (right?) So > we do not need to keep arch.init.plt alive post-module-load. I think we can do that. Theoretically. I'm not sure if it is actually useful. Module's init functions are called after the modules is patched, so there is no obstacle. But arch.init.plt would be useful only for the relocations of the patching module, right? Patching functions would not part of init section anyway, I think, so arch.init.plt is useless post-module-load. > >> int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, > >> char *secstrings, struct module *mod) > >> { > >> @@ -210,11 +225,13 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, > >> Elf_Shdr > >> *sechdrs, > >> * entries. Record the symtab address as well. > >> */ > >> for (i = 0; i < ehdr->e_shnum; i++) { > >> - if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) > >> + if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) { > >> mod->arch.core.plt = sechdrs + i; > >> - else if (!strcmp(secstrings + sechdrs[i].sh_name, > >> ".init.plt")) > >> + mod->arch.core.plt_shndx = i; > >> + } else if (!strcmp(secstrings + sechdrs[i].sh_name, > >> ".init.plt")) { > >> mod->arch.init.plt = sechdrs + i; > >> - else if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && > >> + mod->arch.init.plt_shndx = i; > > > >It is initialized here, but that's not necessarily a bad thing. > > I think I added this line for consistency, but I actually don't think > it is needed. We only would need to keep the section index for > arch.core.plt then. Yes. I'd welcome a comment somewhere in both cases. Either that we initialize it just for consistency, or that we don't, because it's not needed. Miroslav