From mboxrd@z Thu Jan 1 00:00:00 1970 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.web09.27735.1660734303139907166 for ; Wed, 17 Aug 2022 04:05:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=alqboDOp; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660734301; 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; bh=6eaEKs45sxyniKI4B4KvLw/69oAgOTMHop266P8gflk=; b=alqboDOpBRReZ5HmvRqnEEQ+F+4qTxVO+Z3C46jYsD2L9PVHIJxb8DgwQXegmfhoNuoL3r VU8crMLAbM+WIkwHgVTB41DuJHq5IZaGEi6ZkXewRQ59sZnYdGlTX2hE+T4LDWybKfmgLw +FgBp3VxVBqpZgtQ1dENvLOjyoFz7U4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-7vQSChkrNzW732pBFsB12Q-1; Wed, 17 Aug 2022 07:05:00 -0400 X-MC-Unique: 7vQSChkrNzW732pBFsB12Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49B6D811E84; Wed, 17 Aug 2022 11:05:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18276492C3B; Wed, 17 Aug 2022 11:05:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C444E1800920; Wed, 17 Aug 2022 13:04:57 +0200 (CEST) Date: Wed, 17 Aug 2022 13:04:57 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: min.m.xu@intel.com Subject: CcProbeLib not working for runtime calls Message-ID: <20220817110457.2gvr4yxoxlve5ncz@sirius.home.kraxel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, https://bugzilla.redhat.com/show_bug.cgi?id=2114858 I think the call chain is: -> linux does efi runtime call -> some debug message printed -> OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c -> MdePkg/Library/BaseIoLibIntrinsic (IoWriteFifo8) -> OvmfPkg/Library/CcProbeLib (CcProbe) -> page fault when trying to access WorkArea Hmm. We could probably reserve the workarea page and register it for a runtime mapping etc. I suspect that'll only crash the in simliar ways a little later because the tdx/sev code is not prepared to work on runtime calls. I'm also not sure this is possible to make work at all given that #vc/#ve faults are handled by the linux kernel not ovmf at this point. So have CcProbe just return CcGuestTypeNonEncrypted when called at runtime, hoping that the linux kernel handles #vc / #ve faults properly should they occur? take care, Gerd