Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1109302pxb; Wed, 16 Feb 2022 11:12:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyLtw6D+7d//EiHx4GIMnM8mw7pmDJXYzJ3pj9Q8uyiRwvyMRvIjLCwg9DMVdy/lPJbtpv X-Received: by 2002:a17:902:eac5:b0:149:fccf:1cf3 with SMTP id p5-20020a170902eac500b00149fccf1cf3mr3933102pld.77.1645038758608; Wed, 16 Feb 2022 11:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645038758; cv=none; d=google.com; s=arc-20160816; b=FVGTPX1Edv23NkeUwv4S8koh1uTsNfymQP8cHGstONnP7J8p2P7YjijKAKQkPNpC8F SM+SwQOkckvVKqu5Teol6asdiDoqWZ5l2Ra8sXxZ8/rbGH3aelyANGzzTc8vP3I1GzHS GXO1MMyn5kh/k/t63DXTpvHaJoeZEecvKZYqqmH9ieVTVfc5BNQx2aOmjcnMbDV3dmJf e7MuUrUzFudOx17HriUH9KoddbWqgkxuByvavCOPYqsdXj2QBW5ZTfH0QwT2sqOeLK+4 hcyiiXaMR7UHsfCgDJfqHOHldHiKbzV4tz1tfHY9TwXrdFtdMsmNcNcHtUmMDpTh4JZb Jsbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=YTqgL2GGRiZHrJiJS8+mQlW1sq4ttz1z3qBJQG2OejY=; b=QA3+DGJ3/suxX6Roi7/edsrFylJVSenKkKlmo/kiYTcqN9DvFCyc75rjjE5DMr9h+s Vg6As7cwpzUWtWabtZy0iRPvBFrPG1xs4R0tf/H7YL9bv0MnMMT0rZnAjL0q2vTuBrDQ CZ4h7El3tlVUYyQxz1dmtXAExr5GRCB9Zmi+QrVgjxjMQR3415NZ9058QLEB7WljJIAW 54WmO2Yg5zaN70+W5Sl892CNnnq+sSK54xXKNF6xHlX7RpV/co50/SQ+j4RdC253gbme s7T3l2UkNGmLAUdnxxhnwpt5cNU9SFM8w6IucqQNLujifQdAAeFvU2IyFM/GpHmbQtsw eELw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Vvqpy/MG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11si18601606plg.205.2022.02.16.11.12.21; Wed, 16 Feb 2022 11:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Vvqpy/MG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236754AbiBPQ4b (ORCPT + 99 others); Wed, 16 Feb 2022 11:56:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233885AbiBPQ4b (ORCPT ); Wed, 16 Feb 2022 11:56:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CFA26294105 for ; Wed, 16 Feb 2022 08:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645030577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YTqgL2GGRiZHrJiJS8+mQlW1sq4ttz1z3qBJQG2OejY=; b=Vvqpy/MG4ZVhFg7W1pPSuxeDm5QB43CfwWxINmXRghaVdW+uBJ7zZPnL8zFn6yI6H73zx+ BCx1td6EtUug2tHcvh5PsEaxTWNboBEGE2vLgobD3o5LPrfgt4w72pDTmihk48Mzt0JXEq wEw82hwPA1dlVUoyt+pWZ9XqvLzQGbk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-359-nDkGpOFbMa6vpwcU0hx26Q-1; Wed, 16 Feb 2022 11:56:16 -0500 X-MC-Unique: nDkGpOFbMa6vpwcU0hx26Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA23C2F25; Wed, 16 Feb 2022 16:56:14 +0000 (UTC) Received: from redhat.com (unknown [10.22.8.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59F8278AA7; Wed, 16 Feb 2022 16:56:14 +0000 (UTC) Date: Wed, 16 Feb 2022 11:56:12 -0500 From: Joe Lawrence To: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [RFC PATCH v6 03/12] livepatch: Add klp-convert tool Message-ID: References: <20220216163940.228309-1-joe.lawrence@redhat.com> <20220216163940.228309-4-joe.lawrence@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220216163940.228309-4-joe.lawrence@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 16, 2022 at 11:39:31AM -0500, Joe Lawrence wrote: > diff --git a/include/uapi/linux/livepatch.h b/include/uapi/linux/livepatch.h > index e19430918a07..2ee98e985c2a 100644 > --- a/include/uapi/linux/livepatch.h > +++ b/include/uapi/linux/livepatch.h > @@ -9,7 +9,17 @@ > #ifndef _UAPI_LIVEPATCH_H > #define _UAPI_LIVEPATCH_H > > +#include > + > #define KLP_RELA_PREFIX ".klp.rela." > #define KLP_SYM_PREFIX ".klp.sym." > > +struct klp_module_reloc { > + union { > + void *sym; > + __u64 sym64; /* Force 64-bit width */ > + }; > + __u32 sympos; > +} __packed; > + > > [ ... snip ... ] > > diff --git a/scripts/livepatch/klp-convert.h b/scripts/livepatch/klp-convert.h > new file mode 100644 > index 000000000000..35b9dc4e32c4 > --- /dev/null > +++ b/scripts/livepatch/klp-convert.h > > [ ... snip ... ] > > +struct klp_module_reloc { > + union { > + void *sym; > + uint64_t sym64; /* Force 64-bit width */ > + }; > + uint32_t sympos; > +} __packed; This was a hack I added to force a consistent width for the symbol pointer in case the user was building for 32-bit. The actual void *sym64 value itself is not so interesting as it's only needed for the compiler to create a relocation (later resolved by klp-convert). That said, sympos is used by klp-convert, and I bet it's not endian-safe here. Better suggestions welcome :) -- Joe