All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@arm.com>
To: xen-devel@lists.xenproject.org
Cc: julien@xen.org, andrew.cooper3@citrix.com, amc96@cam.ac.uk
Subject: [XTF 1/4] xtf: Perform misc code cleanup
Date: Wed, 10 Mar 2021 11:43:32 +0100	[thread overview]
Message-ID: <20210310104335.14855-2-michal.orzel@arm.com> (raw)
In-Reply-To: <20210310104335.14855-1-michal.orzel@arm.com>

-define macro ALIGN to set alignment:
Header file asm_macros.h should not contain
architecture specific code. Replace hardcoded
alignment value with a call to macro ALIGN.

-move declaration of shared_info into xtf/traps.h:
Declaration of shared_info structure should be
placed in xtf/traps.h as it is a common declaration
for all the possible architectures.

-do not protect including <arch/barrier.h>
We should always include <arch/barrier.h> and rely
on the compiler to throw an error. This would avoid
increasing #if protection each time we would add
a new architecture.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
---
 arch/x86/include/arch/asm_macros.h | 2 ++
 arch/x86/include/arch/traps.h      | 1 -
 include/xtf/asm_macros.h           | 2 +-
 include/xtf/barrier.h              | 4 ----
 include/xtf/traps.h                | 2 ++
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/arch/asm_macros.h b/arch/x86/include/arch/asm_macros.h
index e12e1ba..1aabed5 100644
--- a/arch/x86/include/arch/asm_macros.h
+++ b/arch/x86/include/arch/asm_macros.h
@@ -15,6 +15,8 @@
 # define __ASM_CODE_RAW(x) #x
 #endif
 
+#define ALIGN .align 16
+
 /* Select between two variations based on compat or long mode. */
 #ifdef __i386__
 # define __ASM_SEL(c, l)     __ASM_CODE(c)
diff --git a/arch/x86/include/arch/traps.h b/arch/x86/include/arch/traps.h
index 0c6888b..60fc3a4 100644
--- a/arch/x86/include/arch/traps.h
+++ b/arch/x86/include/arch/traps.h
@@ -57,7 +57,6 @@ extern uint8_t user_stack[PAGE_SIZE];
 
 extern xen_pv_start_info_t *pv_start_info;
 extern xen_pvh_start_info_t *pvh_start_info;
-extern shared_info_t shared_info;
 
 /*
  * Parameters for fine tuning the exec_user_*() behaviour.
diff --git a/include/xtf/asm_macros.h b/include/xtf/asm_macros.h
index 5484f7c..c531355 100644
--- a/include/xtf/asm_macros.h
+++ b/include/xtf/asm_macros.h
@@ -25,7 +25,7 @@
  * @param name Function name.
  */
 #define ENTRY(name)                             \
-    .align 16;                                  \
+    ALIGN;                                      \
     GLOBAL(name)
 
 /**
diff --git a/include/xtf/barrier.h b/include/xtf/barrier.h
index b526fe1..3b02d49 100644
--- a/include/xtf/barrier.h
+++ b/include/xtf/barrier.h
@@ -1,11 +1,7 @@
 #ifndef XTF_BARRIER_H
 #define XTF_BARRIER_H
 
-#if defined(__x86_64__) || defined (__i386__)
 # include <arch/barrier.h>
-#else
-# error Bad architecture
-#endif
 
 #endif /* XTF_BARRIER_H */
 
diff --git a/include/xtf/traps.h b/include/xtf/traps.h
index 8fc66af..4081db6 100644
--- a/include/xtf/traps.h
+++ b/include/xtf/traps.h
@@ -6,6 +6,8 @@
 
 #include <arch/traps.h>
 
+extern shared_info_t shared_info;
+
 /**
  * May be implemented by a guest to provide custom exception handling.
  */
-- 
2.29.0



  reply	other threads:[~2021-03-10 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 10:43 [XTF 0/4] Port XTF to arm64 and arm32 Michal Orzel
2021-03-10 10:43 ` Michal Orzel [this message]
2021-03-10 10:43 ` [XTF 2/4] build: Modify build system to support multiple architectures Michal Orzel
2021-03-10 10:43 ` [XTF 3/4] arm: Add initial architecture code for arm64 and arm32 Michal Orzel
2021-03-10 10:43 ` [XTF 4/4] arm: Add build support for arm64/arm32 Michal Orzel

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=20210310104335.14855-2-michal.orzel@arm.com \
    --to=michal.orzel@arm.com \
    --cc=amc96@cam.ac.uk \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.