From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C05C2C433ED for ; Thu, 1 Apr 2021 12:36:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D22C611CC for ; Thu, 1 Apr 2021 12:36:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D22C611CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=NetBSD.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRwYr-0004D1-2X for qemu-devel@archiver.kernel.org; Thu, 01 Apr 2021 08:36:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRwV7-0002n4-FY for qemu-devel@nongnu.org; Thu, 01 Apr 2021 08:32:41 -0400 Received: from 13thmonkey.org ([80.100.255.32]:60833 helo=diablo.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRwV5-0005TL-JF for qemu-devel@nongnu.org; Thu, 01 Apr 2021 08:32:41 -0400 Received: by diablo.13thmonkey.org (Postfix, from userid 103) id A5FF3C139C5; Thu, 1 Apr 2021 14:32:37 +0200 (CEST) Date: Thu, 1 Apr 2021 14:32:37 +0200 From: Reinoud Zandijk To: Paolo Bonzini Subject: Re: [PATCH v6 2/4] Add NVMM accelerator: x86 CPU support Message-ID: References: <20210331200800.24168-1-reinoud@NetBSD.org> <20210331200800.24168-3-reinoud@NetBSD.org> <5afd10b1-bd32-2f06-b311-246815428bfc@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JZZO+Q2K4y9a3TS/" Content-Disposition: inline In-Reply-To: <5afd10b1-bd32-2f06-b311-246815428bfc@redhat.com> Received-SPF: none client-ip=80.100.255.32; envelope-from=reinoud@diablo.13thmonkey.org; helo=diablo.13thmonkey.org X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Richard Henderson , qemu-devel@nongnu.org, Kamil Rytarowski , Reinoud Zandijk , Ryo ONODERA Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --JZZO+Q2K4y9a3TS/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 01, 2021 at 10:35:40AM +0200, Paolo Bonzini wrote: > On 31/03/21 22:07, Reinoud Zandijk wrote: > > +void nvmm_vcpu_kick(CPUState *cpu); > > Not defined anywhere. Hmmm, indeed. I think its a leftover of the former patch. Good catch. > > +{ > > +#if NVMM_USER_VERSION == 1 > > + struct sigaction sigact; > > + sigset_t set; > > + > > + /* Install the IPI handler. */ > > + memset(&sigact, 0, sizeof(sigact)); > > + sigact.sa_handler = nvmm_ipi_signal; > > + sigaction(SIG_IPI, &sigact, NULL); > > + > > + /* Allow IPIs on the current thread. */ > > + sigprocmask(SIG_BLOCK, NULL, &set); > > + sigdelset(&set, SIG_IPI); > > + pthread_sigmask(SIG_SETMASK, &set, NULL); > > +#else > > + /* > > + * We use the nvmm_vcpu_stop() mechanism, and don't use signals. > > + * Nothing to do. > > + */ > > +#endif > > Since nvmm_vcpu_stop is very similar to KVM's immediate_exit mechanism, I > think you still need to have a dummy signal handler to kick the VM out of > the run loop *if it is in the kernel*. The signal handler however can just > do nothing. Are you worried the in-kernel thread will somehow get stuck or halt on exit of Qemu and left as a zombie? > Also, can you just drop support for NVMM_USER_VERSION == 1? Now thats a good suggestion. We could add support for it in the pkgsrc package. When 9.0 gets retired, we could then retire it there without the need to patch Qemu again. > > diff --git a/target/i386/nvmm/meson.build b/target/i386/nvmm/meson.build > > new file mode 100644 > > index 0000000000..c154e78014 > > --- /dev/null > > +++ b/target/i386/nvmm/meson.build > > @@ -0,0 +1,4 @@ > > +i386_softmmu_ss.add(when: 'CONFIG_NVMM', if_true: files( > > + 'nvmm-all.c', > > + 'nvmm-accel-ops.c', > > +)) > > The nvmm library should be added here. I am not sure what you mean by that. You provided a patch for the meson.build file, will that not suffice? With regards, Reinoud --JZZO+Q2K4y9a3TS/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEELRHWktq6GkG74/X0gpw3AEPIqmgFAmBlvWEACgkQgpw3AEPI qmj7qggAjmVqNTa86IdJscBqLixvf3cHfmRb/2DPYBZihWQUFL/1A46VP3jhGHrs j2CNBl1pEgPZnVL8TyhiEqJn19naJHe8xdNSoKjTGkvLjsOtcGYGNFC5UgHyF2Hh j0Nb6tYd/U+N/irFAxkZu4AtRhzY9M1rnYUJBu6tur4KI6/AgYfoHmghqsnDft3D Azqv4xIE/0dajgaCOr/z7CD57t2LqBoXaYhjMe9KsnZgHIYOdfcxsXnYi0xUcEf6 9UdbkoUWkCdlUZrnLCSH+lSYNsk2Z4YRuoluMU1fV6wMH0Oq5hQYd89C1Ryzp2Kz 3AaFnvWKOM3jzWJvVESbJgMr7yFFDw== =fPky -----END PGP SIGNATURE----- --JZZO+Q2K4y9a3TS/--