From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651698428; cv=none; d=zohomail.com; s=zohoarc; b=cPxKOw3afqOgBgvr2CoLQbbuj0688ItfwIgqcsEXKs7beqv7fkTIEOUJu+NRvppphYlmjXpwhsTfW2sXsEEDw61S9EHBMImA/fP3ya9m9lcrBYnru4MCA07EtlTKRbMs7DE8VutGAhSKlOKQ6Cg1zFGxVFWKM7pLD5CYXXG3MhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651698428; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F1Kb1eLm9tVTwYNCejQZxVmvj58B5hVqCxAsyodmLmU=; b=NVJzYjr3r3QD+fIgNDA56evK16Dtl8boGwUd2eECkg4rpPiEurv6XWAJVD/VUyNjRpIiUuP1PJwWRYT7ux3rr/zzker+/6nvOyC9yiMQWpgf8wQjyPJldq2dC+cIHy77X0YibCXMtgyaWH8G+VilRWs/mEGoY2cvUGc+OkyUA1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651698428116822.9255208658243; Wed, 4 May 2022 14:07:08 -0700 (PDT) Received: from localhost ([::1]:41306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmMDC-0007Gk-Mb for importer@patchew.org; Wed, 04 May 2022 17:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6V-0006QQ-Dr for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6T-00068D-Rr for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:11 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-ujWA2fEDNY2vFYeq_VGTMw-1; Wed, 04 May 2022 17:00:07 -0400 Received: by mail-ej1-f70.google.com with SMTP id ga27-20020a1709070c1b00b006f43c161da4so1506015ejc.7 for ; Wed, 04 May 2022 14:00:06 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hy10-20020a1709068a6a00b006f3ef214dd4sm6244731ejc.58.2022.05.04.14.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 14:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651698009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F1Kb1eLm9tVTwYNCejQZxVmvj58B5hVqCxAsyodmLmU=; b=BU9nGj567eppaS8l3y45Spc7f/yt7UcuWoJzKj1JEuzFS08LhGe2lF2NvRREgJ18kkJTZN Cp2pvNG7k5S+GskmcrvJymiV39vnY7EZpYSCavlIXX410Wo1lG5LkolWKwlKdn1tgE43V7 DTmMYiL7NIt8AN16eNZozpWi2vLzWQs= X-MC-Unique: ujWA2fEDNY2vFYeq_VGTMw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F1Kb1eLm9tVTwYNCejQZxVmvj58B5hVqCxAsyodmLmU=; b=YztHNQYZlhZTE/xS2bY6/z6g3KGj6rOoLRKCKTzbOaMa5+x72ClEjpe6Qu94YKvzCI 19kOKXJfSmgG6OtFwM0vxWF0WIJecJWY6bDn278I4WxnXHWUSJctrQgxkhT+wtzb2jdy 1sxL5okcdqoqDrdunyf99uflQ+biCj+9HxDhOHylmfbY2Bs/GbqI4GO4DfKsR1R+QqRA j2O4B73K7LoMmpkNkTzXLYfY0ypvygd1Gd5rR+BWDbLNJlLbjrljuxgs4QAJEVNaVo5E VVMb4kQfqjV11e8fnqnrQUdkNqcXoJ6Wb8bwQWk6nR5xCCRUALdo9XEFcDhUVYxzhuIw /UnA== X-Gm-Message-State: AOAM531ByW2xQ+NqmkdzeKlOZDt6cytxavpuYlaUvp/DJM7JfV6+qJ90 C24X5UEFZnQ5u0Ig53l3C2NsjPKr5npkKS+H7msG0OGWJsiHUlyxYka21ygLu/uuOTCysMUIOt5 hULigYRgggT2v6VxtscpcmoCTHsGTIrMey5s09sTSzLAPg9kM5RsqDSZR0+uf4E6odl0= X-Received: by 2002:a17:907:2daa:b0:6da:924e:955 with SMTP id gt42-20020a1709072daa00b006da924e0955mr21823095ejc.1.1651698005377; Wed, 04 May 2022 14:00:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi+MyUsaK745ZfGSOvgAou0NEeK4+5ie9waBqe7/dQU/yjAeVxH4BkjCDOaiu/rxVFVEJwdw== X-Received: by 2002:a17:907:2daa:b0:6da:924e:955 with SMTP id gt42-20020a1709072daa00b006da924e0955mr21823071ejc.1.1651698005136; Wed, 04 May 2022 14:00:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Daniele Buono Subject: [PATCH 1/5] slirp: bump submodule to 4.7 release Date: Wed, 4 May 2022 22:59:57 +0200 Message-Id: <20220504210001.678419-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504210001.678419-1-pbonzini@redhat.com> References: <20220504210001.678419-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651698428950100001 Content-Type: text/plain; charset="utf-8" Version 4.7 of slirp provides a new timer API that works better with CFI, together with several other improvements: * Allow disabling the internal DHCP server !22 * Support Unix sockets in hostfwd !103 * IPv6 DNS proxying support !110 * bootp: add support for UEFI HTTP boot !111 and bugfixes. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- slirp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp b/slirp index a88d9ace23..3ad1710a96 160000 --- a/slirp +++ b/slirp @@ -1 +1 @@ -Subproject commit a88d9ace234a24ce1c17189642ef9104799425e0 +Subproject commit 3ad1710a96678fe79066b1469cead4058713a1d9 --=20 2.35.1 From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651698168; cv=none; d=zohomail.com; s=zohoarc; b=AoTwPX0OqwHN6TWlB67sA/P6cgl3Z+qWIcbI/ZVkxbyqfh2owr04Cq6yOW6LtnBTVbxu9CBSLaDEnFcb+uYiMW/CKvOQ4sCrlxwVlw4gw+6ANDeBiPp+kWHAnnidi3hUoGSLvpQd3BS7c6IBSf6Pt2MFMYM11bG22b2OLffMyDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651698168; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=R4ZvnlIoUjZtjWvuejYgl9KVhXxnZ5y5G5J4vXB5mhQ=; b=fAVbVnhNmiF8+w71FTygUsyPE1+aB+KTNl5mb2okk/D2IQR9JNUdo3Tn4Vx7fqdBFRkr/xx+fuBspgHIYdT7oOJ4/7y2R79bQY0DPoIzdK/y6//m5xobJ5rozIu089WbRbX5AZh5B1afsu3H1Y/WOCciPU7Kuu09/KQIdBd/9KI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651698168403419.31004660372435; Wed, 4 May 2022 14:02:48 -0700 (PDT) Received: from localhost ([::1]:60124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmM91-0000im-EP for importer@patchew.org; Wed, 04 May 2022 17:02:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6W-0006SO-Ln for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6U-00068R-PF for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:12 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-cBSgSCYxPUOdpT1cKtW2kg-1; Wed, 04 May 2022 17:00:08 -0400 Received: by mail-ej1-f71.google.com with SMTP id i14-20020a17090639ce00b006dabe6a112fso1484788eje.13 for ; Wed, 04 May 2022 14:00:08 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id h20-20020a1709070b1400b006f3ef214db8sm5990781ejl.30.2022.05.04.14.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 14:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651698010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R4ZvnlIoUjZtjWvuejYgl9KVhXxnZ5y5G5J4vXB5mhQ=; b=eYJO72zmziQp/g/Z67Z7aAb0MqjmZ0nfBrhNV+ZTrQb2gL/bGgrSCTDawP81I7N4z4GeH7 tUjlGa53l9GbLUErce9MYSUhAuWOKLzT0LKBVhA2M9ey1CrLtLDBBUTmnZ8o00QT2jbOhm t05D0Y6B8vLz/+Vo6jPQl3xac1rFKyk= X-MC-Unique: cBSgSCYxPUOdpT1cKtW2kg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R4ZvnlIoUjZtjWvuejYgl9KVhXxnZ5y5G5J4vXB5mhQ=; b=OtruzuQq4g2eL8JX5KDsyKP5FrXoCPgG/Ab0DoufbtDuXLaYXKPghjCP4CmABqy7TY Ut8qPqFBC6f56rukDfDqz0ClY2Fg0x77fes2QbYPVVx82rd1DlKcvv6xFJUlKJzkboYd 8wkjAx9nr7wjqaRrTFatVtsQKpxqJ9gbv65j0KSiY+tGIfS/OmGePP+dqJN6AbOi26zB EXw23YbmRiAOvxXygSg/0piCIZMlOW5qGtqOKKQ4d0XDF3ShGNlR4PLnbpyJhrNM6nlE zybigLimAZui+3hLS4WRzi27PFEp+aIR7JCkX/g2nRXtbHEx+Oxqhxz70wnXxUdHRN54 gcgA== X-Gm-Message-State: AOAM5314u9snKgv54SGZ505ix2/9p2B++mHhCRI3sX3KTZWkG8nI8SnG BYVMVuWNdTpl40aEa3Mm0xmTvUKzM+eiFbolBxM7mWgzOPArk/7oM/j3zjqVRRjgk3rR0smlMta qtJ4tJrtJyY7jR/8UjsW/IZMaIuS5KeHhsPmQv8EiquJST35z8LsgfeHctqm/HfC2AAM= X-Received: by 2002:a05:6402:909:b0:416:6f3c:5c1d with SMTP id g9-20020a056402090900b004166f3c5c1dmr24987063edz.108.1651698006954; Wed, 04 May 2022 14:00:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx12JUubqLRfA0SpAavXAIi0SbLQH0qHmFKBS/Q4z6sliyh3H8AuttqDczvULUOF9eMIqNLbA== X-Received: by 2002:a05:6402:909:b0:416:6f3c:5c1d with SMTP id g9-20020a056402090900b004166f3c5c1dmr24987030edz.108.1651698006618; Wed, 04 May 2022 14:00:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Daniele Buono Subject: [PATCH 2/5] net: slirp: introduce a wrapper struct for QemuTimer Date: Wed, 4 May 2022 22:59:58 +0200 Message-Id: <20220504210001.678419-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504210001.678419-1-pbonzini@redhat.com> References: <20220504210001.678419-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651698170173100001 Content-Type: text/plain; charset="utf-8" This struct will be extended in the next few patches to support the new slirp_handle_timer() call. For that we need to store an additional "int" for each SLIRP timer, in addition to the cb_opaque. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- net/slirp.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index bc5e9e4f77..f1e25d741f 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -184,23 +184,32 @@ static int64_t net_slirp_clock_get_ns(void *opaque) return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); } =20 +struct SlirpTimer { + QEMUTimer timer; +} + static void *net_slirp_timer_new(SlirpTimerCb cb, void *cb_opaque, void *opaque) { - return timer_new_full(NULL, QEMU_CLOCK_VIRTUAL, - SCALE_MS, QEMU_TIMER_ATTR_EXTERNAL, - cb, cb_opaque); + SlirpTimer *t =3D g_new(SlirpTimer, 1); + timer_init_full(&t->timer, NULL, QEMU_CLOCK_VIRTUAL, + SCALE_MS, QEMU_TIMER_ATTR_EXTERNAL, + cb, cb_opaque); + return t; } =20 static void net_slirp_timer_free(void *timer, void *opaque) { - timer_free(timer); + SlirpTimer *t =3D timer; + timer_del(&t->timer); + g_free(t); } =20 static void net_slirp_timer_mod(void *timer, int64_t expire_timer, void *opaque) { - timer_mod(timer, expire_timer); + SlirpTimer *t =3D timer; + timer_mod(&t->timer, expire_timer); } =20 static void net_slirp_register_poll_fd(int fd, void *opaque) --=20 2.35.1 From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651698517; cv=none; d=zohomail.com; s=zohoarc; b=hfknrwiVWE0eMdbsfR2S0jNbKMen14yr2lJqcflEWOIExd8gwxw6Z6t/RsJ+857zOjqq+pCcrZilPezYCio76ofYTMip3GTxCc2E5zULEnW7HEHyBG4++i57eHnD8Wo0pMXCCKwPoJeK8IOiWifqn3McxjUXjp6dG/hYdK74eu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651698517; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TX8UXi4eFSnFUV2u4zCo4HCe7iBVlFy/t8He5jdXGC4=; b=Bo3ijIu2C5UTzsgPfyYYBwRp8hX0qaK8mp4b5lQApXgpQNVFCgTFQjs+KrXpiFwYEHPEFaOSdFrSaCmyau3T+/8fI6TPsmX8vaU2J6GIapetk4eboVXIhC1JusFeI3kZwGTVXzJlLZiXdTx2QqASmF1fgHcYkjxfPLi+b+TvDf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651698517773721.1652423652678; Wed, 4 May 2022 14:08:37 -0700 (PDT) Received: from localhost ([::1]:45982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmMEd-00027P-RS for importer@patchew.org; Wed, 04 May 2022 17:08:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6c-0006Yg-8T for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6Z-00068z-7h for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:17 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-210-zRBs6WCJM9S7Y3qPb9H3mw-1; Wed, 04 May 2022 17:00:11 -0400 Received: by mail-ed1-f71.google.com with SMTP id s24-20020a05640217d800b00425e19e7deaso1400550edy.3 for ; Wed, 04 May 2022 14:00:09 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id bo9-20020a0564020b2900b0042617ba63a5sm9593030edb.47.2022.05.04.14.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 14:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651698013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TX8UXi4eFSnFUV2u4zCo4HCe7iBVlFy/t8He5jdXGC4=; b=HtQ1Itb2T2gWynCRa8hao9PfF8YryQFzH6YA442gqdHsxxLYijnMkKpx7zvChysoIIdVSN VtUd0rPQAFQTqvCvP4glW9ocLwi2c4MgXScphwLN1LSRdGgnWf0CYGZDBZckp9dTySvus8 ReioCBxtno2LKe/0HarF+nn9QmLq0Fs= X-MC-Unique: zRBs6WCJM9S7Y3qPb9H3mw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TX8UXi4eFSnFUV2u4zCo4HCe7iBVlFy/t8He5jdXGC4=; b=qxSR8DFz0Jntb4sks0MxeiyQEi2yKNC2hfe9MVeztDECY30GUhzurdKbRHJjZVBITr 8i/Gv+WC3RAgs8h88RyO5KXFRbjp0A5bYmytZqlkAPKlq2jDGeVlVhBR1t9TFo2rg1cJ mWnIek+BBuWPd0XoL2zluYnV15SIAhjdu2Ns6sZ1FhyMgAN6cCGmrBPMGhKSoeQTUrvT 6wFmUclVc8HYh8T0zXhu/2L37b+5kbnlKXnifUyFCj6ooU79ihXXfOrUoK85ZSnRgNBk jSpXYM0GIwynaVzP85XkpL5m3cCm5+vLm8aIcWkx02uxJhLM7RWDxm1NwvhGGjW5ateh zrsg== X-Gm-Message-State: AOAM530stfBgINvmKyau9EyUVNoikMCNZWNBPr/vWyPsJCNbRVJdwjOp 3XNocyA03CW3ljYFtCJkW0M8ICLX9RGJSklYezwLznl0vQ+uPUfTwU264F9TTS5dzSVZtIf1Ouw o0VTomDPZspFNhTMaQ5iwEDJo0Wd+Buhg5rgE/BChfo2NTraKTjaswOrw41MaEf6KUn8= X-Received: by 2002:a17:906:3ec1:b0:6e8:aae3:90de with SMTP id d1-20020a1709063ec100b006e8aae390demr22397687ejj.127.1651698008628; Wed, 04 May 2022 14:00:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvqWSg/G/xRGO9IEc0gfqrQk+QNHFVfdrfdxjDRMz10PMheGfbWuiu1aXmhlTTIKVgwwcGqw== X-Received: by 2002:a17:906:3ec1:b0:6e8:aae3:90de with SMTP id d1-20020a1709063ec100b006e8aae390demr22397660ejj.127.1651698008357; Wed, 04 May 2022 14:00:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Daniele Buono Subject: [PATCH 3/5] net: slirp: switch to slirp_new Date: Wed, 4 May 2022 22:59:59 +0200 Message-Id: <20220504210001.678419-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504210001.678419-1-pbonzini@redhat.com> References: <20220504210001.678419-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651698519604100001 Content-Type: text/plain; charset="utf-8" Replace slirp_init with slirp_new, so that a more recent cfg.version can be specified. Signed-off-by: Paolo Bonzini --- net/slirp.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index f1e25d741f..b3a92d6e38 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -389,6 +389,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, #if defined(CONFIG_SMBD_COMMAND) struct in_addr smbsrv =3D { .s_addr =3D 0 }; #endif + SlirpConfig cfg =3D { 0 }; NetClientState *nc; SlirpState *s; char buf[20]; @@ -577,12 +578,26 @@ static int net_slirp_init(NetClientState *peer, const= char *model, =20 s =3D DO_UPCAST(SlirpState, nc, nc); =20 - s->slirp =3D slirp_init(restricted, ipv4, net, mask, host, - ipv6, ip6_prefix, vprefix6_len, ip6_host, - vhostname, tftp_server_name, - tftp_export, bootfile, dhcp, - dns, ip6_dns, dnssearch, vdomainname, - &slirp_cb, s); + cfg.version =3D 3; + cfg.restricted =3D restricted; + cfg.in_enabled =3D ipv4; + cfg.vnetwork =3D net; + cfg.vnetmask =3D mask; + cfg.vhost =3D host; + cfg.in6_enabled =3D ipv6; + cfg.vprefix_addr6 =3D ip6_prefix; + cfg.vprefix_len =3D vprefix6_len; + cfg.vhost6 =3D ip6_host; + cfg.vhostname =3D vhostname; + cfg.tftp_server_name =3D tftp_server_name; + cfg.tftp_path =3D tftp_export; + cfg.bootfile =3D bootfile; + cfg.vdhcp_start =3D dhcp; + cfg.vnameserver =3D dns; + cfg.vnameserver6 =3D ip6_dns; + cfg.vdnssearch =3D dnssearch; + cfg.vdomainname =3D vdomainname; + s->slirp =3D slirp_new(&cfg, &slirp_cb, s); QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry); =20 /* --=20 2.35.1 From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651698170; cv=none; d=zohomail.com; s=zohoarc; b=WvP7sROrZCDamyMZbTXRCSVTtg+Rait3bh16MTJvsxSxL7CuQMitKEkPpjkKeItd9k28AOJ4pXPeAiFn70n/ZKmKtoQhOnOdjJE6rTjFt6q1JIrT69LC90z67PJR2NSvCIzcc+1r0xd3tlhJ2daJiV8lZQF+OkJA3tczAjk3FAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651698170; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZpbfXhhFu37+qhfFpaMUS+AAe9dGLE6sTDUGZufIQeE=; b=jtmiygwCQT0Y8V/NDgqY7Loas1gU1RtpgOqlNi93cdgUbpo7W0JlD41Pn6w1WrpNwIX7uBXBbtvHLn6W0Ip/huM+AkFm0C8J5SOuOGyBIGL9z08CdhvJ9ES0NH1x1KKpsFZ+Kj/8nwHrVZkvEKLW6XY9JEGF6uEAvMPpmT6rSE0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651698170340654.1234457687914; Wed, 4 May 2022 14:02:50 -0700 (PDT) Received: from localhost ([::1]:60298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmM93-0000pT-5K for importer@patchew.org; Wed, 04 May 2022 17:02:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6a-0006Ye-Se for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6Y-00068x-8K for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:16 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-460-gNIoul4gPWeg9YXxcflawg-1; Wed, 04 May 2022 17:00:11 -0400 Received: by mail-ej1-f71.google.com with SMTP id qb36-20020a1709077ea400b006f45e182187so1491142ejc.14 for ; Wed, 04 May 2022 14:00:11 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id ml20-20020a170906cc1400b006f3ef214dc6sm6087593ejb.44.2022.05.04.14.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 14:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651698013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZpbfXhhFu37+qhfFpaMUS+AAe9dGLE6sTDUGZufIQeE=; b=eVh50sXNiFO0SI7nSsm02T+Nz+9RdmlbAB49ObAKfze2vRnyNLjuGlF4AqmvnESiH5Pb1Z 4DNlykhy3WLw6AOnUe6F7BD+WygAjFLf/vtp6UF1M6Bab2tkjGN5zIk0h5wh3YW7AR+hNv sqcFk6OgjJoqDQU7hULvMWob7BvkAKI= X-MC-Unique: gNIoul4gPWeg9YXxcflawg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZpbfXhhFu37+qhfFpaMUS+AAe9dGLE6sTDUGZufIQeE=; b=zJCq0lUZX4v5hBCbEyf/NqpKUqI/AB+TD0Cjhn/4pvWBkfAROyUu427HcpDcP4LPki kvg6mlz7k1BHNDbG46KIpZMzO5BgAjo51B3unKw64kDkf3mKsFL2oTWZEqm0YT1F1xE8 RDaIXC0oNsTmn8PjBn5TQ5HQH57TQGaNwOjXX8LemWv7OsmaUTzc7SjEhJtBbKbxjuBG 2bYyGsGriKGvldyq2o9TCvdrwJc/CfVSAb+MkX9UPng8rfFev84yz4vCwL3WBqhzctM3 eW9gbriLg5OZjl5ga9/zz2OZLqnpr0ObxMwWJIPa7UN64j5Asn3lw81HLmYgZi/56q5y PuPg== X-Gm-Message-State: AOAM533LKz9MEcwL596C0M94RHh6JQZnpKrUecv3wmIrgPRfg08/O+5h zA3owD42D5gtjoKtSzyKSfrZzWTa3pauKyOieDJGEhuVQG9opMTmSdVpQgD8uO27MApPo+q1GnV QuvE0/Wtq9pL3D7ijDezM+47qgeYWQaIKcueUEfcKTHob/rlmUc4gWJnsy4+wIrc++Uo= X-Received: by 2002:a17:906:58ca:b0:6f4:444f:31ef with SMTP id e10-20020a17090658ca00b006f4444f31efmr16107838ejs.135.1651698010383; Wed, 04 May 2022 14:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhiVilalOqStR4a555syKmLdhyvdAsHzeisgUiyTFqgFpaj5MYDWg4W4P3eGipbC3JKja4PQ== X-Received: by 2002:a17:906:58ca:b0:6f4:444f:31ef with SMTP id e10-20020a17090658ca00b006f4444f31efmr16107804ejs.135.1651698010092; Wed, 04 May 2022 14:00:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Daniele Buono Subject: [PATCH 4/5] net: slirp: add support for CFI-friendly timer API Date: Wed, 4 May 2022 23:00:00 +0200 Message-Id: <20220504210001.678419-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504210001.678419-1-pbonzini@redhat.com> References: <20220504210001.678419-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651698172404100001 Content-Type: text/plain; charset="utf-8" libslirp 4.7 introduces a CFI-friendly version of the .timer_new callback. The new callback replaces the function pointer with an enum; invoking the callback is done with a new function slirp_handle_timer. Support the new API so that CFI can be made compatible with using a system libslirp. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- net/slirp.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index b3a92d6e38..57af42299d 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -184,10 +184,43 @@ static int64_t net_slirp_clock_get_ns(void *opaque) return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); } =20 +typedef struct SlirpTimer SlirpTimer; struct SlirpTimer { QEMUTimer timer; +#if SLIRP_CHECK_VERSION(4,7,0) + Slirp *slirp; + SlirpTimerId id; + void *cb_opaque; +#endif +}; + +#if SLIRP_CHECK_VERSION(4,7,0) +static void net_slirp_init_completed(Slirp *slirp, void *opaque) +{ + SlirpState *s =3D opaque; + s->slirp =3D slirp; } =20 +static void net_slirp_timer_cb(void *opaque) +{ + SlirpTimer *t =3D opaque; + slirp_handle_timer(t->slirp, t->id, t->cb_opaque); +} + +static void *net_slirp_timer_new_opaque(SlirpTimerId id, + void *cb_opaque, void *opaque) +{ + SlirpState *s =3D opaque; + SlirpTimer *t =3D g_new(SlirpTimer, 1); + t->slirp =3D s->slirp; + t->id =3D id; + t->cb_opaque =3D cb_opaque; + timer_init_full(&t->timer, NULL, QEMU_CLOCK_VIRTUAL, + SCALE_MS, QEMU_TIMER_ATTR_EXTERNAL, + net_slirp_timer_cb, t); + return t; +} +#else static void *net_slirp_timer_new(SlirpTimerCb cb, void *cb_opaque, void *opaque) { @@ -197,6 +230,7 @@ static void *net_slirp_timer_new(SlirpTimerCb cb, cb, cb_opaque); return t; } +#endif =20 static void net_slirp_timer_free(void *timer, void *opaque) { @@ -231,7 +265,12 @@ static const SlirpCb slirp_cb =3D { .send_packet =3D net_slirp_send_packet, .guest_error =3D net_slirp_guest_error, .clock_get_ns =3D net_slirp_clock_get_ns, +#if SLIRP_CHECK_VERSION(4,7,0) + .init_completed =3D net_slirp_init_completed, + .timer_new_opaque =3D net_slirp_timer_new_opaque, +#else .timer_new =3D net_slirp_timer_new, +#endif .timer_free =3D net_slirp_timer_free, .timer_mod =3D net_slirp_timer_mod, .register_poll_fd =3D net_slirp_register_poll_fd, @@ -578,7 +617,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, =20 s =3D DO_UPCAST(SlirpState, nc, nc); =20 - cfg.version =3D 3; + cfg.version =3D SLIRP_CHECK_VERSION(4,7,0) ? 4 : 3; cfg.restricted =3D restricted; cfg.in_enabled =3D ipv4; cfg.vnetwork =3D net; --=20 2.35.1 From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651698311; cv=none; d=zohomail.com; s=zohoarc; b=fwCE7Pk947SOdIeob5mGc/dHUwM+Qu8+rPNs9s/kkaEly+IN6j3ItGzC8IdEdKJE388cgJ5aNcM/qGTdyDHt5vOIpFWEK6T2FmuLf5y8zosimwYkI8Y9ax1KUIdlb28hlfAP+j1hyevoPiyiWW0smoZcl3s59O0qYrIkj1w/j70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651698311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=md1jglYd6z9CUp+wyyryd9+VqjBQdVs9CtFhknqbrD0=; b=Ua6IJPTNqyV9IVYnsFuceIFM7OauJF3t1ZYC34LR0r/OK0gSxqpdXBJksbmZBjVoKzECyag7G+t/ojdcZvuaPv1tWa3j9OaICWl4kDaBKkkUx5LZr4kmsZeCFeLPEDB2YDZkfvVUbuR9CqfPREPEDkvz8JFVh/TgLVbcTY9HW2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651698311241752.4700454303794; Wed, 4 May 2022 14:05:11 -0700 (PDT) Received: from localhost ([::1]:37460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmMBJ-0004cC-Qd for importer@patchew.org; Wed, 04 May 2022 17:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6j-0006p8-BQ for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmM6h-0006Do-LJ for qemu-devel@nongnu.org; Wed, 04 May 2022 17:00:25 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-286-W9E8elBxN9OL1d3ucHSO6g-1; Wed, 04 May 2022 17:00:19 -0400 Received: by mail-ed1-f70.google.com with SMTP id eg38-20020a05640228a600b00425d61d0302so1392870edb.17 for ; Wed, 04 May 2022 14:00:16 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id f12-20020a056402150c00b0042617ba638esm9550516edw.24.2022.05.04.14.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 14:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651698022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=md1jglYd6z9CUp+wyyryd9+VqjBQdVs9CtFhknqbrD0=; b=UQxmpsZL1oMh76GYTGpv29Ipc5ZjUXoCOpUTmOX1NU/EGL3VdUKZ/b9CgXccnehhc4jigL d/wIMQSinpWPxnEPnry16in3+EUCe42MeDoUNWHQCpYbRf0Ic1YXjwKQvdPOwFg7W2NXv5 Np3qniJOSjRkyzn+1kMRCv+OUgRlfCg= X-MC-Unique: W9E8elBxN9OL1d3ucHSO6g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=md1jglYd6z9CUp+wyyryd9+VqjBQdVs9CtFhknqbrD0=; b=hNukFHnvfJSAaJFP6HDfcA00i25gOt//BqVW4FGQaXeHImA5An0gggFY6HlAERpWIW U6oxQFozyLQ+o/L/10ZVwikVgWjqTMX2nd7dfxwfAyUH/Eus+7r+x2mrbk09lN2R3FFP tYEP6JTQE+b/b2tzh/EE4EwqhB1iSYijVLpx4zFHRN315mSbuD/9OROyF1O9ZoKz1rpG NT4QvewGWL9o88lQaDQT6TuQ9i/7Xsdcs6nnuIdB4mh3WFtIw7azopgIbDem2lIET7wk yJT+DW/NJeQq3lAdZyyEP7Y5MHt3FJJ1qJV163X/++Lxim3nizu9ptW0KXz/J3lbX3bL 2o8w== X-Gm-Message-State: AOAM533NwU1RGWKHnOKhgJp0x28P9x39iNqSpbaNeSzEFPbT1aWtpXmO np4wfPqNtbcEd+szdMkugLZ5SO6xjmcjaHr6mMbNQiCN0b5kIfikGFE0T7q2oEfcKOxlGCsMVZl j0bwS8FyKhlrv1mCmIQnLb9YiZBd8z5/40boS9ktxiVDtHWPK5FsLrnbuXj5zlUgRv+8= X-Received: by 2002:a05:6402:3590:b0:427:ba05:6f19 with SMTP id y16-20020a056402359000b00427ba056f19mr20399267edc.334.1651698013469; Wed, 04 May 2022 14:00:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyiyfjRE5HEaSPhx1nokpdhhb6EvCLQAhjdEQLMN0zKtXPWAvynArPUvNQ5XbywDtvfGxVLQ== X-Received: by 2002:a05:6402:3590:b0:427:ba05:6f19 with SMTP id y16-20020a056402359000b00427ba056f19mr20399241edc.334.1651698013228; Wed, 04 May 2022 14:00:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Daniele Buono Subject: [PATCH 5/5] net: slirp: allow CFI with libslirp >= 4.7 Date: Wed, 4 May 2022 23:00:01 +0200 Message-Id: <20220504210001.678419-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504210001.678419-1-pbonzini@redhat.com> References: <20220504210001.678419-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651698312808100001 Content-Type: text/plain; charset="utf-8" slirp 4.7 introduces a new CFI-friendly timer callback that does not pass function pointers within libslirp as callbacks for timers. Check the version number and, if it is new enough, allow using CFI even with a system libslirp. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- meson.build | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index c26aa442d4..defe604065 100644 --- a/meson.build +++ b/meson.build @@ -2509,10 +2509,25 @@ if have_system slirp_opt =3D get_option('slirp') if slirp_opt in ['enabled', 'auto', 'system'] have_internal =3D fs.exists(meson.current_source_dir() / 'slirp/meson.= build') + slirp_dep_required =3D (slirp_opt =3D=3D 'system' or + slirp_opt =3D=3D 'enabled' and not have_internal) slirp =3D dependency('slirp', kwargs: static_kwargs, method: 'pkg-config', - required: slirp_opt =3D=3D 'system' or - slirp_opt =3D=3D 'enabled' and not have_i= nternal) + required: slirp_dep_required) + # slirp <4.7 is incompatible with CFI support in QEMU. This is because + # it passes function pointers within libslirp as callbacks for timers. + # When using a system-wide shared libslirp, the type information for t= he + # callback is missing and the timer call produces a false positive wit= h CFI. + # Do not use the "version" keyword argument to produce a better error. + # with control-flow integrity. + if get_option('cfi') and slirp.found() and slirp.version().version_com= pare('<4.7') + if slirp_dep_required + error('Control-Flow Integrity requires libslirp 4.7.') + else + warning('Control-Flow Integrity requires libslirp 4.7, not using s= ystem-wide libslirp.') + slirp =3D not_found + endif + endif if slirp.found() slirp_opt =3D 'system' elif have_internal @@ -2585,18 +2600,6 @@ if have_system endif endif =20 -# For CFI, we need to compile slirp as a static library together with qemu. -# This is because we register slirp functions as callbacks for QEMU Timers. -# When using a system-wide shared libslirp, the type information for the -# callback is missing and the timer call produces a false positive with CF= I. -# -# Now that slirp_opt has been defined, check if the selected slirp is comp= atible -# with control-flow integrity. -if get_option('cfi') and slirp_opt =3D=3D 'system' - error('Control-Flow Integrity is not compatible with system-wide slirp.'= \ - + ' Please configure with --enable-slirp=3Dgit') -endif - fdt =3D not_found if have_system fdt_opt =3D get_option('fdt') --=20 2.35.1