[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/5] xen/xsm: Improve fallback handling in xsm_fixup_ops()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 5 Nov 2021 10:22:07 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • 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-seal: i=1; a=rsa-sha256; t=1636122261; cv=none; d=zohomail.com; s=zohoarc; b=jnxG/rsByc0XvpNG7AYPU0jEArlHFJ0HZ4wJhARrdSMrAg7HDRr84vSTfA5g6OK5ROUfh7iDvdOZED5gk3rkSvoGlfQ7smxMq5fB5VOBOxQXCfHM+rQT7u14bMuhUmzEecym9NyEQGpirUbNqlNsgqOSudjPMNodRG15zB9IihU=
  • Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 05 Nov 2021 14:24:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <andrew.cooper3@xxxxxxxxxx>
---
CC: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
CC: Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>


Reviewed-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.