From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
Stefano.Stabellini@eu.citrix.com, will.deacon@arm.com,
catalin.marinas@arm.com, Ian.Campbell@citrix.com,
konrad.wilk@oracle.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH RFC 4/6] arm64/xen: introduce asm/hypervisor.h and sys_bitops.h
Date: Thu, 30 May 2013 17:18:31 +0100 [thread overview]
Message-ID: <1369930713-6063-4-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305301705500.4799@kaball.uk.xensource.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
arch/arm64/include/asm/hypervisor.h | 6 ++++++
arch/arm64/include/asm/sync_bitops.h | 26 ++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)
create mode 100644 arch/arm64/include/asm/hypervisor.h
create mode 100644 arch/arm64/include/asm/sync_bitops.h
diff --git a/arch/arm64/include/asm/hypervisor.h b/arch/arm64/include/asm/hypervisor.h
new file mode 100644
index 0000000..b90d9e5
--- /dev/null
+++ b/arch/arm64/include/asm/hypervisor.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_ARM_HYPERVISOR_H
+#define _ASM_ARM_HYPERVISOR_H
+
+#include <asm/xen/hypervisor.h>
+
+#endif
diff --git a/arch/arm64/include/asm/sync_bitops.h b/arch/arm64/include/asm/sync_bitops.h
new file mode 100644
index 0000000..8da0bf4
--- /dev/null
+++ b/arch/arm64/include/asm/sync_bitops.h
@@ -0,0 +1,26 @@
+#ifndef __ASM_SYNC_BITOPS_H__
+#define __ASM_SYNC_BITOPS_H__
+
+#include <asm/bitops.h>
+#include <asm/cmpxchg.h>
+
+/* sync_bitops functions are equivalent to the SMP implementation of the
+ * original functions, independently from CONFIG_SMP being defined.
+ *
+ * We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
+ * under Xen you might be communicating with a completely external entity
+ * who might be on another CPU (e.g. two uniprocessor guests communicating
+ * via event channels and grant tables). So we need a variant of the bit
+ * ops which are SMP safe even on a UP kernel.
+ */
+
+#define sync_set_bit(nr, p) set_bit(nr, p)
+#define sync_clear_bit(nr, p) clear_bit(nr, p)
+#define sync_change_bit(nr, p) change_bit(nr, p)
+#define sync_test_and_set_bit(nr, p) test_and_set_bit(nr, p)
+#define sync_test_and_clear_bit(nr, p) test_and_clear_bit(nr, p)
+#define sync_test_and_change_bit(nr, p) test_and_change_bit(nr, p)
+#define sync_test_bit(nr, addr) test_bit(nr, addr)
+#define sync_cmpxchg cmpxchg
+
+#endif
--
1.7.2.5
next prev parent reply other threads:[~2013-05-30 16:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 16:18 [PATCH RFC 0/6] Introduce Xen support to ARM64 Stefano Stabellini
2013-05-30 16:18 ` [PATCH RFC 1/6] [HACK!] arm64/xen: create links to arch/arm include files and Xen code Stefano Stabellini
2013-05-31 10:36 ` Catalin Marinas
2013-05-31 12:02 ` Stefano Stabellini
2013-05-31 13:10 ` Catalin Marinas
2013-05-31 15:20 ` Stefano Stabellini
2013-05-30 16:18 ` [PATCH RFC 2/6] arm64/xen: arm/xen header changes to compile on arm64 Stefano Stabellini
2013-05-31 10:43 ` Catalin Marinas
2013-05-31 13:25 ` Stefano Stabellini
2013-05-30 16:18 ` [PATCH RFC 3/6] arm64/xen: use XEN_IO_PROTO_ABI_ARM on ARM64 Stefano Stabellini
2013-05-30 16:18 ` Stefano Stabellini [this message]
2013-05-30 16:18 ` [PATCH RFC 5/6] arm64/xen: implement xen_remap on arm64 Stefano Stabellini
2013-05-31 10:59 ` Catalin Marinas
2013-05-31 13:21 ` Stefano Stabellini
2013-05-31 14:16 ` Catalin Marinas
2013-05-31 14:50 ` Stefano Stabellini
2013-05-31 15:23 ` Stefano Stabellini
2013-05-31 15:56 ` Catalin Marinas
2013-05-30 16:18 ` [PATCH RFC 6/6] arm64/xen: introduce CONFIG_XEN and hypercall.S on ARM64 Stefano Stabellini
2013-05-31 11:02 ` Catalin Marinas
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=1369930713-6063-4-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=catalin.marinas@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will.deacon@arm.com \
--cc=xen-devel@lists.xensource.com \
/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).