From patchwork Wed Jun 28 15:53:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697265 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4426146wrm; Wed, 28 Jun 2023 09:02:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4m0CrvRF4kP01bgPmSmIDcorBnlINAi3ipVQBZPREziPWu2GwMtAHSAQdy1sAI2mIFE3yg X-Received: by 2002:a67:ffc4:0:b0:443:78dd:447 with SMTP id w4-20020a67ffc4000000b0044378dd0447mr2491705vsq.3.1687968148541; Wed, 28 Jun 2023 09:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687968148; cv=none; d=google.com; s=arc-20160816; b=VtABJDWC+/AltJ4iT6PFx4I0W/U3/AwcPYocuNbsZ9WWs0GiODshVIqNTFQlKJNGru RKgWUoPKFcSdUMWKswk7QBxo9gXwNBSMzLthwMI7Xv/pXHIgBu92tDcpJxTCQYoKGKsG Foquxj+HnWvk708jOLuxI2qNcdWthuDgvOptgMQdzEqKABVMhhLF9l9xR8LgPBGh59CC gTDkBcDUVdZUVZf3wh7xDqWBzzRxXBElnCQ6gMbSBM43P6joZXQPaM3rgAloxkWz4AOh PYgTBtPX1PhHyEaMxmz0Zd1xwCm8v0LwEnd0bGr9z48Dbuhy1WmZLa3t9uhS5SfJAx49 KE7Q== 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=iZPYp3VLZeraZ7kAA283/V2ksX5guNAeZdMB4i4D/xw=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=a7pMRznUOX9v0cha9wWb3pwqQ2P4T34bQw1GtzXrSnv/PsoQQvUWa2EqkCtAfYnxZA gYI1aT0WS5riMaEzVnlfbyxuslFwZQQ8eHCUfPi4yxvKvC13PMT/b9zhUZri9mS9ignX WPyRQ10b3XiGEU/ps9AnH6WwqtAbK16d7GvVQh75pNqFFOtA1JUn/Pg457RN85HZIBph bFV2HAQNPBU5ekDsV7Mf6Eg0LjCtI+ww+2HfBhk1hFbI8bMC04h7E2gBFq7I/ErkyhPv f+rPx3gGQ8xSE5GNYLBqMFQ9lmQ6TXp/PyFQoEUfEFvHBmxfe+QuFYT1PC4O/sqIOMZS ZG/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D2q6V5oV; 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 g17-20020a67e291000000b0044393f46c13si53751vsf.17.2023.06.28.09.02.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jun 2023 09:02:28 -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=D2q6V5oV; 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 1qEXWt-00039c-5a; Wed, 28 Jun 2023 11:56:27 -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 1qEXWV-0002oU-27 for qemu-devel@nongnu.org; Wed, 28 Jun 2023 11:56:05 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEXW8-0001nv-8p for qemu-devel@nongnu.org; Wed, 28 Jun 2023 11:55:41 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fb5bcb9a28so5903238e87.3 for ; Wed, 28 Jun 2023 08:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687967738; x=1690559738; 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=iZPYp3VLZeraZ7kAA283/V2ksX5guNAeZdMB4i4D/xw=; b=D2q6V5oV2b6utGwiKObbkSM0lWmZeQlqDT7JVt3yJ+zWi88HYKtLr7fjAatAEs9Hvi 0GjVO226sTOtxcVFchXpjMnwvFHZH/5Lu8RfR8IJDaZmnqPpl/BvZfwgmTF7QNAi1pvM LoPO6LjGGqMRnhLdjwWdKiQI35uguV0A49tuoxww3SO7AOn6OWFS5mFz7/cBRNj6MI5c i3/zS6c6Sn3Ejaa4UdjFZN/VG5B7qNBp4SPcRooNUt/C4xTVu9BOaPoUJnZwD/Iql4+u Dsz4LLoNAGgCdKa6KgT5ubsSvng6D03/9PG4qy9oQJ9Xq6QWwwj90aa474olrwP1Uje7 Fpyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687967738; x=1690559738; 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=iZPYp3VLZeraZ7kAA283/V2ksX5guNAeZdMB4i4D/xw=; b=NC6jwe9Jsq+sM9W/6tAd0FbzSV/mclJZCnawTxvDKugKI9eXc6+lMQnAUtQUV07Xdg k3SfzVfz69E0yaRim1eGEoxzOmG2rvuJXZnrHSUX9MLNqY6cmZZaYCGt/WNrh4CnWMs2 AZVlUYzj2aX2qW4ezSZl3hg/y7A7BF2bivpEKR1MsRI/ews/I7LE+Uj/8djpWtVbljhi +EdN9XF4N12iwrJjBDUuk8OtFqRKWCWpU30GoJIqTguFuMRGa8Jxf7DBEoQyo4VcTtbs q23T59XxQBYQ9PF0ALg3bhiWC5mARm1pT5F7lAaRjSRaGXh6c/G/mB1AY2kZcG5OyOFX lGAg== X-Gm-Message-State: AC+VfDwmwDuhPW43Q85YevEPXsKNMH/zlKyRsLCh0u8mCvJStBgegr+l YsXRca5UxwaPbIRTxxV+DX/v5Tw3J7rId3ViqNs= X-Received: by 2002:a05:6512:39d1:b0:4fb:8afa:4dc9 with SMTP id k17-20020a05651239d100b004fb8afa4dc9mr3724565lfu.49.1687967738189; Wed, 28 Jun 2023 08:55:38 -0700 (PDT) Received: from m1x-phil.lan ([176.187.207.229]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c020e00b003fba92fad35sm1811324wmi.26.2023.06.28.08.55.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 28 Jun 2023 08:55:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 24/30] target/arm: Restrict KVM-specific fields from ArchCPU Date: Wed, 28 Jun 2023 17:53:07 +0200 Message-Id: <20230628155313.71594-25-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230628155313.71594-1-philmd@linaro.org> References: <20230628155313.71594-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=philmd@linaro.org; helo=mail-lf1-x129.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, T_SCC_BODY_TEXT_LINE=-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 These fields shouldn't be accessed when KVM is not available. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230405160454.97436-8-philmd@linaro.org> --- target/arm/cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 00e675f58f..4d6c0f95d5 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -961,6 +961,7 @@ struct ArchCPU { */ uint32_t kvm_target; +#ifdef CONFIG_KVM /* KVM init features for this CPU */ uint32_t kvm_init_features[7]; @@ -973,6 +974,7 @@ struct ArchCPU { /* KVM steal time */ OnOffAuto kvm_steal_time; +#endif /* CONFIG_KVM */ /* Uniprocessor system with MP extensions */ bool mp_is_up;