From patchwork Wed Jun 26 19:49:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 807510 Delivered-To: patch@linaro.org Received: by 2002:adf:e842:0:b0:362:4979:7f74 with SMTP id d2csp476659wrn; Wed, 26 Jun 2024 12:51:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyQix3OTwGIEoBG6VRSSdvIZJbUeEfyfYfwF3ob6eUDCixWM0swZVRuBAd0vynAvXhFnBXmS+5AJwC6G3S25cy X-Google-Smtp-Source: AGHT+IGAQO9N55c+vuI4/mkGM7gGMUlzx2nnWdWqAdNyfFgHl/Hl7/j3eH1y3LYEXCo+8aA7soDu X-Received: by 2002:a05:620a:601a:b0:79b:ba64:fd6f with SMTP id af79cd13be357-79be471fda5mr1458838585a.40.1719431486547; Wed, 26 Jun 2024 12:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719431486; cv=none; d=google.com; s=arc-20160816; b=YsBa3+p4vUJqjeD/Y1EYhDVtkD0Dp7OAVb4d4uCalZLnyKnPxrJo88T8T2sI2+6gyA jWi/qOQWoxAQU5yq55EgEoRi0LHVQIONG3pb0Q8rm8mS+DnpACCNBnDZ11BmLfNLyVvC nIuna1gfpiOgQlvYxNBs4UBFdc4FWNNccPGsve1vp8Dqs9pfLsD0+pUWAiDUG2ZEFeYV PDTPbR4aNnBfC31zd+0LzvjqTbfI9SLJ0LjVHI+taetVn6polF9tFgx/kK/0rwisliOr Wvv0rjpRX1Yvy+Hw7cfv3PNdWS7mTkNVx9hMGu2TQbVYzDxplzN8hxxDALDQdJXqF6QG n/xw== 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=DfnhjluiI4IZZVonHBRb763w0QLa0hN07g2FgRNiqJE=; fh=YiKACOOGwOIKvy+G1clkODZYvBNJscfpNjsHDps50o0=; b=0TbrJKDIIHzvq0U1fEoJZAU9ImbR2T0yOSgRaoe6Mc90BtzA/kyUJhNRSJ5sFREbbt VSGjkRx4WyllccUaWhj4CjBGz8VubLpVZ7e2u1oX5c267SaPWNJY8qoV9RRaPB9MfQO7 IY+16EmAYzbPgjalzm0HwXKMCYNgCIdDGFvEJyZup1A9oEJdzCYNHV5cWZqDm63Mbugb xcn2IriCldMck1NvCKDyeKRR9qwiD0Pvvk7doTvD3MWD9z4lB8A/s8X7grx95U606g+d o1Kt6uzR66j9XTc/f1XuRnXnRBzQ61uQYsTgwRV7XfBuO8OTc/qhgtU6Q2mylmTF+7nt 4GNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z0O4ucgm; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-79bcf511f6fsi1333237685a.66.2024.06.26.12.51.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jun 2024 12:51: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=@linaro.org header.s=google header.b=z0O4ucgm; 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=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYen-0007JR-T9; Wed, 26 Jun 2024 15:50: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 1sMYem-0007JA-I2 for qemu-devel@nongnu.org; Wed, 26 Jun 2024 15:50:16 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMYeb-0002gl-2c for qemu-devel@nongnu.org; Wed, 26 Jun 2024 15:50:15 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1f9cd92b146so55801295ad.3 for ; Wed, 26 Jun 2024 12:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719431393; x=1720036193; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DfnhjluiI4IZZVonHBRb763w0QLa0hN07g2FgRNiqJE=; b=z0O4ucgmJMWI/vMHYTu/CKbp8qIlPSlWFrtX3TM/ioZCUgBCbQ9UztUP7+QFhLdOEn ly62gQOOpTmFp6kx08FNmgx2C4iLUmzDCFBXwAY4SsM7HLkYzBolj+i+xEVJ8xl0977y P4W9bDLw98d//hPWmLMzV85ZFH+m+9gwkzbJW7xyx0YMyFiIw6HKXwtaKBfJGv8WVrDa eOu9DdrGs5LGShqEJOBw+oJFwqymmVgxzBG3RXSHoDgZ4cbKVtIoj75oHDTswam9+GGv QIAvTFXA5qU8M9mMvDSbqY1DTabe7vL+GsYU+qYe+Y3GV4qh6ygatNCoF3CY1v2Lbvaw bFDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719431393; x=1720036193; 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=DfnhjluiI4IZZVonHBRb763w0QLa0hN07g2FgRNiqJE=; b=PLG65TOTiLsjJStMBfpIAlLxUak0B+An0Chf9bNuLNHhfsNk0OQvah0g96LLK+g4AC BVyzK/MTfUsyAZKvfEL0io5kZu119oPszsZQOWU+qrXmgQzn+/Gc9srXIpnvkEHS/lO+ sDccEu+HsWc1ykus6/gyZa7O2HqQ9GSczLQpFMzATGfDPQ+gjfEt92SQn+ofCltmcsqW H+VAIzCy+HH3hEXNFIfV53WOMJEfdSJ2LY+z5BtIYG4TESsRRCAAQdAmbcGCW1932y7y 96p/vPSHo7FEHjqJKjVwmGS5D7CIfcPmW+iSKowePSSCtKnAzd8BXu8nt7Z0B1ftzy50 zm/w== X-Gm-Message-State: AOJu0YxO1eCrGB3/7Y/lHYK8qvNTBtTUR5V3O3jXDe6HjPV3+6h/o/Gj AeZYPDxsC3M59rPNcvgeJ7fMvq4XFQjaRRptkYOniMI0y7OUOyX2qKLcNuxh4xlXNTKTq0KtoAq A X-Received: by 2002:a17:902:dac7:b0:1f9:a8c5:a288 with SMTP id d9443c01a7336-1fa1d62183amr143225975ad.37.1719431392818; Wed, 26 Jun 2024 12:49:52 -0700 (PDT) Received: from stoup.. (174-21-76-141.tukw.qwest.net. [174.21.76.141]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb2f0318sm103734625ad.2.2024.06.26.12.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 12:49:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, alex.bennee@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH 1/3] target/i386/sev: Cast id_auth_uaddr through uintptr_t Date: Wed, 26 Jun 2024 12:49:48 -0700 Message-Id: <20240626194950.1725800-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626194950.1725800-1-richard.henderson@linaro.org> References: <20240626194950.1725800-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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 This member is __u64 in the kernel structure. Cast via uintptr_t to match the host's pointer size. Signed-off-by: Richard Henderson --- target/i386/sev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 30b83f1d77..9dfdac69ab 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -2171,13 +2171,13 @@ sev_snp_guest_set_id_block(Object *obj, const char *value, Error **errp) finish->id_block_en = 0; g_free(sev_snp_guest->id_block); - g_free((guchar *)finish->id_block_uaddr); + g_free((void *)(uintptr_t)finish->id_block_uaddr); /* store the base64 str so we don't need to re-encode in getter */ sev_snp_guest->id_block = g_strdup(value); finish->id_block_uaddr = - (uint64_t)qbase64_decode(sev_snp_guest->id_block, -1, &len, errp); + (uintptr_t)qbase64_decode(sev_snp_guest->id_block, -1, &len, errp); if (!finish->id_block_uaddr) { return; @@ -2208,13 +2208,13 @@ sev_snp_guest_set_id_auth(Object *obj, const char *value, Error **errp) gsize len; g_free(sev_snp_guest->id_auth); - g_free((guchar *)finish->id_auth_uaddr); + g_free((void *)(uintptr_t)finish->id_auth_uaddr); /* store the base64 str so we don't need to re-encode in getter */ sev_snp_guest->id_auth = g_strdup(value); finish->id_auth_uaddr = - (uint64_t)qbase64_decode(sev_snp_guest->id_auth, -1, &len, errp); + (uintptr_t)qbase64_decode(sev_snp_guest->id_auth, -1, &len, errp); if (!finish->id_auth_uaddr) { return;