From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5CB529418AD for ; Thu, 18 Apr 2024 11:45:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=9eRKsBuLHWilvhlfa9bFQ02TZg7w4hXQR4DfC3k1UCU=; 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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20240206; t=1713440710; v=1; b=Ub6gOUFlb98QanP5XcyYHeegTZ4U7bgPOFPHK0MzcRNblxUP6FeToN6OSvKhFJxb10pfFFv/ FN1o+MA1kSMKWaiBsTB464zF101mRFepPB/zW9PlhnJn0u4PnYu4M8aRzsGe/j+Ey503I0SAEmY tWT10uXQLYJ9WA9Rqbwsfxe5dI7uzEaksBQCc4dhXxm3wzSXTx8oNozCOWHfvhY0p44Txjdlhqo v4494NmxK14gv/8M2zV+WzkGSMpm9fGI+enZeGjPWq9Lj2jdI9qvPwo2ckOdP9TOAoPVFjDSyKg UmvIy6URroioNKlagqvS3NJ5bqYLWWUmL7QsZfLIKSb+Q== X-Received: by 127.0.0.2 with SMTP id 94RKYY7687511xskOIeLhDBs; Thu, 18 Apr 2024 04:45:10 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.10751.1713440709984013786 for ; Thu, 18 Apr 2024 04:45:10 -0700 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-650-vZNX3rmwML-nfQ8kKwCKdw-1; Thu, 18 Apr 2024 07:45:05 -0400 X-MC-Unique: vZNX3rmwML-nfQ8kKwCKdw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 ED275811029; Thu, 18 Apr 2024 11:45:04 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7A172166B32; Thu, 18 Apr 2024 11:45:04 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C43DF1800DF8; Thu, 18 Apr 2024 13:45:03 +0200 (CEST) Date: Thu, 18 Apr 2024 13:45:03 +0200 From: "Gerd Hoffmann" To: "Yao, Jiewen" Cc: "devel@edk2.groups.io" , Ard Biesheuvel , Oliver Steffen Subject: Re: [edk2-devel] [PATCH 0/4] OvmfPkg: Add VirtHstiDxe driver Message-ID: References: <20240322142735.1749388-1-kraxel@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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 Resent-Date: Thu, 18 Apr 2024 04:45:10 -0700 Resent-From: kraxel@redhat.com Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2C9IeQcVSaZ9GpHuqudtBiMKx7686176AA= 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=20240206 header.b=Ub6gOUFl; 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 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Wed, Apr 17, 2024 at 01:20:57PM +0000, Yao, Jiewen wrote: > That is good start. The SMRAM lock and Flash lock seem good to me. > > Comment: > 1) Do we really need to add "Q35" for the policy? > #define VIRT_HSTI_BYTE0_Q35_SMM_SMRAM_LOCK BIT0 > #define VIRT_HSTI_BYTE0_Q35_SMM_SECURE_VARS_FLASH BIT1 > > I feel we had better remove it, since SMM_SMRAM_LOCK and SMM_SECURE_VARS_FLASH are common features for almost all X86 platforms. Well, SMM mode is supported for the qemu 'q35' machine type only, the 'pc' machine type doesn't provide enough memory for SMM. Which why I've added 'Q35' to the name. The SMM_SMRAM_LOCK test actually is q35-specific because the control registers are chipset specific. But, yes, the concept is not q35 specific. I can drop 'Q35' if you prefer it that way. > 2) Would you please let me know what "READONLY_CODE_FLASH" really means? > > #define VIRT_HSTI_BYTE0_Q35_SMM_SECURE_VARS_FLASH BIT1 > #define VIRT_HSTI_BYTE0_READONLY_CODE_FLASH BIT2 > > Does READONLY_CODE_FLASH mean NO write to flash even in SMM mode? > Or does it just mean NO write in normal operation mode, but still writable in SMM mode? With qemu being configured properly flash behavior should be this: | OVMF_CODE.fd | OVMF_VARS.fd -------------------------------+----------------+---------------- SMM_REQUIRE=TRUE, SMM mode | read-only | writable SMM_REQUIRE=TRUE, normal mode | read-only (1) | read-only (2) SMM_REQUIRE=FALSE | read-only (3) | writable VIRT_HSTI_BYTE0_READONLY_CODE_FLASH will verify (1) + (3). VIRT_HSTI_BYTE0_Q35_SMM_SECURE_VARS_FLASH will verify (2). (probably a good idea to add that as comment to the patches). take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117983): https://edk2.groups.io/g/devel/message/117983 Mute This Topic: https://groups.io/mt/105086174/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-