From nobody Mon Feb 9 18:43:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623307592; cv=none; d=zohomail.com; s=zohoarc; b=JqKDki/UuBBKujsOtSkWUCzzL+QdjTeePNVEIoOPdiFPBXsf98RowfoXGcUsKDGjTAqzdWpkT8uJl0rtnG4yMlQMdFRCrfjLFX6Pgl0nHzF2kExBG+X3s6eUzuOtTUjiZbxFfZIB91pRl565ZBVmw55TcJyMQ1Y7bhnQtzmt+hY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623307592; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6XX5j3UbRtfmHxe3V1ph1hTBGyFJAYSVF+9Z2vcsOdo=; b=SFRrAzIfxZ6XdC6x+rpHqYszKkhUnlvX+2/2GF8WiP5gCA0RdgkAj3KBWSbdxCjDmc3JYOp44OB8dRo5U4OutSWaPj0mdfs0s7eoKlYQWy+xF+iBCyh7VfCjgxQBPj5o1iI2vJW+KPP0r2Iz+awsFHd5clzX+VW7Y26nMvdc8RM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623307592483299.11478892182754; Wed, 9 Jun 2021 23:46:32 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-5SxTXfOIMBmmGMytVLMwuw-1; Thu, 10 Jun 2021 02:46:29 -0400 Received: by mail-wm1-f72.google.com with SMTP id o82-20020a1ca5550000b029019ae053d508so2673404wme.6 for ; Wed, 09 Jun 2021 23:46:29 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id c7sm2565263wrc.42.2021.06.09.23.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 23:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623307591; 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=6XX5j3UbRtfmHxe3V1ph1hTBGyFJAYSVF+9Z2vcsOdo=; b=I9TZd+e+a4bSwGF0ZcuCiaMF+9xkcouezRePDdDhdiYHES4rGp+B92fxYi7tzICQ8w7fle EkEejveND3XASqIPW2GrTFNXk0cJNbXUF/CtzmMItrS72evP9jA8msKJA8L2iqpAU6shdI Vgq8cd1ATC4suOZoxIHPh/DNXujD094= X-MC-Unique: 5SxTXfOIMBmmGMytVLMwuw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6XX5j3UbRtfmHxe3V1ph1hTBGyFJAYSVF+9Z2vcsOdo=; b=KVTmVkAsKySIyWgrh5J8eL6MqePd7bOrnjL2hgKG3XBnJcKtslIaYDlFQymzG/xeph /5m05cVUX+AOGeiX6M2bz0LTRWTRRBylaFzs/VF+UmizsR46vwB/zKMGNGua/VpvjffS 5psg6AHcvM4uRAO5GPMXT7AvkWC3acpU6XD1zmSl/hfYl77AaaWOCzVPs7wE25hqtl1O i0qvPm3CsiDHWMwgUk1A+He30ERhX4jsukO/AksC2OuKDlPGw8+GlqWCa0mzyyrnKUvl cNGj2DvG3SrEQPAJE0rNpvkVYK2JC/3PKLfrrNiGs3gMt7T9/qO0TCdN2pLqIuv9Dwff SS9Q== X-Gm-Message-State: AOAM533qB/2ArcgPWFtJciS7B6wO6E7BdFEilnkyCjxOKJgZy/HP6xRC eZnaltQUGQxTpUYIaXhPnWl6JUzJDfkQB8MQ7McgxVF6rwb7OVg6pSK603Rox1HXE7bf8LebhAh 5M0zDLdJf+oiBHw== X-Received: by 2002:a5d:59af:: with SMTP id p15mr3613300wrr.292.1623307588875; Wed, 09 Jun 2021 23:46:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRbDkQkHoVvh05WdUyTY3UiGUarqHqJGvkE3/nADrw0FfjHi0DsxfVZd0wbOGhUwO0kH48pg== X-Received: by 2002:a5d:59af:: with SMTP id p15mr3613289wrr.292.1623307588768; Wed, 09 Jun 2021 23:46:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr . David Alan Gilbert" , Connor Kuehl , Markus Armbruster , Brijesh Singh , Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 07/11] target/i386/sev: Mark unreachable code with g_assert_not_reached() Date: Thu, 10 Jun 2021 08:45:52 +0200 Message-Id: <20210610064556.1421620-8-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610064556.1421620-1-philmd@redhat.com> References: <20210610064556.1421620-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The unique sev_encrypt_flash() invocation (in pc_system_flash_map) is protected by the "if (sev_enabled())" check, so is not reacheable. Replace the abort() call in sev_es_save_reset_vector() by g_assert_not_reached() which meaning is clearer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/sev-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index eb0c89bf2be..4668365fd3e 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -54,7 +54,7 @@ int sev_inject_launch_secret(const char *hdr, const char = *secret, =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) { - return 0; + g_assert_not_reached(); } =20 bool sev_es_enabled(void) @@ -68,7 +68,7 @@ void sev_es_set_reset_vector(CPUState *cpu) =20 int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) { - abort(); + g_assert_not_reached(); } =20 SevAttestationReport * --=20 2.31.1