From nobody Sun Nov 24 23:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719500116; cv=none; d=zohomail.com; s=zohoarc; b=X6xw9XlIj7fgc7/yZkwKNBFYmf+0CfkWgJY/ypdImBKUB5JGaPZlZ260k6AS/ldALLQf2dRcH0j4oVgfV+TcAHD8YcH2mfHRO8ah7kKdzbJYxQ69+nG+dt0VfKc0oBZKiaECbM/XObt1MG2W6Mj/lnQWl0YLexQ2EtpNGyKPB1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719500116; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u8TcXNw1quRhJfIms88BIFe4UYU2p+cTpYnRuEZRfYo=; b=H9yg3XsBJqHTNW/NJKz7f6tiDgZKrG0LDcJIEcLOliBmBZQwTn/Qp4WOSggMLAFyDuROplX7JkDYHfR9vbkVoO8ahBCGlC9XRwJn0Slhh+LPQztiEITbbzVZcQVbpRf2mYJUsoV43KSNz2IRNwBFiESRutZv+3pfvP0IddVvW2A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719500116884335.7092024557745; Thu, 27 Jun 2024 07:55:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMqVm-0007sr-Fi; Thu, 27 Jun 2024 10:54:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVl-0007sT-AA for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVj-0007HZ-QZ for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:09 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-57peZZOeNkC6o9IMe3jrjw-1; Thu, 27 Jun 2024 10:54:04 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-57d241a4d0eso459374a12.2 for ; Thu, 27 Jun 2024 07:54:04 -0700 (PDT) Received: from avogadro.local ([151.48.235.205]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-584d1280e93sm974664a12.33.2024.06.27.07.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 07:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719500047; 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=u8TcXNw1quRhJfIms88BIFe4UYU2p+cTpYnRuEZRfYo=; b=E9wELK4iSOdGLdkOaquW6cWqmKCpu+aUbNsjJih4dNI1Jigx4VGaFlPSmh+ik8gC0+EWBL GogUeubqCbxr3D+ADTkHQ4oNokes2WxCMEjWjhFKNQLVtrR154q7Gp74kNkwiHJHeKxE68 AqS4KxlEs0M2yU2mjYfnE2ueU0IcrxA= X-MC-Unique: 57peZZOeNkC6o9IMe3jrjw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500043; x=1720104843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u8TcXNw1quRhJfIms88BIFe4UYU2p+cTpYnRuEZRfYo=; b=HDeiBJ0EipUC4/fpzJITGo5Jpnh554VBJrSd6zHm7MTqxyoAm9SDHzJDezljSXza3W TJcLCuzYqCrEDGMCWNfUVHzEX6QPNv7Z9xQY/NJwrV2gKZygYqpC1H4c9wmSwzbvhc5O Cw5C5WsxaVuWfmZnU4il8vCwnsgAya6S2ua1++IlzyFCTSkpHQsddsYJDi3IkxyQiMIZ rOGKrvYEAd19k0TVOtGjkMt4pDJJ0JWNEeY3aZOfBvDYWvRht/eIoOWjXRtrTlbyfL6S VfRMiAX3KrRCRz/6N0fTTQKv1QBGogcenJNHsFabv8zWuhnOvP02Yye3wVvMWI8GIjEY sr6A== X-Gm-Message-State: AOJu0YzVgsLIcODKJLSosCbBOBNvOHyNPZ52B9bQ0H+G/ryV0E5c9HRB Zd4BWQGB4tx6VG3R1Ueeod884hvZF2kIGfArRiJDXtMpdQ4QJhDpSnrFpS1czdN3Sbg1CH6UtHA 2j+mAqn/Ea6wmQjMbhVYAsswv3qqu92L1LmSIXDTA08RKFpvFxnOulz/dG/EKlEiKFaDvk3YNI5 /BpWsoinyaPLlJaR732OJvD8DheiNYABiQ3fzl X-Received: by 2002:a50:aade:0:b0:57d:50c:e28d with SMTP id 4fb4d7f45d1cf-57d4bd72312mr11786663a12.10.1719500042968; Thu, 27 Jun 2024 07:54:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWLxRT5D69zKsWzGjv0ZSTiWZY4cL5E745ScOAzWRC5Ix6bOrAEvP0SWE02pvYd4KH3yw6cA== X-Received: by 2002:a50:aade:0:b0:57d:50c:e28d with SMTP id 4fb4d7f45d1cf-57d4bd72312mr11786644a12.10.1719500042497; Thu, 27 Jun 2024 07:54:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, alex.bennee@linaro.org Subject: [PATCH 1/5] target/i386: SEV: rename sev_snp_guest->id_block Date: Thu, 27 Jun 2024 16:53:53 +0200 Message-ID: <20240627145357.1038664-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145357.1038664-1-pbonzini@redhat.com> References: <20240627145357.1038664-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.212, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719500117577100001 Content-Type: text/plain; charset="utf-8" Free the "id_block" name for the binary version of the data. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/sev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 30b83f1d77d..6daa8c264cd 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -152,7 +152,7 @@ struct SevSnpGuestState { =20 /* configuration parameters */ char *guest_visible_workarounds; - char *id_block; + char *id_block_base64; char *id_auth; char *host_data; =20 @@ -1296,7 +1296,7 @@ sev_snp_launch_finish(SevCommonState *sev_common) } } =20 - trace_kvm_sev_snp_launch_finish(sev_snp->id_block, sev_snp->id_auth, + trace_kvm_sev_snp_launch_finish(sev_snp->id_block_base64, sev_snp->id_= auth, sev_snp->host_data); ret =3D sev_ioctl(sev_common->sev_fd, KVM_SEV_SNP_LAUNCH_FINISH, finish, &error); @@ -2159,7 +2159,7 @@ sev_snp_guest_get_id_block(Object *obj, Error **errp) { SevSnpGuestState *sev_snp_guest =3D SEV_SNP_GUEST(obj); =20 - return g_strdup(sev_snp_guest->id_block); + return g_strdup(sev_snp_guest->id_block_base64); } =20 static void @@ -2170,14 +2170,14 @@ sev_snp_guest_set_id_block(Object *obj, const char = *value, Error **errp) gsize len; =20 finish->id_block_en =3D 0; - g_free(sev_snp_guest->id_block); + g_free(sev_snp_guest->id_block_base64); g_free((guchar *)finish->id_block_uaddr); =20 /* store the base64 str so we don't need to re-encode in getter */ - sev_snp_guest->id_block =3D g_strdup(value); + sev_snp_guest->id_block_base64 =3D g_strdup(value); =20 finish->id_block_uaddr =3D - (uint64_t)qbase64_decode(sev_snp_guest->id_block, -1, &len, errp); + (uint64_t)qbase64_decode(sev_snp_guest->id_block_base64, -1, &len,= errp); =20 if (!finish->id_block_uaddr) { return; --=20 2.45.2 From nobody Sun Nov 24 23:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719500102; cv=none; d=zohomail.com; s=zohoarc; b=aYc5yXfO/6TXKA4DbMZhVQwnVloFTex4je2v69Nf3MG0SDWi5UOuYNety8RIetQC++wRK7Pz2nEckMKobIxs/knKJGkjEg4hXv+o1n7/8H0W1jaWJcUaRA5TBbVwtxcgesWhrTjSK+EuXTzn5747lM2vsJD7Ti8tNSSjFOoWMFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719500102; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=b2IS7msecJ7gmIh0NCWZXMeuw+h41Tdg1NGfSCga9pg=; b=PIhd01HV0oVJyke16je6S6hcYbSUkNMj0dbW8OQwbqn9TzYSsTdb3qmstJWA2suu4Gzqdv/PokinpRNfJYIKYSxz/hlBrBt6ESeMacrWWwxp/yIxwMS/Lw2TsYAcb/ajow5Tv7KnXT7WzTloCIpL8yaKe1fCelKALZJD19uxpG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719500102134910.8445940516183; Thu, 27 Jun 2024 07:55:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMqVr-0007tG-U6; Thu, 27 Jun 2024 10:54:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVo-0007t6-IJ for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVm-0007Ho-Vw for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:12 -0400 Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20--DyqZtr_Pzqtl-LASBiWbg-1; Thu, 27 Jun 2024 10:54:07 -0400 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2ec5f22cbedso38627791fa.3 for ; Thu, 27 Jun 2024 07:54:07 -0700 (PDT) Received: from avogadro.local ([151.48.235.205]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-584d1280e88sm977815a12.39.2024.06.27.07.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 07:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719500049; 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=b2IS7msecJ7gmIh0NCWZXMeuw+h41Tdg1NGfSCga9pg=; b=ZhQvZfLaCJG7EBhqu4mirygfdSx8nH4lMKCPnQvCy02yTjPxC4L0E2CURGhPebQXcCNfZF ujsOxkOi4J+SpwYT5ax2iiKkEPlGJJ9q1AkNCdC/bHcsLa+84soZDHVCBR36yFfdgsTIMn B1g3ZXpgp6LIQ51vKUmOqzcOzWXTgpI= X-MC-Unique: -DyqZtr_Pzqtl-LASBiWbg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500046; x=1720104846; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b2IS7msecJ7gmIh0NCWZXMeuw+h41Tdg1NGfSCga9pg=; b=aNJTL3EKsyZ0NzFiPCai3JQfp2Zt7bNrTiQd/7xnRfdCSNpHNlaU9P+MEMl3nw94FP 0LkyTZ6pJGLl/Ss0/bklqLcg5Y7gtqwfhqsBeMTQzu0O2QeTxcdujz6zz6yU7cNQ7FDY PzbCwptyXjOJ4lY3hCxyhauzwNAYHJEBp3ao6x3nNKhBL++vy+wTuHyYBUqspZoqCMFs Ix5Rgxq9HSnFWvCB8QUl3QXOJVYP0nrqk+Mim7kEk34rci/3dAhs+XHac4vVnpt9QZhp e0epQjFncZgm4c3ZazYO4PXOMQFUbfrJTeKQMP8t25r+Aotpl6g23PR8fQ3ipgm/8+IV HpWw== X-Gm-Message-State: AOJu0YyuUmKQmoP8CydsZ2N7O9CAst1IZbNuCOEuMXw19y6ew5ddZD+k yzQnL6mOfw3d4iRsF947bWp4o8QtdocKXc1yJmA46tEC5lum9QqYPjouTaYaNbwOzUW8ddV/MZl lkbjBWy3L75Pa82LGkHLLq/dqP9A6WYRbs/lDhVbkxmZaxdeKXNoa72tJl1wU/vODlGitFOps1x mnr5sM5YqlpvzOpu/AhbNNgfh6+ulEY6C4o/aP X-Received: by 2002:a2e:9213:0:b0:2ec:4de9:7334 with SMTP id 38308e7fff4ca-2ec5b2fd2bdmr102371951fa.11.1719500045832; Thu, 27 Jun 2024 07:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1k+lYbTD+7n4O80+xmu4J3yLVNOrQN8wKmP+f+TOBZeuFiPrz/dpymR3tuctAyStwfx8mmg== X-Received: by 2002:a2e:9213:0:b0:2ec:4de9:7334 with SMTP id 38308e7fff4ca-2ec5b2fd2bdmr102371671fa.11.1719500045296; Thu, 27 Jun 2024 07:54:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, alex.bennee@linaro.org Subject: [PATCH 2/5] target/i386: SEV: store pointer to decoded id_block in SevSnpGuest Date: Thu, 27 Jun 2024 16:53:54 +0200 Message-ID: <20240627145357.1038664-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145357.1038664-1-pbonzini@redhat.com> References: <20240627145357.1038664-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.212, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719500103616100002 Content-Type: text/plain; charset="utf-8" Do not rely on finish->id_block_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/sev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 6daa8c264cd..2d4cfd41e83 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -153,6 +153,7 @@ struct SevSnpGuestState { /* configuration parameters */ char *guest_visible_workarounds; char *id_block_base64; + uint8_t *id_block; char *id_auth; char *host_data; =20 @@ -2170,16 +2171,15 @@ sev_snp_guest_set_id_block(Object *obj, const char = *value, Error **errp) gsize len; =20 finish->id_block_en =3D 0; + g_free(sev_snp_guest->id_block); g_free(sev_snp_guest->id_block_base64); - g_free((guchar *)finish->id_block_uaddr); =20 /* store the base64 str so we don't need to re-encode in getter */ sev_snp_guest->id_block_base64 =3D g_strdup(value); + sev_snp_guest->id_block =3D + qbase64_decode(sev_snp_guest->id_block_base64, -1, &len, errp); =20 - finish->id_block_uaddr =3D - (uint64_t)qbase64_decode(sev_snp_guest->id_block_base64, -1, &len,= errp); - - if (!finish->id_block_uaddr) { + if (!sev_snp_guest->id_block) { return; } =20 @@ -2190,6 +2190,7 @@ sev_snp_guest_set_id_block(Object *obj, const char *v= alue, Error **errp) } =20 finish->id_block_en =3D 1; + finish->id_block_uaddr =3D (uintptr_t)sev_snp_guest->id_block; } =20 static char * --=20 2.45.2 From nobody Sun Nov 24 23:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719500127; cv=none; d=zohomail.com; s=zohoarc; b=Runbh/I5OFtVXXx0LsCa3wEjnC7zBDf26OVUfSe+G+5+wkCBzHRMqOLPKGxYQd8Osc+YUJt7Dzek5ZLuXzlic6M8PusNzz9vl8NzAuTJDhuEBkkh1Y6U+f0UJXj/oOQZovJaU942CW9KCJ5dOacJSS3Xp/BokraGse95Nu1GPhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719500127; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wOVf84lwfgLrYogRC0LnY4gOavX8fM5mQLjh40mAI/o=; b=UchMSMvjSBdXf+1iYkGWZE1N6MiyzKtqmkK6eViDDJKTootRwIh90hyR7trrvDzXZ+L4pvrPj1Nm6LVXtBuy4aKEVEPdVPCTGEkmCNVjdXzWwq/uuPVf4jkblgfhg/TkoyamhhLa8CjqutIxZAmLiBRlfjxkIWadmtoxX0WltAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719500127385653.8073642244051; Thu, 27 Jun 2024 07:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMqVu-0007uA-7f; Thu, 27 Jun 2024 10:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVr-0007th-TJ for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVq-0007I3-1F for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:15 -0400 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-qP0CTMArOnC_51Qfr6kl_A-1; Thu, 27 Jun 2024 10:54:10 -0400 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-52ce42bb0efso4174390e87.2 for ; Thu, 27 Jun 2024 07:54:10 -0700 (PDT) Received: from avogadro.local ([151.48.235.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a729d6fdc8esm66440566b.22.2024.06.27.07.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 07:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719500053; 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=wOVf84lwfgLrYogRC0LnY4gOavX8fM5mQLjh40mAI/o=; b=cDZcIwHH92svQWBFLxnW+WCmfaBkNbuHW+vE5xYICkkE38wlHFTeKJGc5PGM0gYZxcAhvx 2QCArDaankLxaF3JmihOcy1cULYuP91bgdh5D6opkrvPC2yo3U/fu3jGJrsj14RqPmV/r0 lfv39UfpjIOwL5sS0EeF2925R1ej984= X-MC-Unique: qP0CTMArOnC_51Qfr6kl_A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500048; x=1720104848; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wOVf84lwfgLrYogRC0LnY4gOavX8fM5mQLjh40mAI/o=; b=spGUj+KNxDH9y5UCO6uWj1+ku32qobxGHbWjGZELfKqt9JNzMIrQUjBcgK57dm3MnF /cqKrWgx67P7PbLUxR2XMI3O3X9UgHD+HiEpBREhsZiwYlwEjhsrJXxBm0AXCG9sAal/ QxwUXw2unq/hVGJZVNuL0e7l33MxabtgXjf8bEkkXmpTqkuVGrcsEeqeIdbLto/5p9q5 aNkN3XJpIOFCyUIGUULPzzRQFeXrOYVNUe7QDMmzlImEiKDpg096lvtpa7AKEDZiS/A7 n8ySnfN7ReurDUdouO3AtVrkaKOOQF3ssJRdNxEr4+oeGKrdJCI1lSS6/hC7CZEoAqj6 BPMQ== X-Gm-Message-State: AOJu0YxVBVzMS9ZU6Jt2pP737VIixUIhH9vJbH6klv66xaniPtTm4eBs cFALe1nrREgbzmcdsFQR5TSjkSPnaQM7HaZt1y/HdUIgWy6QSaEeelv0lNk1P2fha/vPAnGB3cJ auwuk7RyBdlc/iJkb8TsqqYf+oSaa75xtjARkmhmNNEZnQOidD2fL0DyDmFkBO2JjdtlbLjbELQ XUCoOOmFKPaTXErduUKWkoOV+0ArL/MjCGQsx/ X-Received: by 2002:a19:641c:0:b0:52c:dca7:c9bd with SMTP id 2adb3069b0e04-52ce064e3e3mr9346250e87.30.1719500048758; Thu, 27 Jun 2024 07:54:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFu+quy5kOlRS3maCOD9ORsX83Tg3m+qBYsrmJnWvy1RC6X55dBngXKbu8/BMCN2vnmpOmvgw== X-Received: by 2002:a19:641c:0:b0:52c:dca7:c9bd with SMTP id 2adb3069b0e04-52ce064e3e3mr9346235e87.30.1719500048277; Thu, 27 Jun 2024 07:54:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, alex.bennee@linaro.org Subject: [PATCH 3/5] target/i386: SEV: rename sev_snp_guest->id_auth Date: Thu, 27 Jun 2024 16:53:55 +0200 Message-ID: <20240627145357.1038664-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145357.1038664-1-pbonzini@redhat.com> References: <20240627145357.1038664-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.212, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719500127649100001 Content-Type: text/plain; charset="utf-8" Free the "id_auth" name for the binary version of the data. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/sev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 2d4cfd41e83..a6b063b762c 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -154,7 +154,7 @@ struct SevSnpGuestState { char *guest_visible_workarounds; char *id_block_base64; uint8_t *id_block; - char *id_auth; + char *id_auth_base64; char *host_data; =20 struct kvm_sev_snp_launch_start kvm_start_conf; @@ -1297,7 +1297,7 @@ sev_snp_launch_finish(SevCommonState *sev_common) } } =20 - trace_kvm_sev_snp_launch_finish(sev_snp->id_block_base64, sev_snp->id_= auth, + trace_kvm_sev_snp_launch_finish(sev_snp->id_block_base64, sev_snp->id_= auth_base64, sev_snp->host_data); ret =3D sev_ioctl(sev_common->sev_fd, KVM_SEV_SNP_LAUNCH_FINISH, finish, &error); @@ -2198,7 +2198,7 @@ sev_snp_guest_get_id_auth(Object *obj, Error **errp) { SevSnpGuestState *sev_snp_guest =3D SEV_SNP_GUEST(obj); =20 - return g_strdup(sev_snp_guest->id_auth); + return g_strdup(sev_snp_guest->id_auth_base64); } =20 static void @@ -2208,14 +2208,14 @@ sev_snp_guest_set_id_auth(Object *obj, const char *= value, Error **errp) struct kvm_sev_snp_launch_finish *finish =3D &sev_snp_guest->kvm_finis= h_conf; gsize len; =20 - g_free(sev_snp_guest->id_auth); + g_free(sev_snp_guest->id_auth_base64); g_free((guchar *)finish->id_auth_uaddr); =20 /* store the base64 str so we don't need to re-encode in getter */ - sev_snp_guest->id_auth =3D g_strdup(value); + sev_snp_guest->id_auth_base64 =3D g_strdup(value); =20 finish->id_auth_uaddr =3D - (uint64_t)qbase64_decode(sev_snp_guest->id_auth, -1, &len, errp); + (uint64_t)qbase64_decode(sev_snp_guest->id_auth_base64, -1, &len, = errp); =20 if (!finish->id_auth_uaddr) { return; --=20 2.45.2 From nobody Sun Nov 24 23:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719500115; cv=none; d=zohomail.com; s=zohoarc; b=GD8PjrpvqaoS3tBluAwcZ3bCQvtVkgTod59LdkicZIZ/RCbgZRtCf1J8yoPzd/8rX6PGYnp/ZzHZLy3bWr1gA/uqvZJppqummCmiaBG13gAs9pPXUjAvCKEwV3lq+CgqNlF1DOaMY60W2Nap7ZPQzq1F4s5A/8RR0OzZJmkLFpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719500115; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kahTNt6XmEjQH2qUEICtuDFVEALNHFOMfowFA3jt/ZA=; b=TeMjNMKSGA7ou5NvhDnOVNTdyNe0o+EtOFdiKbowNAih2VFlU+gzvYQ/E90lb7IP8i8Eg42PRdPIj55h+cn+oKAhjEkItQr/qFIqtj5t2wLCFj1mv8jxBU/ZDlBqnzpEj75F/qmMCM/F4VnUcgbeAKGE3wNUGP//mEWhRT55Dtw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719500115890890.2241090192609; Thu, 27 Jun 2024 07:55:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMqVx-0007ui-Dj; Thu, 27 Jun 2024 10:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVv-0007uR-1s for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVt-0007IB-Il for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:18 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-qL0-b2wPOCyrVkNnT0HWYA-1; Thu, 27 Jun 2024 10:54:13 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a7135459efbso339314266b.2 for ; Thu, 27 Jun 2024 07:54:12 -0700 (PDT) Received: from avogadro.local ([151.48.235.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a729d7203b8sm67210066b.79.2024.06.27.07.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 07:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719500054; 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=kahTNt6XmEjQH2qUEICtuDFVEALNHFOMfowFA3jt/ZA=; b=jDLZV1/zbBfhzUFhBwbFEpGtInIJPzEQ2eeopqf5jX6fqmLv8yh2ejIaakU0U/vjdOnIWq AZFBcQEcM1j8VDnEWrgj5ElDiQFvzltkWgD4slcRzQjm3TPrPFIMnzFi1VxBsQo/Sl+qbF XaJzCauamPJcapOKOmhnbnA/ZE7JoTA= X-MC-Unique: qL0-b2wPOCyrVkNnT0HWYA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500051; x=1720104851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kahTNt6XmEjQH2qUEICtuDFVEALNHFOMfowFA3jt/ZA=; b=qhpEkW8iWTyKvf0GcU+J5Gp37DsU3ROBiBAT0awmdgdexG9y0m48TGXjRTtYJoIlce rd45kKRpJZHfxCJI5YazLjdoQz0nZ8hambLXTyroAWUJrVotRn9/r1c2KXjUsAoq54ff kxVErAzYEXNjo2IYoBhkJhaKs3VC4HghYf4/94NG/dtzpQvM4Vvg2QTWLhluz6tcybCa WQq23m+kilflL3HVOAds8TwLpPgKF2RnVQp/X5Fbpwh0M50lxx5hg58TOPza5TLpDaIX PsZdPETzxn72iovXyH+EIY/hwBy7HDYkm8c67cIWt0ARw2L6ppUIfiCb7qHa024rHbRE H14A== X-Gm-Message-State: AOJu0YzmppK3IBhOyGQ64c4ABCe9vM40DR5cqHs41psa73Fu7YSYXj5/ sDoS7Mduhmzyv+W4qa84Ez/KWKvy5LRQ+4/BZsh+HWWUjWcubUFrIzH75nYNY5/IHCkPZP4Qgog qMMgj/M9TS+fGpVt9c66TRtCyQEa0t/hxrrHJ4aG//SBwl4sDZKDV3a+mnDptCb1FARZ3k/i4YO xW9Tyq1cXqA90jeNO8GwNjqiHiMhPxUMyjlhAP X-Received: by 2002:a17:907:d041:b0:a72:87c4:8fc7 with SMTP id a640c23a62f3a-a7287c4a170mr381386766b.2.1719500051364; Thu, 27 Jun 2024 07:54:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGLinNd+o/pheO51PaR+rxIPT43fsFfdZcE6j51Y0KmDsjTrtR23gfkR5YGIYZh1ckQOtdAA== X-Received: by 2002:a17:907:d041:b0:a72:87c4:8fc7 with SMTP id a640c23a62f3a-a7287c4a170mr381384966b.2.1719500051032; Thu, 27 Jun 2024 07:54:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, alex.bennee@linaro.org Subject: [PATCH 4/5] target/i386: SEV: store pointer to decoded id_auth in SevSnpGuest Date: Thu, 27 Jun 2024 16:53:56 +0200 Message-ID: <20240627145357.1038664-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145357.1038664-1-pbonzini@redhat.com> References: <20240627145357.1038664-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.212, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719500117583100002 Content-Type: text/plain; charset="utf-8" Do not rely on finish->id_auth_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/sev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index a6b063b762c..28d6bd3adfa 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -155,6 +155,7 @@ struct SevSnpGuestState { char *id_block_base64; uint8_t *id_block; char *id_auth_base64; + uint8_t *id_auth; char *host_data; =20 struct kvm_sev_snp_launch_start kvm_start_conf; @@ -2208,16 +2209,16 @@ sev_snp_guest_set_id_auth(Object *obj, const char *= value, Error **errp) struct kvm_sev_snp_launch_finish *finish =3D &sev_snp_guest->kvm_finis= h_conf; gsize len; =20 + finish->id_auth_uaddr =3D 0; + g_free(sev_snp_guest->id_auth); g_free(sev_snp_guest->id_auth_base64); - g_free((guchar *)finish->id_auth_uaddr); =20 /* store the base64 str so we don't need to re-encode in getter */ sev_snp_guest->id_auth_base64 =3D g_strdup(value); + sev_snp_guest->id_auth =3D + qbase64_decode(sev_snp_guest->id_auth_base64, -1, &len, errp); =20 - finish->id_auth_uaddr =3D - (uint64_t)qbase64_decode(sev_snp_guest->id_auth_base64, -1, &len, = errp); - - if (!finish->id_auth_uaddr) { + if (!sev_snp_guest->id_auth) { return; } =20 @@ -2226,6 +2227,8 @@ sev_snp_guest_set_id_auth(Object *obj, const char *va= lue, Error **errp) len, KVM_SEV_SNP_ID_AUTH_SIZE); return; } + + finish->id_auth_uaddr =3D (uintptr_t)sev_snp_guest->id_auth; } =20 static bool --=20 2.45.2 From nobody Sun Nov 24 23:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719500118; cv=none; d=zohomail.com; s=zohoarc; b=DUvZHFOVYRIEKDs/8vBBvKyw9S9WC1fRVfDpYPmXV5HYjiboSb9Sy4RX/RAFwT83/HcGvU/zp3e3LOFdY/pPcOaT6t7w1FPQOrBl8CnPdB4TBAVz/9+kMkOQiVzkd3TLv+J6unT+E667CcRVHTmRwh2e236zm4Jf4UqMqxxQLRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719500118; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ndsw8fOyaChmgjQGUrWjnxxCLs4JQPIUld82Y9cUCkQ=; b=TWRBz9CQmNamNgVVfAD2yitRxs9fQSj+rQmlEGoBs86qeZYGIirZ2J4xXgfeeQuY4vPoOXwtRPttBEHBif+8sRo4JeqrSuhAs5HAaCOzVg0HHq+7hkyrR5mOIDgfqC/lf5HuuwiwdL9vVF2RhPmYtMaoWmoBbcrju8wXIcq1sQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719500118401805.3830434422824; Thu, 27 Jun 2024 07:55:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMqW0-0007vX-8o; Thu, 27 Jun 2024 10:54:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVw-0007uf-R3 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMqVu-0007IY-Jm for qemu-devel@nongnu.org; Thu, 27 Jun 2024 10:54:20 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-257-Haj_ZnLkNAiv8JWxVQAnuQ-1; Thu, 27 Jun 2024 10:54:16 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a7253454b3fso269614666b.1 for ; Thu, 27 Jun 2024 07:54:15 -0700 (PDT) Received: from avogadro.local ([151.48.235.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a729d77987bsm66000866b.122.2024.06.27.07.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 07:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719500057; 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=ndsw8fOyaChmgjQGUrWjnxxCLs4JQPIUld82Y9cUCkQ=; b=HyOOzcHJPvx0tPL+ccqPgQGJJ6ohH2oKBYjQYYpb9t712Ws8AJDnf1KhFcx8VGu3qfdwtM 7Tw6zhEouMDhzbWfaHqAlGhROXLLSS/mozkpbOCt5m8ar8sXXar4DMiL2n2zUXPQfr9TrF hPi+2O7lHbxvLnp5rGtNTu4TmRb+Np8= X-MC-Unique: Haj_ZnLkNAiv8JWxVQAnuQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500054; x=1720104854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ndsw8fOyaChmgjQGUrWjnxxCLs4JQPIUld82Y9cUCkQ=; b=AAkKKcYYb7gb0cwwItv+k+5lSom7quVqE6fTNwwMtY+DPKBlH/ZLOnb1vzEmGYKR/2 RBH+E/MrX+ld6zVia/CgAielZKsqDH//Va+E40CybQhcp+jKJ4JStu3p58cNRmfsmSkp Lq51G3kt9zU3L+WI4RNi+vcgy1GySPb8pdwoxpmYAuRSC6wMhT7pVRmAaBg5W8Rvm+CG WgRwBeyi0VxKizdQX7pAc6p5Uf2iXLlYlJ8RXy1ib830I6QcvINeZ5ehAiJeKBDnb7aM X7N+C49FKsWpgeXEhltRX9WcuDKHHJUd9QMWIcN89WvcJIg2WNGrOYF6JeMQ2Qvh0sed j9Yg== X-Gm-Message-State: AOJu0Yz3OiZS1olB+dWUePfroIafnQjF2uJMn4gYIPVwBCyj7Li2gswt zo3WC/1O+RXZ5cFEEBUqP/W0bz2hQXdJljN3ZsL8UnFtaBiavqqmMt891WTLicHlgZ0aWj8+rjA QEOglH93FwlIRFhtKyIpewA3pYYiDzcddq3F8nRZiyLEK0heMNG+LOEoAXvn+ox/zdtdZ9/tuzH 4cLoD3s8pRE4HQ79F5Yn2JDJyKqPefNW9vsuw6 X-Received: by 2002:a17:906:ae92:b0:a72:6416:5ccc with SMTP id a640c23a62f3a-a7264165fb5mr603267466b.58.1719500054270; Thu, 27 Jun 2024 07:54:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAG2ibHYkrlelUzyugOBvvt8aeJvYofzbd5oiSk/9XTkw4qPz3/Wc3lWlVgW1Gls49VkYBOA== X-Received: by 2002:a17:906:ae92:b0:a72:6416:5ccc with SMTP id a640c23a62f3a-a7264165fb5mr603266166b.58.1719500053941; Thu, 27 Jun 2024 07:54:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, alex.bennee@linaro.org Subject: [PATCH 5/5] target/i386: SEV: fix format strings for 32-bit hosts Date: Thu, 27 Jun 2024 16:53:57 +0200 Message-ID: <20240627145357.1038664-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145357.1038664-1-pbonzini@redhat.com> References: <20240627145357.1038664-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.212, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719500119600100005 Content-Type: text/plain; charset="utf-8" Use PRIx64 for uint64_t and %zu for size_t/gsize. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 28d6bd3adfa..77ff908ab17 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -886,7 +886,7 @@ sev_snp_launch_update(SevSnpGuestState *sev_snp_guest, =20 if (!data->hva || !data->len) { error_report("SNP_LAUNCH_UPDATE called with invalid address" - "/ length: %p / %lx", + "/ length: %p / %" PRIx64, data->hva, data->len); return 1; } @@ -934,8 +934,8 @@ sev_snp_launch_update(SevSnpGuestState *sev_snp_guest, =20 out: if (!ret && update.gfn_start << TARGET_PAGE_BITS !=3D data->gpa + data= ->len) { - error_report("SEV-SNP: expected update of GPA range %lx-%lx," - "got GPA range %lx-%llx", + error_report("SEV-SNP: expected update of GPA range %" PRIx64 "-%"= PRIx64 "," + "got GPA range %" PRIx64 "-%llx", data->gpa, data->gpa + data->len, data->gpa, update.gfn_start << TARGET_PAGE_BITS); ret =3D -EIO; @@ -2148,7 +2148,7 @@ sev_snp_guest_set_guest_visible_workarounds(Object *o= bj, const char *value, } =20 if (len !=3D sizeof(start->gosvw)) { - error_setg(errp, "parameter length of %lu exceeds max of %lu", + error_setg(errp, "parameter length of %zu exceeds max of %zu", len, sizeof(start->gosvw)); return; } @@ -2185,7 +2185,7 @@ sev_snp_guest_set_id_block(Object *obj, const char *v= alue, Error **errp) } =20 if (len !=3D KVM_SEV_SNP_ID_BLOCK_SIZE) { - error_setg(errp, "parameter length of %lu not equal to %u", + error_setg(errp, "parameter length of %zu not equal to %u", len, KVM_SEV_SNP_ID_BLOCK_SIZE); return; } @@ -2223,7 +2223,7 @@ sev_snp_guest_set_id_auth(Object *obj, const char *va= lue, Error **errp) } =20 if (len > KVM_SEV_SNP_ID_AUTH_SIZE) { - error_setg(errp, "parameter length:ID_AUTH %lu exceeds max of %u", + error_setg(errp, "parameter length:ID_AUTH %zu exceeds max of %u", len, KVM_SEV_SNP_ID_AUTH_SIZE); return; } @@ -2291,7 +2291,7 @@ sev_snp_guest_set_host_data(Object *obj, const char *= value, Error **errp) } =20 if (len !=3D sizeof(finish->host_data)) { - error_setg(errp, "parameter length of %lu not equal to %lu", + error_setg(errp, "parameter length of %zu not equal to %zu", len, sizeof(finish->host_data)); return; } --=20 2.45.2