From: Sean Christopherson Date: Tue, 30 Aug 2022 04:27:04 +0000 Subject: [PATCH v5 7/7] KVM: selftests: Add ucall pool based implementation In-Reply-To: <20220829163627.qbafyl4qz5cxxue5@kamzik> References: <20220825232522.3997340-1-seanjc@google.com> <20220825232522.3997340-8-seanjc@google.com> <20220829163627.qbafyl4qz5cxxue5@kamzik> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Aug 29, 2022, Andrew Jones wrote: > On Thu, Aug 25, 2022 at 11:25:22PM +0000, Sean Christopherson wrote: > > +static struct ucall *ucall_alloc(void) > > +{ > > + struct ucall *uc; > > + int i; > > + > > + GUEST_ASSERT(ucall_pool && ucall_pool->in_use); > > ucall_pool->in_use will never be null. > > > + > > + for (i = 0; i < KVM_MAX_VCPUS; ++i) { > > + if (!atomic_test_and_set_bit(i, ucall_pool->in_use)) { > > + uc = &ucall_pool->ucalls[i]; > > + memset(uc->args, 0, sizeof(uc->args)); > > + return uc; > > + } > > + } > > nit: blank line Got 'em. Thanks for the reviews, much appreciated!