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

compat code lacks support for __attribute__


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Wed, 14 Jun 2023 10:43:58 +0200
  • Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1686732245; s=strato-dkim-0002; d=strato.com; h=Message-ID:Subject:To:From:Date:Cc:Date:From:Subject:Sender; bh=feGxpcqc2SUWbawaHYkxho7w62lCWXe/X00TfFDE8RA=; b=UAIh18N/dbYmZKUzYGggnxiWR+9R+jaxqefjg+YD5XeiD48yYeFFX6sqBcDy/uNR37 M7uQlE9+P5wqbHPhwAQYPWJhmZb2X0sy2liK5xen9L+aUOo/Rfq1N3Yio0PFtthbn1Cr VIqWRBCrs8FwuZQzwykZsshfDtzXhWLUYeDU0iHn2TDbcUS64MEvQ4yC8jGeRQwP81cw irt8JhJ8rVrHT6ZTP/6CotSdSUX4NaFVAedqRm63oqT6VLgYsFtHkaM56SeblfxjyDJt jyR7P1NCqyV7OfPVmmoUSRjRx/eI6o3usxZclzTZky1pfV1W0SWnQAIBHO3ck1ZHgGlt Y8iQ==
  • Arc-seal: i=1; a=rsa-sha256; t=1686732245; cv=none; d=strato.com; s=strato-dkim-0002; b=mFhYt+eQVW2Joa+AdEWNc24kP9hRLrcmduKO75xNGZMSdvPHlKB3RkF9hDA0i2+wd/ eCIj2JsFXytlOGfvZjR7pbrdSJS0TPZoV9E18bGU7a+yj1iqt9osVit4lX/TE9WrjITY N8gI2jC5V4HgwhPkn8oCsKulaYN8m1cBHssn+xUgzteBeF2CMgiD0Y82m7Of0yHU0CFG 2kXwIGyukm0LUTKBtn+v1ubprmHO0Jw5KGFn4SfjiDIoE8ERRe3/pHdVxs0Crw1lmHYO OUaoTh7ZxwiWBrXVprVffFulNUH6AwhfbQ6LQ+9W8I2tiRVoxCj5AtS3sfQV/lRVvrdo ojDg==
  • Delivery-date: Wed, 14 Jun 2023 08:44:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

I would like to share code between the hypervisor and xenalyze, so that
every definition comes from a single place and is not duplicated in xen
and xenalyze. This works as long as simple constructs like struct x {};
are used. Depending on the data to be stored into the trace buffer, having
support for __packed may reduce the amount of data that need to be copied.

The tooling currently converts ___attribute__ into compat___attribute__.
Was support for __attribute__ intentionally left out, or was there just
no usecase for it?


Olaf

+++ b/xen/include/public/trace.h
@@ -80,6 +80,14 @@
 #define TRC_LOST_RECORDS        (TRC_GEN + 1)
 #define TRC_TRACE_WRAP_BUFFER  (TRC_GEN + 2)
 #define TRC_TRACE_CPU_CHANGE    (TRC_GEN + 3)
+#define TRC_a (TRC_GEN + 123)
+struct __attribute__((__packed__)) trc_a {
+    unsigned a;
+};
+#define TRC_b (TRC_GEN + 321)
+typedef struct __attribute__((__packed__)) trc_b {
+    unsigned b;
+} trc_b_t;
 
 #define TRC_SCHED_RUNSTATE_CHANGE   (TRC_SCHED_MIN + 1)
 #define TRC_SCHED_CONTINUE_RUNNING  (TRC_SCHED_MIN + 2)

Attachment: pgpmsQpgNcp4i.pgp
Description: Digitale Signatur von OpenPGP


 


Rackspace

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