From nobody Tue Feb 10 02:49:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1633179245; cv=none; d=zohomail.com; s=zohoarc; b=SIcbMzSnXZ9QtkbEbe4HL+GzmnJ2/4eJ+8TYLBYXrI7WHrD7Qg2UMFAbaDmU7d4z8PcWYw56nwojywiSU0yNl6ZwVERwJG+sOKashm0yqk1/cwVVYmK3ImUFamknePXDcI7yQctRYW9uj9MR0hhuLC1JgGWoiGfE1p2ssxmLhbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633179245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=OQJZIkvVd0km81PAjQexZHCm9ax3E3pRxRXNwMlSSt66bRMNUnoKWl/Y2OiVRvOyawO0Vnx2P1SK6SXHnkRjop3JOed9xXLFKvZLrN+AhFjjKb0jWhJ4mjVFtW8pN5TGazwyyyjUnhUu03Sj6cJc89PuRo6hjUSgUIL0A8gz4VM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1633179245099396.60003725648085; Sat, 2 Oct 2021 05:54:05 -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-390-0bzUdgF3PuKuIaEr1EeY8Q-1; Sat, 02 Oct 2021 08:54:01 -0400 Received: by mail-wm1-f72.google.com with SMTP id p63-20020a1c2942000000b0030ccf0767baso7337069wmp.6 for ; Sat, 02 Oct 2021 05:54:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id f1sm9356839wri.43.2021.10.02.05.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 05:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633179244; 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=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=Er+pX0m24AQlNquJtjyPPllr3nUvDCaGJ6xTjVp3WCq752g5CqOoCxOE9Gn4i0SIpSgcv/ wnqH3viL7bZxmQrU8jJyGWoKgocLsZYQ+oIjYWdawMMNqCk6fGA6s0KhKE2tRMR4B8RcXN eIlW/lcZJ2caFemlxQNq1JJWCd/5TxQ= X-MC-Unique: 0bzUdgF3PuKuIaEr1EeY8Q-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=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=ccOK9AUVjiKXKTt+mB+oU7C7MKcwJyXcAOatPmCD9Nx3tjrQPOvZhpxyJ6hD8Brzpm J0UTCoAfXj84V1EUO/NzjP3Kpc7ookuxCV4Dq3KxYBnChqJGG3aMdPnZ+lyZHl2yTLgh NOeUN/rNRRjlBYIgEzTV5vXVGbTmJZ+M3Z/BL+kIkozNkxAVzKaU9/NLlSdU6jkL9pnm TmPo6g3RoA7w+z6AeGdcFQWAgMcdjJdezKacNWq6on9ZpbOkKzba/aEBpPRia+IJ/sl/ FD9vdXLF+0/5CDORYWwoHSG0/3ld9B29U82NFimdpF9vFVIBCT4mmtoBhckIlSUIT9/d 9b8g== X-Gm-Message-State: AOAM5309049QD+x+On4xn06/GC27if3t2JYzVrowtE3zQ0bQfqyueXAR NjF8SlXSoL5MuU2MbiGgXQIVpMuna155/0yD10rGpNdlD3ip6VkSUg3r1Qzdu+PhYXkRhRhdgnp 089ZOOXQn4xBb1A== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr3374981wry.292.1633179240040; Sat, 02 Oct 2021 05:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1kpUWp8JDca6ogxcYyGFA/Lr3YXbhWtYHXiUio3plQycEwa1/nNlCgTVPD8fjk35/bjBa4A== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr3374964wry.292.1633179239910; Sat, 02 Oct 2021 05:53:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" , Dov Murik , Sergio Lopez , kvm@vger.kernel.org, James Bottomley , Eduardo Habkost , Paolo Bonzini , Brijesh Singh , "Daniel P . Berrange" , Connor Kuehl Subject: [PATCH v3 09/22] target/i386/sev: Mark unreachable code with g_assert_not_reached() Date: Sat, 2 Oct 2021 14:53:04 +0200 Message-Id: <20211002125317.3418648-10-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211002125317.3418648-1-philmd@redhat.com> References: <20211002125317.3418648-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: 1633179245677100002 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini --- 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