From nobody Mon Feb 9 16:12:42 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=1633623491; cv=none; d=zohomail.com; s=zohoarc; b=HJEV2sLLhrxv2CANqBl2ZhbbYRCCkz/XJOhVRwCSIlzDpUjNdAsISdB4N3yixitPwrZyZYt2bbvrXBDyhX2e+XaTBtRMTj4qhlj/g+Jv7sPPGwr0bViMmoPuvermeRe6nFy5HJHog6HU3wZlnEIqYHDYlR102m/bTDPaBSKdsFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633623491; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Yu0i8hmAoNBqKA56xVa0FWOHuPb3wa3Ay0pPJ2J6oOs=; b=DaPxrVAT0P2d5GZ7yVNGhDhI/XCYfcA3eaSVUnScK+XawqMEOyV+EJhniUfWoCItHJ+kgotjOndHVFgyqOH8GBz/rMBbR3d1ywz0/NKTdkjgc1jJC5RF5ipT65kEXnu0c+hW9oE5WBT1FJZPg7waj8M3zurKaSf9KNitlQHiXmI= 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) 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 1633623491889694.520064179537; Thu, 7 Oct 2021 09:18:11 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-549-oYL6SQnEMoyevDR17Cs7gw-1; Thu, 07 Oct 2021 12:18:05 -0400 Received: by mail-wr1-f70.google.com with SMTP id v15-20020adfa1cf000000b00160940b17a2so5116712wrv.19 for ; Thu, 07 Oct 2021 09:18:05 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id u1sm8426658wmc.29.2021.10.07.09.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 09:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633623490; 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=Yu0i8hmAoNBqKA56xVa0FWOHuPb3wa3Ay0pPJ2J6oOs=; b=GVt1yT+itLUmXxIN/pgJBMpMb0IN2dtm9beZrzcogT0AVKh3mcNZb6eSPkJjf3kftFx2f7 mnqbiWB9Ka1bcTcYO/kRS+wigslP2ATitcb4NVAf0B7TYnt0AheuHCeH45TitDwDd2112Q JtX6bNywe9B0bZEs/lEe28hryPJFUus= X-MC-Unique: oYL6SQnEMoyevDR17Cs7gw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yu0i8hmAoNBqKA56xVa0FWOHuPb3wa3Ay0pPJ2J6oOs=; b=pMejY8x4shohZBIJOtnLA2YgoNTotaP1jb/2UJ6+0Q8+4K/KaXNOlhIykuWMSXewqw m59dmHkB/0h1Aky9flBdineiSWMoIAT8nl2GyHUfHO25e3AYDpWdUmLrZ98/A/Ch7IxP jd6FZodOBkxEbpIJzNMywp++9biuMSA3zbTHcHl5hXi17HoyGyVVtyIHo82RZ7IbLmFe rzhZjq8mP1QXXT8CjujLEzIVmqZmNrXhU9/PjEJDUmL8/d65FkkFEc9gTlbp342w7mCh XJzq9M91/C5t/2ufiEi8pbsJoA0X32eA5iBOZV1trBtP7bZALfpkDsFZvHtXXtKdfJF7 fKZg== X-Gm-Message-State: AOAM531+GSc08VDWnFKnXZxbsvx/6Sq295/4H8N/BTSGo+YA/GY5orPx 9gmKGVgAqR05ewbVJdiia54+a3HmLXihqbmox7TYzitKU1okhKCP8KFEVmbyOxOdSFdgPGUPNjI yIiwoewKXh5nr3Q== X-Received: by 2002:adf:bb08:: with SMTP id r8mr6741293wrg.247.1633623484642; Thu, 07 Oct 2021 09:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1j54x6mkDDT5G+p886ML0TNkhiqQSJ77tctklrBToCqo96VSPVZB4HfWC67SFWx8EPKXHSw== X-Received: by 2002:adf:bb08:: with SMTP id r8mr6741267wrg.247.1633623484503; Thu, 07 Oct 2021 09:18:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , James Bottomley , Brijesh Singh , Sergio Lopez , Dov Murik , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Connor Kuehl Subject: [PATCH v4 10/23] target/i386/sev: Mark unreachable code with g_assert_not_reached() Date: Thu, 7 Oct 2021 18:17:03 +0200 Message-Id: <20211007161716.453984-11-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211007161716.453984-1-philmd@redhat.com> References: <20211007161716.453984-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) X-ZM-MESSAGEID: 1633623494130100001 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. Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini 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 20b1e18ec1b..55f1ec74196 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