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: 623766 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp961389pvb; Fri, 11 Nov 2022 10:36:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf45L94H8QCSSeaEOOIZNViDK79fC4KEfbR+SvnmhBTVc4lkBTxjm1tlAV1kP35hFZ21Bc9p X-Received: by 2002:a37:d284:0:b0:6ec:5539:52fa with SMTP id f126-20020a37d284000000b006ec553952famr2238626qkj.38.1668191779315; Fri, 11 Nov 2022 10:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668191779; cv=none; d=google.com; s=arc-20160816; b=tXw8bHi+iB3rKcqMQ8m0XqwyQ7AcKpa13SS3IAtEa9r+23kgfBK95emSidm+QVskrl OqHDSyfV3k51c4hyD9rOhoa5AELeJUPoJqlJj+vJMXwqpCtXhMCL2rVVePlMlk+YM/hl txOXQ00OvF6mq1NFn763d5nHQVshlrYWQyiG6GKlkKfBYzhBDwSZks0LUZquPJ6lRLY6 nR5tmWycVAK9i7pDEw2Ht3aNmbUz2jiPMntd23H5in/5p5NibT4zdf7Gjg88nRvtxNgj 4bt40VDT7+5XHn9fyeKVCst08wdzdR4p/SpJ6/XTDPA/u25vjNA+hhceDxhxd6WvLpJ2 o1Qw== 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=KjvcD/bUb6v85GBYMsY2wRda3lPUntOnEJ8cQndopVc=; b=ei/LshaXD3LSSnsCX02dPRbqmJkycVRMdJOpHp2Ptkp9+l7lW0WIZTCTnS7J9LNkPH p8YPWfMDUB6/v3acvHiW8d70ftw+bHqSp0xjL+zSEKKOK/beiktThR+0TcxRRGUq0tPw qo+mgQ9KSVtwrUNPEy59euXyN9LRZEBaHQAdLGyoYrVgvyCS1M/J3KKosyXqVBj/jlGL CE81SlsmoI2nGlJK3rpx+GiFarpFrEMDk9Xt4NUyfxr8LhTDQuhpR5gXTqa8k6Fd5w23 IpmQ8/kqHf7ol4YSbp0Vxb7xIAv56dmerPsBxzbI7p17oSIVgZ6PHptcePIgvzpWBH01 H31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j07ZcctB; 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 m8-20020a05620a290800b006e2c12e0307si1603550qkp.358.2022.11.11.10.36.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Nov 2022 10:36:19 -0800 (PST) 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=j07ZcctB; 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 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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);