From nobody Wed Feb 11 01:09:16 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1668191781; cv=none; d=zohomail.com; s=zohoarc; b=ZEIK40Zs+f8D0sblDvyU00VEbm5jePifXDMedVrPRVP/ro+WXC1v/R/MFcgyF6pYi8LqXAXT6avEel5StY8kka1NYo6c0JSAAdnrBnpZEU4bNU2BQ5mpbeysn9McU1FizusuFFyno/dXLbgx/FBbDN4wRhjRdcwBIdazguzyJ5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668191781; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KjvcD/bUb6v85GBYMsY2wRda3lPUntOnEJ8cQndopVc=; b=JyrRvMGW0lhqwaTCzdVcWYdJnkYLH/SZM+habparKoof9utwA2fR4N8/hS2a/ZoWXV1DZJgj85YV5iyKJMewliTOmQrrC48HFTmMI3/dzzNxe+ArYEtf7ENndutjRq5tP5d80NtCUNsdetCbxESnqiAzoSEnkM7atXwivRQ9qkA= 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 1668191781427669.1866261893907; Fri, 11 Nov 2022 10:36:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otYrt-0007sj-Gy; Fri, 11 Nov 2022 13:35:10 -0500 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 1otYrn-0007rN-6Y for qemu-devel@nongnu.org; Fri, 11 Nov 2022 13:35:06 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otYrl-0007Om-4y for qemu-devel@nongnu.org; Fri, 11 Nov 2022 13:35:02 -0500 Received: by mail-wr1-x42c.google.com with SMTP id k8so7556705wrh.1 for ; Fri, 11 Nov 2022 10:34:57 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id u17-20020a05600c4d1100b003cfb7c02542sm3505512wmp.11.2022.11.11.10.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 10:34:51 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F38891FFB8; Fri, 11 Nov 2022 18:25:36 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=KjvcD/bUb6v85GBYMsY2wRda3lPUntOnEJ8cQndopVc=; b=j07ZcctBaiVRR4dHoUX9jCUfu4N4o7HNNO6oPYNq/GaPjeAsFFnZJfoBUGtZa7iaVC q7Tk8wIPIr3lqDUZ/U9GgOVskORuQJhX2zf3JXG98i1S58y29kCb7N+62SW+0myhkOtD QVqjnwVU8Hbe6zEOhXf/wVIJW3kZmpxtnHDeFJAvao/pPWbSHgAtY+tHi3oNMubkT0ai nIGN8RERXD+MGSz1CQTDUPYbIngyaiSRAHT0SucBRJNeS6/MCbvLg97iJTEbGPF27foP 3euQevj5rwR32v2a/X8vycNPPui7dx2sG4u5N9cozpWDNekiDzJ4y1b0Ej5lURnLsFq2 hfTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=KjvcD/bUb6v85GBYMsY2wRda3lPUntOnEJ8cQndopVc=; b=dYeImgXHZZ5eyitGZVndHrM2Ghub+bXU21kKf20rOU8ZSjyhLgugVHFVQEI4SAaIb6 3EAWcUzu46kNBq+AWT2Gz3mUSIgmK0XXomlCxb+/1RMTY2z+Yf3bdWkM1lf0nKIlh6HG Hq8bdEtoAgoCDL0X/BiM5ddRHe6/2bpjFALL0ROR1ITeBEPLUH1LWvymRym7ofFwvay8 sLngAXHkwaMQ2oGIPQwl5J9lYrb6u+nUKor98HUkzmfWQU4diOMkRD7bdRpRaq5GC6n3 pUY2Fa/m43A0Ly2yGB/XeZaCe1F/Di1g8dSACkKyXYUkkH14pgEUlURQdEKYdL2WIjO/ z5YQ== X-Gm-Message-State: ANoB5pnu+XdVAWvJzshY11fdvMGJZSnC9UeRWawl+jk8giVYynhDTiZu 89r2YuGdZT2agXaZCwJfW02PHg== X-Google-Smtp-Source: AA0mqf4jHdXwT+07aSV3JQymPXLBWFlFBOCfyq7XM6J/G1XScEyOZkpznnYp/Nm7WZcPlAxOogtz+A== X-Received: by 2002:a5d:68c1:0:b0:236:84b5:c0d8 with SMTP id p1-20020a5d68c1000000b0023684b5c0d8mr2071393wrw.342.1668191695330; Fri, 11 Nov 2022 10:34:55 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Wenchao Wang , Kamil Rytarowski , Reinoud Zandijk , Paolo Bonzini , Marcelo Tosatti , Sunil Muthuswamy , haxm-team@intel.com (open list:X86 HAXM CPUs), kvm@vger.kernel.org (open list:X86 KVM CPUs) Subject: [PATCH v5 13/20] target/i386: add explicit initialisation for MexTxAttrs Date: Fri, 11 Nov 2022 18:25:28 +0000 Message-Id: <20221111182535.64844-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111182535.64844-1-alex.bennee@linaro.org> References: <20221111182535.64844-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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_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 @linaro.org) X-ZM-MESSAGEID: 1668191782476100003 Where appropriate initialise with MEMTXATTRS_CPU otherwise use MEMTXATTRS_UNSPECIFIED instead of the null initialiser. Signed-off-by: Alex Benn=C3=A9e --- target/i386/cpu.h | 4 +++- target/i386/hax/hax-all.c | 2 +- target/i386/nvmm/nvmm-all.c | 2 +- target/i386/sev.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d4bc19577a..04ab96b076 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2246,7 +2246,9 @@ static inline uint32_t cpu_compute_eflags(CPUX86State= *env) =20 static inline MemTxAttrs cpu_get_mem_attrs(CPUX86State *env) { - return ((MemTxAttrs) { .secure =3D (env->hflags & HF_SMM_MASK) !=3D 0 = }); + MemTxAttrs attrs =3D MEMTXATTRS_CPU(env_cpu(env)); + attrs.secure =3D (env->hflags & HF_SMM_MASK) !=3D 0; + return attrs; } =20 static inline int32_t x86_get_a20_mask(CPUX86State *env) diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index b185ee8de4..337090e16f 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -385,7 +385,7 @@ static int hax_handle_io(CPUArchState *env, uint32_t df= , uint16_t port, { uint8_t *ptr; int i; - MemTxAttrs attrs =3D { 0 }; + MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; =20 if (!df) { ptr =3D (uint8_t *) buffer; diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index b75738ee9c..cb0720a6fa 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -502,7 +502,7 @@ nvmm_vcpu_post_run(CPUState *cpu, struct nvmm_vcpu_exit= *exit) static void nvmm_io_callback(struct nvmm_io *io) { - MemTxAttrs attrs =3D { 0 }; + MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; int ret; =20 ret =3D address_space_rw(&address_space_io, io->port, attrs, io->data, diff --git a/target/i386/sev.c b/target/i386/sev.c index 32f7dbac4e..292cbcdd92 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1274,7 +1274,7 @@ bool sev_add_kernel_loader_hashes(SevKernelLoaderCont= ext *ctx, Error **errp) uint8_t *hashp; size_t hash_len =3D HASH_SIZE; hwaddr mapped_len =3D sizeof(*padded_ht); - MemTxAttrs attrs =3D { 0 }; + MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; bool ret =3D true; =20 /* diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index e738d83e81..42846144dd 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -791,7 +791,7 @@ static HRESULT CALLBACK whpx_emu_ioport_callback( void *ctx, WHV_EMULATOR_IO_ACCESS_INFO *IoAccess) { - MemTxAttrs attrs =3D { 0 }; + MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; address_space_rw(&address_space_io, IoAccess->Port, attrs, &IoAccess->Data, IoAccess->AccessSize, IoAccess->Direction); --=20 2.34.1