From patchwork Fri Nov 11 18:25:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1702946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=j07ZcctB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N86q85VNfz23lq for ; Sat, 12 Nov 2022 05:36:20 +1100 (AEDT) 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) 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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, =?utf-8?q?Alex_Benn=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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Where appropriate initialise with MEMTXATTRS_CPU otherwise use MEMTXATTRS_UNSPECIFIED instead of the null initialiser. Signed-off-by: Alex Bennée --- 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) static inline MemTxAttrs cpu_get_mem_attrs(CPUX86State *env) { - return ((MemTxAttrs) { .secure = (env->hflags & HF_SMM_MASK) != 0 }); + MemTxAttrs attrs = MEMTXATTRS_CPU(env_cpu(env)); + attrs.secure = (env->hflags & HF_SMM_MASK) != 0; + return attrs; } 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 = { 0 }; + MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; if (!df) { ptr = (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 = { 0 }; + MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; int ret; ret = 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(SevKernelLoaderContext *ctx, Error **errp) uint8_t *hashp; size_t hash_len = HASH_SIZE; hwaddr mapped_len = sizeof(*padded_ht); - MemTxAttrs attrs = { 0 }; + MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; bool ret = true; /* 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 = { 0 }; + MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; address_space_rw(&address_space_io, IoAccess->Port, attrs, &IoAccess->Data, IoAccess->AccessSize, IoAccess->Direction);