[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FA93B3F.3000906@redhat.com>
Date: Tue, 08 May 2012 17:26:55 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: x86@...nel.org, kvm@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Avi Kivity <avi@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>, gleb@...hat.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC dontapply 5/5] kvm_para: guest side for eoi avoidance
Il 23/04/2012 16:04, Michael S. Tsirkin ha scritto:
> +/* Our own copy of __test_and_clear_bit to make sure
> + * it is done with a single instruction */
Is this for microoptimization or correctness? If the latter, it does
not ensure anything without a "lock" prefix.
Paolo
> +static inline int kvm_test_and_clear_bit(int nr, volatile u16* addr)
> +{
> + int oldbit;
> +
> + asm volatile("btr %2,%1\n\t"
> + "sbb %0,%0"
> + : "=r" (oldbit), BITOP_ADDR_CONSTRAINT(*addr) : "Ir" (nr));
> + return oldbit;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists