xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	wei.liu2@citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, Julien Grall <julien.grall@arm.com>,
	jbeulich@suse.com
Subject: [PATCH] xen/public: arch-arm: Restrict the visibility of struct vcpu_guest_core_regs
Date: Mon, 20 May 2019 19:12:50 +0100	[thread overview]
Message-ID: <20190520181250.17404-1-julien.grall@arm.com> (raw)

Currently, the structure vcpu_guest_core_regs is part of the public API.
This implies that any change in the structure should be backward
compatible.

However, the structure is only needed by the tools and Xen. It is also
not expected to be ever used outside of that context. So we could save us
some headache by only declaring the structure for Xen and tools.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    This is a follow-up of the discussion [1].

    As this is now Xen and tools only, I am wondering whether the check on
    GNU_C is still necessary. I am happy to send a follow-up patch (or fold
    in this one) if it can be removed.

    [1] <3c245c5b-51c6-1d0e-ad6c-42414573166f@arm.com>
---
 xen/include/public/arch-arm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index eb424e8286..e9a86d8eb8 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -197,6 +197,7 @@
     } while ( 0 )
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 /* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */
 # define __DECL_REG(n64, n32) union {          \
@@ -272,6 +273,8 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_core_regs_t);
 
 #undef __DECL_REG
 
+#endif
+
 typedef uint64_t xen_pfn_t;
 #define PRI_xen_pfn PRIx64
 #define PRIu_xen_pfn PRIu64
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	wei.liu2@citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, Julien Grall <julien.grall@arm.com>,
	jbeulich@suse.com
Subject: [Xen-devel] [PATCH] xen/public: arch-arm: Restrict the visibility of struct vcpu_guest_core_regs
Date: Mon, 20 May 2019 19:12:50 +0100	[thread overview]
Message-ID: <20190520181250.17404-1-julien.grall@arm.com> (raw)
Message-ID: <20190520181250.JYIG_tC2hPvrl9AwC0I3dXDRjRavoDUAI4F26P5FN0s@z> (raw)

Currently, the structure vcpu_guest_core_regs is part of the public API.
This implies that any change in the structure should be backward
compatible.

However, the structure is only needed by the tools and Xen. It is also
not expected to be ever used outside of that context. So we could save us
some headache by only declaring the structure for Xen and tools.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    This is a follow-up of the discussion [1].

    As this is now Xen and tools only, I am wondering whether the check on
    GNU_C is still necessary. I am happy to send a follow-up patch (or fold
    in this one) if it can be removed.

    [1] <3c245c5b-51c6-1d0e-ad6c-42414573166f@arm.com>
---
 xen/include/public/arch-arm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index eb424e8286..e9a86d8eb8 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -197,6 +197,7 @@
     } while ( 0 )
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 /* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */
 # define __DECL_REG(n64, n32) union {          \
@@ -272,6 +273,8 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_core_regs_t);
 
 #undef __DECL_REG
 
+#endif
+
 typedef uint64_t xen_pfn_t;
 #define PRI_xen_pfn PRIx64
 #define PRIu_xen_pfn PRIu64
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-05-20 18:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 18:12 Julien Grall [this message]
2019-05-20 18:12 ` [Xen-devel] [PATCH] xen/public: arch-arm: Restrict the visibility of struct vcpu_guest_core_regs Julien Grall
2019-05-21  9:26 ` Jan Beulich
2019-05-21  9:26   ` [Xen-devel] " Jan Beulich
2019-05-21  9:35   ` Julien Grall
2019-05-21  9:35     ` [Xen-devel] " Julien Grall
2019-05-21  9:43     ` Jan Beulich
2019-05-21  9:43       ` [Xen-devel] " Jan Beulich
2019-05-21  9:55       ` Julien Grall
2019-05-21  9:55         ` [Xen-devel] " Julien Grall
2019-05-21 21:06         ` Stefano Stabellini
2019-05-21 21:06           ` [Xen-devel] " Stefano Stabellini
2019-05-22 12:20         ` Julien Grall
2019-05-22 12:20           ` [Xen-devel] " Julien Grall
2019-05-22 12:29           ` Jan Beulich
2019-05-22 12:29             ` [Xen-devel] " Jan Beulich
2019-05-22 13:00             ` Julien Grall
2019-05-22 13:00               ` [Xen-devel] " Julien Grall
2019-05-22 18:05               ` Artem Mygaiev
2019-05-22 18:05                 ` [Xen-devel] " Artem Mygaiev
2019-06-02 10:37                 ` Julien Grall
2019-06-02 10:37                   ` [Xen-devel] " Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190520181250.17404-1-julien.grall@arm.com \
    --to=julien.grall@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).