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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77A2EC433F5 for ; Fri, 5 Nov 2021 14:24:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 326836044F for ; Fri, 5 Nov 2021 14:24:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 326836044F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=apertussolutions.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.222429.384610 (Exim 4.92) (envelope-from ) id 1mj08p-0007WO-J4; Fri, 05 Nov 2021 14:24:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 222429.384610; Fri, 05 Nov 2021 14:24:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mj08p-0007WH-FU; Fri, 05 Nov 2021 14:24:27 +0000 Received: by outflank-mailman (input) for mailman id 222429; Fri, 05 Nov 2021 14:24:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mj08o-0007W4-26 for xen-devel@lists.xenproject.org; Fri, 05 Nov 2021 14:24:26 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 123d17b8-3e44-11ec-9787-a32c541c8605; Fri, 05 Nov 2021 15:24:24 +0100 (CET) Received: from [172.20.51.40] (50.216.66.194 [50.216.66.194]) by mx.zohomail.com with SMTPS id 1636122257858344.84417735095747; Fri, 5 Nov 2021 07:24:17 -0700 (PDT) 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: 123d17b8-3e44-11ec-9787-a32c541c8605 ARC-Seal: i=1; a=rsa-sha256; t=1636122261; cv=none; d=zohomail.com; s=zohoarc; b=jnxG/rsByc0XvpNG7AYPU0jEArlHFJ0HZ4wJhARrdSMrAg7HDRr84vSTfA5g6OK5ROUfh7iDvdOZED5gk3rkSvoGlfQ7smxMq5fB5VOBOxQXCfHM+rQT7u14bMuhUmzEecym9NyEQGpirUbNqlNsgqOSudjPMNodRG15zB9IihU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636122261; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ejx6XTr8UJAJxOcAsUPXtPka4YA3F0nyBW6RZkn0wM4=; b=EiFi4UuF7GYiN/UbPL4V/pWvobhusmBD3PwGG7tpIwVa7uadVyPU+XpB8eL6WbzjuIg49M3RtM2QMqzKxLyzhIQvCno0Vy5sRCGdJ9oJqvUGiRY3IYk2JUACPYST8GZkjdGKBaDrTZtJBa100o2rI9zAWiik9BlTtTFmDJRQ+hE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1636122261; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=ejx6XTr8UJAJxOcAsUPXtPka4YA3F0nyBW6RZkn0wM4=; b=aaydQ4z6/IHw2iq6ZB/ftumrfyR9c7roIm7VKUw5AhB8kirlZAH8VYljsCj+0R8t 8u3vnhMtQ2x9CoC1EdEc6dYC38RqOsJEkFXfGerba2vfWrIILJkAmy8Q9hlGCm+tBnP TqT1oEo3PVcDQdPZQeNc/OIxSY563JPDCxJT/R44= Subject: Re: [PATCH 4/5] xen/xsm: Improve fallback handling in xsm_fixup_ops() To: Andrew Cooper , Xen-devel Cc: Daniel De Graaf References: <20211105135555.24261-1-andrew.cooper3@citrix.com> <20211105135555.24261-5-andrew.cooper3@citrix.com> From: "Daniel P. Smith" Message-ID: Date: Fri, 5 Nov 2021 10:22:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211105135555.24261-5-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ZohoMailClient: External On 11/5/21 9:55 AM, Andrew Cooper wrote: > The current xsm_fixup_ops() is just shy of a full page when compiled, and very > fragile to NULL function pointer errors. > > Address both of these issues with a minor piece of structure (ab)use. > Introduce dummy_ops, and fixup the provided xsm_ops pointer by treating both > as an array of unsigned longs. > > The compiled size improvement speaks for itself: > > $ ../scripts/bloat-o-meter xen-syms-before xen-syms-after > add/remove: 1/0 grow/shrink: 0/1 up/down: 712/-3897 (-3185) > Function old new delta > dummy_ops - 712 +712 > xsm_fixup_ops 3987 90 -3897 > > and there is an additional safety check that will make it obvious during > development if there is an issue with the fallback handling. > > Signed-off-by: Andrew Cooper > --- > CC: Daniel De Graaf > CC: Daniel Smith Reviewed-by: Daniel P. Smith