Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp722780pxj; Thu, 3 Jun 2021 18:32:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI7O3zDIShozpczpRs5FEvmD3tTi0L0rg6YIVrqVMmwncp7d5949riO2Uwyb2DPLdUl4FK X-Received: by 2002:a17:906:9bce:: with SMTP id de14mr1874690ejc.353.1622770375085; Thu, 03 Jun 2021 18:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622770375; cv=none; d=google.com; s=arc-20160816; b=mimA3cBQeO8ryM4idJswHZxNPMG058DA/lM2864EpzhV31qOoCKb1y6BHW6lehSQZV OG1VyUBuaAJwApNZi5ULW1+uDMua2XUa7nR1Pjn/XvI/hDIxcYNVweu9YjOkLa56S4uS JUqjyx7w3lgbIL1BWsa5/FhLSzDlWQ9Rg+jnS+MvbDwt2xDVf1z474TDPJJ3UvujNRTz NmESznOe8Pg9OJxPYomhVSF4dwsv93hAEl1WwDI1433ulVfxT4Ouyc4I0RevoO1C7K/H UlA3GsYeEfyHAb8TEUwvZpraO1iC14/ut5d5EkbEAe7qTaEcTdlAH6+VVYDHtzNWrnDU sDuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=T/MGaP9q9f0JKQhqX62iqN0ZP08JFP5du6nrkmNfcZI=; b=eoqD+dW/rB45Gr0Bu4Lcq/ywYI8MJDn1Bvk6BIMwsosvzX01uvaAQdg7tpyW6Grr64 hZ7FKmtwnAxstW+U14yhRaecLyrS8TdrqYS/80uf3WenlznEYued+SdUOCkj+oBNkykJ HiXqPjzhg/+EZ9T9U0u1muyGN8usLgz/8UdPA7W7yMSXvh6DEPeZ1k2r0/aIv0kwxPDc 0VzLfzaSh52xoImzduMEL9V7B+WBOGmpj+HUmaZSn1OSeS733Wx+w/BM2J4qUa4TTh9F FuMz2FJgSRJiFenf42SxK+xTb3lH3AuXtePbO616cfQcDdlEx5oY95WAQ21rsupRC6WW KiLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="K/HQSMU4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si3257567edr.331.2021.06.03.18.32.29; Thu, 03 Jun 2021 18:32:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="K/HQSMU4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229944AbhFDBbF (ORCPT + 99 others); Thu, 3 Jun 2021 21:31:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49464 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbhFDBbE (ORCPT ); Thu, 3 Jun 2021 21:31:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622770158; 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=T/MGaP9q9f0JKQhqX62iqN0ZP08JFP5du6nrkmNfcZI=; b=K/HQSMU4LBVYpz00V1PPKjKhDMrTDf3NbQeokcJY/KZ1gwFMnyQsSZVRHXvKCYQMHwRpwM HxrpXfWZjLstkN++epmqAL2GWEw0KWUuwsCvIJhLeLCREABiej2cCjKpeeHsjE4VSxWC2J lBZ/h+FnIFWli49CMH7Eq7lm5nEu4RM= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-MnbzckLPPbuGOkyxFAEofA-1; Thu, 03 Jun 2021 21:29:17 -0400 X-MC-Unique: MnbzckLPPbuGOkyxFAEofA-1 Received: by mail-pf1-f199.google.com with SMTP id r15-20020a62e40f0000b02902ec871096d3so180435pfh.12 for ; Thu, 03 Jun 2021 18:29:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=T/MGaP9q9f0JKQhqX62iqN0ZP08JFP5du6nrkmNfcZI=; b=P20IH17Ua4mdJwhkkT2YWsPf15azeyB7AHmk67WrCd3kff4S8RZXq+Mj+y6EVMK18j 2c9rGV2A7QMJkhF0x/yhf11CQsHrGsSG+2BAWDcJ5aUhoa7f4NXoQpLmcvK1yEEjya5d WaZKmQJ1LEB8xKcBlyqMNQfsOal6TdE1bsSue9Mcbb+onUx6tvCBaPbZ6+gP4fYAAFhT HUPZsIEIVFpy4PbbCMxs4acWWHKVtxh95e0RuIZyuyhg+p+BcQL6rJ3dw+UGZXp7B8bH 1uIwzg6o8ohmTfZ7wN+Ljl6TQttHytEN4BJnjivWmHbm+ru6vV12Iok4ZhZSWkZ0n2I3 I3OQ== X-Gm-Message-State: AOAM5318iYES0gPYEfEMr6xTQ2il1kHSLl4kqKr3yGBJEQhjY4+ENKWE GQ+IfRZKogUiApS2o8299A/aADsWuJ5hbw7EUgBo1hnmcgXcZ6Yh3Utap7UBQBgAVEDCleRvUAg G+wjbLezhUPjyWtW42fJc3UXQWukplzPYWqsQcBS+xgfaMjA7I5mczG2Boeg5pfsK3luQQAJMfY RM X-Received: by 2002:a17:90b:1b4f:: with SMTP id nv15mr14342939pjb.56.1622770156356; Thu, 03 Jun 2021 18:29:16 -0700 (PDT) X-Received: by 2002:a17:90b:1b4f:: with SMTP id nv15mr14342903pjb.56.1622770155986; Thu, 03 Jun 2021 18:29:15 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id h12sm289129pgn.54.2021.06.03.18.29.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 18:29:15 -0700 (PDT) Subject: Re: [PATCH v1 1/8] virtio: Force only split mode with protected guest To: Andi Kleen , Andy Lutomirski , mst@redhat.com Cc: virtualization@lists.linux-foundation.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, x86@kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com, jpoimboe@redhat.com, linux-kernel@vger.kernel.org References: <20210603004133.4079390-1-ak@linux.intel.com> <20210603004133.4079390-2-ak@linux.intel.com> From: Jason Wang Message-ID: <4b071a9f-3683-b990-ddc2-450ac5a10388@redhat.com> Date: Fri, 4 Jun 2021 09:29:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/6/4 上午2:00, Andi Kleen 写道: > > On 6/3/2021 10:33 AM, Andy Lutomirski wrote: >> On 6/2/21 5:41 PM, Andi Kleen wrote: >>> Only allow split mode when in a protected guest. Followon >>> patches harden the split mode code paths, and we don't want >>> an malicious host to force anything else. Also disallow >>> indirect mode for similar reasons. >> I read this as "the virtio driver is buggy.  Let's disable most of the >> buggy code in one special case in which we need a driver without bugs. >> In all the other cases (e.g. hardware virtio device connected over >> USB-C), driver bugs are still allowed." > > My understanding is most of the other modes (except for split with > separate descriptors) are obsolete and just there for compatibility. > As long as they're deprecated they won't harm anyone. > > -Andi > For "mode" do you packed vs split? If yes, it's not just for compatibility. Though packed virtqueue is designed to be more hardware friendly, most hardware vendors choose to start from split. Thanks