From: Paul Mackerras <paulus@ozlabs.org>
To: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: kvm-ppc@vger.kernel.org
Subject: [PATCH 01/13] powerpc: Add simple cache inhibited MMIO accessors
Date: Fri, 19 Aug 2016 15:35:45 +1000 [thread overview]
Message-ID: <1471584957-21484-2-git-send-email-paulus@ozlabs.org> (raw)
In-Reply-To: <1471584957-21484-1-git-send-email-paulus@ozlabs.org>
From: Suresh Warrier <warrier@linux.vnet.ibm.com>
Add simple cache inhibited accessors for memory mapped I/O.
Unlike the accessors built from the DEF_MMIO_* macros, these
don't include any hardware memory barriers, callers need to
manage memory barriers on their own. These can only be called
in hypervisor real mode.
Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
[paulus@ozlabs.org - added line to comment]
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
arch/powerpc/include/asm/io.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 2fd1690..f6fda84 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -241,6 +241,35 @@ static inline void out_be64(volatile u64 __iomem *addr, u64 val)
#endif
#endif /* __powerpc64__ */
+
+/*
+ * Simple Cache inhibited accessors
+ * Unlike the DEF_MMIO_* macros, these don't include any h/w memory
+ * barriers, callers need to manage memory barriers on their own.
+ * These can only be used in hypervisor real mode.
+ */
+
+static inline u32 _lwzcix(unsigned long addr)
+{
+ u32 ret;
+
+ __asm__ __volatile__("lwzcix %0,0, %1"
+ : "=r" (ret) : "r" (addr) : "memory");
+ return ret;
+}
+
+static inline void _stbcix(u64 addr, u8 val)
+{
+ __asm__ __volatile__("stbcix %0,0,%1"
+ : : "r" (val), "r" (addr) : "memory");
+}
+
+static inline void _stwcix(u64 addr, u32 val)
+{
+ __asm__ __volatile__("stwcix %0,0,%1"
+ : : "r" (val), "r" (addr) : "memory");
+}
+
/*
* Low level IO stream instructions are defined out of line for now
*/
--
2.8.1
next prev parent reply other threads:[~2016-08-19 5:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 5:35 [PATCH 00/13] Real-mode acceleration of device interrupts in HV KVM Paul Mackerras
2016-08-19 5:35 ` Paul Mackerras [this message]
2016-08-19 5:35 ` [PATCH 02/13] KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function Paul Mackerras
2016-08-19 5:35 ` [PATCH 03/13] KVM: PPC: select IRQ_BYPASS_MANAGER Paul Mackerras
2016-08-19 5:35 ` [PATCH 04/13] KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap Paul Mackerras
2016-08-19 5:35 ` [PATCH 05/13] powerpc/powernv: Provide facilities for EOI, usable from real mode Paul Mackerras
2016-08-19 5:35 ` [PATCH 06/13] KVM: PPC: Book3S HV: Enable IRQ bypass Paul Mackerras
2016-08-19 5:35 ` [PATCH 07/13] KVM: PPC: Book3S HV: Handle passthrough interrupts in guest Paul Mackerras
2016-09-12 0:53 ` [PATCH v2 " Paul Mackerras
2016-08-19 5:35 ` [PATCH 08/13] KVM: PPC: Book3S HV: Complete passthrough interrupt in host Paul Mackerras
2016-08-19 5:35 ` [PATCH 09/13] KVM: PPC: Book3S HV: Dump irqmap in debugfs Paul Mackerras
2016-08-19 5:35 ` [PATCH 10/13] KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass Paul Mackerras
2016-08-19 5:35 ` [PATCH 11/13] KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode Paul Mackerras
2016-08-19 5:35 ` [PATCH 12/13] KVM: PPC: Book3S HV: Set server for passed-through interrupts Paul Mackerras
2016-08-19 5:35 ` [PATCH 13/13] KVM: PPC: Book3S HV: Counters for passthrough IRQ stats Paul Mackerras
2016-09-12 0:55 ` [PATCH 00/13] Real-mode acceleration of device interrupts in HV KVM Paul Mackerras
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=1471584957-21484-2-git-send-email-paulus@ozlabs.org \
--to=paulus@ozlabs.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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).