From: Jan Kiszka <[email protected]>

JAILHOUSE_HVC_CODE is the same, most of the JAILHOUSE_CPU_STAT_VMEXITS_*
are, and when we move struct jailhouse_comm_region, we can save
COMM_REGION_COMMON_PLATFORM_INFO.

Signed-off-by: Jan Kiszka <[email protected]>
---
 include/arch/arm-common/asm/jailhouse_hypercall.h | 27 ++++++++++++++++++-----
 include/arch/arm/asm/jailhouse_hypercall.h        | 14 +-----------
 include/arch/arm64/asm/jailhouse_hypercall.h      | 14 +-----------
 3 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/include/arch/arm-common/asm/jailhouse_hypercall.h 
b/include/arch/arm-common/asm/jailhouse_hypercall.h
index aeab2816..6f2e0b30 100644
--- a/include/arch/arm-common/asm/jailhouse_hypercall.h
+++ b/include/arch/arm-common/asm/jailhouse_hypercall.h
@@ -36,10 +36,25 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */

-#define COMM_REGION_COMMON_PLATFORM_INFO       \
-       __u8 gic_version;                       \
-       __u8 padding[7];                        \
-       __u64 gicd_base;                        \
-       __u64 gicc_base;                        \
-       __u64 gicr_base;                        \
+#define JAILHOUSE_HVC_CODE             0x4a48
+
+/* CPU statistics, common part */
+#define JAILHOUSE_CPU_STAT_VMEXITS_MAINTENANCE JAILHOUSE_GENERIC_CPU_STATS
+#define JAILHOUSE_CPU_STAT_VMEXITS_VIRQ                
JAILHOUSE_GENERIC_CPU_STATS + 1
+#define JAILHOUSE_CPU_STAT_VMEXITS_VSGI                
JAILHOUSE_GENERIC_CPU_STATS + 2
+#define JAILHOUSE_CPU_STAT_VMEXITS_PSCI                
JAILHOUSE_GENERIC_CPU_STATS + 3
+#define JAILHOUSE_CPU_STAT_VMEXITS_SMCCC       JAILHOUSE_GENERIC_CPU_STATS + 4
+
+#ifndef __ASSEMBLY__
+
+struct jailhouse_comm_region {
+       COMM_REGION_GENERIC_HEADER;
+       __u8 gic_version;
+       __u8 padding[7];
+       __u64 gicd_base;
+       __u64 gicc_base;
+       __u64 gicr_base;
        __u32 vpci_irq_base;
+} __attribute__((packed));
+
+#endif /* !__ASSEMBLY__ */
diff --git a/include/arch/arm/asm/jailhouse_hypercall.h 
b/include/arch/arm/asm/jailhouse_hypercall.h
index 275d4891..aabd66ba 100644
--- a/include/arch/arm/asm/jailhouse_hypercall.h
+++ b/include/arch/arm/asm/jailhouse_hypercall.h
@@ -38,30 +38,18 @@

 #include "../arm-common/asm/jailhouse_hypercall.h"

-#define JAILHOUSE_HVC_CODE             0x4a48
-
 #define JAILHOUSE_CALL_INS             ".arch_extension virt\n\t" \
                                        "hvc #0x4a48"
 #define JAILHOUSE_CALL_NUM_RESULT      "r0"
 #define JAILHOUSE_CALL_ARG1            "r1"
 #define JAILHOUSE_CALL_ARG2            "r2"

-/* CPU statistics */
-#define JAILHOUSE_CPU_STAT_VMEXITS_MAINTENANCE JAILHOUSE_GENERIC_CPU_STATS
-#define JAILHOUSE_CPU_STAT_VMEXITS_VIRQ                
JAILHOUSE_GENERIC_CPU_STATS + 1
-#define JAILHOUSE_CPU_STAT_VMEXITS_VSGI                
JAILHOUSE_GENERIC_CPU_STATS + 2
-#define JAILHOUSE_CPU_STAT_VMEXITS_PSCI                
JAILHOUSE_GENERIC_CPU_STATS + 3
-#define JAILHOUSE_CPU_STAT_VMEXITS_SMCCC       JAILHOUSE_GENERIC_CPU_STATS + 4
+/* CPU statistics, arm-specific part */
 #define JAILHOUSE_CPU_STAT_VMEXITS_CP15                
JAILHOUSE_GENERIC_CPU_STATS + 5
 #define JAILHOUSE_NUM_CPU_STATS                        
JAILHOUSE_GENERIC_CPU_STATS + 6

 #ifndef __ASSEMBLY__

-struct jailhouse_comm_region {
-       COMM_REGION_GENERIC_HEADER;
-       COMM_REGION_COMMON_PLATFORM_INFO;
-} __attribute__((packed));
-
 static inline __u32 jailhouse_call(__u32 num)
 {
        register __u32 num_result asm(JAILHOUSE_CALL_NUM_RESULT) = num;
diff --git a/include/arch/arm64/asm/jailhouse_hypercall.h 
b/include/arch/arm64/asm/jailhouse_hypercall.h
index 9daa21fe..108d052f 100644
--- a/include/arch/arm64/asm/jailhouse_hypercall.h
+++ b/include/arch/arm64/asm/jailhouse_hypercall.h
@@ -38,28 +38,16 @@

 #include "../arm-common/asm/jailhouse_hypercall.h"

-#define JAILHOUSE_HVC_CODE             0x4a48
-
 #define JAILHOUSE_CALL_INS             "hvc #0x4a48"
 #define JAILHOUSE_CALL_NUM_RESULT      "x0"
 #define JAILHOUSE_CALL_ARG1            "x1"
 #define JAILHOUSE_CALL_ARG2            "x2"

-/* CPU statistics */
-#define JAILHOUSE_CPU_STAT_VMEXITS_MAINTENANCE JAILHOUSE_GENERIC_CPU_STATS
-#define JAILHOUSE_CPU_STAT_VMEXITS_VIRQ                
JAILHOUSE_GENERIC_CPU_STATS + 1
-#define JAILHOUSE_CPU_STAT_VMEXITS_VSGI                
JAILHOUSE_GENERIC_CPU_STATS + 2
-#define JAILHOUSE_CPU_STAT_VMEXITS_PSCI                
JAILHOUSE_GENERIC_CPU_STATS + 3
-#define JAILHOUSE_CPU_STAT_VMEXITS_SMCCC       JAILHOUSE_GENERIC_CPU_STATS + 4
+/* CPU statistics, arm64-specific part */
 #define JAILHOUSE_NUM_CPU_STATS                        
JAILHOUSE_GENERIC_CPU_STATS + 5

 #ifndef __ASSEMBLY__

-struct jailhouse_comm_region {
-       COMM_REGION_GENERIC_HEADER;
-       COMM_REGION_COMMON_PLATFORM_INFO;
-} __attribute__((packed));
-
 static inline __u64 jailhouse_call(__u64 num)
 {
        register __u64 num_result asm(JAILHOUSE_CALL_NUM_RESULT) = num;
--
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/9671ca54-64ff-f0f7-93bc-818c9a1dfeb8%40web.de.

Reply via email to