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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 81943ECE58D for ; Wed, 9 Oct 2019 09:44:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65E6C21835 for ; Wed, 9 Oct 2019 09:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730718AbfJIJoi (ORCPT ); Wed, 9 Oct 2019 05:44:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51324 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730041AbfJIJoi (ORCPT ); Wed, 9 Oct 2019 05:44:38 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDE6C3CBE2 for ; Wed, 9 Oct 2019 09:44:37 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id f3so827798wrr.23 for ; Wed, 09 Oct 2019 02:44:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IgLlslTtHyY/DsCT/GempjMqnPIRbjKjjsT71GS80BU=; b=H67ptIrE81+ct0JSyznDPPG7lh8Bv6MnhdjudDo+WSRa538k8cIrAxDZaQZvBasd1W I96LT51S6TdV0M7fEulzRWAoPqakxVkgVS/qH9xEX+iVDjGL3GD5I4ZSFVoiO4Hf7H+s yg4gZ7ql0lLCfIZiCD7RvpAzpwHMLuihMKJv7gLzsg64CtDu+lGMLyHe52VUg9jD/Gzh TCGZbmbAlsF8IVI3OhdsMAJ7of77eI4nrwDhIR+Zqy9xFcMSAmzBhMtZw4c7GflNT0lk 0i0Ke7D2CGlXMK62IivgULYtectDHJ9RYAG0ibVpBPjxNDsXaFdIvY8erRvw/jm8qBiv 1orA== X-Gm-Message-State: APjAAAXvyjycss22U/byhEUUMNFCOZ60FJuAuip7JLPbS9FqR1U5RMAJ sUJubVBLmpBrkSrfeVk7lB7QiVjsUdlDXbYn2Mb10jFGJZ3d/W1JjDRZZOn5+i5qipKDX2BwJyd JdbZMiSEHoGxL X-Received: by 2002:a1c:7311:: with SMTP id d17mr1768165wmb.49.1570614275926; Wed, 09 Oct 2019 02:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4Wse3vGoQIgd/ml9oYw6+IUa/k66QMkr3IXKbfsrgPgFKxrYzXylx/6gMsMm5PeJvNXxJPg== X-Received: by 2002:a1c:7311:: with SMTP id d17mr1768146wmb.49.1570614275686; Wed, 09 Oct 2019 02:44:35 -0700 (PDT) Received: from steredhat (host174-200-dynamic.52-79-r.retail.telecomitalia.it. [79.52.200.174]) by smtp.gmail.com with ESMTPSA id a3sm1320859wmj.35.2019.10.09.02.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 02:44:35 -0700 (PDT) Date: Wed, 9 Oct 2019 11:44:32 +0200 From: Stefano Garzarella To: netdev@vger.kernel.org, Stefan Hajnoczi Cc: linux-hyperv@vger.kernel.org, "K. Y. Srinivasan" , Sasha Levin , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "David S. Miller" , virtualization@lists.linux-foundation.org, Stephen Hemminger , Jason Wang , "Michael S. Tsirkin" , Haiyang Zhang , Dexuan Cui , Jorgen Hansen Subject: Re: [RFC PATCH 11/13] vsock: add 'transport_hg' to handle g2h\h2g transports Message-ID: <20191009094432.by5zs4c3binrznpp@steredhat> References: <20190927112703.17745-1-sgarzare@redhat.com> <20190927112703.17745-12-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927112703.17745-12-sgarzare@redhat.com> User-Agent: NeoMutt/20180716 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Sep 27, 2019 at 01:27:01PM +0200, Stefano Garzarella wrote: > VMCI transport provides both g2h and h2g behaviors in a single > transport. > We are able to set (or not) the g2h behavior, detecting if we > are in a VMware guest (or not), but the h2g feature is always set. > This prevents to load other h2g transports while we are in a > VMware guest. > > This patch adds a new 'transport_hg' to handle this case, reducing > the priority of transports that provide both g2h and h2g > behaviors. A transport that has g2h and h2g features, can be > bypassed by a transport that has only the h2g feature. > Since I'm enabling the VSOCK_TRANSPORT_F_G2H in the vmci_transport only when we run in a VMware guest, this patch doesn't work well if a KVM (or HyperV) guest application create an AF_VSOCK socket and no transports are loaded, because in this case the vmci_transport is loaded (MODULE_ALIAS_NETPROTO(PF_VSOCK)) and it is registered as transport_h2g. At this point, if we want to run a nested VM using vhost_transport, we can't load it. So, I can leave VSOCK_TRANSPORT_F_G2H always set in the vmci_transport and this should fix this issue. Or maybe I need to change how the registering works, e.g. handling a list of transport registered, setting priority or using the last registered transport. Any suggestion? Thanks, Stefano