From patchwork Fri Jun 28 17:28:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 808281 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp485495wrr; Fri, 28 Jun 2024 10:32:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpAlCpItAG1LWwdpMW0eq0peT4QRuw/U24FbkuoTFRTD9yQEPyR8I24DcqQwP0MNkS3eCF/fWTg2Rwa61Nqrh4 X-Google-Smtp-Source: AGHT+IE8qPo8IrAWR/GfbpXMUzww7g5joq8QS14zMMracoXcOTPaCEM6zuFs01YYZjouXTVofKnS X-Received: by 2002:ad4:5d62:0:b0:6b5:a4c6:4b3b with SMTP id 6a1803df08f44-6b5a4c64d84mr31473196d6.54.1719595973118; Fri, 28 Jun 2024 10:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719595973; cv=none; d=google.com; s=arc-20160816; b=ABdESpY4vGnUzl43csiT5jPu3ZN9d3854haSA07cTCyO5WAkl7X9xor7CcnrBuLHA+ oL4GEpYLpmk0C6QUPLLwKyhPXrvhYTVuyBJhkPCovew6p4nIBDbxW45FYbbmlYay1jGN RdGiBq0UVt/CCQtmk+5wp0lESxqYiwGpgtmDnRhu27PLUNi8UZe+1I2CeSKmAY5Y5jwM E+5bCn0rsmiJw12WJA4wi54uliMJ6sPhO+HkPBhcFuxivJwXh7h2PcDvlObncFb8IPQ8 cVCmXTFt2WdrkxBDf+X3bWIkrKNcbeM0MEakrYfW//FK2LqEtuiVvU0zsvJxjVUsNuQJ a1ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A2XgIgI4I4VJi3eTDPeYIQcPPk61UBK6QowRUBwCEHE=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=d0Xx91iC3/CGqlrzveVgNwaHFwAPrP1dHjf0w/rAQLbpk+Kw9KtOTHFZeeTurJLrCC QudL/tW1kSAW43aVy50jQExRFbQCDERCF1VybkeJTvK3qPPsPHRLw05k9GcNoZIXqbF1 rhOBD73uv591LAIDxPRGNAYsm/VTRpnqf62pVBl6mkp4r1GjAZ/uI76gQYuWIPdvD9wL kXL7oJHeby8v+q1fCAbD51IBPr9LdlDhb98SQmEMYW73dxAIQeL4eUWf/6x5gYe9qpsz V2qx0YM/Za/mINHQWOdIyGBW54rG84K0QTUxrfVlzE+s395PXPdVFmM4i/C7IcwO8Yv3 EqMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K0hAojPv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e3637e5si24200896d6.71.2024.06.28.10.32.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 10:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K0hAojPv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNFQ5-0006Av-AP; Fri, 28 Jun 2024 13:29:57 -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 1sNFQ3-000629-6S for qemu-devel@nongnu.org; Fri, 28 Jun 2024 13:29:55 -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 1sNFQ1-0002GY-Fh for qemu-devel@nongnu.org; Fri, 28 Jun 2024 13:29:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719595792; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A2XgIgI4I4VJi3eTDPeYIQcPPk61UBK6QowRUBwCEHE=; b=K0hAojPvZ3dgP/ZkKiaRa+QImaw0ARb5IEI2x/y5FOW+3d4R7rbzJQ1d/5ZBYgHghhu6N+ RXWVRuE2BGgW7MW0eiBS/EG1eTiL/88R5SYcc1faEQeD64zQhvfpiCWM7QXcXigixcgvxF OcQBz9PhksUYCkEeHanGAl8htEEpMm0= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-gOyNK0_OPLW5HUBDlLNHcQ-1; Fri, 28 Jun 2024 13:29:50 -0400 X-MC-Unique: gOyNK0_OPLW5HUBDlLNHcQ-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a706f30724eso55835966b.1 for ; Fri, 28 Jun 2024 10:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719595789; x=1720200589; 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=A2XgIgI4I4VJi3eTDPeYIQcPPk61UBK6QowRUBwCEHE=; b=r6vvOW2YxTj/Iyw+Eoq8r6JyPNbad1axW9GpxK8PTX6FLMKjvIAALKZpQmlUL+rG9W Jp42Tz91vev4I2uMtpLxocvCkHRhR64FWSpL61KYsYb3kj+NRGZL5lszY+tyELnuyZvP bS+8V+DaxNdTiL5YL18xUa6kbRGTT/pb7d77IBFULjDpo8cUNWWwyk3T+YqA218pU00/ stHdsudHFNr42d9UdIuv6Ta4U6rpTzMQ+Li+GMecG+GBduPz0a88gzDirAjeSBimhkNL nUlRMih8pP0BsTAXukfftsHtkV/ecjL4gSynTXlRpl6jsvFei9p/sDrZi3BU4Rhi3j/f DvaA== X-Gm-Message-State: AOJu0YxUbUW+fiBERmE1AO9+cipcUnh8QdFvoqtPHnrA2SvJO/eNdP+q YyAXssRBcTm+XVnG5+h4kHJEuLIOoRRtUfPx9GUcDqUf45EYR3EP4GabWpFMvkvyMCdXMULOLjE XibS6cdOkDg75DFEdfED4MG8/+VLp0qplzhjNQDumgXqXo1st3NtG+fwsTaLya6LMps6fWMPNlJ GfGCaTrqMkDbPspsftnkwt4VY1xMHGUvdXo3tn X-Received: by 2002:a17:907:d047:b0:a72:76c8:ef68 with SMTP id a640c23a62f3a-a7276c8effamr793983566b.69.1719595789331; Fri, 28 Jun 2024 10:29:49 -0700 (PDT) X-Received: by 2002:a17:907:d047:b0:a72:76c8:ef68 with SMTP id a640c23a62f3a-a7276c8effamr793982166b.69.1719595788994; Fri, 28 Jun 2024 10:29:48 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0651a8sm95235466b.128.2024.06.28.10.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 10:29:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 22/23] target/i386/sev: Use size_t for object sizes Date: Fri, 28 Jun 2024 19:28:54 +0200 Message-ID: <20240628172855.1147598-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628172855.1147598-1-pbonzini@redhat.com> References: <20240628172855.1147598-1-pbonzini@redhat.com> MIME-Version: 1.0 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.206, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This code was using both uint32_t and uint64_t for len. Consistently use size_t instead. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20240626194950.1725800-3-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 16 ++++++++-------- target/i386/trace-events | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 28d6bd3adfa..0ffdf8952c3 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -121,7 +121,7 @@ struct SevCommonStateClass { Error **errp); int (*launch_start)(SevCommonState *sev_common); void (*launch_finish)(SevCommonState *sev_common); - int (*launch_update_data)(SevCommonState *sev_common, hwaddr gpa, uint8_t *ptr, uint64_t len); + int (*launch_update_data)(SevCommonState *sev_common, hwaddr gpa, uint8_t *ptr, size_t len); int (*kvm_init)(ConfidentialGuestSupport *cgs, Error **errp); }; @@ -173,7 +173,7 @@ typedef struct SevLaunchUpdateData { QTAILQ_ENTRY(SevLaunchUpdateData) next; hwaddr gpa; void *hva; - uint64_t len; + size_t len; int type; } SevLaunchUpdateData; @@ -886,7 +886,7 @@ sev_snp_launch_update(SevSnpGuestState *sev_snp_guest, if (!data->hva || !data->len) { error_report("SNP_LAUNCH_UPDATE called with invalid address" - "/ length: %p / %lx", + "/ length: %p / %zx", data->hva, data->len); return 1; } @@ -945,7 +945,8 @@ out: } static int -sev_launch_update_data(SevCommonState *sev_common, hwaddr gpa, uint8_t *addr, uint64_t len) +sev_launch_update_data(SevCommonState *sev_common, hwaddr gpa, + uint8_t *addr, size_t len) { int ret, fw_error; struct kvm_sev_launch_update_data update; @@ -1090,8 +1091,7 @@ sev_launch_finish(SevCommonState *sev_common) } static int -snp_launch_update_data(uint64_t gpa, void *hva, - uint32_t len, int type) +snp_launch_update_data(uint64_t gpa, void *hva, size_t len, int type) { SevLaunchUpdateData *data; @@ -1108,7 +1108,7 @@ snp_launch_update_data(uint64_t gpa, void *hva, static int sev_snp_launch_update_data(SevCommonState *sev_common, hwaddr gpa, - uint8_t *ptr, uint64_t len) + uint8_t *ptr, size_t len) { int ret = snp_launch_update_data(gpa, ptr, len, KVM_SEV_SNP_PAGE_TYPE_NORMAL); @@ -1165,7 +1165,7 @@ sev_snp_cpuid_info_fill(SnpCpuidInfo *snp_cpuid_info, } static int -snp_launch_update_cpuid(uint32_t cpuid_addr, void *hva, uint32_t cpuid_len) +snp_launch_update_cpuid(uint32_t cpuid_addr, void *hva, size_t cpuid_len) { KvmCpuidInfo kvm_cpuid_info = {0}; SnpCpuidInfo snp_cpuid_info; diff --git a/target/i386/trace-events b/target/i386/trace-events index 06b44ead2e2..51301673f0c 100644 --- a/target/i386/trace-events +++ b/target/i386/trace-events @@ -6,7 +6,7 @@ kvm_memcrypt_register_region(void *addr, size_t len) "addr %p len 0x%zx" kvm_memcrypt_unregister_region(void *addr, size_t len) "addr %p len 0x%zx" kvm_sev_change_state(const char *old, const char *new) "%s -> %s" kvm_sev_launch_start(int policy, void *session, void *pdh) "policy 0x%x session %p pdh %p" -kvm_sev_launch_update_data(void *addr, uint64_t len) "addr %p len 0x%" PRIx64 +kvm_sev_launch_update_data(void *addr, size_t len) "addr %p len 0x%zx" kvm_sev_launch_measurement(const char *value) "data %s" kvm_sev_launch_finish(void) "" kvm_sev_launch_secret(uint64_t hpa, uint64_t hva, uint64_t secret, int len) "hpa 0x%" PRIx64 " hva 0x%" PRIx64 " data 0x%" PRIx64 " len %d" From patchwork Fri Jun 28 17:28:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 808280 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp484354wrr; Fri, 28 Jun 2024 10:30:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVah9Yig+Z/KGCKxGj2U16UD7b2VPHrVxh6SOvPdgj0VPsFoi9dkZJNFUvyR0PtqNek/9BFvZ8//Ee9OGhybAvC X-Google-Smtp-Source: AGHT+IFJffd2tRdF68swxAfXJfBQWZTUe5pSlJF/cWTQ5pCxF1qya6QFfA7xe/SxutrSl8tD7wBW X-Received: by 2002:a0c:e4cb:0:b0:6b0:7275:e06b with SMTP id 6a1803df08f44-6b58d354b2cmr69202026d6.5.1719595826303; Fri, 28 Jun 2024 10:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719595826; cv=none; d=google.com; s=arc-20160816; b=OoozHpE2GrIgR+HGqwuPfLPAr69woIXQQyJDmAY3hEIpQPL74Nsb93B1UdOt2JXA7H dHEId7xsAXOsGktvj7sKc0KMyKAM2ZRVnBvjjtiqUsiA97PWxvS0Hym4vrXZERdiE35r Lyn6GKdhzOZhf6ch+CAtDXtEmVWBhtfgj19PpzkJTebkpavOKVc9pyP9lV3iQQMTjEe7 zcQBp1/NRzppsvqpawTND3zyhCzSy1ogRredaaEGLAEyH5i9ZdRwEqZSDVI/MzYrAnUe YkSAoFuqZgG+d2pyUuulia9l73e0fZKcUBH9+itVq3chV/sI8FNDj+kTiV3oz0etSZ3E ocWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qo4iq+TZlgWKFhoxHuIKDhYlvc+TuqqUn66pvomGcWk=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=zfJGDYc7cbz6QMLobRLHE81CvBnp6HHm8BMqdcgTQVx9xeh3A4QwfQ+GCsrH8A+cMZ X7XHXW5fe7nFrENB7FwZvKSXCIpVf+TOedhrEkf21CGlU2wV37zgOYOrhhEUnGIUGyAw piMbvBrQPPiTkzKdH4zeKWTWsymFvKSUqHOVegxwVJ+u6dQaZOjVOd1eUtYzmG7WCqEL dgWtBMkZNBkHBwHmZ1M4r/b3uBnvLgUNHt4nXsGNIBc4Av4Mao83U5QQkKLoz6lYtjXD NOWBOt22SYDClNVRpLf1lFmKxvBRCqmj0XYVqw2VnE5S60c8ivAftgxzCGfi4onmkWwv N5jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i2WAKshH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e3631c3si25011286d6.107.2024.06.28.10.30.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 10:30:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i2WAKshH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNFQA-0006OL-Px; Fri, 28 Jun 2024 13:30:02 -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 1sNFQ9-0006MD-2l for qemu-devel@nongnu.org; Fri, 28 Jun 2024 13:30:01 -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 1sNFQ3-0002Gl-Lq for qemu-devel@nongnu.org; Fri, 28 Jun 2024 13:30:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719595795; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qo4iq+TZlgWKFhoxHuIKDhYlvc+TuqqUn66pvomGcWk=; b=i2WAKshHKQAiNKUkLPdy55mv7LKHQ42XEcZD/yjIRJChCwYt5KZMlhOlU5NNHRNozasiTA qvSYp84fQ7CaYM2rS0dBJGoG/Ns3Oru3T6Xj4sJXWEJ1YuNSAKJKH9ADNpjem7KZL7X1i/ KbZG8+wtanchovDiarx8dneq6q8bILM= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-82-LqKosx9PPFyq0fkDn0gGkw-1; Fri, 28 Jun 2024 13:29:53 -0400 X-MC-Unique: LqKosx9PPFyq0fkDn0gGkw-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-57a524f1f7eso587748a12.2 for ; Fri, 28 Jun 2024 10:29:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719595792; x=1720200592; 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=qo4iq+TZlgWKFhoxHuIKDhYlvc+TuqqUn66pvomGcWk=; b=psCeIX7L67zCo6lqG56x4hSehpDNVLm7BYfjDhUT1rjHCPftK4NZcUMKIeELl9A+ZM af07viAZUGgpBrhlxv1ha4GmHNKHZUoJjBDUSzO8M4Kvo0DYFVaH0oiuoaEhBdsVoeNO DR6ieT7NK+jMSVRcA4sfNZb0ysnm2hidbQisZUFPjz1TeVQq+ZiVefSl5Y79xllpxwLt gGgATVX2roo6iKoy552SgMwAOkQnV7VCt0bbZ4Fj3qNZ6FV80ml3B8wC6/wgoB/p1h4J aFPqJjWhEWy3aSuo9r2OxrUtx5AKJdWKOY700xQV/AXQ+jX9N66AIXEbuV/18BAMDs7J U6lQ== X-Gm-Message-State: AOJu0YzZiZi3YCi5+HAhRwi8sQ15KhyPbMmz2MxSLGBNaQ2uzFYe/Y96 9Sf4pkm/D6D8rlG5xI3gP+4klp6XHdajJ5hrDpyUU8BitVKQCkAi/qWf+p9ut62HlrCTD7cF5XO znY1DIAJ53bgPw6N7h7tNgpomcLf6W8t0K8+/O3xtZqY1+Zmxd67SYVLD/yn6H2QqBKqCrpSTE6 4DPjj24Zj0CQsLsqRhir+OZzf+omBvDKTEnbTE X-Received: by 2002:a05:6402:358c:b0:587:2e28:deb6 with SMTP id 4fb4d7f45d1cf-5872e28e17fmr279896a12.41.1719595791705; Fri, 28 Jun 2024 10:29:51 -0700 (PDT) X-Received: by 2002:a05:6402:358c:b0:587:2e28:deb6 with SMTP id 4fb4d7f45d1cf-5872e28e17fmr279880a12.41.1719595791302; Fri, 28 Jun 2024 10:29:51 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5861324f069sm1305553a12.33.2024.06.28.10.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 10:29:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 23/23] target/i386/sev: Fix printf formats Date: Fri, 28 Jun 2024 19:28:55 +0200 Message-ID: <20240628172855.1147598-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628172855.1147598-1-pbonzini@redhat.com> References: <20240628172855.1147598-1-pbonzini@redhat.com> MIME-Version: 1.0 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.206, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson hwaddr uses HWADDR_PRIx, sizeof yields size_t so uses %zu, and gsize uses G_GSIZE_FORMAT. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20240626194950.1725800-4-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 0ffdf8952c3..3ab8b3c28b7 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -934,8 +934,9 @@ sev_snp_launch_update(SevSnpGuestState *sev_snp_guest, out: if (!ret && update.gfn_start << TARGET_PAGE_BITS != 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 %" + HWADDR_PRIx "-%" HWADDR_PRIx "," + "got GPA range %" HWADDR_PRIx "-%llx", data->gpa, data->gpa + data->len, data->gpa, update.gfn_start << TARGET_PAGE_BITS); ret = -EIO; @@ -2148,7 +2149,8 @@ sev_snp_guest_set_guest_visible_workarounds(Object *obj, const char *value, } if (len != sizeof(start->gosvw)) { - error_setg(errp, "parameter length of %lu exceeds max of %lu", + error_setg(errp, "parameter length of %" G_GSIZE_FORMAT + " exceeds max of %zu", len, sizeof(start->gosvw)); return; } @@ -2185,7 +2187,8 @@ sev_snp_guest_set_id_block(Object *obj, const char *value, Error **errp) } if (len != KVM_SEV_SNP_ID_BLOCK_SIZE) { - error_setg(errp, "parameter length of %lu not equal to %u", + error_setg(errp, "parameter length of %" G_GSIZE_FORMAT + " not equal to %u", len, KVM_SEV_SNP_ID_BLOCK_SIZE); return; } @@ -2223,7 +2226,8 @@ sev_snp_guest_set_id_auth(Object *obj, const char *value, Error **errp) } 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 %" G_GSIZE_FORMAT + " exceeds max of %u", len, KVM_SEV_SNP_ID_AUTH_SIZE); return; } @@ -2291,7 +2295,8 @@ sev_snp_guest_set_host_data(Object *obj, const char *value, Error **errp) } if (len != sizeof(finish->host_data)) { - error_setg(errp, "parameter length of %lu not equal to %lu", + error_setg(errp, "parameter length of %" G_GSIZE_FORMAT + " not equal to %zu", len, sizeof(finish->host_data)); return; }