From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A13E0AC15FB for ; Wed, 24 Jan 2024 17:11:51 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EnYGEaB18reLS9U75wqVUxV9bNU+5+VNFK+y9/UfR6U=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1706116310; v=1; b=ct55HbswoGMy7q0Iq/PCJg2QdzML7Z86dtu/duebh60/bl1OtKzMhYJZNUozbPY7h0RsPHpE ZIx1YZV/b9k2IqTqH1CuHkLny3J0Bc/6dWTBzO/kMbJXdUcacPLsZxve46G3M6OoE63I8nFBNUl e4T76RxEUAcDUewVMhtEL3Cg= X-Received: by 127.0.0.2 with SMTP id GKAkYY7687511xx3ty9Tj8Lz; Wed, 24 Jan 2024 09:11:50 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.28592.1706116309543687584 for ; Wed, 24 Jan 2024 09:11:49 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-A9bOQPA5MLO-tiO4-HeECQ-1; Wed, 24 Jan 2024 12:11:44 -0500 X-MC-Unique: A9bOQPA5MLO-tiO4-HeECQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCADD827D87; Wed, 24 Jan 2024 17:11:43 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A92B8AC01; Wed, 24 Jan 2024 17:11:43 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A756D180038B; Wed, 24 Jan 2024 18:11:42 +0100 (CET) Date: Wed, 24 Jan 2024 18:11:42 +0100 From: "Gerd Hoffmann" To: Laszlo Ersek Cc: devel@edk2.groups.io, "Brian J. Johnson" , "West, Catharine" , "Xu, Min M" , "Ni, Ray" , "Wu, MingliangX" , "Yao, Jiewen" , "Xue, Shengfeng" , "Dong, Eric" , "Kumar, Rahul R" , "De, Debkumar" Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0 Message-ID: <63a6jposj5ucemyltcwqkka5fcmng7zvtxoop23n6pc3jetbuo@evihgquzwk5w> References: <3505f62e-cc54-490e-983f-7b4312e41509@hpe.com> <3lxerlg6g5gbzsxyh2v4qqqxru34ewytbge2wm6s7quyx3itx6@xlajojgm73qe> <1708ba2b-c969-ee8a-2cbe-fdc9acd31998@redhat.com> <3ea2zwl64ktnxhchys2x3yqndz35gx2ppssvkn5zeg23jt5x7e@qm2jpmw2zveb> <70393bba-23a8-0c26-e245-55cc075e9002@redhat.com> <5e3c5720-4cd6-fa02-fc5e-4eb550df68c3@redhat.com> MIME-Version: 1.0 In-Reply-To: <5e3c5720-4cd6-fa02-fc5e-4eb550df68c3@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: udody50aBM0l6DrHNuS7tzUXx7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ct55Hbsw; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi, > > static u8 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) > > { > > [ ... ] > > * When there is no need to deal with noncoherent DMA (e.g., no VT-d > > * or VT-d has snoop control), guest CD/MTRR/PAT are all ignored. The > > * EPT memory type is set to WB. The effective memory type is forced > > * WB. > > * > > * Otherwise, we trust guest. Guest CD/MTRR/PAT are all honored. The > > * EPT memory type is used to emulate guest CD/MTRR. > > [ ... ] > > > >> Something must be special about Min's assigned device. > > > > Yep. I think the magic word is "snoop control". When pci-assigning a > > *real* pci device VT-d (aka iommu) handles cache control that way. When > > assigning a mdev device this is not the case. > > > > mdev is a virtual pci device emulated by the kernel. This can be purely > > virtual (see samples/vfio-mdev/mtty.c in the linux kernel, which can be > > used to reproduce this). More typical is hardware-assisted device > > partitioning, used for some intel and nvidia gpus. Roughly comparable > > with SR/IOV, but not implemented completely in hardware, the kernel has > > some device-specific support code instead. > > Very interesting, thanks! ... But, given that mdev is emulated in the > kernel: isn't that *all the more reason* for treating the guest memory > as writeback-cacheable? For a 100% emulated device this would make sense indeed. When making some GPU resources available to VMs (including giving the GPU DMA access to guest memory) not so much. The later is the case with the intel/nvidia gpu mdev devices. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114333): https://edk2.groups.io/g/devel/message/114333 Mute This Topic: https://groups.io/mt/100367559/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-