From: Matthias Brugger <mbrugger@suse.com>
To: pbonzini@redhat.com, rkrcmar@redhat.com,
christoffer.dall@linaro.org, marc.zyngier@arm.com,
linux@armlinux.org.uk, catalin.marinas@arm.com,
will.deacon@arm.com
Cc: suzuki.poulose@arm.com, james.morse@arm.com,
david.daney@cavium.com, rrichter@cavium.com, agraf@suse.de,
mbrugger@suse.com, mark.rutland@arm.com,
lorenzo.pieralisi@arm.com, dave.long@linaro.org,
ard.biesheuvel@linaro.org, zlim.lnx@gmail.com,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] arm64: insn: Do not disable irqs during patching
Date: Thu, 4 Aug 2016 11:15:14 +0200 [thread overview]
Message-ID: <1470302117-32296-2-git-send-email-mbrugger@suse.com> (raw)
In-Reply-To: <1470302117-32296-1-git-send-email-mbrugger@suse.com>
From: Robert Richter <rrichter@cavium.com>
__aarch64_insn_write() is always called with interrupts enabled. Thus,
there is no need to use an irqsave variant for the spin lock.
This change should also address the fix of:
commit abffa6f3b157 ("arm64: convert patch_lock to raw lock")
We need to enable interrupts to allow cpu sync for code patching
using smp_call_function*().
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm64/kernel/insn.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
index 63f9432..138bd8a 100644
--- a/arch/arm64/kernel/insn.c
+++ b/arch/arm64/kernel/insn.c
@@ -86,7 +86,7 @@ bool aarch64_insn_is_branch_imm(u32 insn)
aarch64_insn_is_bcond(insn));
}
-static DEFINE_RAW_SPINLOCK(patch_lock);
+static DEFINE_SPINLOCK(patch_lock);
static void __kprobes *patch_map(void *addr, int fixmap)
{
@@ -129,16 +129,15 @@ int __kprobes aarch64_insn_read(void *addr, u32 *insnp)
static int __kprobes __aarch64_insn_write(void *addr, u32 insn)
{
void *waddr = addr;
- unsigned long flags = 0;
int ret;
- raw_spin_lock_irqsave(&patch_lock, flags);
+ spin_lock(&patch_lock);
waddr = patch_map(addr, FIX_TEXT_POKE0);
ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);
patch_unmap(FIX_TEXT_POKE0);
- raw_spin_unlock_irqrestore(&patch_lock, flags);
+ spin_unlock(&patch_lock);
return ret;
}
--
2.6.6
next prev parent reply other threads:[~2016-08-04 9:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 9:15 arm64: Implement IPI based TLB invalidation Matthias Brugger
2016-08-04 9:15 ` Matthias Brugger [this message]
2016-08-04 9:15 ` [PATCH 2/4] " Matthias Brugger
2016-08-04 9:15 ` [PATCH 3/4] KVM: arm/arm64: Check for broadcast TLBI support Matthias Brugger
2016-08-06 7:22 ` kbuild test robot
2016-08-04 9:15 ` [PATCH 4/4] arm64: hibernate: " Matthias Brugger
2016-08-04 20:57 ` [PATCH] arm64: Add workaround for Cavium erratum 26026 Robert Richter
2016-08-04 21:40 ` David Daney
2016-08-05 7:00 ` Robert Richter
2016-08-05 16:37 ` David Daney
2016-08-05 2:35 ` kbuild test robot
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=1470302117-32296-2-git-send-email-mbrugger@suse.com \
--to=mbrugger@suse.com \
--cc=agraf@suse.de \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=dave.long@linaro.org \
--cc=david.daney@cavium.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=rrichter@cavium.com \
--cc=suzuki.poulose@arm.com \
--cc=will.deacon@arm.com \
--cc=zlim.lnx@gmail.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).