Thread (164 messages) 164 messages, 20 authors, 2023-05-25

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

From: Sean Christopherson <seanjc@google.com>
Date: 2023-05-24 21:39:58
Also in: kvm, linux-doc, linux-fsdevel, linux-kselftest, linux-mm, lkml, qemu-devel

On Wed, May 24, 2023, Peter Zijlstra wrote:
On Wed, May 24, 2023 at 01:16:03PM -0700, Sean Christopherson wrote:
quoted
Of course, the only accesses outside of mmu_lock are reads, so on x86 that
"atomic" access is just a READ_ONCE() load, but that's not the case for all
architectures.
This is true on *all* archs. atomic_set() and atomic_read() are no more
and no less than WRITE_ONCE() / READ_ONCE().
Ah, I take it s390's handcoded assembly routines are just a paranoid equivalents
and not truly special?  "l" and "st" do sound quite generic...

  commit 7657e41a0bd16c9d8b3cefe8fd5d6ac3c25ae4bf
  Author: Heiko Carstens [off-list ref]
  Date:   Thu Feb 17 13:13:58 2011 +0100

    [S390] atomic: use inline asm
    
    Use inline assemblies for atomic_read/set(). This way there shouldn't
    be any questions or subtle volatile semantics left.

static inline int __atomic_read(const atomic_t *v)
{
	int c;

	asm volatile(
		"	l	%0,%1\n"
		: "=d" (c) : "R" (v->counter));
	return c;
}

static inline void __atomic_set(atomic_t *v, int i)
{
	asm volatile(
		"	st	%1,%0\n"
		: "=R" (v->counter) : "d" (i));
}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help