From patchwork Thu Mar 10 15:08:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12776541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC4ACC433EF for ; Thu, 10 Mar 2022 15:12:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.288430.489069 (Exim 4.92) (envelope-from ) id 1nSKS9-0006ti-OC; Thu, 10 Mar 2022 15:11:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 288430.489069; Thu, 10 Mar 2022 15:11:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nSKS9-0006tb-Kk; Thu, 10 Mar 2022 15:11:45 +0000 Received: by outflank-mailman (input) for mailman id 288430; Thu, 10 Mar 2022 15:11:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nSKS8-0006dy-PJ for xen-devel@lists.xenproject.org; Thu, 10 Mar 2022 15:11:44 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5d4ec551-a084-11ec-853a-5f4723681683; Thu, 10 Mar 2022 16:11:30 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5d4ec551-a084-11ec-853a-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646925103; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=GbMTP6W7ZSddYtznbDAcAhdWrF1w25AtQwobW6NsGfM=; b=MKBQIvblvB9IlNnBA6Kx+zQZAaCHAvrxtcqgARJxzV7OcKB+dVefL30+ EPolCaKqxUxpEsva5vrbt/sONIqIsoiyaxwO2qkyhikPdvLb4z3mHBX0h HiBKLBNXJatxlhbyC0eca34W3ZFlT9WoSlRKDDqq31X2OgH75D0Ur64Vq 0=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 65923548 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:6iso96Cd5V6QnBVW/zLjw5YqxClBgxIJ4kV8jS/XYbTApG501GAHy GJNXj2GPq3fN2L8ctp0bY/i8ktQ7ZPdzYAyQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Vg2tYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPht0 /x8r6KxZT0zHaTIt/xEfQBBCAZxaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bmJsUHs2xIxjDFF/c2B5vERs0m4PcGgWZq3Z0STZ4yY eIHU2VeSBrKQyZXI2wIMswGuf2yhSfGJmgwRF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8Ew7puxx16 pNwiawq4dXJQmoplWz2/H4EzVR0makq3srluAey1ZFV5EFVbNXpYsDuGtIDZY7Gj7g4oxPKp gjMCjl3ocWTbqmVQGYgoE2q+bcHUjbXy32D3Tqg/blnQS/xxtCvgklLM92pAZ1yHtycegA2w 3+CNUaqFh/dL5nUUtDPpZyfSLOMB20ffvtChPlHb21LtBPB5ryw6SHlYndotvaPKA18A== X-IronPort-AV: E=Sophos;i="5.90,171,1643691600"; d="scan'208";a="65923548" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NIg/p07TqaXhi2rotEG8q51luUv+aJqcI0NRkE9s4qB7suMjtO0jeUE1/p3F9fKHZiLDAx1U5VCt+TraQThbf8tuVTgujg97bXCPlF+4Ze/8BwKOn5q7uJff5hfYjNX5PqNeUO23PnTN/qI0e61t9bZe6yTqSfxygNwRqC7KTmDfUcY7ehasFtr9A0HVG59/U57N12sZou3dP8Fbc392eoAnbL7uFJ3keTeCPRLmdoo/2VxUogfU12tlZsWaVyTKLyrIdroPiZYvV6gE5TN95/zMxlpbUcCuK80u6LuwVAZMgnTtrLRH9/mUEoG03gjwYSbEWn5Ifh6tYiwrIZzZng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KPIrQ2uUJcoC3uPyB57aRxa3Wp1cquKb0s6A4/jRqUY=; b=NxmmD28ZgdFk2qdxSDGlXXzZE2AVaTxY0YOzbehPxsdl0NJM6ugm3nr0KsxNRe9J0+wP5y+11kAD55zGnhImn3tAUsn9PDY0Es52lHIqCvMjI/w2FGKyALaGcTqyMW+uXblWFRMn5sLvGWcWwJKb1cPemIzzKeVAb3YUT/rZYxWMaRwFFkrUXzLLwsprh/dkTRKroihr33LHgBLFlyPLxeEzPopWUAuurVlV3Mbhva/NuBoKJ3YtXGlDQ8Xou+8K++uBK8Cw61WgDG5d/HQteC5f9HLOuWVsxqg+DP7dxXeZUnmzeJo5nWeTYrfewvcj24qAlho1v+MYJVBxtD/xJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KPIrQ2uUJcoC3uPyB57aRxa3Wp1cquKb0s6A4/jRqUY=; b=QGai4kAFlCO+1qSsnDHmBEwrqiZoN230hf/xbLPkBtAQFw2fW8qew5S3O0n+ybTdYYKZhvAWIC4Qvn6zvpIEYgnnY8zCyr4rpv8fj1a1Mzup9cKbdxM3yMCH4QOW9jACpIhibsF/p4CnadM/mbZk9E9ceK0vtJF3NzW39z4XQAg= From: Roger Pau Monne To: CC: Konrad Rzeszutek Wilk , Ross Lagerwall , , Roger Pau Monne Subject: [PATCH 1/3] livepatch: use basename to perform object file matching Date: Thu, 10 Mar 2022 16:08:32 +0100 Message-ID: <20220310150834.98815-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220310150834.98815-1-roger.pau@citrix.com> References: <20220310150834.98815-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P123CA0061.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::25) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e61a2442-5848-46eb-d87a-08da02a846fa X-MS-TrafficTypeDiagnostic: BYAPR03MB3624:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B/iuhW7NSgEXq6ixZHL7SLTuDBhtYdLTHUANRQjw5n4cBnJvTHO8CBtHJBwY2eqUIhQ66gUdlRWsHf7czj0h91LN6I8b0+xprDeGMchYnYlazS42LLVX0oiDoC1EC4loGExjkOxtEOAdP5gfojyZXi4hXG2vKOUyNz+dBiQFSZr61sAxR9RvIXmlUnuSftaAhznIINwtoTey88KEiFXm2a3Zj9qFoPPForBogDyI5sLpcKOO9Y5QjtJUBFUmyhXaU2D0dINmOtAP8fCYArlViO4dEh/xMqQBXp+ZvzfjIhXBWkN69tNMPGrp3ELIYjVWpZhAVYD7xfFrtqNzGzkhqcXjDiiUWNcbMnhquteTDo3hjeKypSgIuk8Cnt0N2bvr/TdLwJN15LbYK26wAGVNw56nSGpS+bHV77EkH3fXWwHyWTJREF0YqyIkh0U+zjBkms0Ee4n14tDC41swMCaHgaPUcU+v5Jfoi7npvfGUo//5C+eHXj/Bpe8PGwS9k7r6yPCLZ8WJcj5k6tsWZzJ6rUeu6LBA6S9uUTDiMGWyCR0OlwuCj5VetwU16HsLnwx9nIfl9TvtDVhnmh3rIwFOKhr2bhYfXQwJ41vAnGKb8nLuESV64uiYEinF+0vtf4PTYi0ZGaKQn8jZIOOVMV01cw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6512007)(186003)(2616005)(26005)(1076003)(86362001)(38100700002)(107886003)(5660300002)(6506007)(2906002)(6666004)(66556008)(8676002)(4326008)(66946007)(66476007)(6486002)(36756003)(316002)(54906003)(6916009)(82960400001)(8936002)(508600001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HsBqO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6SIR/HA8o6cbb2gDFx?= =?utf-8?q?P4lb67+e5M7cfg1uDbI8N7wOIemzqoC7b0KEMOCX7rZN8D4C0z31w9OGJH/reC51w?= =?utf-8?q?ISwxnO8hcJuxKskyzHM+ojKkndaR5CmpQc1USBTPcgLv4rRemoBZ2LfnPd8gpN4v8?= =?utf-8?q?fYZLIjVKXzFLUJiUo0pDEfq54+VYXh9V+zfIqy/QWLe4o0MpJyIbdSOhzrwt9Wzhq?= =?utf-8?q?kaEIM0LRnxXlWtg6fQIB6ikO6dOMDnXVkkAk4Q5eLzHdMMqDRLAvVu1RV2mxrxchj?= =?utf-8?q?tKJkZ0QBh1LEo6uicHnMo+FDhTkPfpQg5X6a4twgKeR41vQGs2OlywzzsVZzF0YZR?= =?utf-8?q?0CCZiDHEMSMzf90u6+wLdduBDityu00j1D/BlKV0xRWNijPI1nGQ+go1HGMrgxCal?= =?utf-8?q?w4EPHmNppNuRbaGHdAxkVTRyHyn5tD5qMkNOxVXJU6k1Jtm+8vIitEdT8Y4Q9xWPf?= =?utf-8?q?F05IA6iz7HubBmZicyy2e/RZ2ghoXY5tnqUVVp2OR2+S5VmRsMaSvYr13DKto9jOs?= =?utf-8?q?Pk/MT+AY5YvEPduuuR3T0qxcT3Ua7OTOc56w2MiSZGEk9egKXn/PbcP3R+e+UOpjn?= =?utf-8?q?q8+eg3ZYQN68aWTEI5+BNweYCCrdtgNwO86MI/a900VfhPY63KrXg8/ETW1fMuNiz?= =?utf-8?q?FjZO5mHWOweYosJ81QAnKaSXChK8JduK0VhlCHEKQM53P0/4bKLjnAw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: e61a2442-5848-46eb-d87a-08da02a846fa X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2022 15:11:39.5906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OOV7jaF6TLwjlpO7RBw0EMBLWxs5v0aK/J+Xe8cZAsvSiGsnXW5dclJRqF8NCNs9dgJO5CF4Yhz4F3t7PBWHgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB3624 X-OriginatorOrg: citrix.com The changes in the Xen build logic has resulted in the compiler and objcopy being called from xen/ instead of relative to each object directory. This requires using basename so that the directory is not taken into account when checking against the list of files to be explicitly ignored. Also adjust the paths used to store the differing object files, as with the current logic the resulting path will be wrong when using newer Xen versions, changed_objs would end containing entries like: xen/arch/x86/hvm/vmx/arch/x86/hvm/vmx/vmx.o Signed-off-by: Roger Pau Monné Reviewed-by: Bjoern Doebel --- livepatch-gcc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/livepatch-gcc b/livepatch-gcc index 91333d5..fe782e0 100755 --- a/livepatch-gcc +++ b/livepatch-gcc @@ -32,10 +32,10 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then if [ "$1" = "-o" ]; then obj=$2 [[ $2 = */.tmp_*.o ]] && obj=${2/.tmp_/} - case "$obj" in + case "$(basename $obj)" in version.o|\ debug.o|\ - efi/check.o|\ + check.o|\ *.xen-syms.*.o|\ *.xen.efi.*.o|\ built_in.o|\ @@ -46,6 +46,7 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then *.o) path="$(pwd)/$(dirname $obj)" dir="${path#$LIVEPATCH_BUILD_DIR}" + obj=$(basename $obj) if [ -n "$LIVEPATCH_CAPTURE_DIR" -a -d "$LIVEPATCH_CAPTURE_DIR" ]; then echo "$dir/$obj" >> "${LIVEPATCH_CAPTURE_DIR}/changed_objs" keep=yes @@ -61,15 +62,16 @@ if [[ "$TOOLCHAINCMD" =~ $GCC_RE ]] ; then done elif [[ "$TOOLCHAINCMD" =~ $OBJCOPY_RE ]] ; then obj="${!#}" - case "$obj" in + case "$(basename $obj)" in version.o|\ debug.o|\ - efi/check.o|\ + check.o|\ .*.o) ;; *.o) path="$(pwd)/$(dirname $obj)" dir="${path#$LIVEPATCH_BUILD_DIR}" + obj=$(basename $obj) if [ -n "$LIVEPATCH_CAPTURE_DIR" -a -d "$LIVEPATCH_CAPTURE_DIR" ]; then echo "$dir/$obj" >> "${LIVEPATCH_CAPTURE_DIR}/changed_objs" keep=yes @@ -85,7 +87,7 @@ ret="$?" if [[ "$keep" = "yes" ]] ; then mkdir -p "$(dirname $LIVEPATCH_CAPTURE_DIR/$dir/$obj)" - cp "$obj" "$LIVEPATCH_CAPTURE_DIR/$dir/$obj" + cp "$path/$obj" "$LIVEPATCH_CAPTURE_DIR/$dir/$obj" fi exit "$ret"