From patchwork Mon Feb 21 09:27:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544405 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3097046imn; Mon, 21 Feb 2022 01:30:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJypmWTLe9QXhCY5tE4ldXAfcA/7N+dDeBy9gkPmCy5Mkgojp/R6dqbbjstrQKPxfweSrP+2 X-Received: by 2002:a0c:ecd1:0:b0:42c:343e:b9b0 with SMTP id o17-20020a0cecd1000000b0042c343eb9b0mr14120507qvq.92.1645435836471; Mon, 21 Feb 2022 01:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645435836; cv=none; d=google.com; s=arc-20160816; b=fqmymhwqyiKgvBFV/t1oPD4dyC0eOdmRfG225LOJg5v7ER5RGedLRh6h42JxVOH5KP Vi5GFxHjAjALvLt1kKaWFau4dkoL1+J+ez22/iX4G8OYbNVas/920ucxYSiV+uwWXY4C pVChki6t3HRWC4aiEyGBQRbicY67W8pcVliuNQWlVDWiimxHzPK6DgmypNdF7ms/uOh8 bYZy0LkduTrYrGKtQ/aa2kNBjmu+nZry7NgrgX0gBuCQzCEVVfb3ZNyGqzlIJSIKV7+S thf6BJxecWbNeCCOtsc0PDyjnHbYBpf3QDEzJcj8wiOYEgZUcXHeNc+QD6UOXo6PYE35 +mnQ== 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:to:from :dkim-signature; bh=6zQvB0fbDONAONglDBnAHNCQ7EKB6euvQKXFm0Tco2I=; b=bZhgKRc3gAAh2CX3EOSHcIQHSj/KGgxR8lSvm9DBqeGF5zS50cnokWju9GSeSMqFBh 4zPmx+JbfLhuN7YEYSv8weDo+bNUDofmLzcKqJAPrysAq4/c+eXC7T9KN/motVXBuF2P lZW11w5u3kCcSL8hJuv4zx5sTcMl7EF+/uAJnlMx03yvxHDT/PaUMYCjkztfg6FeT1MT L0CG3rJ92NYLvdf7Q9ANtXp2516+kWuVvtEy8/iRc2wQt9DlhUiDJiy+sSE10U6XEYae j149fuFVtK00ph7rY3ooGBoIPfS0gEhd3dVf92iOv6uS3GJlDfiWrOvR42/luVZeqvLg goIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MBczjj3o; 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 z3si2181961qtx.350.2022.02.21.01.30.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:30:36 -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=MBczjj3o; 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]:39142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM51g-0007xJ-2l for patch@linaro.org; Mon, 21 Feb 2022 04:30:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0007wI-RX for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:09 -0500 Received: from [2a00:1450:4864:20::435] (port=38515 helo=mail-wr1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zF-0000z4-MU for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:09 -0500 Received: by mail-wr1-x435.google.com with SMTP id d27so25925069wrb.5 for ; Mon, 21 Feb 2022 01:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6zQvB0fbDONAONglDBnAHNCQ7EKB6euvQKXFm0Tco2I=; b=MBczjj3oV+/4YApEHYqgnq7x92xiC+SsChthisGINKrKPPWB6+gfa5UfHJkJKBS3em QspES5jhQXYEzew07C1sepvnRAkYYk+6ftoPB/JGjdd94XWrAM8FL3eRyqnjihjIw+p5 00eW/j7PGgaNoTIKEUf0+608I3yg/JNRYT3egHNfxDNwhabV2PtbXLqf98tRNmuhOL6U tpCSNV1HHErztfFguFSmaxUitmM9pKMKVKpyjjVy033MeSn5rPjXoeWP8vzF+uZIXYAt MvvfTKxFKjCMMbKW9jciRMqjdpGgJUZHbtgL1Qw3SzBlxpbyZfblw6y4kuNtXLaNvZri p8Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6zQvB0fbDONAONglDBnAHNCQ7EKB6euvQKXFm0Tco2I=; b=DiuAnpalkatKTmZ9KTeJHfaELB6cknsvBEzDt2CzJ2seYU16qaz5knZ1Hh0ZWybckC ECFnGJfAguePR8vdBwzbzScxn5QeafYw9a6s0PpPDR93lgQnNeE7T77ys299QKZ9KlCk nPIpHAjSNJD6kD9Ewkj93x4sDq8YvAQrCLjKUaQ8RaB1OxqcHL987DIrlYPiP3IDzbJA /EVnASLNTVUn1A6WapkKAd/Ogx56RBMTE+JuTsJg3ZHbgJ7KzUC9Zxj0cs0yqKukw/eD nZYSGYA6Cl4lApwgazYgJnwoT7np+fNwxvTQYKF/CTpV1c26WIWad6a3Ea9z5jeY3O/L WuXQ== X-Gm-Message-State: AOAM531wIX8HudMmetX3mi6qxsKIfd6wEF6nxPHkgXmsHVdYJc4tykm6 4pcVpFkIyefr+0/02ReKuytnr+CYvHaDsg== X-Received: by 2002:adf:912f:0:b0:1e3:909:a6b6 with SMTP id j44-20020adf912f000000b001e30909a6b6mr14702336wrj.684.1645435683315; Mon, 21 Feb 2022 01:28:03 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/26] MAINTAINERS: Adding myself as a reviewer of some components Date: Mon, 21 Feb 2022 09:27:35 +0000 Message-Id: <20220221092800.404870-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::435 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Ani Sinha Added myself as a reviewer of vmgenid, unimplemented device and empty slot. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-id: 20220131122001.1476101-1-ani@anisinha.ca Signed-off-by: Peter Maydell --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 81aa31b5e1a..bd85e27889f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2189,6 +2189,7 @@ F: tests/qtest/prom-env-test.c VM Generation ID S: Orphan +R: Ani Sinha F: hw/acpi/vmgenid.c F: include/hw/acpi/vmgenid.h F: docs/specs/vmgenid.txt @@ -2204,6 +2205,7 @@ F: hw/misc/led.c Unimplemented device M: Peter Maydell R: Philippe Mathieu-Daudé +R: Ani Sinha S: Maintained F: include/hw/misc/unimp.h F: hw/misc/unimp.c @@ -2211,6 +2213,7 @@ F: hw/misc/unimp.c Empty slot M: Artyom Tarasenko R: Philippe Mathieu-Daudé +R: Ani Sinha S: Maintained F: include/hw/misc/empty_slot.h F: hw/misc/empty_slot.c From patchwork Mon Feb 21 09:27:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544406 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3097069imn; Mon, 21 Feb 2022 01:30:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2BDh+PLr9tt0RNjY3kxteCT2ssMmFkURnS7Cc4lpZqeYeOXxH6KezUPlztZ9iB8JHedby X-Received: by 2002:ae9:e84a:0:b0:5f1:90f3:b63c with SMTP id a71-20020ae9e84a000000b005f190f3b63cmr11411024qkg.498.1645435838459; Mon, 21 Feb 2022 01:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645435838; cv=none; d=google.com; s=arc-20160816; b=fOWBcVsLU4aqGv7OVYsgZSSd5+jyp6ya+ig5a2zy1LInIirS5JShWDaTT9018/Q8tM tbWcv3vLLUH8DTjX6yEoGcwNez1rDbr4YCe32Tt2qgcK2ZwYhKCtCY6RXoOyjx95p8AU VWKjFAHBR1/FyJBAElDChWjo34jm6PLokz+QGovZ2tc5S0l1dEpbMITIMWbpckRir+kO c7N/1UEtk9HDgGuA6gdLRGbGCNKV/f+n+ihOLgsPShuzRk4X6HgcHx/h4rvMbtR4tjyA vjHBNX3A46WNQq8EvMO03beguVkVZXCep34WJN4/xIN3a7Lk2Wf9C0VTrStWrMsqYcmB x2Bw== 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:to:from :dkim-signature; bh=9tYZc8SFpVJlI6L3nF+15B/SWWzQNfcdLSbyoMOVDso=; b=fSMKkjTV89GKvHMKOZx5vfnLJSzthLLqHh0AUl+1W5qLj1yfUTJxvYL3EtPSv0nMry UZJnz3zcKJ1KqaA8X8UFKa+5ouwBL+yMzX1KZiX68Z7jIiFtl+fgDcSioMXAabFLxF6q lSrK674AsPmjqOeqh63z+fXjbnFIqZGLQEYh+0f5MjIDvrXo5kX7YhBfNfbeSyYTEoP6 1B0sTlJdsdj6Wz8KC8cGmVNDUYCYKOW50ccvNy4tF8cXK6nMvVBOlWaLZmRJqfFYQl6W fxlDfYaAHQSs5SzzEpUnrMZ/mM4Qb64Rde0aDkgwzEu5eZFwtGrWBzW0qfcLCFId+suK NN6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mlAgnFp8; 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 f14si14996370qtk.28.2022.02.21.01.30.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:30:38 -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=mlAgnFp8; 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]:39200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM51h-0007zn-Sr for patch@linaro.org; Mon, 21 Feb 2022 04:30:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0007wH-Vx for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:10 -0500 Received: from [2a00:1450:4864:20::42f] (port=42602 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zF-0000zF-Mm for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:08 -0500 Received: by mail-wr1-x42f.google.com with SMTP id h6so25878117wrb.9 for ; Mon, 21 Feb 2022 01:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9tYZc8SFpVJlI6L3nF+15B/SWWzQNfcdLSbyoMOVDso=; b=mlAgnFp8t+DnGhGkXIcO1N2ZK7XylHlnJLYVtGO6rJUTixnj3f7n1GAnkNnqykTlTn IRAxn7ZkgUXikAYg1MzT8Za6y1BS6vflTJAP0+LZPLirFPultTUVpVRt9yggqvMErA5h 14QwWPRKVTaaEm1qjU3zWn0tYLsF8KXqu+CT8Slra0a5vVmKsRR7jBLf/1o1v4Blgc0h 1I4lxdq24wI/q7tHazi6+Zd5H5YnpQteclHTI/4u+BkKtMeKhYeYBfYBtKY4Croje/5w 0q4PZpHgGzOtAxRsr3eqpwOOOKxN8oV6Ie3EJDB+DnuGZQUS79itdQVBNgUTL60lCm/D 4DIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9tYZc8SFpVJlI6L3nF+15B/SWWzQNfcdLSbyoMOVDso=; b=Pu2VLPefaqV8dNeNjmnn4Ioa2WLHu9Q4nk4w3npDy6s6Lg9KL5C564mRJKfxXEIdFc 5lAPJLFAKSFCr+eMjPsBnd0ukDBNQi7VEMyKd/aFISnyjWz3UsmXiDFoKBoMihgEei6c oFCe/e/EKrLMSeliM9enlXoCxPt82b6OUcshLxUHj/U5i//bBka2t5SDXSAm5Nh/uvX6 p3y4TlIyYs1sdOKI4/bDRI1JdsfdZnRMYGUtNavVnvlyIFzqE9Yfxl5tNclL74po/ts4 MUpcJH4AoMzYDcODHQ9/cKcx/PDac1Mvu1nDJH5/KkYHYM51EDTzxaMG9Fd/K+lt0V/f 6XBw== X-Gm-Message-State: AOAM531Z6mCdFaNIcA8IeD/Y8igJI4Yjp+beGOctGCgFOQ2OTKd+gs33 CP/O2PdoNQjzL1ZdRvUOEQEG39pHMxFSog== X-Received: by 2002:adf:e28f:0:b0:1e7:cf02:2d28 with SMTP id v15-20020adfe28f000000b001e7cf022d28mr15526468wri.232.1645435684276; Mon, 21 Feb 2022 01:28:04 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:03 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/26] tests/qtest: add qtests for npcm7xx sdhci Date: Mon, 21 Feb 2022 09:27:36 +0000 Message-Id: <20220221092800.404870-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Signed-off-by: Shengtan Mao Signed-off-by: Patrick Venture Message-id: 20220208181843.4003568-1-venture@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- tests/qtest/npcm7xx_sdhci-test.c | 215 +++++++++++++++++++++++++++++++ tests/qtest/meson.build | 1 + 2 files changed, 216 insertions(+) create mode 100644 tests/qtest/npcm7xx_sdhci-test.c diff --git a/tests/qtest/npcm7xx_sdhci-test.c b/tests/qtest/npcm7xx_sdhci-test.c new file mode 100644 index 00000000000..7de28f900bf --- /dev/null +++ b/tests/qtest/npcm7xx_sdhci-test.c @@ -0,0 +1,215 @@ +/* + * QTests for NPCM7xx SD-3.0 / MMC-4.51 Host Controller + * + * Copyright (c) 2022 Google LLC + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#include "qemu/osdep.h" +#include "hw/sd/npcm7xx_sdhci.h" + +#include "libqos/libqtest.h" +#include "libqtest-single.h" +#include "libqos/sdhci-cmd.h" + +#define NPCM7XX_REG_SIZE 0x100 +#define NPCM7XX_MMC_BA 0xF0842000 +#define NPCM7XX_BLK_SIZE 512 +#define NPCM7XX_TEST_IMAGE_SIZE (1 << 30) + +char *sd_path; + +static QTestState *setup_sd_card(void) +{ + QTestState *qts = qtest_initf( + "-machine kudo-bmc " + "-device sd-card,drive=drive0 " + "-drive id=drive0,if=none,file=%s,format=raw,auto-read-only=off", + sd_path); + + qtest_writew(qts, NPCM7XX_MMC_BA + SDHC_SWRST, SDHC_RESET_ALL); + qtest_writew(qts, NPCM7XX_MMC_BA + SDHC_CLKCON, + SDHC_CLOCK_SDCLK_EN | SDHC_CLOCK_INT_STABLE | + SDHC_CLOCK_INT_EN); + sdhci_cmd_regs(qts, NPCM7XX_MMC_BA, 0, 0, 0, 0, SDHC_APP_CMD); + sdhci_cmd_regs(qts, NPCM7XX_MMC_BA, 0, 0, 0x41200000, 0, (41 << 8)); + sdhci_cmd_regs(qts, NPCM7XX_MMC_BA, 0, 0, 0, 0, SDHC_ALL_SEND_CID); + sdhci_cmd_regs(qts, NPCM7XX_MMC_BA, 0, 0, 0, 0, SDHC_SEND_RELATIVE_ADDR); + sdhci_cmd_regs(qts, NPCM7XX_MMC_BA, 0, 0, 0x45670000, 0, + SDHC_SELECT_DESELECT_CARD); + + return qts; +} + +static void write_sdread(QTestState *qts, const char *msg) +{ + int fd, ret; + size_t len = strlen(msg); + char *rmsg = g_malloc(len); + + /* write message to sd */ + fd = open(sd_path, O_WRONLY); + g_assert(fd >= 0); + ret = write(fd, msg, len); + close(fd); + g_assert(ret == len); + + /* read message using sdhci */ + ret = sdhci_read_cmd(qts, NPCM7XX_MMC_BA, rmsg, len); + g_assert(ret == len); + g_assert(!strcmp(rmsg, msg)); + + g_free(rmsg); +} + +/* Check MMC can read values from sd */ +static void test_read_sd(void) +{ + QTestState *qts = setup_sd_card(); + + write_sdread(qts, "hello world"); + write_sdread(qts, "goodbye"); + + qtest_quit(qts); +} + +static void sdwrite_read(QTestState *qts, const char *msg) +{ + int fd, ret; + size_t len = strlen(msg); + char *rmsg = g_malloc(len); + + /* write message using sdhci */ + sdhci_write_cmd(qts, NPCM7XX_MMC_BA, msg, len, NPCM7XX_BLK_SIZE); + + /* read message from sd */ + fd = open(sd_path, O_RDONLY); + g_assert(fd >= 0); + ret = read(fd, rmsg, len); + close(fd); + g_assert(ret == len); + + g_assert(!strcmp(rmsg, msg)); + + g_free(rmsg); +} + +/* Check MMC can write values to sd */ +static void test_write_sd(void) +{ + QTestState *qts = setup_sd_card(); + + sdwrite_read(qts, "hello world"); + sdwrite_read(qts, "goodbye"); + + qtest_quit(qts); +} + +/* Check SDHCI has correct default values. */ +static void test_reset(void) +{ + QTestState *qts = qtest_init("-machine kudo-bmc"); + uint64_t addr = NPCM7XX_MMC_BA; + uint64_t end_addr = addr + NPCM7XX_REG_SIZE; + uint16_t prstvals_resets[] = {NPCM7XX_PRSTVALS_0_RESET, + NPCM7XX_PRSTVALS_1_RESET, + 0, + NPCM7XX_PRSTVALS_3_RESET, + 0, + 0}; + int i; + uint32_t mask; + + while (addr < end_addr) { + switch (addr - NPCM7XX_MMC_BA) { + case SDHC_PRNSTS: + /* + * ignores bits 20 to 24: they are changed when reading registers + */ + mask = 0x1f00000; + g_assert_cmphex(qtest_readl(qts, addr) | mask, ==, + NPCM7XX_PRSNTS_RESET | mask); + addr += 4; + break; + case SDHC_BLKGAP: + g_assert_cmphex(qtest_readb(qts, addr), ==, NPCM7XX_BLKGAP_RESET); + addr += 1; + break; + case SDHC_CAPAB: + g_assert_cmphex(qtest_readq(qts, addr), ==, NPCM7XX_CAPAB_RESET); + addr += 8; + break; + case SDHC_MAXCURR: + g_assert_cmphex(qtest_readq(qts, addr), ==, NPCM7XX_MAXCURR_RESET); + addr += 8; + break; + case SDHC_HCVER: + g_assert_cmphex(qtest_readw(qts, addr), ==, NPCM7XX_HCVER_RESET); + addr += 2; + break; + case NPCM7XX_PRSTVALS: + for (i = 0; i < NPCM7XX_PRSTVALS_SIZE; ++i) { + g_assert_cmphex(qtest_readw(qts, addr + 2 * i), ==, + prstvals_resets[i]); + } + addr += NPCM7XX_PRSTVALS_SIZE * 2; + break; + default: + g_assert_cmphex(qtest_readb(qts, addr), ==, 0); + addr += 1; + } + } + + qtest_quit(qts); +} + +static void drive_destroy(void) +{ + unlink(sd_path); + g_free(sd_path); +} + +static void drive_create(void) +{ + int fd, ret; + GError *error = NULL; + + /* Create a temporary raw image */ + fd = g_file_open_tmp("sdhci_XXXXXX", &sd_path, &error); + if (fd == -1) { + fprintf(stderr, "unable to create sdhci file: %s\n", error->message); + g_error_free(error); + } + g_assert(sd_path != NULL); + + ret = ftruncate(fd, NPCM7XX_TEST_IMAGE_SIZE); + g_assert_cmpint(ret, ==, 0); + g_message("%s", sd_path); + close(fd); +} + +int main(int argc, char **argv) +{ + int ret; + + drive_create(); + + g_test_init(&argc, &argv, NULL); + + qtest_add_func("npcm7xx_sdhci/reset", test_reset); + qtest_add_func("npcm7xx_sdhci/write_sd", test_write_sd); + qtest_add_func("npcm7xx_sdhci/read_sd", test_read_sd); + + ret = g_test_run(); + drive_destroy(); + return ret; +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index f33d84d19bc..721eafad125 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -190,6 +190,7 @@ qtests_npcm7xx = \ 'npcm7xx_gpio-test', 'npcm7xx_pwm-test', 'npcm7xx_rng-test', + 'npcm7xx_sdhci-test', 'npcm7xx_smbus-test', 'npcm7xx_timer-test', 'npcm7xx_watchdog_timer-test'] + \ From patchwork Mon Feb 21 09:27:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544409 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3100669imn; Mon, 21 Feb 2022 01:37:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyY5+pQhYLBIco/qLOAtCWdR1O+D4HM0+lkF0Eo/j668MlUY/mR9SEVSmxGTCTwfGyPXEMl X-Received: by 2002:a05:622a:8d:b0:2dd:d979:bc46 with SMTP id o13-20020a05622a008d00b002ddd979bc46mr9189360qtw.342.1645436228774; Mon, 21 Feb 2022 01:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436228; cv=none; d=google.com; s=arc-20160816; b=igfYZWYRvmlVu44dF5an8/6xOnsaWgL3fjK9V1N37hRQKs10VZwHiAju9Ta8UArSHZ rGJVRGjG1BdqBQ2YyEUtdEws6JeSrET+bhNqQQCT2DR3EK/WFXeE2NmLZdt+LRJa2xP3 dfpxtfneDn25JM+8+FxUYPEsYi9sI7O5J1icr82X6yezyLnbI1N+tVqtwvobtOd/lV6L aNE8VV9422PubqVmmVE0A0d5bHycFmqsQLREWYIN84bvKrUsmlnBv0FUJM2B8i0SshJT 37CUuzzCFH+6xz9cp1IBqIC/DfoqOnFOF9Ixu9vn9/5YuVSb2YhDPAlLr5ImUIhvUHMc QT+A== 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:to:from :dkim-signature; bh=TBtemdBkPo64I0n22RSwP5PjcdlU1O1SUJPKco0jPDg=; b=MNbTdc525g34dIeoHTxpwV8Hh6ykNTipJmzClkGCZNIeOwlODih/sf44w+7Jl8OKc0 RulukYAdu9ruJrmZFPPSQlXpyL00JUr7acP9Xl3diizDbBvbh6+uGhpBvGCxkTeYlHss k3lOdvsHZKHzHkxua1ADiH+6oIIx6yDM9mjL2IvV7fy04DBEpplnGGnILz4X/7avaBbq NJb3js6a7FJ+9YzbQPZmrEG1qxYsw792y5wiqOrJelvvqlNdcnlCIM9ZndeeXb2VsVnK /0J2wyQ6HlqW5Vd2l7Fq6/wLihu0bAkwG+Gc2n+p4bYt/dexvNRR8Pm4GkocKFZ5zCTX 4Dkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mq2RP9QD; 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 fi12si9493396qvb.455.2022.02.21.01.37.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:37:08 -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=mq2RP9QD; 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]:47438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM580-0005LR-7u for patch@linaro.org; Mon, 21 Feb 2022 04:37:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0007wG-Uy for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:09 -0500 Received: from [2a00:1450:4864:20::334] (port=53769 helo=mail-wm1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zG-0000zJ-SN for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:09 -0500 Received: by mail-wm1-x334.google.com with SMTP id n8so9111554wms.3 for ; Mon, 21 Feb 2022 01:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=TBtemdBkPo64I0n22RSwP5PjcdlU1O1SUJPKco0jPDg=; b=mq2RP9QDsyV20XWZ3VldAxUqmxJg4IWFTmVrR1/q9VtwFNwXYHCKjQvwBsL7PHycZ9 xKhlufx09DtnEy1vi3GmXL12waUr1ACr/VBu0lMNKOu80kOK8aNah98EYIx768KyWUY6 zGjvPDUoCyrZ1qz3WNosbV7FoJqfUs3a0U9wTE/BF7G/ls57ePFq5aa//djpKdAXt3pC 5mwibDIIh7tvLzxEBJX4kyStLmBJGtB4asr2iO5aMTBIRkgEaGdnj0EQ+CREb7uV1T1u tmKhtuuskVrWdydos3zL2qgCB7DEo+e6d4JPhWWAFxJkbhYgt37thsEwYiL4F0Ltzb0J rwGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TBtemdBkPo64I0n22RSwP5PjcdlU1O1SUJPKco0jPDg=; b=UWEOFrJJryU38+JZm/y4eP1BxKVp9Sa/at2V6pZhEFfKf48pYyg1gA7Bj6ePl5Xa3l 9M6AJNpxMsD8hxd+vTPkFFWjruH/l4EacKy2/JNJbamzJtNc6PpeiF2XhpzY1mn7ZuhE KJ87uQONEZR0tmLk4aIYZz6MCeEpdEYeMYo2Wtjd5fsO3lD84e9FV43YES+CTX75IbZ/ ABY0CczlNnSA1vM+E2zVu7AiPMTD+u7qeFswVMdmPcmsI9scB3WPrw3nyGc7JEFkeEis zcW09rUC2uznRvn45RlO1TlDL3xlUbMdt9zdpAIsIWaM1XnwsPV5dsXB12sE01W7upEu Vwsg== X-Gm-Message-State: AOAM532FJl7ilMvdRXyAnocVksPgTD570PwCK8sIRpCC8H1G74S28HsR BizkbN+zgSLAI1tF0ukVg+DUev9xI4uXkA== X-Received: by 2002:a05:600c:a4b:b0:37b:ea2b:5583 with SMTP id c11-20020a05600c0a4b00b0037bea2b5583mr20889659wmq.139.1645435685088; Mon, 21 Feb 2022 01:28:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:04 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/26] hvf: arm: Use macros for sysreg shift/masking Date: Mon, 21 Feb 2022 09:27:37 +0000 Message-Id: <20220221092800.404870-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::334 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Alexander Graf We are parsing the syndrome field for sysregs in multiple places across the hvf code, but repeat shift/mask operations with hard coded constants every time. This is an error prone approach and makes it harder to reason about the correctness of these operations. Let's introduce macros that allow us to unify the constants used as well as create new helpers to extract fields from the sysreg value. Suggested-by: Peter Maydell Signed-off-by: Alexander Graf Reviewed-by: Cameron Esfahani > Reviewed-by: Philippe Mathieu-Daudé Message-id: 20220209124135.69183-1-agraf@csgraf.de Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 69 ++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 0dc96560d34..808c96da8cc 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -35,9 +35,34 @@ ENCODE_AA64_CP_REG(CP_REG_ARM64_SYSREG_CP, crn, crm, op0, op1, op2) #define PL1_WRITE_MASK 0x4 +#define SYSREG_OP0_SHIFT 20 +#define SYSREG_OP0_MASK 0x3 +#define SYSREG_OP0(sysreg) ((sysreg >> SYSREG_OP0_SHIFT) & SYSREG_OP0_MASK) +#define SYSREG_OP1_SHIFT 14 +#define SYSREG_OP1_MASK 0x7 +#define SYSREG_OP1(sysreg) ((sysreg >> SYSREG_OP1_SHIFT) & SYSREG_OP1_MASK) +#define SYSREG_CRN_SHIFT 10 +#define SYSREG_CRN_MASK 0xf +#define SYSREG_CRN(sysreg) ((sysreg >> SYSREG_CRN_SHIFT) & SYSREG_CRN_MASK) +#define SYSREG_CRM_SHIFT 1 +#define SYSREG_CRM_MASK 0xf +#define SYSREG_CRM(sysreg) ((sysreg >> SYSREG_CRM_SHIFT) & SYSREG_CRM_MASK) +#define SYSREG_OP2_SHIFT 17 +#define SYSREG_OP2_MASK 0x7 +#define SYSREG_OP2(sysreg) ((sysreg >> SYSREG_OP2_SHIFT) & SYSREG_OP2_MASK) + #define SYSREG(op0, op1, crn, crm, op2) \ - ((op0 << 20) | (op2 << 17) | (op1 << 14) | (crn << 10) | (crm << 1)) -#define SYSREG_MASK SYSREG(0x3, 0x7, 0xf, 0xf, 0x7) + ((op0 << SYSREG_OP0_SHIFT) | \ + (op1 << SYSREG_OP1_SHIFT) | \ + (crn << SYSREG_CRN_SHIFT) | \ + (crm << SYSREG_CRM_SHIFT) | \ + (op2 << SYSREG_OP2_SHIFT)) +#define SYSREG_MASK \ + SYSREG(SYSREG_OP0_MASK, \ + SYSREG_OP1_MASK, \ + SYSREG_CRN_MASK, \ + SYSREG_CRM_MASK, \ + SYSREG_OP2_MASK) #define SYSREG_OSLAR_EL1 SYSREG(2, 0, 1, 0, 4) #define SYSREG_OSLSR_EL1 SYSREG(2, 0, 1, 1, 4) #define SYSREG_OSDLR_EL1 SYSREG(2, 0, 1, 3, 4) @@ -783,21 +808,21 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint32_t rt) default: cpu_synchronize_state(cpu); trace_hvf_unhandled_sysreg_read(env->pc, reg, - (reg >> 20) & 0x3, - (reg >> 14) & 0x7, - (reg >> 10) & 0xf, - (reg >> 1) & 0xf, - (reg >> 17) & 0x7); + SYSREG_OP0(reg), + SYSREG_OP1(reg), + SYSREG_CRN(reg), + SYSREG_CRM(reg), + SYSREG_OP2(reg)); hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); return 1; } trace_hvf_sysreg_read(reg, - (reg >> 20) & 0x3, - (reg >> 14) & 0x7, - (reg >> 10) & 0xf, - (reg >> 1) & 0xf, - (reg >> 17) & 0x7, + SYSREG_OP0(reg), + SYSREG_OP1(reg), + SYSREG_CRN(reg), + SYSREG_CRM(reg), + SYSREG_OP2(reg), val); hvf_set_reg(cpu, rt, val); @@ -886,11 +911,11 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg, uint64_t val) CPUARMState *env = &arm_cpu->env; trace_hvf_sysreg_write(reg, - (reg >> 20) & 0x3, - (reg >> 14) & 0x7, - (reg >> 10) & 0xf, - (reg >> 1) & 0xf, - (reg >> 17) & 0x7, + SYSREG_OP0(reg), + SYSREG_OP1(reg), + SYSREG_CRN(reg), + SYSREG_CRM(reg), + SYSREG_OP2(reg), val); switch (reg) { @@ -960,11 +985,11 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg, uint64_t val) default: cpu_synchronize_state(cpu); trace_hvf_unhandled_sysreg_write(env->pc, reg, - (reg >> 20) & 0x3, - (reg >> 14) & 0x7, - (reg >> 10) & 0xf, - (reg >> 1) & 0xf, - (reg >> 17) & 0x7); + SYSREG_OP0(reg), + SYSREG_OP1(reg), + SYSREG_CRN(reg), + SYSREG_CRM(reg), + SYSREG_OP2(reg)); hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized()); return 1; } From patchwork Mon Feb 21 09:27:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544413 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3103236imn; Mon, 21 Feb 2022 01:42:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7JHTcCq68IVh9Z1ez1OMOEcpBL11FBIZCCUkHEcijPL3gGqHLDpcoMUbJPF4Fxw8hwIpr X-Received: by 2002:ac8:5ac7:0:b0:2dd:e0ff:f61b with SMTP id d7-20020ac85ac7000000b002dde0fff61bmr7613358qtd.114.1645436536839; Mon, 21 Feb 2022 01:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436536; cv=none; d=google.com; s=arc-20160816; b=bhqqrw7E0X6oc6YY3p4l9T/EdHAFm3cVkYLlDjd6OMKFeetzBRl1998I8ncYK/XfR/ cX9DrisskTSWTrenSekNAwWO5vdeNYHnyIBYI3sb9UJAl0ee4Tkp2O3reu0Ir4P7VYrn aWgLu//ouocFY8CijoA5HypKk40wkrwiTdt3TftUIE84fYjwPWylZ2dhD/O9j5nzpcrX TvyH+SFeuPw3+LVoZXcTzCXhtQebVJ74s46vJrP0zeWcm0NUUWnd4gh4pVXUhmROQS82 M1NU2miwp60ItLrz3MtVD6vPGDNVPe/B1+m7DrEHo6JXx6rqrwmqwjO0j2hL9eZ4UIdF FfSA== 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:to:from :dkim-signature; bh=5AoCux+aFBEAi+jbJxkDJWzNaBcRwPJ7SGnCp4qZ8wQ=; b=nPQQ2I2bsDft3zzv8Tmv/ucEgCKYjiBITB2/b9mYzTgjpw193YjRHt1p1OV3dJLNT2 3rrZDsKrM48B/HWq9z4IsEHo7n7Pc0vmMWFNCcY4hYcKSbV2sGDN8YrVXFDP1fqzwhV2 ujoLzDO8K/lJHAFsnc4sRYIov4s5+fFtnq+bzrtqCQkLr5ddLrjTj7VmKitBI+mn198U 3XSE2CdTPxnotIZP4Ma6KHYj//UPszVxX3USfFjj1RIYSod/3X6KLSLnS7Mn81Ey8Rzn aIvBzF3gDVAVvVnnUj5ohm1T+cqn7PLMMfkgSFrnijTs08LFNqJq9mFxVF+rM1CIeBsB c+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n26BuIZk; 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 4si12452356qvf.318.2022.02.21.01.42.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:42:16 -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=n26BuIZk; 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]:56230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Cy-0002v6-9i for patch@linaro.org; Mon, 21 Feb 2022 04:42:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zK-0007wM-2I for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:10 -0500 Received: from [2a00:1450:4864:20::42b] (port=47054 helo=mail-wr1-x42b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zH-0000zS-HU for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:09 -0500 Received: by mail-wr1-x42b.google.com with SMTP id x5so21037179wrg.13 for ; Mon, 21 Feb 2022 01:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5AoCux+aFBEAi+jbJxkDJWzNaBcRwPJ7SGnCp4qZ8wQ=; b=n26BuIZk3bU2LcIxg10I6+DnqUknzZiTY7muhGmjCHz6UId0IupP+RhJ4Br1Qt+uji tNxzeWmLxc5as7Ef0NE/NVChEDbbX08qBahLMN4s39eV4SnMQoRuz7JA6RyQ6GxhcVp9 g+gEp2qJTslRQwzDrQlE164DOSmMWbGvowV6B+sR+yvcb5zUt2GsZRAwPEnZOKcNSJvI 78vIwc6wqCiXb2GPgV8u6Eaj2w2dqMfPreVoJvQkjjDDTZC/+pI4uyMzcYMpiad3ewEt SQQlD9y8R6LqBmRlw+jieuuk5IwIty2fsMTdm+Bnw/qyNkwSbHBTSn7noOen50tG+sMr 6/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5AoCux+aFBEAi+jbJxkDJWzNaBcRwPJ7SGnCp4qZ8wQ=; b=20xKw7SmK8cdzBRWJ02D7G47zeio/cqp7aUbRl00Q+zWBnos3Dv355Fz1F54ekmSaq smnEKy+xSm2c/bGboDKUbno5+kzH3n2BEqWacMyiQjLqPWJzh7PH/gcaJ+VM121ArC5J OSDMhvSVsx8d7sjklmEZGP7sPCedBJW/TMaRUw2KD0BTXgpkzzyK/MxidqZ2B/OUe0wa x9ZbueDCO4qo+CponyHj5u17nJEv8fK1252hC9TUcufI1IhkCRksKOkCCpEHIjYKP2ed SXVWs1hkcvBVflSz0c47v5wpEodfAc12W6cXQRg7ZixJYY0WTxjfP2/9S/dWv4Eo3qy4 +6fA== X-Gm-Message-State: AOAM531XZw4G0yhCPiwT8i5zYo7xe3QkNSD1sfiiY0j+CihOE+pTnY4b bdk35lDpHts5b6U6/jrijbgDWfQqDkbx5Q== X-Received: by 2002:a5d:558f:0:b0:1e6:337b:a9e1 with SMTP id i15-20020a5d558f000000b001e6337ba9e1mr14792559wrv.639.1645435685829; Mon, 21 Feb 2022 01:28:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:05 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/26] hvf: arm: Handle unknown ID registers as RES0 Date: Mon, 21 Feb 2022 09:27:38 +0000 Message-Id: <20220221092800.404870-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Alexander Graf Recent Linux versions added support to read ID_AA64ISAR2_EL1. On M1, those reads trap into QEMU which handles them as faults. However, AArch64 ID registers should always read as RES0. Let's handle them accordingly. This fixes booting Linux 5.17 guests. Cc: qemu-stable@nongnu.org Reported-by: Ivan Babrou Signed-off-by: Alexander Graf Message-id: 20220209124135.69183-2-agraf@csgraf.de Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 808c96da8cc..4d4ddab348a 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -754,6 +754,15 @@ static bool hvf_handle_psci_call(CPUState *cpu) return true; } +static bool is_id_sysreg(uint32_t reg) +{ + return SYSREG_OP0(reg) == 3 && + SYSREG_OP1(reg) == 0 && + SYSREG_CRN(reg) == 0 && + SYSREG_CRM(reg) >= 1 && + SYSREG_CRM(reg) < 8; +} + static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint32_t rt) { ARMCPU *arm_cpu = ARM_CPU(cpu); @@ -806,6 +815,11 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint32_t rt) /* Dummy register */ break; default: + if (is_id_sysreg(reg)) { + /* ID system registers read as RES0 */ + val = 0; + break; + } cpu_synchronize_state(cpu); trace_hvf_unhandled_sysreg_read(env->pc, reg, SYSREG_OP0(reg), From patchwork Mon Feb 21 09:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544412 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3103225imn; Mon, 21 Feb 2022 01:42:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj96S1vXw7zqZGHr3twTCpq2np5EurVbpcHLlN1XKo77G4yDn3UXj260AjfG2fqEDz1nRJ X-Received: by 2002:a05:622a:1007:b0:2d0:5c40:560e with SMTP id d7-20020a05622a100700b002d05c40560emr17234014qte.220.1645436536045; Mon, 21 Feb 2022 01:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436536; cv=none; d=google.com; s=arc-20160816; b=leVT/qGKgkvwZokLAfiWZd+rlZt55kEPFFZ93EpROq94A7wErDY1be+xlfvcCIVSPR 9MqMsEUu5DhIVaR38Q4P3qc+Apdl2hSR2BN/KZTLjzQk+58BM/iEJXnyqunvRE6GJ6uj oa0anp4OndIxDRSLNJ7JVJp0achxhnOKZR0IG01uQ/ejwyTQmLRDbp281wNHBtpR70Ad vtaQt1575CFabNhpZTGrT2rOJxcJJ53KsLmnrz5gZjivSSX4RXmg5HHU+YmcgqOrbieI N2BAhqi8vX9xKASCplZ1IPZ1bOrYQyNlEpHTeYN9PccU71c/97QyG0t79SpGYyx6vNFQ /SdA== 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:to:from :dkim-signature; bh=fFvAlZujctsZO52O7VB0vP1MN+adbAx5qb5AzRyyPls=; b=yps9gniGI8P1cERBrl4WSPxyvQIze5itW9O+KW+0V2jNTUpoUqc1NmnosXA80sCFAa lSMCsvp8vgxjMPjBMCz2eHKK2PkKxUvwmfndkhmZmij5WpPgmZrSIfr3teyKs8qvRquh 9fsxxaGUpGJgVY1vghWL0OKqAJ3G/db+4mrWF4n8eSnYckAeT0MfAddHjGtZVjmds6d4 P8pUAgyAnX6wxdX3hcIYVjmwVpgB2qxO0uOnctLsUNDGi2DuTANQetOETkeEW4/DygDB 6dINXAP1ptdfMp3zcVSlZ8iQ38lprwuzZ3Yk9a177JscywE3V0WlhtehfsJ31k5/+s29 lwBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W18dolzB; 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 h24si5023006qkl.464.2022.02.21.01.42.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:42:16 -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=W18dolzB; 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]:56196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Cx-0002tt-He for patch@linaro.org; Mon, 21 Feb 2022 04:42:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zM-00080M-EV for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: from [2a00:1450:4864:20::329] (port=40496 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0000zc-GE for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: by mail-wm1-x329.google.com with SMTP id m126-20020a1ca384000000b0037bb8e379feso13072021wme.5 for ; Mon, 21 Feb 2022 01:28:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fFvAlZujctsZO52O7VB0vP1MN+adbAx5qb5AzRyyPls=; b=W18dolzBStjuLAcc9Y5G9Yb6vR+yh3xL22I74N/Q5R3WaBjqVaCpeiFRnIgmFj/RZU PWMLCZqxpJOycZ7Kvj+dya21tEIxZ038muPo20HL6xb3wo+qf7toO2QptLSVyLK8IIpC gnhQc8d+Kdhml0WL1xna/AGrkKz5Jr7feQoPRgRVdPRscswMLzWlTzuL8JjFaDH1CoHo O+Sj96auCC5aNxGn5IGtYYRQ1OSjNGPE0uIuzQdeUxQ3G0Bo0dU6IBqPJyQHCw9QWJ3+ oIgx1yw+en5WKXNYQo402Pup7d5DkJVEK/cMWyl5/X+KUm0kcW+4EAkScfy+7j2CYhyM C7wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fFvAlZujctsZO52O7VB0vP1MN+adbAx5qb5AzRyyPls=; b=T79puvIDC3pwGQcoPldL7ufQlLSW+2PyPJXHHpKjTGkclgERW0LDzgQFqF4l7aO+S5 6ngWstsNTYyVLwQhZFYDMbB96IfkayfSpy0YO8HlZMuuNJ7/g3TBCAqj/a5usXaTXeqo 2dozF1QZT1XRcoTxBd4To4rgVnwp3XnCzr5I3yG0qR7SfOL7kZddiD0W4zqlvx1s0sTM u7ps0EQgi1llH1tpjpCVE/jiXQD8rloVbgnqQF4zW8W6bmBucpLM3F8zc+j6VAJ4WG0y NJj14XkfmTdy0xukazcB03IARo9OyL1nvXWHVZ0OdkWfRfTc0h4VSrT4th8Xs/7IeZEk Gs/w== X-Gm-Message-State: AOAM530i6lQniTAmBnjjCnaVDMzVknNSsosJQ1dKB/PNn8hgRvGwgEtE Qcv37A3/ELFD+U6HAh3HoZTWlgzSY8em8g== X-Received: by 2002:a05:600c:4ec6:b0:352:cc24:1754 with SMTP id g6-20020a05600c4ec600b00352cc241754mr20055994wmq.184.1645435686942; Mon, 21 Feb 2022 01:28:06 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:06 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/26] Mark remaining global TypeInfo instances as const Date: Mon, 21 Feb 2022 09:27:39 +0000 Message-Id: <20220221092800.404870-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Bernhard Beschow More than 1k of TypeInfo instances are already marked as const. Mark the remaining ones, too. This commit was created with: git grep -z -l 'static TypeInfo' -- '*.c' | \ xargs -0 sed -i 's/static TypeInfo/static const TypeInfo/' Signed-off-by: Bernhard Beschow Reviewed-by: Alistair Francis Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Igor Mammedov Acked-by: Corey Minyard Message-id: 20220117145805.173070-2-shentey@gmail.com Signed-off-by: Peter Maydell --- hw/core/generic-loader.c | 2 +- hw/core/guest-loader.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/i2c-ddc.c | 2 +- hw/display/macfb.c | 4 ++-- hw/display/virtio-vga.c | 2 +- hw/dma/bcm2835_dma.c | 2 +- hw/i386/pc_piix.c | 2 +- hw/i386/sgx-epc.c | 2 +- hw/intc/bcm2835_ic.c | 2 +- hw/intc/bcm2836_control.c | 2 +- hw/ipmi/ipmi.c | 4 ++-- hw/mem/nvdimm.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/misc/bcm2835_mbox.c | 2 +- hw/misc/bcm2835_powermgt.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/bcm2835_rng.c | 2 +- hw/misc/pvpanic-isa.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/ppc/prep_systemio.c | 2 +- hw/ppc/spapr_iommu.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/sclp.c | 2 +- hw/s390x/tod-kvm.c | 2 +- hw/s390x/tod-tcg.c | 2 +- hw/s390x/tod.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/sd/allwinner-sdhost.c | 2 +- hw/sd/aspeed_sdhci.c | 2 +- hw/sd/bcm2835_sdhost.c | 2 +- hw/sd/cadence_sdhci.c | 2 +- hw/sd/npcm7xx_sdhci.c | 2 +- hw/usb/dev-mtp.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/vfio/igd.c | 2 +- hw/virtio/virtio-pmem.c | 2 +- qom/object.c | 4 ++-- 39 files changed, 42 insertions(+), 42 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index 504ed7ca72e..c666545aa00 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -207,7 +207,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); } -static TypeInfo generic_loader_info = { +static const TypeInfo generic_loader_info = { .name = TYPE_GENERIC_LOADER, .parent = TYPE_DEVICE, .instance_size = sizeof(GenericLoaderState), diff --git a/hw/core/guest-loader.c b/hw/core/guest-loader.c index d3f9d1a06eb..391c875a297 100644 --- a/hw/core/guest-loader.c +++ b/hw/core/guest-loader.c @@ -129,7 +129,7 @@ static void guest_loader_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); } -static TypeInfo guest_loader_info = { +static const TypeInfo guest_loader_info = { .name = TYPE_GUEST_LOADER, .parent = TYPE_DEVICE, .instance_size = sizeof(GuestLoaderState), diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index 2be77bdd3a0..088fc3d51c5 100644 --- a/hw/display/bcm2835_fb.c +++ b/hw/display/bcm2835_fb.c @@ -454,7 +454,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_fb; } -static TypeInfo bcm2835_fb_info = { +static const TypeInfo bcm2835_fb_info = { .name = TYPE_BCM2835_FB, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835FBState), diff --git a/hw/display/i2c-ddc.c b/hw/display/i2c-ddc.c index 13eb529fc14..146489518c7 100644 --- a/hw/display/i2c-ddc.c +++ b/hw/display/i2c-ddc.c @@ -113,7 +113,7 @@ static void i2c_ddc_class_init(ObjectClass *oc, void *data) isc->send = i2c_ddc_tx; } -static TypeInfo i2c_ddc_info = { +static const TypeInfo i2c_ddc_info = { .name = TYPE_I2CDDC, .parent = TYPE_I2C_SLAVE, .instance_size = sizeof(I2CDDCState), diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 2eeb80cc3f0..c9b468c10e4 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -782,14 +782,14 @@ static void macfb_nubus_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, macfb_nubus_properties); } -static TypeInfo macfb_sysbus_info = { +static const TypeInfo macfb_sysbus_info = { .name = TYPE_MACFB, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MacfbSysBusState), .class_init = macfb_sysbus_class_init, }; -static TypeInfo macfb_nubus_info = { +static const TypeInfo macfb_nubus_info = { .name = TYPE_NUBUS_MACFB, .parent = TYPE_NUBUS_DEVICE, .instance_size = sizeof(MacfbNubusState), diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index b23a75a04b9..5a2f7a45408 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -220,7 +220,7 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data) virtio_vga_set_big_endian_fb); } -static TypeInfo virtio_vga_base_info = { +static const TypeInfo virtio_vga_base_info = { .name = TYPE_VIRTIO_VGA_BASE, .parent = TYPE_VIRTIO_PCI, .instance_size = sizeof(VirtIOVGABase), diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c index eb0002a2b98..5e9306110dc 100644 --- a/hw/dma/bcm2835_dma.c +++ b/hw/dma/bcm2835_dma.c @@ -394,7 +394,7 @@ static void bcm2835_dma_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_dma; } -static TypeInfo bcm2835_dma_info = { +static const TypeInfo bcm2835_dma_info = { .name = TYPE_BCM2835_DMA, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835DMAState), diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index d9b344248da..8d33cf689db 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -867,7 +867,7 @@ static void isa_bridge_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_BRIDGE_ISA; }; -static TypeInfo isa_bridge_info = { +static const TypeInfo isa_bridge_info = { .name = "igd-passthrough-isa-bridge", .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index 96b2940d75e..d664829d354 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -167,7 +167,7 @@ static void sgx_epc_class_init(ObjectClass *oc, void *data) mdc->fill_device_info = sgx_epc_md_fill_device_info; } -static TypeInfo sgx_epc_info = { +static const TypeInfo sgx_epc_info = { .name = TYPE_SGX_EPC, .parent = TYPE_DEVICE, .instance_size = sizeof(SGXEPCDevice), diff --git a/hw/intc/bcm2835_ic.c b/hw/intc/bcm2835_ic.c index 9000d995e81..4513fad16f2 100644 --- a/hw/intc/bcm2835_ic.c +++ b/hw/intc/bcm2835_ic.c @@ -227,7 +227,7 @@ static void bcm2835_ic_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_ic; } -static TypeInfo bcm2835_ic_info = { +static const TypeInfo bcm2835_ic_info = { .name = TYPE_BCM2835_IC, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835ICState), diff --git a/hw/intc/bcm2836_control.c b/hw/intc/bcm2836_control.c index 2ead76ffdce..b0589df1881 100644 --- a/hw/intc/bcm2836_control.c +++ b/hw/intc/bcm2836_control.c @@ -392,7 +392,7 @@ static void bcm2836_control_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2836_control; } -static TypeInfo bcm2836_control_info = { +static const TypeInfo bcm2836_control_info = { .name = TYPE_BCM2836_CONTROL, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2836ControlState), diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index 8d35c9fdd61..bbb07b151e9 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -85,7 +85,7 @@ static void ipmi_interface_class_init(ObjectClass *class, void *data) ik->do_hw_op = ipmi_do_hw_op; } -static TypeInfo ipmi_interface_type_info = { +static const TypeInfo ipmi_interface_type_info = { .name = TYPE_IPMI_INTERFACE, .parent = TYPE_INTERFACE, .class_size = sizeof(IPMIInterfaceClass), @@ -120,7 +120,7 @@ static void bmc_class_init(ObjectClass *oc, void *data) device_class_set_props(dc, ipmi_bmc_properties); } -static TypeInfo ipmi_bmc_type_info = { +static const TypeInfo ipmi_bmc_type_info = { .name = TYPE_IPMI_BMC, .parent = TYPE_DEVICE, .instance_size = sizeof(IPMIBmc), diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 59959d55633..7c7d777781b 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -264,7 +264,7 @@ static void nvdimm_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } -static TypeInfo nvdimm_info = { +static const TypeInfo nvdimm_info = { .name = TYPE_NVDIMM, .parent = TYPE_PC_DIMM, .class_size = sizeof(NVDIMMClass), diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 03bd0dd60e5..f27e1a11bab 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -291,7 +291,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data) mdc->fill_device_info = pc_dimm_md_fill_device_info; } -static TypeInfo pc_dimm_info = { +static const TypeInfo pc_dimm_info = { .name = TYPE_PC_DIMM, .parent = TYPE_DEVICE, .instance_size = sizeof(PCDIMMDevice), diff --git a/hw/misc/bcm2835_mbox.c b/hw/misc/bcm2835_mbox.c index 04e53c98282..1e4e061bc1f 100644 --- a/hw/misc/bcm2835_mbox.c +++ b/hw/misc/bcm2835_mbox.c @@ -323,7 +323,7 @@ static void bcm2835_mbox_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_mbox; } -static TypeInfo bcm2835_mbox_info = { +static const TypeInfo bcm2835_mbox_info = { .name = TYPE_BCM2835_MBOX, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835MboxState), diff --git a/hw/misc/bcm2835_powermgt.c b/hw/misc/bcm2835_powermgt.c index 25fa804cbda..976f3d34e5e 100644 --- a/hw/misc/bcm2835_powermgt.c +++ b/hw/misc/bcm2835_powermgt.c @@ -144,7 +144,7 @@ static void bcm2835_powermgt_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_powermgt; } -static TypeInfo bcm2835_powermgt_info = { +static const TypeInfo bcm2835_powermgt_info = { .name = TYPE_BCM2835_POWERMGT, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835PowerMgtState), diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 76ea511d53d..e94e951057e 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -421,7 +421,7 @@ static void bcm2835_property_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_property; } -static TypeInfo bcm2835_property_info = { +static const TypeInfo bcm2835_property_info = { .name = TYPE_BCM2835_PROPERTY, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835PropertyState), diff --git a/hw/misc/bcm2835_rng.c b/hw/misc/bcm2835_rng.c index d0c4e64e88d..b3c80cf1867 100644 --- a/hw/misc/bcm2835_rng.c +++ b/hw/misc/bcm2835_rng.c @@ -131,7 +131,7 @@ static void bcm2835_rng_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_rng; } -static TypeInfo bcm2835_rng_info = { +static const TypeInfo bcm2835_rng_info = { .name = TYPE_BCM2835_RNG, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835RngState), diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c index 7b66d58acc8..a39fcdd1fce 100644 --- a/hw/misc/pvpanic-isa.c +++ b/hw/misc/pvpanic-isa.c @@ -77,7 +77,7 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); } -static TypeInfo pvpanic_isa_info = { +static const TypeInfo pvpanic_isa_info = { .name = TYPE_PVPANIC_ISA_DEVICE, .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(PVPanicISAState), diff --git a/hw/misc/pvpanic-pci.c b/hw/misc/pvpanic-pci.c index af8cbe28305..62e1be68c1d 100644 --- a/hw/misc/pvpanic-pci.c +++ b/hw/misc/pvpanic-pci.c @@ -74,7 +74,7 @@ static void pvpanic_pci_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); } -static TypeInfo pvpanic_pci_info = { +static const TypeInfo pvpanic_pci_info = { .name = TYPE_PVPANIC_PCI_DEVICE, .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PVPanicPCIState), diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index bd9d62b5593..e7fc082518d 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -430,7 +430,7 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->user_creatable = true; } -static TypeInfo etsec_info = { +static const TypeInfo etsec_info = { .name = TYPE_ETSEC_COMMON, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(eTSEC), diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index b2bd7832487..8c9b8dd67b7 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -300,7 +300,7 @@ static void prep_systemio_class_initfn(ObjectClass *klass, void *data) device_class_set_props(dc, prep_systemio_properties); } -static TypeInfo prep_systemio800_info = { +static const TypeInfo prep_systemio800_info = { .name = TYPE_PREP_SYSTEMIO, .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(PrepSystemIoState), diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index db010718589..81e5a1aea3a 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -685,7 +685,7 @@ static void spapr_tce_table_class_init(ObjectClass *klass, void *data) spapr_register_hypercall(H_STUFF_TCE, h_stuff_tce); } -static TypeInfo spapr_tce_table_info = { +static const TypeInfo spapr_tce_table_info = { .name = TYPE_SPAPR_TCE_TABLE, .parent = TYPE_DEVICE, .instance_size = sizeof(SpaprTceTable), diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 01b58ebc707..4b2bdd94b38 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1392,7 +1392,7 @@ static const TypeInfo s390_pci_device_info = { .class_init = s390_pci_device_class_init, }; -static TypeInfo s390_pci_iommu_info = { +static const TypeInfo s390_pci_iommu_info = { .name = TYPE_S390_PCI_IOMMU, .parent = TYPE_OBJECT, .instance_size = sizeof(S390PCIIOMMU), diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 89c30a8a91a..eff74479f45 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -460,7 +460,7 @@ static void sclp_class_init(ObjectClass *oc, void *data) sc->service_interrupt = service_interrupt; } -static TypeInfo sclp_info = { +static const TypeInfo sclp_info = { .name = TYPE_SCLP, .parent = TYPE_DEVICE, .instance_init = sclp_init, diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c index ec855811aeb..9d0cbfbce2b 100644 --- a/hw/s390x/tod-kvm.c +++ b/hw/s390x/tod-kvm.c @@ -147,7 +147,7 @@ static void kvm_s390_tod_init(Object *obj) td->stopped = false; } -static TypeInfo kvm_s390_tod_info = { +static const TypeInfo kvm_s390_tod_info = { .name = TYPE_KVM_S390_TOD, .parent = TYPE_S390_TOD, .instance_size = sizeof(S390TODState), diff --git a/hw/s390x/tod-tcg.c b/hw/s390x/tod-tcg.c index 7646b4aa380..2d540dba65a 100644 --- a/hw/s390x/tod-tcg.c +++ b/hw/s390x/tod-tcg.c @@ -73,7 +73,7 @@ static void qemu_s390_tod_init(Object *obj) } } -static TypeInfo qemu_s390_tod_info = { +static const TypeInfo qemu_s390_tod_info = { .name = TYPE_QEMU_S390_TOD, .parent = TYPE_S390_TOD, .instance_size = sizeof(S390TODState), diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c index fd5a36bf24e..c81b1c03383 100644 --- a/hw/s390x/tod.c +++ b/hw/s390x/tod.c @@ -123,7 +123,7 @@ static void s390_tod_class_init(ObjectClass *oc, void *data) dc->user_creatable = false; } -static TypeInfo s390_tod_info = { +static const TypeInfo s390_tod_info = { .name = TYPE_S390_TOD, .parent = TYPE_DEVICE, .instance_size = sizeof(S390TODState), diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 4c431adb774..c8773f73f75 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2352,7 +2352,7 @@ static void lsi53c810_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_LSI_53C810; } -static TypeInfo lsi53c810_info = { +static const TypeInfo lsi53c810_info = { .name = TYPE_LSI53C810, .parent = TYPE_LSI53C895A, .class_init = lsi53c810_class_init, diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c index de5bc49e68f..041e45c6804 100644 --- a/hw/sd/allwinner-sdhost.c +++ b/hw/sd/allwinner-sdhost.c @@ -835,7 +835,7 @@ static void allwinner_sdhost_sun5i_class_init(ObjectClass *klass, void *data) sc->max_desc_size = 64 * KiB; } -static TypeInfo allwinner_sdhost_info = { +static const TypeInfo allwinner_sdhost_info = { .name = TYPE_AW_SDHOST, .parent = TYPE_SYS_BUS_DEVICE, .instance_init = allwinner_sdhost_init, diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c index df1bdf1fa4e..be8cafd65f8 100644 --- a/hw/sd/aspeed_sdhci.c +++ b/hw/sd/aspeed_sdhci.c @@ -198,7 +198,7 @@ static void aspeed_sdhci_class_init(ObjectClass *classp, void *data) device_class_set_props(dc, aspeed_sdhci_properties); } -static TypeInfo aspeed_sdhci_info = { +static const TypeInfo aspeed_sdhci_info = { .name = TYPE_ASPEED_SDHCI, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(AspeedSDHCIState), diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c index 088a7ac6ed4..9431c359145 100644 --- a/hw/sd/bcm2835_sdhost.c +++ b/hw/sd/bcm2835_sdhost.c @@ -436,7 +436,7 @@ static void bcm2835_sdhost_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_bcm2835_sdhost; } -static TypeInfo bcm2835_sdhost_info = { +static const TypeInfo bcm2835_sdhost_info = { .name = TYPE_BCM2835_SDHOST, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(BCM2835SDHostState), diff --git a/hw/sd/cadence_sdhci.c b/hw/sd/cadence_sdhci.c index 56b8bae1c3f..75db34befe5 100644 --- a/hw/sd/cadence_sdhci.c +++ b/hw/sd/cadence_sdhci.c @@ -175,7 +175,7 @@ static void cadence_sdhci_class_init(ObjectClass *classp, void *data) dc->vmsd = &vmstate_cadence_sdhci; } -static TypeInfo cadence_sdhci_info = { +static const TypeInfo cadence_sdhci_info = { .name = TYPE_CADENCE_SDHCI, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(CadenceSDHCIState), diff --git a/hw/sd/npcm7xx_sdhci.c b/hw/sd/npcm7xx_sdhci.c index ef503365dfb..b2f5b4a5425 100644 --- a/hw/sd/npcm7xx_sdhci.c +++ b/hw/sd/npcm7xx_sdhci.c @@ -166,7 +166,7 @@ static void npcm7xx_sdhci_instance_init(Object *obj) TYPE_SYSBUS_SDHCI); } -static TypeInfo npcm7xx_sdhci_info = { +static const TypeInfo npcm7xx_sdhci_info = { .name = TYPE_NPCM7XX_SDHCI, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(NPCM7xxSDHCIState), diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index c1d1694fd0b..1e6ac76bef9 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -2106,7 +2106,7 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data) device_class_set_props(dc, mtp_properties); } -static TypeInfo mtp_info = { +static const TypeInfo mtp_info = { .name = TYPE_USB_MTP, .parent = TYPE_USB_DEVICE, .instance_size = sizeof(MTPState), diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index d0d46dd0a4a..2b35cb6cdd3 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1801,7 +1801,7 @@ static void usb_host_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } -static TypeInfo usb_host_dev_info = { +static const TypeInfo usb_host_dev_info = { .name = TYPE_USB_HOST_DEVICE, .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBHostDevice), diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c index d4685709a3b..afe3fe7efc4 100644 --- a/hw/vfio/igd.c +++ b/hw/vfio/igd.c @@ -199,7 +199,7 @@ static void vfio_pci_igd_lpc_bridge_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_BRIDGE_ISA; } -static TypeInfo vfio_pci_igd_lpc_bridge_info = { +static const TypeInfo vfio_pci_igd_lpc_bridge_info = { .name = "vfio-pci-igd-lpc-bridge", .parent = TYPE_PCI_DEVICE, .class_init = vfio_pci_igd_lpc_bridge_class_init, diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c index d1aeb90a31a..5419dca75e2 100644 --- a/hw/virtio/virtio-pmem.c +++ b/hw/virtio/virtio-pmem.c @@ -182,7 +182,7 @@ static void virtio_pmem_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } -static TypeInfo virtio_pmem_info = { +static const TypeInfo virtio_pmem_info = { .name = TYPE_VIRTIO_PMEM, .parent = TYPE_VIRTIO_DEVICE, .class_size = sizeof(VirtIOPMEMClass), diff --git a/qom/object.c b/qom/object.c index 4f0677cca9e..9f7a33139d4 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2793,13 +2793,13 @@ static void object_class_init(ObjectClass *klass, void *data) static void register_types(void) { - static TypeInfo interface_info = { + static const TypeInfo interface_info = { .name = TYPE_INTERFACE, .class_size = sizeof(InterfaceClass), .abstract = true, }; - static TypeInfo object_info = { + static const TypeInfo object_info = { .name = TYPE_OBJECT, .instance_size = sizeof(Object), .class_init = object_class_init, From patchwork Mon Feb 21 09:27:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544416 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3105927imn; Mon, 21 Feb 2022 01:47:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/j6LGop1oZ+jwogimKjMrbQcfL4BGtRa0lDDedOispwF/X3z4AMlT5OlOZSk+JjZWzzbU X-Received: by 2002:a37:c44d:0:b0:60d:d761:516a with SMTP id h13-20020a37c44d000000b0060dd761516amr11152752qkm.273.1645436866829; Mon, 21 Feb 2022 01:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436866; cv=none; d=google.com; s=arc-20160816; b=bnXZaRUXPFaKB9wH16EgGJHUDoDQ13UoI95qb9QSuym6pctjtRdXPjtWYi6f+aokBg lkzKe2ANfS+/PdxdwevO5oYtjz0Mjck6EWSosInbuRQdi5qC2VkCsJ3YK+TzmOvnaMen njM/Q6chPeFdhTUE9oZbdznBsDzw+8eiVqewsI1PwY5Q+m68SqbA8J1u2AQQTfHkCUJa gCosUmQ0Tc9G6z5kD8UZn2MQAldh73ZG469IAOfxrd+Ihh09eMrg0iRe6tlDfGz3Lz8F gYSknZQJnwM2X5sCjXJCUcnYEDLfkxOB372LPblGFD91Fi9GF1ra3qFJq+5Kr41KnYkh blBA== 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:to:from :dkim-signature; bh=ohvqOffcepW7CtlFg3ZQ+s1HR00RGP932N5zAI3tYFM=; b=BIkRMvMh+j7aNb2d/VPmyczbX1iaPNyCZkPzEGwPfEeZymhjuYdSERX3oMXL8c+/dO V+cMwadDXA4DzjXNyMNl5D8QjH5EPnVweG65nV2PEdxQQNxMMR87ho0oP25dTYYa8WnF EpTPFxYdDidCYqd/FyMjGG+QL4RCEd0NNJR4P1PRwUap5amW02GdpQaN5KnU8plrKci5 /QkFD7Oeh4K0YHF62qXvxb5BDsP6tG0bTLDDlhR7brBjJGFNeE28n6ru1cxo0OqZ8k3J v4MVxwVx/JpXCc0/30pHr3sD/j6erS4U0oYjlJVc3ZKHcHEHQ7Z098V4XFOE31s82xjg DV0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K64WrwKY; 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 h1si15067121qkn.309.2022.02.21.01.47.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:47:46 -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=K64WrwKY; 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]:36608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5II-0000aw-3d for patch@linaro.org; Mon, 21 Feb 2022 04:47:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zL-0007xx-2p for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:11 -0500 Received: from [2a00:1450:4864:20::335] (port=37401 helo=mail-wm1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0000zm-Gk for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:10 -0500 Received: by mail-wm1-x335.google.com with SMTP id p14-20020a05600c1d8e00b0037f881182a8so899809wms.2 for ; Mon, 21 Feb 2022 01:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ohvqOffcepW7CtlFg3ZQ+s1HR00RGP932N5zAI3tYFM=; b=K64WrwKYAlEvYlJaxl9/Xft/Nwcwpd4Y4yk6dj/MrJaKpqHGI1FF6kTVdqGS3Un7DK ILkF3U/9V0MwXNzJBX6CiLaIx7J/W5LLvNNhG2pew+/+36kUPtNx+tfktnYL7ZhRjfNc G/l9dYchBpssbtR9AbA9KR28F5xAfoSxiWZ5XLUtgXgLQNnRfELjM5QrUblHffkLn36E cBzaa+9mGiOXy39iKa5t6OklqlPNPfpOOI4V82bESTxLn3D3ux1QobSi+M9lzaw64oyN E12HrTAsom8B1L9CiZgboGEGu1l6fhYk36eBEB5zrMSMzapHpZNtmskAP38R4pueyEOK ciIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ohvqOffcepW7CtlFg3ZQ+s1HR00RGP932N5zAI3tYFM=; b=ClDsx64GEqdoG36K20jDYVF5v382tNJBNlB5uuB1hyYhrAFdnkdho8PDfqhul+rb4K 3lKLv5aC8Bi4TJ7jFN0WIZRg8SiuVY5nZQbwMSfOxwLIjTs9cidF8nWtZag+EgfULSvX +MVMVXzTigA5qVsJYVaFuXL4dPOGNI1+00NELWmnAZNKnXTOn1dR1aSuidZdBCRtlt6p eSQH8RT67Sp2I1rgp0eqozx4SU/ZQ7jQ4wcpdEEbqYr1hmdCl3lerLF1l9Nd+QoM5DKP HtM/+CPacPkH+x3e8JPUicIJlfoewQOpLdOFCRtOw0PhJEm4s+gETP14HxLbmUf+2V6M Zs+g== X-Gm-Message-State: AOAM533zX+iasDcQcuTDMfhfsGESPD2bj30+zETRaLpvoiuqtjMRCJs2 axml+YD+/0du5Pa43e8kMkMBAg6uQlq2BA== X-Received: by 2002:a05:600c:1f15:b0:34f:e3cc:334b with SMTP id bd21-20020a05600c1f1500b0034fe3cc334bmr17301331wmb.0.1645435687668; Mon, 21 Feb 2022 01:28:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/26] checkpatch: Ensure that TypeInfos are const Date: Mon, 21 Feb 2022 09:27:40 +0000 Message-Id: <20220221092800.404870-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::335 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Bernhard Beschow Now that all static TypeInfo instances are declared const, prevent that new non-const instances are created. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-id: 20220117145805.173070-3-shentey@gmail.com Signed-off-by: Peter Maydell --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5e501110601..ddd8148d87e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2882,6 +2882,7 @@ sub process { SCSIBusInfo| SCSIReqOps| Spice[A-Z][a-zA-Z0-9]*Interface| + TypeInfo| USBDesc[A-Z][a-zA-Z0-9]*| VhostOps| VMStateDescription| From patchwork Mon Feb 21 09:27:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544408 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3100668imn; Mon, 21 Feb 2022 01:37:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrxI2SVKXKPG0SpXT6oKGUA1MAlkFDJwt7f0V6qgMq+0FhAlr5r6LeXjCQUl20Q3BGVNPM X-Received: by 2002:a05:622a:1ba9:b0:2dd:9687:eb1f with SMTP id bp41-20020a05622a1ba900b002dd9687eb1fmr13923078qtb.409.1645436228626; Mon, 21 Feb 2022 01:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436228; cv=none; d=google.com; s=arc-20160816; b=cVRwUCWysLHwb6WNIy3wZrffu+eeu1MgHhXbgLLE0zGAuCWoaCk7vLOFZEqyK4p/SE c2az3WG3rqT2F9vN+fJJBeGfgY8GBFboDCRPqEyyAV5KZc7WQLFQ2r01oc0IbdpbF2aT OcNd+Vk3UH+U9QYK99GuYTDm0lPCRNsTgZT4j9KCW5Qup+SRx83SefS9qOkmhcPcxiZT 5loJ971GCQkELULxwHuIGkrxDeErYGO8BfXU0rafgiJfRw44+o64/ka7os3wCM8ITE57 F6evevDRDWnPo0eG6MxUe9R+wraAtENkVvNVZPbOsdfA+m/3RVLjss7ZfanjtXuafTwF aJ7w== 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:to:from :dkim-signature; bh=8fBYS41UsWbP0oQzjFohWFoqIxyMIMGF5D+riPpbPJY=; b=eLzzu5yWrL2bYF+wlyv7tkRR99Neq3JDcD839d2iTYfJYw0XIygRlo4bSalRms9Xq5 6YzN7TeCC9eKD6pebp/OcJ6CqMQiRmA72TTlxw1cE6rVmLfKBiYMPGCUP6+qPePNhsok bCmVKc2aMqSG71wTFKBaAsM7HFkxXVsqC3vNzuEClN79HMYgem1teVSwTVTbptmuI6sc gtLEUmDqLvkVNsS0gr/DPvK+R7CkiaY2LYwQSpCmGDzhEE4fJ1gvkW4bYCdgtckwgp1u 95YeUz5EWGNvIt2JEwZRMMZJR27obeLdFDTksVlKJSF2MJStKD7Q0ENOsqqfjCiNsV+G qzyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LK6rDyEb; 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 k15si14536567qko.578.2022.02.21.01.37.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:37:08 -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=LK6rDyEb; 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]:47710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM580-0005W3-5O for patch@linaro.org; Mon, 21 Feb 2022 04:37:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zL-0007yx-JT for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:11 -0500 Received: from [2a00:1450:4864:20::32c] (port=33763 helo=mail-wm1-x32c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zJ-0000zw-Ox for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:11 -0500 Received: by mail-wm1-x32c.google.com with SMTP id y6-20020a7bc186000000b0037bdc5a531eso8057347wmi.0 for ; Mon, 21 Feb 2022 01:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8fBYS41UsWbP0oQzjFohWFoqIxyMIMGF5D+riPpbPJY=; b=LK6rDyEb/8JWAHEbe9Z9HC5mXc2Acvxs1fcIZplzHjSK2e1qCPFClELjrHZyhAhamf 49aSh3yWoOot04rJZkeI0fAoOaWUCutIehE6G+esWPqodf9dDrcR1jUAwUjpXCr8gOBD B2B3m+M42+W7fRPKo4qaiIfYs4baconlNcw2tx4oVarUbH9zkJ1N8j2ILpcH8AiMSsL7 N+qNt3j2uMuogV4Wy9PzJvfZi9RNvO0vS+yXf4NSfsIpfdOGJGMssO31Ws224yqvAehw MZxRS9pk/oyuehp6Va0g+1qlIfPEabXcbt8cOn0CpBSbYkKLdVwQfJ7lqWb66UAJZg2o zJGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8fBYS41UsWbP0oQzjFohWFoqIxyMIMGF5D+riPpbPJY=; b=G322HU4x2Kjnh/w6sjV+9WJxV0TtDdnVtiWPdklsEx3Y0q8FoFxR3pcdv2rJFKC0og h5IRLaT91ZmDVPNVNNfiUydGxD8b0/T0qVEOG8uZIlfmx8feUm1lWWXCAsF+zwVCM7SF BLx/VNke0sFlloTBnq1q9r2xqeW7io4z3chK4rjG2yNz7bTiacTxgSftVjqbwP4GguP7 w736lgcLbVdPCl3ry9kWGeRTMyj4YprFgEtNpSdRFoy2VoBuZLliyD3lvdvzpheh3iL6 hN+w0EbensidM2gOnDcQ2TuPYx9VaGld6oMordN36bV9hQCn0U2ljl27RDNOTqdDjKeI OeUA== X-Gm-Message-State: AOAM533a4fF+/fSrIk5DZdjCemA/IuoFY4RuHhvx1OoDnb4FBk5RU7cZ ENlXPDv/bVphFJximtqwO0xY6jh1gUoDUQ== X-Received: by 2002:a05:600c:ad0:b0:37b:b989:faaf with SMTP id c16-20020a05600c0ad000b0037bb989faafmr20324035wmr.167.1645435688411; Mon, 21 Feb 2022 01:28:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:08 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/26] target/arm: Move '-cpu host' code to cpu64.c Date: Mon, 21 Feb 2022 09:27:41 +0000 Message-Id: <20220221092800.404870-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Now that KVM has dropped AArch32 host support, the 'host' CPU type is always AArch64, and we can move it to cpu64.c. This move will allow us to share code between it and '-cpu max', which should behave the same as '-cpu host' when using KVM or HVF. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-2-peter.maydell@linaro.org --- target/arm/cpu.c | 30 ------------------------------ target/arm/cpu64.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5a9c02a2561..a4a229a65be 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -39,7 +39,6 @@ #include "sysemu/tcg.h" #include "sysemu/hw_accel.h" #include "kvm_arm.h" -#include "hvf_arm.h" #include "disas/capstone.h" #include "fpu/softfloat.h" @@ -2079,31 +2078,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) #endif /* CONFIG_TCG */ } -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) -static void arm_host_initfn(Object *obj) -{ - ARMCPU *cpu = ARM_CPU(obj); - -#ifdef CONFIG_KVM - kvm_arm_set_cpu_features_from_host(cpu); - if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { - aarch64_add_sve_properties(obj); - aarch64_add_pauth_properties(obj); - } -#else - hvf_arm_set_cpu_features_from_host(cpu); -#endif - arm_cpu_post_init(obj); -} - -static const TypeInfo host_arm_cpu_type_info = { - .name = TYPE_ARM_HOST_CPU, - .parent = TYPE_AARCH64_CPU, - .instance_init = arm_host_initfn, -}; - -#endif - static void arm_cpu_instance_init(Object *obj) { ARMCPUClass *acc = ARM_CPU_GET_CLASS(obj); @@ -2151,10 +2125,6 @@ static const TypeInfo arm_cpu_type_info = { static void arm_cpu_register_types(void) { type_register_static(&arm_cpu_type_info); - -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) - type_register_static(&host_arm_cpu_type_info); -#endif } type_init(arm_cpu_register_types) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 8786be7783e..052666b819e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -30,6 +30,7 @@ #endif #include "sysemu/kvm.h" #include "kvm_arm.h" +#include "hvf_arm.h" #include "qapi/visitor.h" #include "hw/qdev-properties.h" @@ -681,6 +682,31 @@ void aarch64_add_pauth_properties(Object *obj) } } +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) +static void arm_host_initfn(Object *obj) +{ + ARMCPU *cpu = ARM_CPU(obj); + +#ifdef CONFIG_KVM + kvm_arm_set_cpu_features_from_host(cpu); + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { + aarch64_add_sve_properties(obj); + aarch64_add_pauth_properties(obj); + } +#else + hvf_arm_set_cpu_features_from_host(cpu); +#endif + arm_cpu_post_init(obj); +} + +static const TypeInfo host_arm_cpu_type_info = { + .name = TYPE_ARM_HOST_CPU, + .parent = TYPE_AARCH64_CPU, + .instance_init = arm_host_initfn, +}; + +#endif + /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. * The version of '-cpu max' for qemu-system-arm is defined in cpu.c; @@ -1023,6 +1049,10 @@ static void aarch64_cpu_register_types(void) for (i = 0; i < ARRAY_SIZE(aarch64_cpus); ++i) { aarch64_cpu_register(&aarch64_cpus[i]); } + +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) + type_register_static(&host_arm_cpu_type_info); +#endif } type_init(aarch64_cpu_register_types) From patchwork Mon Feb 21 09:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544419 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3108101imn; Mon, 21 Feb 2022 01:52:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZxahixHOECfBDq/k7UehDt9kFAuocypQptVTth0m/DtiNnQILLWX4DWfYKBV1bjkApVdp X-Received: by 2002:a0c:f692:0:b0:42d:8917:fe1 with SMTP id p18-20020a0cf692000000b0042d89170fe1mr14916898qvn.57.1645437123447; Mon, 21 Feb 2022 01:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437123; cv=none; d=google.com; s=arc-20160816; b=MjV4BkSXIvjOG3gSYNG3sNVN+kh51UhNRfsR2smfeoDoA3t5OKXo6OxDIxW/Xx5im1 Uq4e/nkTRiva4MDqzKI+PvzgYAny3TMZnoa5cCtZkaorgkYgz/hPgADuv/G/NqM6LUEz y25tG/wej93Fn2zfBg1QBaQ5X9zn2o2k6yp6WeKXYIUoRf6aH88MB4mSmUzt2ZVg8kWA ycbCGJ567SBLHA4hbponc2sO7vV6DfAjQXBaGWvbE6sdGnghC41DbLLiuXjtd40MXdFn 3/UNdNEYiMqMH1IDF3wmgBwR6RfqznDbvNUj7rgncAEhQZKxWgymV717SpYdltxpdrpF kEKw== 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:to:from :dkim-signature; bh=cEOGtMvEBym4vB62YkCGC60KIA3PCqmNTfzEeeuJSVc=; b=nWca40CV74iv6R2Ywlr/kAXd3+671Cfl+Ezg+utDydDwT5LW5NwyTlQAczt3Yyv3Ps tr1oRExLqOsRfDAx5sNkBxAimn+Wpbd76HE3A+NuSSQDB00bbLI+qmxxe79PRxluzryO gm6G0ZopGY3k3n5L5O/EFO20rYj6BonoR3b2zRU4rZL73rgv8UY1dveduQkzpclUimyy 4eLqe/yArW1Y9oIAo8cVEuYObQ+f4XdyiPT38djLkGawMyiGyzyTZa95B7quxShJRXEh wIHTosJxiAnXhXmeCPTFiC0p2F7tciAa+435BWDuf3h5U53kRaXNcOBwDKtFAkYBLlMl vLEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mXGkeYBa; 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 n7si6993323qvk.154.2022.02.21.01.52.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:52:03 -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=mXGkeYBa; 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]:45114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5MQ-0006R7-WC for patch@linaro.org; Mon, 21 Feb 2022 04:52:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zM-00080D-AK for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: from [2a00:1450:4864:20::32a] (port=37391 helo=mail-wm1-x32a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zK-000102-D9 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:11 -0500 Received: by mail-wm1-x32a.google.com with SMTP id p14-20020a05600c1d8e00b0037f881182a8so899835wms.2 for ; Mon, 21 Feb 2022 01:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=cEOGtMvEBym4vB62YkCGC60KIA3PCqmNTfzEeeuJSVc=; b=mXGkeYBaOmvRgSL3Jn9CrrmOUZGmDjrmZmw7y72YVvt5bnPeWLw5u1Ve9FigIZU/8v 2aynQiXKyn8OFGOe8yeOhbSHYJDXAgNvmiXd5/hX66z5KMw91dhL/SgaozKc3PPY/GkR lGEeD9dcW1vZlRq8mnvCIDhc6wuRhzhv/VRymaf7JvqSPuX4WpYk2v8ErVVeMSPWGjZW fMw9XQtHQ56VcQePL13NH4/i/JvSvUNvEgII/ltl+X1vM4DAkar1Wn5QRUvJMHhBwL2t i7PeusScQrtxZPXmr8Tjolgk7HdFpK9/WEvbzJC5aRUqoJvRw/dn0tNi7Uny21huzRge TjQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cEOGtMvEBym4vB62YkCGC60KIA3PCqmNTfzEeeuJSVc=; b=VBNpT3NSLes0irC/L0g0V6KllouU2eXiebK8eN2SoPTC9oUjRb1AC1RSgwbsOWhLqy dRV864Fzw8DZpH8mtHsrdTFvcrsuU9SJwrmboIz07RPRnWJvgfKau9xTV4wtY8ZO7aao pa9cP2WrDr9t0Yr1BEJ3Kge2j147luX0uIRmFPLmDFsSs0+yUhHwM8OqU0sTEfbDy5CF qtxc1k36/EBJ+kJrWcn9SWVznr+kQ1Yf1ZkCxjxOHYrl2CqFSUojLREu6otReLSH0Q3a wdnwxVI/kzZmvGAeq8E8WHUe1kiOeMK5n91Q35/W1M9qqSR9T+KGFRaXfH2GLRDVhdUt Ifgg== X-Gm-Message-State: AOAM5319HaWbooYbmySU7YgEKxOpDkj0os5LZKzsy8OxgMJTYNJFIjQF 7788+WWyVMbopl9uvvc2318M8IGS+vqPiA== X-Received: by 2002:a7b:ca45:0:b0:37b:e8cf:8ebb with SMTP id m5-20020a7bca45000000b0037be8cf8ebbmr20441169wml.72.1645435689111; Mon, 21 Feb 2022 01:28:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:08 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/26] target/arm: Use aarch64_cpu_register() for 'host' CPU type Date: Mon, 21 Feb 2022 09:27:42 +0000 Message-Id: <20220221092800.404870-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Use the aarch64_cpu_register() machinery to register the 'host' CPU type. This doesn't gain us anything functionally, but it does mean that the code for initializing it looks more like that for the other CPU types, in that its initfn then doesn't need to call arm_cpu_post_init() (because aarch64_cpu_instance_init() does that for it). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-3-peter.maydell@linaro.org --- target/arm/cpu64.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 052666b819e..590ac562714 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -683,7 +683,7 @@ void aarch64_add_pauth_properties(Object *obj) } #if defined(CONFIG_KVM) || defined(CONFIG_HVF) -static void arm_host_initfn(Object *obj) +static void aarch64_host_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -696,15 +696,7 @@ static void arm_host_initfn(Object *obj) #else hvf_arm_set_cpu_features_from_host(cpu); #endif - arm_cpu_post_init(obj); } - -static const TypeInfo host_arm_cpu_type_info = { - .name = TYPE_ARM_HOST_CPU, - .parent = TYPE_AARCH64_CPU, - .instance_init = arm_host_initfn, -}; - #endif /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); @@ -943,6 +935,9 @@ static const ARMCPUInfo aarch64_cpus[] = { { .name = "cortex-a72", .initfn = aarch64_a72_initfn }, { .name = "a64fx", .initfn = aarch64_a64fx_initfn }, { .name = "max", .initfn = aarch64_max_initfn }, +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) + { .name = "host", .initfn = aarch64_host_initfn }, +#endif }; static bool aarch64_cpu_get_aarch64(Object *obj, Error **errp) @@ -1049,10 +1044,6 @@ static void aarch64_cpu_register_types(void) for (i = 0; i < ARRAY_SIZE(aarch64_cpus); ++i) { aarch64_cpu_register(&aarch64_cpus[i]); } - -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) - type_register_static(&host_arm_cpu_type_info); -#endif } type_init(aarch64_cpu_register_types) From patchwork Mon Feb 21 09:27:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544417 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3105947imn; Mon, 21 Feb 2022 01:47:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdUoJDOQtniM5m8a7laQ3269Ysyihd2CM1Tuj08vG0NmS9tUlYZ1w3sqpatDHE3/p6dvfY X-Received: by 2002:ad4:5be1:0:b0:430:c99:8a87 with SMTP id k1-20020ad45be1000000b004300c998a87mr14591429qvc.82.1645436869899; Mon, 21 Feb 2022 01:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436869; cv=none; d=google.com; s=arc-20160816; b=c1AP3eNjOwjoCtrVbAKYXvx+4iDpYLbHux8aIWlpec+socAgmGu9AkhUkD9D8B4RvC QFX2rbH7p5Zq0SPqO0DZtombMqgWIl68U/0g8lQLx1lE1bvMo3h6lJtybN0WgjDq8R68 j1uvUYOpm96Rd7JNLBOTR29BhtbU01FXhS2scIy1jXG9tjv58mKo0wlE7vBjCorzI7PZ doOy4gexbwMfmFLYCZB8dD/vxaNqu2YNlmXDVJsocifmRfLpPtKO9Qt1VRhqTTwtBmAE gj/eRe7HiVV8ZdQLblOy58AQTOm6s8U94Qecmo+13es57zM7RJwR0cNUGSooTFuW0y8d irSw== 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:to:from :dkim-signature; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=zEqfPu2gISDIX6UBO3Zpzx2ez3d+QWn3+/9idaL2H/J188cu/0VNP90b3ejVj8Zi+6 S09vEtzhJ0ZpsvspklC07iJ0x++aVk5wScQdXbPGfIhJChpaMttz+EEHoF2uuEz7NqXy mwN27Amk/becHiwFj2LGv5FxHrPtjqaFdfkOJtch4LJ6Eg3dc9GFtX3Q9OMKU79YhYM6 jRfgzVCkFyC1DEnZGBJp4r0CmgzVvqcwE5UPqQkJUFMvvx6TKgjARRNPgTIRA/3KQyo9 6XmgAKy9e6t9jndBUqcW7pUaYKuJ5P+MvxXi5IbMgrLgl7XTsDpT/40G1lShM3aD2SE8 kPHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AobexD8k; 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 j21si484883qko.640.2022.02.21.01.47.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:47:49 -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=AobexD8k; 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]:36738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5IL-0000gP-9Y for patch@linaro.org; Mon, 21 Feb 2022 04:47:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zM-000819-Mm for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: from [2a00:1450:4864:20::42a] (port=36530 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zL-00010b-4j for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: by mail-wr1-x42a.google.com with SMTP id o24so25918831wro.3 for ; Mon, 21 Feb 2022 01:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=AobexD8k7xbR6TRSKdWQZQBOrAw+TJC6FuX3QMgKdsSAOQHO1W5+MnQ+aOIV3XPXTP aeYrNkEvXQOrHXi9kJqPR/ZL3CV+9DbguFWvTLbkg+mPK8hA8Kua6YaCbWijEf1AqNN8 2Ke/eMgomD9nTUOp+LUTBPanRWCPeHibgwz4VqVFYMe/PGfdrGMB8hiTQTE2UXE9R0qv pdIJ+cS3GuN0aC+AIByekfpZe/EWNmR+dc6MmL5tM7TFWTKwSt9qtLsIJ/60Oa3tFzWe F9n1xgvfZAIrkqdFu77jXWNcCqr5nFYpAKt2peW2iJWaBR39tBrZ0ORwxg0XwgHqerCJ z+yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=Szeyupvx+bun9dJeqa0zJHxQ2YPJYEb33P8JZbPCoSjYlpzdyWsJ0/oMcB3FhT2Mn6 Pg1qL5uzVgLrOpCar8uBr8WEJPJJW6BxsaJVcilNOogYZ6T5QT8LDWL4IlVdc8NTtb4j ca1QQI7VVt5zhdtIDgNNvCifQYshx5NXtBkrfFSz+DlWxNYWmclyUQaJwlrUJV4KBsb4 qw6/00xRV/a5xO3eiNNTClNqumXw1Z7qQJfo5JlRERG6VrGoOqijZhLWnCoYfBH0IkPw m9Op8EnIkFp/aFy4Sr3vZx0SihSMIgy/C4DcachWMdVA36FRKBVQzIWG/QjtsAj29V6I AX/A== X-Gm-Message-State: AOAM533XdTb70y2qEPYrcHYqE7WsTZuM9dpOj8GWgHdiGS3tddlPKXmb CR1mNJfRDAPRppCSn5WoRa+ijdIgoY2ycQ== X-Received: by 2002:a05:6000:12:b0:1dd:f5db:6c0c with SMTP id h18-20020a056000001200b001ddf5db6c0cmr15487429wrx.256.1645435689830; Mon, 21 Feb 2022 01:28:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/26] target/arm: Make KVM -cpu max exactly like -cpu host Date: Mon, 21 Feb 2022 09:27:43 +0000 Message-Id: <20220221092800.404870-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Currently for KVM the intention is that '-cpu max' and '-cpu host' are the same thing, but because we did this with two separate pieces of code they have got a little bit out of sync. Specifically, 'max' has a 'sve-max-vq' property, and 'host' does not. Bring the two together by having the initfn for 'max' actually call the initfn for 'host'. This will result in 'max' no longer exposing the 'sve-max-vq' property when using KVM. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-4-peter.maydell@linaro.org --- target/arm/cpu64.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 590ac562714..ae2e431247f 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -682,22 +682,22 @@ void aarch64_add_pauth_properties(Object *obj) } } -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) static void aarch64_host_initfn(Object *obj) { +#if defined(CONFIG_KVM) ARMCPU *cpu = ARM_CPU(obj); - -#ifdef CONFIG_KVM kvm_arm_set_cpu_features_from_host(cpu); if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { aarch64_add_sve_properties(obj); aarch64_add_pauth_properties(obj); } -#else +#elif defined(CONFIG_HVF) + ARMCPU *cpu = ARM_CPU(obj); hvf_arm_set_cpu_features_from_host(cpu); +#else + g_assert_not_reached(); #endif } -#endif /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. @@ -709,7 +709,9 @@ static void aarch64_max_initfn(Object *obj) ARMCPU *cpu = ARM_CPU(obj); if (kvm_enabled()) { - kvm_arm_set_cpu_features_from_host(cpu); + /* With KVM, '-cpu max' is identical to '-cpu host' */ + aarch64_host_initfn(obj); + return; } else { uint64_t t; uint32_t u; From patchwork Mon Feb 21 09:27:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544421 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3108130imn; Mon, 21 Feb 2022 01:52:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxq8JPA0WcMHZoEJW2jPrIOeMExlxITeHE2RZsC0OTXhnX880Lnd7znAkJbs/pHV2SFVb6n X-Received: by 2002:a0c:80c5:0:b0:42c:3efa:2ed with SMTP id 63-20020a0c80c5000000b0042c3efa02edmr14701325qvb.106.1645437127774; Mon, 21 Feb 2022 01:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437127; cv=none; d=google.com; s=arc-20160816; b=vv2dLVyej4QXUqQZMV5d5M1Ig4nQfgvhfY2WZpaBKbfpVmszOA7AUzK6qevwhCOWTR cDx144T25X4ewhX7Uvs8hpYjp0LFtcZ8xFgbp7xvpCnHCLcWisHPPINOfmLQGEAGuYNF rr24FyzaPPlunMnTj6j4u40HhNtfRRHBuosqQpjKudoNk65q3WX3+Njc6w1O37adnZqC Vj7UOsqYMAzYA5IicVhvu2OrsdcK/+Qo4/p7fyBviaSAID2uBdlf57ZVGgK6dVh3jwHi /LTkjHg4O64Djc1sXoiqJ6I1QoMdBRrSRwiWWm20ufBUOCcnle0GO+VGjKaWlRWHLUAg mxUA== 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:to:from :dkim-signature; bh=Xfcy31MSFDcBP73xxb5IfXxX1Gf18FiCDI/7Lu5FhBI=; b=ouuCc2TEy3HA7FOZfISdWqqRp5cfG7wfSCOCazmwKANATKwmXUEEyX0N1gDcuFgSXQ LFm6mZFZDejF1JlLsdWp569pCRkFo0KljRn5u0BVHT+Xg+19sh2A6yfZeLFvi6ou9qWE oLlIPkoZ06+ukW3wNuEaQLwLT1GGUiMnOlXcdzIj/59rP7AqMhHQ1wbnCrghi1eJe7R7 Rglpptj31pEZOKLKiR3VIkOsJU81TA7WQjtB6BoracIbVwN//pQMETVSeIldDqOZ1ZR6 kMMLeNR+sbQr7ehRkJIySnwS+ZdtwhbwOItcTOR03uxyLrgNipDg1Dfy6wCtMyN5Smqi Bmwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fcdzAo0r; 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 p6si7295383qkp.570.2022.02.21.01.52.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:52:07 -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=fcdzAo0r; 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]:45440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5MV-0006dk-BI for patch@linaro.org; Mon, 21 Feb 2022 04:52:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zO-00086I-SC for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:14 -0500 Received: from [2a00:1450:4864:20::42d] (port=35596 helo=mail-wr1-x42d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zM-00010r-6V for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:14 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v12so25925939wrv.2 for ; Mon, 21 Feb 2022 01:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Xfcy31MSFDcBP73xxb5IfXxX1Gf18FiCDI/7Lu5FhBI=; b=fcdzAo0rpXDanUC4juAr749SZrU8Ngo0l596WJN5G5qWY7oICuU1BLxg5JYC0m3KXu CfG+1AcEGG0MfMdc2d5X55kLjKvH4aTaLengjJv0CvLodG0m0GZztoX4CzfmRyVmrrPZ Qf4sS998+ueSLkWDDtyc6hy+zh1B29tlBnrc2Bbanyb8RY5CtXOjJMWrKwwLF7bhhyhh Sgk7sshIWF5V6GFM2xIyBAvhEBp364xdIR2lBZ0V6BKBrkwRkcA6MilGCR83ke30+hq1 6kWVwbCVeJ7vzd6gKlEdgfRt2H/iVXJcgETNS1kNk/OuG/acBww39YTqEwZJuWg1myn/ PaXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xfcy31MSFDcBP73xxb5IfXxX1Gf18FiCDI/7Lu5FhBI=; b=5QELaxNc3o4ColrgNZzlNYKrJUYPAI0HdkbLIbEeohaB4yMView1MkqCIoAJUgrUWf xVGCamCm7f1Omq6MSKIeBE1tgoRzwVqpmvVh3SNtH1DNB12uEoqZ9odsosW2xm8x+h7g F6d+M5BW1rYDmt0XBkTvldP2oGEGZPQW3s8s86fhpz5yIA8IS8UGUc4iLfz/Tz3T+CXI HY5Tg4tmuS1cItQDAVM6qhoFNepkZcoi0fZjvvYOXLqWVqcIYMtbB2XZ9Fp4/jptH/T4 DySXmtrRfY+8Ld0zIT18TeMBK6a42+9cT93Yf6abqCk8eRypnzD9Y29TWrw0SRnFG5yt UHWA== X-Gm-Message-State: AOAM530MZh4N04CuRUpSMLLVZlTDC8ytKzIjpVchBlupBzZALa69jvU0 u9I8R4Bzr9BLMpsM0jHIS9vehZ77CXRbTA== X-Received: by 2002:adf:f68d:0:b0:1e1:db49:a721 with SMTP id v13-20020adff68d000000b001e1db49a721mr15101300wrp.297.1645435690841; Mon, 21 Feb 2022 01:28:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/26] target/arm: Unindent unnecessary else-clause Date: Mon, 21 Feb 2022 09:27:44 +0000 Message-Id: <20220221092800.404870-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Now that the if() branch of the condition in aarch64_max_initfn() returns early, we don't need to keep the rest of the code in the function inside an else block. Remove the else, unindenting that code. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-5-peter.maydell@linaro.org --- target/arm/cpu64.c | 289 +++++++++++++++++++++++---------------------- 1 file changed, 146 insertions(+), 143 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index ae2e431247f..2280e476fd7 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -707,176 +707,179 @@ static void aarch64_host_initfn(Object *obj) static void aarch64_max_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); + uint64_t t; + uint32_t u; if (kvm_enabled()) { /* With KVM, '-cpu max' is identical to '-cpu host' */ aarch64_host_initfn(obj); return; - } else { - uint64_t t; - uint32_t u; - aarch64_a57_initfn(obj); + } - /* - * Reset MIDR so the guest doesn't mistake our 'max' CPU type for a real - * one and try to apply errata workarounds or use impdef features we - * don't provide. - * An IMPLEMENTER field of 0 means "reserved for software use"; - * ARCHITECTURE must be 0xf indicating "v7 or later, check ID registers - * to see which features are present"; - * the VARIANT, PARTNUM and REVISION fields are all implementation - * defined and we choose to define PARTNUM just in case guest - * code needs to distinguish this QEMU CPU from other software - * implementations, though this shouldn't be needed. - */ - t = FIELD_DP64(0, MIDR_EL1, IMPLEMENTER, 0); - t = FIELD_DP64(t, MIDR_EL1, ARCHITECTURE, 0xf); - t = FIELD_DP64(t, MIDR_EL1, PARTNUM, 'Q'); - t = FIELD_DP64(t, MIDR_EL1, VARIANT, 0); - t = FIELD_DP64(t, MIDR_EL1, REVISION, 0); - cpu->midr = t; + /* '-cpu max' for TCG: we currently do this as "A57 with extra things" */ - t = cpu->isar.id_aa64isar0; - t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* AES + PMULL */ - t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 2); /* SHA512 */ - t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, ATOMIC, 2); - t = FIELD_DP64(t, ID_AA64ISAR0, RDM, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, SHA3, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, SM3, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, SM4, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, DP, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 1); - t = FIELD_DP64(t, ID_AA64ISAR0, TS, 2); /* v8.5-CondM */ - t = FIELD_DP64(t, ID_AA64ISAR0, TLB, 2); /* FEAT_TLBIRANGE */ - t = FIELD_DP64(t, ID_AA64ISAR0, RNDR, 1); - cpu->isar.id_aa64isar0 = t; + aarch64_a57_initfn(obj); - t = cpu->isar.id_aa64isar1; - t = FIELD_DP64(t, ID_AA64ISAR1, DPB, 2); - t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, SB, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, SPECRES, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 1); - t = FIELD_DP64(t, ID_AA64ISAR1, LRCPC, 2); /* ARMv8.4-RCPC */ - t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 1); - cpu->isar.id_aa64isar1 = t; + /* + * Reset MIDR so the guest doesn't mistake our 'max' CPU type for a real + * one and try to apply errata workarounds or use impdef features we + * don't provide. + * An IMPLEMENTER field of 0 means "reserved for software use"; + * ARCHITECTURE must be 0xf indicating "v7 or later, check ID registers + * to see which features are present"; + * the VARIANT, PARTNUM and REVISION fields are all implementation + * defined and we choose to define PARTNUM just in case guest + * code needs to distinguish this QEMU CPU from other software + * implementations, though this shouldn't be needed. + */ + t = FIELD_DP64(0, MIDR_EL1, IMPLEMENTER, 0); + t = FIELD_DP64(t, MIDR_EL1, ARCHITECTURE, 0xf); + t = FIELD_DP64(t, MIDR_EL1, PARTNUM, 'Q'); + t = FIELD_DP64(t, MIDR_EL1, VARIANT, 0); + t = FIELD_DP64(t, MIDR_EL1, REVISION, 0); + cpu->midr = t; - t = cpu->isar.id_aa64pfr0; - t = FIELD_DP64(t, ID_AA64PFR0, SVE, 1); - t = FIELD_DP64(t, ID_AA64PFR0, FP, 1); - t = FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 1); - t = FIELD_DP64(t, ID_AA64PFR0, SEL2, 1); - t = FIELD_DP64(t, ID_AA64PFR0, DIT, 1); - cpu->isar.id_aa64pfr0 = t; + t = cpu->isar.id_aa64isar0; + t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* AES + PMULL */ + t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 2); /* SHA512 */ + t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, ATOMIC, 2); + t = FIELD_DP64(t, ID_AA64ISAR0, RDM, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, SHA3, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, SM3, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, SM4, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, DP, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, TS, 2); /* v8.5-CondM */ + t = FIELD_DP64(t, ID_AA64ISAR0, TLB, 2); /* FEAT_TLBIRANGE */ + t = FIELD_DP64(t, ID_AA64ISAR0, RNDR, 1); + cpu->isar.id_aa64isar0 = t; - t = cpu->isar.id_aa64pfr1; - t = FIELD_DP64(t, ID_AA64PFR1, BT, 1); - t = FIELD_DP64(t, ID_AA64PFR1, SSBS, 2); - /* - * Begin with full support for MTE. This will be downgraded to MTE=0 - * during realize if the board provides no tag memory, much like - * we do for EL2 with the virtualization=on property. - */ - t = FIELD_DP64(t, ID_AA64PFR1, MTE, 3); - cpu->isar.id_aa64pfr1 = t; + t = cpu->isar.id_aa64isar1; + t = FIELD_DP64(t, ID_AA64ISAR1, DPB, 2); + t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, SB, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, SPECRES, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 1); + t = FIELD_DP64(t, ID_AA64ISAR1, LRCPC, 2); /* ARMv8.4-RCPC */ + t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 1); + cpu->isar.id_aa64isar1 = t; - t = cpu->isar.id_aa64mmfr0; - t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 5); /* PARange: 48 bits */ - cpu->isar.id_aa64mmfr0 = t; + t = cpu->isar.id_aa64pfr0; + t = FIELD_DP64(t, ID_AA64PFR0, SVE, 1); + t = FIELD_DP64(t, ID_AA64PFR0, FP, 1); + t = FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 1); + t = FIELD_DP64(t, ID_AA64PFR0, SEL2, 1); + t = FIELD_DP64(t, ID_AA64PFR0, DIT, 1); + cpu->isar.id_aa64pfr0 = t; - t = cpu->isar.id_aa64mmfr1; - t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ - t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1); - t = FIELD_DP64(t, ID_AA64MMFR1, VH, 1); - t = FIELD_DP64(t, ID_AA64MMFR1, PAN, 2); /* ATS1E1 */ - t = FIELD_DP64(t, ID_AA64MMFR1, VMIDBITS, 2); /* VMID16 */ - t = FIELD_DP64(t, ID_AA64MMFR1, XNX, 1); /* TTS2UXN */ - cpu->isar.id_aa64mmfr1 = t; + t = cpu->isar.id_aa64pfr1; + t = FIELD_DP64(t, ID_AA64PFR1, BT, 1); + t = FIELD_DP64(t, ID_AA64PFR1, SSBS, 2); + /* + * Begin with full support for MTE. This will be downgraded to MTE=0 + * during realize if the board provides no tag memory, much like + * we do for EL2 with the virtualization=on property. + */ + t = FIELD_DP64(t, ID_AA64PFR1, MTE, 3); + cpu->isar.id_aa64pfr1 = t; - t = cpu->isar.id_aa64mmfr2; - t = FIELD_DP64(t, ID_AA64MMFR2, UAO, 1); - t = FIELD_DP64(t, ID_AA64MMFR2, CNP, 1); /* TTCNP */ - t = FIELD_DP64(t, ID_AA64MMFR2, ST, 1); /* TTST */ - cpu->isar.id_aa64mmfr2 = t; + t = cpu->isar.id_aa64mmfr0; + t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 5); /* PARange: 48 bits */ + cpu->isar.id_aa64mmfr0 = t; - t = cpu->isar.id_aa64zfr0; - t = FIELD_DP64(t, ID_AA64ZFR0, SVEVER, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, AES, 2); /* PMULL */ - t = FIELD_DP64(t, ID_AA64ZFR0, BITPERM, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, BFLOAT16, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, SHA3, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, SM4, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, I8MM, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, F32MM, 1); - t = FIELD_DP64(t, ID_AA64ZFR0, F64MM, 1); - cpu->isar.id_aa64zfr0 = t; + t = cpu->isar.id_aa64mmfr1; + t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ + t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1); + t = FIELD_DP64(t, ID_AA64MMFR1, VH, 1); + t = FIELD_DP64(t, ID_AA64MMFR1, PAN, 2); /* ATS1E1 */ + t = FIELD_DP64(t, ID_AA64MMFR1, VMIDBITS, 2); /* VMID16 */ + t = FIELD_DP64(t, ID_AA64MMFR1, XNX, 1); /* TTS2UXN */ + cpu->isar.id_aa64mmfr1 = t; - /* Replicate the same data to the 32-bit id registers. */ - u = cpu->isar.id_isar5; - u = FIELD_DP32(u, ID_ISAR5, AES, 2); /* AES + PMULL */ - u = FIELD_DP32(u, ID_ISAR5, SHA1, 1); - u = FIELD_DP32(u, ID_ISAR5, SHA2, 1); - u = FIELD_DP32(u, ID_ISAR5, CRC32, 1); - u = FIELD_DP32(u, ID_ISAR5, RDM, 1); - u = FIELD_DP32(u, ID_ISAR5, VCMA, 1); - cpu->isar.id_isar5 = u; + t = cpu->isar.id_aa64mmfr2; + t = FIELD_DP64(t, ID_AA64MMFR2, UAO, 1); + t = FIELD_DP64(t, ID_AA64MMFR2, CNP, 1); /* TTCNP */ + t = FIELD_DP64(t, ID_AA64MMFR2, ST, 1); /* TTST */ + cpu->isar.id_aa64mmfr2 = t; - u = cpu->isar.id_isar6; - u = FIELD_DP32(u, ID_ISAR6, JSCVT, 1); - u = FIELD_DP32(u, ID_ISAR6, DP, 1); - u = FIELD_DP32(u, ID_ISAR6, FHM, 1); - u = FIELD_DP32(u, ID_ISAR6, SB, 1); - u = FIELD_DP32(u, ID_ISAR6, SPECRES, 1); - u = FIELD_DP32(u, ID_ISAR6, BF16, 1); - u = FIELD_DP32(u, ID_ISAR6, I8MM, 1); - cpu->isar.id_isar6 = u; + t = cpu->isar.id_aa64zfr0; + t = FIELD_DP64(t, ID_AA64ZFR0, SVEVER, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, AES, 2); /* PMULL */ + t = FIELD_DP64(t, ID_AA64ZFR0, BITPERM, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, BFLOAT16, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, SHA3, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, SM4, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, I8MM, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, F32MM, 1); + t = FIELD_DP64(t, ID_AA64ZFR0, F64MM, 1); + cpu->isar.id_aa64zfr0 = t; - u = cpu->isar.id_pfr0; - u = FIELD_DP32(u, ID_PFR0, DIT, 1); - cpu->isar.id_pfr0 = u; + /* Replicate the same data to the 32-bit id registers. */ + u = cpu->isar.id_isar5; + u = FIELD_DP32(u, ID_ISAR5, AES, 2); /* AES + PMULL */ + u = FIELD_DP32(u, ID_ISAR5, SHA1, 1); + u = FIELD_DP32(u, ID_ISAR5, SHA2, 1); + u = FIELD_DP32(u, ID_ISAR5, CRC32, 1); + u = FIELD_DP32(u, ID_ISAR5, RDM, 1); + u = FIELD_DP32(u, ID_ISAR5, VCMA, 1); + cpu->isar.id_isar5 = u; - u = cpu->isar.id_pfr2; - u = FIELD_DP32(u, ID_PFR2, SSBS, 1); - cpu->isar.id_pfr2 = u; + u = cpu->isar.id_isar6; + u = FIELD_DP32(u, ID_ISAR6, JSCVT, 1); + u = FIELD_DP32(u, ID_ISAR6, DP, 1); + u = FIELD_DP32(u, ID_ISAR6, FHM, 1); + u = FIELD_DP32(u, ID_ISAR6, SB, 1); + u = FIELD_DP32(u, ID_ISAR6, SPECRES, 1); + u = FIELD_DP32(u, ID_ISAR6, BF16, 1); + u = FIELD_DP32(u, ID_ISAR6, I8MM, 1); + cpu->isar.id_isar6 = u; - u = cpu->isar.id_mmfr3; - u = FIELD_DP32(u, ID_MMFR3, PAN, 2); /* ATS1E1 */ - cpu->isar.id_mmfr3 = u; + u = cpu->isar.id_pfr0; + u = FIELD_DP32(u, ID_PFR0, DIT, 1); + cpu->isar.id_pfr0 = u; - u = cpu->isar.id_mmfr4; - u = FIELD_DP32(u, ID_MMFR4, HPDS, 1); /* AA32HPD */ - u = FIELD_DP32(u, ID_MMFR4, AC2, 1); /* ACTLR2, HACTLR2 */ - u = FIELD_DP32(u, ID_MMFR4, CNP, 1); /* TTCNP */ - u = FIELD_DP32(u, ID_MMFR4, XNX, 1); /* TTS2UXN */ - cpu->isar.id_mmfr4 = u; + u = cpu->isar.id_pfr2; + u = FIELD_DP32(u, ID_PFR2, SSBS, 1); + cpu->isar.id_pfr2 = u; - t = cpu->isar.id_aa64dfr0; - t = FIELD_DP64(t, ID_AA64DFR0, PMUVER, 5); /* v8.4-PMU */ - cpu->isar.id_aa64dfr0 = t; + u = cpu->isar.id_mmfr3; + u = FIELD_DP32(u, ID_MMFR3, PAN, 2); /* ATS1E1 */ + cpu->isar.id_mmfr3 = u; - u = cpu->isar.id_dfr0; - u = FIELD_DP32(u, ID_DFR0, PERFMON, 5); /* v8.4-PMU */ - cpu->isar.id_dfr0 = u; + u = cpu->isar.id_mmfr4; + u = FIELD_DP32(u, ID_MMFR4, HPDS, 1); /* AA32HPD */ + u = FIELD_DP32(u, ID_MMFR4, AC2, 1); /* ACTLR2, HACTLR2 */ + u = FIELD_DP32(u, ID_MMFR4, CNP, 1); /* TTCNP */ + u = FIELD_DP32(u, ID_MMFR4, XNX, 1); /* TTS2UXN */ + cpu->isar.id_mmfr4 = u; - u = cpu->isar.mvfr1; - u = FIELD_DP32(u, MVFR1, FPHP, 3); /* v8.2-FP16 */ - u = FIELD_DP32(u, MVFR1, SIMDHP, 2); /* v8.2-FP16 */ - cpu->isar.mvfr1 = u; + t = cpu->isar.id_aa64dfr0; + t = FIELD_DP64(t, ID_AA64DFR0, PMUVER, 5); /* v8.4-PMU */ + cpu->isar.id_aa64dfr0 = t; + + u = cpu->isar.id_dfr0; + u = FIELD_DP32(u, ID_DFR0, PERFMON, 5); /* v8.4-PMU */ + cpu->isar.id_dfr0 = u; + + u = cpu->isar.mvfr1; + u = FIELD_DP32(u, MVFR1, FPHP, 3); /* v8.2-FP16 */ + u = FIELD_DP32(u, MVFR1, SIMDHP, 2); /* v8.2-FP16 */ + cpu->isar.mvfr1 = u; #ifdef CONFIG_USER_ONLY - /* For usermode -cpu max we can use a larger and more efficient DCZ - * blocksize since we don't have to follow what the hardware does. - */ - cpu->ctr = 0x80038003; /* 32 byte I and D cacheline size, VIPT icache */ - cpu->dcz_blocksize = 7; /* 512 bytes */ + /* + * For usermode -cpu max we can use a larger and more efficient DCZ + * blocksize since we don't have to follow what the hardware does. + */ + cpu->ctr = 0x80038003; /* 32 byte I and D cacheline size, VIPT icache */ + cpu->dcz_blocksize = 7; /* 512 bytes */ #endif - bitmap_fill(cpu->sve_vq_supported, ARM_MAX_VQ); - } + bitmap_fill(cpu->sve_vq_supported, ARM_MAX_VQ); aarch64_add_pauth_properties(obj); aarch64_add_sve_properties(obj); From patchwork Mon Feb 21 09:27:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544410 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3100672imn; Mon, 21 Feb 2022 01:37:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaqHP8dUClG+dRNxkrx7GapUR53sGzuFpu1tXiWyxEfaLoIbWJ8R1bvKJcSEPpN5j2nxnp X-Received: by 2002:a37:6c46:0:b0:60d:d526:7e48 with SMTP id h67-20020a376c46000000b0060dd5267e48mr11353658qkc.451.1645436229201; Mon, 21 Feb 2022 01:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436229; cv=none; d=google.com; s=arc-20160816; b=xOjFsZjYZlElM2YN7s9v8XIcM4BXbQtMHnXNRvXMn4dfDXjSl22LuIHZoNiaa+KM4U 5VBKpy1U630m3VzautmQY2Ba7rc1Ix6zs6jLUFwxfxWOKmFX4DkD3x426yFlS7+tUiTq hevV/sZFEFqMbIrBB5PRldXo+r1reH0EC0S8eT89or7uaX4l2OQbAME5GkVY2FVsJjTM 4oJYFRBFv4jhfGe8rEW2waMEA8zJmIbPDHfGLB5QEvpaZdmSFXfk546Geugz9Vx3lIsC nQ9Clu2mU97jrNzWq9+Oyd8VCBNZ6sfFJIMaPpiupSk2xXfdHfKtL1TPsKMUuBH6Eor/ yRYg== 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:to:from :dkim-signature; bh=u4Q+Hke1BccBlcaqJg+5JH0IMmPFZMSy7PZO5x6wtSc=; b=Cvt1G6/MtM++yVcSLvHIWuPHvj6HtoZlUTAFLd7mXTjG8SqhHJcVAYJ+fGgXlTjJi3 HmqM45QvkGLz1kzQtH5ICetMDeU+5DRtLKBzDRuweGI+zbbWbPYfYd/o2AU6chWmpnJo 9pJGfRZPA3sU7slRj4iLy0NqcUCJZEHchre8qubsmCvETdnFeD2EFQ52XUO3JVI1aXYW DUkRrWUrPob3JxTDkUnOUNzl9/H+CrbPlmpP3a9Df47ygByI/w+GTA6cDspKkx4tKpAu nXa514qBcd8vukpLYtaJgh1SE/SnlXvpQVHVcBagzwmt7EJUeXjcn8o/5MDrNkBqfjCC SAFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NFfBpe6C; 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 n17si15315125qtk.126.2022.02.21.01.37.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:37:09 -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=NFfBpe6C; 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]:47686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM580-0005V7-NH for patch@linaro.org; Mon, 21 Feb 2022 04:37:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zO-00085H-Aj for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:14 -0500 Received: from [2a00:1450:4864:20::433] (port=43540 helo=mail-wr1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zM-000112-S9 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:14 -0500 Received: by mail-wr1-x433.google.com with SMTP id i14so25874413wrc.10 for ; Mon, 21 Feb 2022 01:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=u4Q+Hke1BccBlcaqJg+5JH0IMmPFZMSy7PZO5x6wtSc=; b=NFfBpe6CFa1e6lvwaau30cagWbybPB72TYcBmgAyLJYb5ZYHC5wzghws3aKRp+4HDU AmaHQTrOUjy/ZojGbaYc8JtgMDaPkyvwihK70OQPYeDZPeP2pMeCl9NRUeMaTq1CfU9C msNNUMJsU8PSMRiM6kxsKzNNd15oUXirQ1XoYbcf4UJaOpcy8pbhGv4Ik6iLV2psYuLc 7Fv+xm+4DnR/0zbDDvXDDlda3qRMfLoNatAuQwXIPEqfKVWQlaP3p3FA6zvbznal0mY/ Yg8uZ19BZ/jG98T0QWYiB3EtYF4YorruT8Fw9pGPy/WPJlKzUDOWWQbnDXjJzNeULF4N Wo6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u4Q+Hke1BccBlcaqJg+5JH0IMmPFZMSy7PZO5x6wtSc=; b=MKedZOoE14WRLfj2tifKnOK1p5dawgNJ+pbzma6QBALIQlPf3rc98+CjZ6xJXxZ/He INlxk81tejMnfoN4wapkBlEYak/vdQw2KBk8QkZxv+Ojk51UsC7c92SGckGPjzl3/um3 PS18jPBYiR092OIfqwJoxBj/UZy/RZ5bOtGsSHHhiXQReFoAo34vsZqn/uMsZd5wTmU1 hWZyv4U4OTn4b8WlrI1NvH4nMmzR7Fv94lxsGItN+yQoP1e93L/77H7MukLXK96g4Fmf jKG4z/54fg7etx1bzJWqSuN9HQpiTBjEM0f/7PbnN71fSWiuaAbeJ23N/F0+ww4vX/bU 8+FQ== X-Gm-Message-State: AOAM5319gFa0R96ifGb3Lk2Xk5o2Gc0uFK5DDqfNTa887HcjAS6qSTU9 Q8DMODutugIo/IWp73PEKMHdNUTnTFwjIQ== X-Received: by 2002:adf:f5c3:0:b0:1e3:3f71:7974 with SMTP id k3-20020adff5c3000000b001e33f717974mr14705649wrp.587.1645435691555; Mon, 21 Feb 2022 01:28:11 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:11 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/26] target/arm: Fix '-cpu max' for HVF Date: Mon, 21 Feb 2022 09:27:45 +0000 Message-Id: <20220221092800.404870-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::433 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Currently when using hvf we mishandle '-cpu max': we fall through to the TCG version of its initfn, which then sets a lot of feature bits that the real host CPU doesn't have. The hvf accelerator code then exposes these bogus ID register values to the guest because it doesn't check that the host really has the features. Make '-cpu host' be like '-cpu max' for hvf, as we do with kvm. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-6-peter.maydell@linaro.org --- target/arm/cpu64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 2280e476fd7..19330d9ee94 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -29,6 +29,7 @@ #include "hw/loader.h" #endif #include "sysemu/kvm.h" +#include "sysemu/hvf.h" #include "kvm_arm.h" #include "hvf_arm.h" #include "qapi/visitor.h" @@ -710,8 +711,8 @@ static void aarch64_max_initfn(Object *obj) uint64_t t; uint32_t u; - if (kvm_enabled()) { - /* With KVM, '-cpu max' is identical to '-cpu host' */ + if (kvm_enabled() || hvf_enabled()) { + /* With KVM or HVF, '-cpu max' is identical to '-cpu host' */ aarch64_host_initfn(obj); return; } From patchwork Mon Feb 21 09:27:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544423 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3109350imn; Mon, 21 Feb 2022 01:54:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJy52io+jzIVoR56poQ+YtyF14pAZcuo7cDqGEabW7lFdoGZxpM3lYTQcgaqwDsv57ZMHW7h X-Received: by 2002:a37:9e86:0:b0:507:42b:7540 with SMTP id h128-20020a379e86000000b00507042b7540mr11411036qke.159.1645437271894; Mon, 21 Feb 2022 01:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437271; cv=none; d=google.com; s=arc-20160816; b=rczuWTbp6yGFww8uuQDpWcKbR5B6LZSb6oRqWJCg24fqrwivoquDX6Y4v/IXwFFcw2 LAbqiiOqwglFA0UojE1Q8rsiqvWgE3gsH6phQKRtdCgE5k1xRgAWE3F4PFzrjLVseE2C SRpTjW/D+WOdU5TklxmrXHd4s1YfMuvrXEd7dzGOEBEd4vVkhfs2YjzMRgURJYLY0KOQ 7x5STwTgQbV1bRcbAYz9bQazVb1/YA04aWH8D5W5ZFHaoUVT3DQBSQ2BBeIagddQqaXU 3YZ+JLbinHURIVKEH/YRNbBEf3ZOsvfGUQ+Pba7r+4ectVBEKqt9NqigW82WsJDJdx8K 2clg== 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:to:from :dkim-signature; bh=9uNHsCSBiyyY7VqKj99MP2CiA4TXNDtewjy7bEKnAE0=; b=hLp2rte6pWEEd+GR5LFwBUMTWB2La6xSZDg0MH8jABcHzHDwDWO0cKAqx6yTaw8zX6 46H1isiOZ7G0yRsPn4nG4EUzzyCxgXld0zTw5+gXQDhIhRDmp1xgPHx0nl5f9Zzw6yWP utsRL+eeaIAaKomY6R13NJaNX8pPVF1lln98WhbndMKL1CLrJ/dbP8x6wkhJIcUKcdvu H2f3/RdjhsU8Maf8nsIDmRExJtmB51HDrOzvPtRDvcecX3P5FAcYTgUCf2XCna0IY2ny YLqZQ5ytdUWnSE3yvss8I2j8ShXOWmWyG7FghBUwR7rCu8awDMElPdEqGjgz3+66zYjj 2qVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0OJWEP3; 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 d197si4971024qke.79.2022.02.21.01.54.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:54:31 -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=x0OJWEP3; 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]:54420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Op-000453-D4 for patch@linaro.org; Mon, 21 Feb 2022 04:54:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zP-000873-Ca for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:15 -0500 Received: from [2a00:1450:4864:20::333] (port=36703 helo=mail-wm1-x333.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zN-00011P-HM for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:15 -0500 Received: by mail-wm1-x333.google.com with SMTP id q198-20020a1ca7cf000000b0037bb52545c6so13077646wme.1 for ; Mon, 21 Feb 2022 01:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9uNHsCSBiyyY7VqKj99MP2CiA4TXNDtewjy7bEKnAE0=; b=x0OJWEP3PkkrmlmxIUYxo5YyvttK7BhvSIroXT6VB//6VZUGmv8C0QNSnE9rkJf/6a C7sAv/dt59kDQKN6dngDnEeLt116CcpFnd2H1rzwr4H77WDG9ZxVyS2roSGsNkzau5Pt y8g2g826sgngxOB2u5eMN2cBYKWd0lDvPv6gmwyq+2XofQ0Fui6XQLXSQQjjUxnbmgrS itzfNLk7xkbCqF/l3kagwEwAsp2L1k/IAhv5NfwVSVIg7YxxEhLHHdWgEiJvzU314aN0 4nd0u5PZLfhauNJwSqebIcEXXYLoCUxSscCArXpeHuVqkcVFHRr+ycPOP78Xmf8oIoWK hHCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9uNHsCSBiyyY7VqKj99MP2CiA4TXNDtewjy7bEKnAE0=; b=IPYkDLgd8QkkzH1lfefP8Yv4rQBJbtL2WOx2dGWMfydmA+J6uPARt6Qg7BVegu+Z8K V4HylHE4hNSorADW4wDn8gwZuOrza7sV/FrLHu6f8bJjKEOXyq6JiDX+RNccM/C1JcTi Y208Amw70dyJU1MABhbA2GZozULmGAsUoYrcNtU+8EHwHJDLwqxdYRYHU7EF/ZZPLA5W vF7a7FPkGS/FPUo1Jdr+7fsAan+UzCQtPlEdmFBUME5b9ehoUkgSToiDVLZ8HrPyxnKE HyEySJosZ+7IUm+hP4C7u5Acdhb3Hfx1Lr6qffQWz58662mA+1Xd9CMLHeujH+x5Tw+Q TM0w== X-Gm-Message-State: AOAM531+/n4lzJbpnEMV94/exUNFCVLd/l/oSUNabpAUSb4XmrdBGz9y 4aZX0OiQUFCp7goPIpNGmM7ULFRNMayOLg== X-Received: by 2002:a05:600c:1f14:b0:37b:c475:2de0 with SMTP id bd20-20020a05600c1f1400b0037bc4752de0mr17233629wmb.70.1645435692332; Mon, 21 Feb 2022 01:28:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:11 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/26] target/arm: Support PAuth extension for hvf Date: Mon, 21 Feb 2022 09:27:46 +0000 Message-Id: <20220221092800.404870-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::333 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Currently we don't allow guests under hvf to use the PAuth extension, because we didn't have any special code to handle that, and therefore in arm_cpu_pauth_finalize() we will sanitize the ID_AA64ISAR1 value the guest sees to clear the PAuth related fields. Add support for this in the same way that KVM does it, by defaulting to "PAuth enabled" if the host CPU has it and allowing the user to disable it via '-cpu pauth=no' on the command line. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-7-peter.maydell@linaro.org --- target/arm/cpu64.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 19330d9ee94..1171ab16b94 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -633,9 +633,10 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) uint64_t t; /* Exit early if PAuth is enabled, and fall through to disable it */ - if (kvm_enabled() && cpu->prop_pauth) { + if ((kvm_enabled() || hvf_enabled()) && cpu->prop_pauth) { if (!cpu_isar_feature(aa64_pauth, cpu)) { - error_setg(errp, "'pauth' feature not supported by KVM on this host"); + error_setg(errp, "'pauth' feature not supported by %s on this host", + kvm_enabled() ? "KVM" : "hvf"); } return; @@ -672,10 +673,14 @@ void aarch64_add_pauth_properties(Object *obj) /* Default to PAUTH on, with the architected algorithm on TCG. */ qdev_property_add_static(DEVICE(obj), &arm_cpu_pauth_property); - if (kvm_enabled()) { + if (kvm_enabled() || hvf_enabled()) { /* * Mirror PAuth support from the probed sysregs back into the - * property for KVM. Is it just a bit backward? Yes it is! + * property for KVM or hvf. Is it just a bit backward? Yes it is! + * Note that prop_pauth is true whether the host CPU supports the + * architected QARMA5 algorithm or the IMPDEF one. We don't + * provide the separate pauth-impdef property for KVM or hvf, + * only for TCG. */ cpu->prop_pauth = cpu_isar_feature(aa64_pauth, cpu); } else { @@ -695,6 +700,7 @@ static void aarch64_host_initfn(Object *obj) #elif defined(CONFIG_HVF) ARMCPU *cpu = ARM_CPU(obj); hvf_arm_set_cpu_features_from_host(cpu); + aarch64_add_pauth_properties(obj); #else g_assert_not_reached(); #endif From patchwork Mon Feb 21 09:27:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544414 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3103250imn; Mon, 21 Feb 2022 01:42:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIn7nsWzzC+qVqnLsRr4tEb6thh5IV7vQcH8msuedXjGJkvV1EC1ThUMp7sY5dfBdL/lAB X-Received: by 2002:a37:4142:0:b0:507:4a3a:f98f with SMTP id o63-20020a374142000000b005074a3af98fmr11237797qka.730.1645436537924; Mon, 21 Feb 2022 01:42:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436537; cv=none; d=google.com; s=arc-20160816; b=ZqelmLzR9AxZWRc/RCdf0LGrGpA+jngtBbQ9BgkVMYk8t+69EQAmu8b0BbIZMrQ+FE z5Nfql5YyHzaxZRWZa9Ez96E4G5FQivVEVrv9sqJS4SF58gCI9zbTRGA4NmXtNN92/mc bpSRXTzhcT3+G5LWiPc/4693QJnMeMG1/x1/mmSuQuHegjOX/4TKHhPOWULNuK1oxF3R yGZ5aAjDJ6DDQnCXhrwJ4F0dotE4uiUw/9bjdz9/g7rBn55eYQeaOsTYazqJh00PLuBz ki0+gm24YDwzqxn9Pp8P39mtuD+v0RMvYdgf+ceudKrAv0HUfIcf7XIjH/WFomKGnwvQ /Q2g== 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:to:from :dkim-signature; bh=Jo4pFV4ykYDrN4qI9p9hUopFbfxsOOFztCVH63tiFRs=; b=j3qa/fd80fHxzNeH/H69SMvN7sDG4C6HETlm2dbDhxqhkL9D0vUT90RvhZ3+t58diZ s8b3m5L2LtP12APrjyOH8l6QkRyjckrhVtnsIZM+BYaoXIwn8Gk1H0hpK8lL9AMQ+ovw h+mTu5k58JRrXn/C3DepVGHYW+vCcKqi6eDHZBvvQkOdDUvc4rJ9Bf/3e8wqu0VoQxbu RyN/RUHuKI9KW7egzJ6YYgfJi8u9a/wGc/QM/eNsQwCrcm1MkWZLI0blZ9VmSJkXBfS2 95yIpD8c4LFrUP/00CjB0ovpLxtOpmBzIo11Z5aDatobRmY5oJ6WeE9vmQH8qDqbiZoT NypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rmuNkrdV; 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 i9si13618127qkg.623.2022.02.21.01.42.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:42:17 -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=rmuNkrdV; 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]:56234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Cz-0002vA-Ex for patch@linaro.org; Mon, 21 Feb 2022 04:42:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zQ-000892-DM for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:16 -0500 Received: from [2a00:1450:4864:20::42c] (port=45649 helo=mail-wr1-x42c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zO-00011c-BG for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:16 -0500 Received: by mail-wr1-x42c.google.com with SMTP id p9so25860020wra.12 for ; Mon, 21 Feb 2022 01:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Jo4pFV4ykYDrN4qI9p9hUopFbfxsOOFztCVH63tiFRs=; b=rmuNkrdVr6wQjOw7bWvZ+cFleWJNDUM6k9M7lPB9C5DmlNofzKe0Pef8VJlPOZlJPc WtnRAPBlDEosdwfEH8ySD3WWtpVLYjXQGbKPaJZ2TwYCIMZzH4aW1aAgn/GQNfII94NA BNBfB1jsAK46ER0pNh7lgOOrcNuK/9oyM4PVr9rHtszsW9u1VZCaJh47wd52OmJKHXte ny2+r9oLy8AEPo/20WcPxb+4VCTPf49vRe0Qfo1MKx0ajuUb8FalsfEHKcbFqOQhtbP9 jPH8hzkd1/kagex7dKVqfI36DYzkFTCXnwLTsgF7W6kPimAmlM0ejuh182G9rg83BDYZ ndkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jo4pFV4ykYDrN4qI9p9hUopFbfxsOOFztCVH63tiFRs=; b=CduBRT+bsNWAmYqdY+LTNwLubAW7l+ElgVUt3g8oVBzyD+NNHEszXvyxFcz1tzCmnq gYV/RmSYydaNoke+TnMppgx4VMPc32pk5PNIaoPByq04qGnBMfNZWf6YhKnQd3Sh2EMi M64wLwfJcRlQhpm8yrXOvLqrcE0qiss/rHTbDjh+9/Cp3Oblv+UTihTRypYsuRE++NLd FuIZBHj0+f9lQmDGUOaoKMDP6QUr/YQ9PusXSvh/4woJuMOhfaJk1LYpJZbI9HHb+xxE wKGBL4D73SzLIuVRYod8sbr3lXBBQicgJrHyfrY0GK5EahAl9WJm0jiAxPxtBiQMFIsQ xyzg== X-Gm-Message-State: AOAM533UPsx4XFzxU871DG/RjHBa7vaj21oOijKew0ELPoLKpbC17ZnY k4X+v+iP/FEfnm+s1z3rNwSqrSs2HtiYjg== X-Received: by 2002:adf:e28f:0:b0:1e7:cf02:2d28 with SMTP id v15-20020adfe28f000000b001e7cf022d28mr15526958wri.232.1645435693085; Mon, 21 Feb 2022 01:28:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/26] Kconfig: Add I2C_DEVICES device group Date: Mon, 21 Feb 2022 09:27:47 +0000 Message-Id: <20220221092800.404870-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Currently there is no way for a board model's Kconfig stanza to say "I have an i2c bus which the user can plug an i2c device into, build all the free-standing i2c devices". The Kconfig mechanism for this is the "device group". Add an I2C_DEVICES group along the same lines as the existing PCI_DEVICES. Simple free-standing i2c devices which a user might plausibly want to be able to plug in on the QEMU commandline should have default y if I2C_DEVICES and board models which have an i2c bus that is user-accessible should use imply I2C_DEVICES to cause those pluggable devices to be built. In this commit we mark only a fairly conservative set of i2c devices as belonging to the I2C_DEVICES group: the simple sensors and RTCs (not including PMBus devices or devices which need GPIO lines to be connected). Signed-off-by: Peter Maydell Acked-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Hao Wu Message-id: 20220208155911.3408455-2-peter.maydell@linaro.org --- docs/devel/kconfig.rst | 8 ++++++-- hw/i2c/Kconfig | 5 +++++ hw/rtc/Kconfig | 2 ++ hw/sensor/Kconfig | 5 +++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst index a1cdbec7512..aa5042f1569 100644 --- a/docs/devel/kconfig.rst +++ b/docs/devel/kconfig.rst @@ -192,11 +192,15 @@ declares its dependencies in different ways: no directive and are not used in the Makefile either; they only appear as conditions for ``default y`` directives. - QEMU currently has two device groups, ``PCI_DEVICES`` and - ``TEST_DEVICES``. PCI devices usually have a ``default y if + QEMU currently has three device groups, ``PCI_DEVICES``, ``I2C_DEVICES``, + and ``TEST_DEVICES``. PCI devices usually have a ``default y if PCI_DEVICES`` directive rather than just ``default y``. This lets some boards (notably s390) easily support a subset of PCI devices, for example only VFIO (passthrough) and virtio-pci devices. + ``I2C_DEVICES`` is similar to ``PCI_DEVICES``. It contains i2c devices + that users might reasonably want to plug in to an i2c bus on any + board (and not ones which are very board-specific or that need + to be wired up in a way that can't be done on the command line). ``TEST_DEVICES`` instead is used for devices that are rarely used on production virtual machines, but provide useful hooks to test QEMU or KVM. diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig index 8217cb50411..9bb8870517f 100644 --- a/hw/i2c/Kconfig +++ b/hw/i2c/Kconfig @@ -1,6 +1,11 @@ config I2C bool +config I2C_DEVICES + # Device group for i2c devices which can reasonably be user-plugged + # to any board's i2c bus + bool + config SMBUS bool select I2C diff --git a/hw/rtc/Kconfig b/hw/rtc/Kconfig index f06e133b8a2..730c272bc54 100644 --- a/hw/rtc/Kconfig +++ b/hw/rtc/Kconfig @@ -1,10 +1,12 @@ config DS1338 bool depends on I2C + default y if I2C_DEVICES config M41T80 bool depends on I2C + default y if I2C_DEVICES config M48T59 bool diff --git a/hw/sensor/Kconfig b/hw/sensor/Kconfig index b317f91b7b4..215944decc7 100644 --- a/hw/sensor/Kconfig +++ b/hw/sensor/Kconfig @@ -1,18 +1,22 @@ config TMP105 bool depends on I2C + default y if I2C_DEVICES config TMP421 bool depends on I2C + default y if I2C_DEVICES config DPS310 bool depends on I2C + default y if I2C_DEVICES config EMC141X bool depends on I2C + default y if I2C_DEVICES config ADM1272 bool @@ -25,3 +29,4 @@ config MAX34451 config LSM303DLHC_MAG bool depends on I2C + default y if I2C_DEVICES From patchwork Mon Feb 21 09:27:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544415 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3105909imn; Mon, 21 Feb 2022 01:47:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJvD+hFDn51a2VxMon8kzcp+QiRtkTl6MUMcu99SiwOz9MlpdWxSugdhAaGhBlLAN0KvkN X-Received: by 2002:a0c:8102:0:b0:42c:3c80:7cfd with SMTP id 2-20020a0c8102000000b0042c3c807cfdmr14733602qvc.85.1645436865231; Mon, 21 Feb 2022 01:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436865; cv=none; d=google.com; s=arc-20160816; b=bCUBDsyDZHLyhyv0BCIPtam9lzlLWwm0ZwAoGM+9VugPYY1VOmsSu4bA+v1HDy8wxA s30JAb8g/fd5atJRNu4NWJvr/ZEM8znFePWnjQjRZ9T3XOvdHB9Su5eklusfkoWUkfZR x2p1TxwfxpXrxbRJT1pA/9OqVUFDC/HBD2JipVMUAVxUzLMXyI5v/sA0GZa+p0g4LQNG QdXlRgRgdLufWlHbJ0huLa09d46GM5EAaqJ2MKOfvHpXuUd9GXg9xD1GtmFeh9KzojtI VreEATietlL/yZJi/kVsN6cDpYRAP8FZHEz+NgmO8TYyRop4DIqJJ32dYXNOf0bj+j0N gXSQ== 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:to:from :dkim-signature; bh=/WgV7SCF1nvzYrA0ef2G2OADZcw5l795LudXqExHAzA=; b=wRfje7bHrsjd3F9M2N9HPLnMkpg8yBQq7jveRtbvRdu0jJp3XfFRzz3lQ0iRcOF+uQ b0oA2w+SSDeCUrwPa9IxM9P1zY7sYoPaR54MeT8wAt/Ehgv8SjPokz7Xz0RU3wLSfPx7 cBqVmVjTgsoapLeO4lSmgj/LVNO6sXvwhnSRyZwIplKUGpRL0SPDysGhFoMlLG43DaCw SGDeQrt1gpfuOxqzkQIw6QM5rAxBCcDrxiNhP2AxYeK0sGgLlb2JC611tcKovrsPvijh 6kgsApImNKmbiqtu5Y7fq0+GD4XNeK405i52Hx++GP6ABtTmlgw5Ii2VabjIvR8xgLHi Kk2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F0f9CuO7; 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 w9si15624387qko.284.2022.02.21.01.47.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:47:45 -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=F0f9CuO7; 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]:36642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5IG-0000cA-RF for patch@linaro.org; Mon, 21 Feb 2022 04:47:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zQ-0008A4-R1 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:16 -0500 Received: from [2a00:1450:4864:20::32d] (port=39480 helo=mail-wm1-x32d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zP-00011u-81 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:16 -0500 Received: by mail-wm1-x32d.google.com with SMTP id j9-20020a05600c190900b0037bff8a24ebso13029299wmq.4 for ; Mon, 21 Feb 2022 01:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/WgV7SCF1nvzYrA0ef2G2OADZcw5l795LudXqExHAzA=; b=F0f9CuO7m/5sZtS79gDOoNmJ/RIRPYT30dUA1PjX+jgphjh8jy+OklVxZbwgRgbpf+ pQlKZt7tfQy6mKcWWFNHpDRM0KrFxNQJU5pt8yJ8PSrJ+0QagvR9B0dNX4dV2rRcyjgV i7vJ8S/taCMsYUDGP6RjZQmpf4bmY/q6tJTBI086+aBd0WC9GIm/WeiANnExQcBHvUNs 575XZggrEBWVZBZB8LtgvkNBbuYsxviIof6MaymBLH0EAb1+7qHm4nibTX1gxqGQj5jY 5mcDaI/fnDyd+/NTj7p+X5zMwEKc5ub1HPdhZc549e2LFlhm19/9nPavsioWt/l55eEu L9xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/WgV7SCF1nvzYrA0ef2G2OADZcw5l795LudXqExHAzA=; b=iq2zeIeoUm8g2h93vVgnb3YZDgkBgZaxdWVRLE4kz084j7LWR8tlvZEsYvJHfPOsJ3 GypxTgYEZIlMZGVt3Wled7grllK93Vgio943i5vbxpor49yem+pdoSPabnvT0BOXudto OL84Po48B+5ii3HUAGUa7iODgHDEaKhO7ANZWshWhOqydBk04yrS+uenbuYNntKNq99B zSVD385YtqyI88dsYQYDCyfjtzF+W52cUv3SdA/GugYKg5PNvvljEQRuP2OypXAMDru4 9wlHS1nh83lwTVgl/a00LcbcxCxpggmWBeFAZH2EiNrzN9cx1ixyMJqCfMW8TxFGnDDz T+qg== X-Gm-Message-State: AOAM532enuveij9m9jCGZ18Ba3IIv2pa5F0FrzVNsekwLILh5ytilV/M 6a2RwccCER2Fz8HTxBPyYrd1zUiuY1fU1w== X-Received: by 2002:a05:600c:ac5:b0:37b:b5fb:555d with SMTP id c5-20020a05600c0ac500b0037bb5fb555dmr19919470wmr.153.1645435693926; Mon, 21 Feb 2022 01:28:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/26] Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus Date: Mon, 21 Feb 2022 09:27:48 +0000 Message-Id: <20220221092800.404870-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" For arm boards with an i2c bus which a user could reasonably want to plug arbitrary devices, add 'imply I2C_DEVICES' to the Kconfig stanza. Signed-off-by: Peter Maydell Acked-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Hao Wu Message-id: 20220208155911.3408455-3-peter.maydell@linaro.org --- hw/arm/Kconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 2e0049196d6..6945330030e 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -46,6 +46,7 @@ config DIGIC config EXYNOS4 bool + imply I2C_DEVICES select A9MPCORE select I2C select LAN9118 @@ -184,6 +185,7 @@ config REALVIEW bool imply PCI_DEVICES imply PCI_TESTDEV + imply I2C_DEVICES select SMC91C111 select LAN9118 select A9MPCORE @@ -229,6 +231,7 @@ config SABRELITE config STELLARIS bool + imply I2C_DEVICES select ARM_V7M select CMSDK_APB_WATCHDOG select I2C @@ -406,6 +409,7 @@ config NPCM7XX config FSL_IMX25 bool + imply I2C_DEVICES select IMX select IMX_FEC select IMX_I2C @@ -414,6 +418,7 @@ config FSL_IMX25 config FSL_IMX31 bool + imply I2C_DEVICES select SERIAL select IMX select IMX_I2C @@ -422,6 +427,7 @@ config FSL_IMX31 config FSL_IMX6 bool + imply I2C_DEVICES select A9MPCORE select IMX select IMX_FEC @@ -450,6 +456,7 @@ config ASPEED_SOC config MPS2 bool + imply I2C_DEVICES select ARMSSE select LAN9118 select MPS2_FPGAIO @@ -466,6 +473,7 @@ config FSL_IMX7 bool imply PCI_DEVICES imply TEST_DEVICES + imply I2C_DEVICES select A15MPCORE select PCI select IMX @@ -481,6 +489,7 @@ config ARM_SMMUV3 config FSL_IMX6UL bool + imply I2C_DEVICES select A15MPCORE select IMX select IMX_FEC @@ -495,6 +504,7 @@ config MICROBIT config NRF51_SOC bool + imply I2C_DEVICES select I2C select ARM_V7M select UNIMP From patchwork Mon Feb 21 09:27:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544420 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3108131imn; Mon, 21 Feb 2022 01:52:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxj4b134/euPGuMbLeSaZDi5bb4WcpMvN/d6qtENSM3lOki0J+Amsokzb0/Q9dyu/xu6dGr X-Received: by 2002:a05:622a:c7:b0:2d4:e00c:68fe with SMTP id p7-20020a05622a00c700b002d4e00c68femr16768242qtw.501.1645437127764; Mon, 21 Feb 2022 01:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437127; cv=none; d=google.com; s=arc-20160816; b=rIU3C1Jdz1XHf2ki9hkN3vISc/OveHKlpF3QiwRg4lYV+b4g8h9iryKnMbbE9vH7nm fHZ/bHwO+KrYF9IdAHlZdqoxegs16+LdhemUS0RmnhEsl00Sry3B1oqgLQjikGzlClWR ZV+MV+aUxjEmMxFstCHKIMMXoQvnZ3Y6dafb6nqqVspes3bJUC+InmwmHlPxtPEqTlL+ ZA4syLGn6iTrSpal/WBiw14nMiThe0jexM5kesUJlHs5Zh6sflwF/L/TD7Q/A177igIR pFN2kjelgV2kryYZ/oRhWYJlZJQ3/dWMqTK6q/yyleY8Pk08/yXBS0hKyD44+c/9ymoF hSyg== 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:to:from :dkim-signature; bh=aSTeDwPaqQEtMzC2ib6lB1DqSTk7wFZjV/NwlrctUvU=; b=jrSSc12Ut0R2N2+esv8VwOsfTfJryeYdqRV5Pgm7AvGQbiHV4ilqKX9sIyoc+vu9cq mT+mI0Xu5X9TOWTWpXArnouvmqN+qszvEPUxKZMBUZfkPAqYF+xLPcOFaHylR/GFx9us +yaFGhtOB9g101NLvEXrku+rUEsreAQ1OjWrVsqEPoYEBvL3bmQPDtYPkMi2VoJwQyWw QsOLzXMzU2PtYHjC6fv1qxelNtOywQ8pl4+06XL9zpkyJAJQN6WeP3ah/Er+1VLBiFBg tUw2Ss3i9NFq26ByqOlMHD2cwCkdhn6mSwK5RhvXuEw/5GllYFq7VVPLyhrO8MmjlADV ykTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VwvD+e6Y; 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 f3si5050148qkg.112.2022.02.21.01.52.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:52:07 -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=VwvD+e6Y; 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]:45488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5MV-0006fu-BW for patch@linaro.org; Mon, 21 Feb 2022 04:52:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-0008Je-FW for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:25 -0500 Received: from [2a00:1450:4864:20::331] (port=38468 helo=mail-wm1-x331.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zQ-00012B-01 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:17 -0500 Received: by mail-wm1-x331.google.com with SMTP id k127-20020a1ca185000000b0037bc4be8713so13069410wme.3 for ; Mon, 21 Feb 2022 01:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aSTeDwPaqQEtMzC2ib6lB1DqSTk7wFZjV/NwlrctUvU=; b=VwvD+e6YYlNpw7aZujS0iO3BOQzbcwCDe5Aaml85cHtOgwFtIttgcVySu1SykLUWvD 8Vs0YfiRQHBpvoPN7XJx8cpDx0OCmwUMLrecuovnfSmNBsr50wu2IvGqEn8W2pjmKEWr z/blQGsgiGnBcnAnmh8dKPvIKR1xvPfZdzc+zdh0zUo/q76baGsPCF2L9lb0LXuDhz/I tGfUUxRk9pe/1NesHb7EOiz1792Y23TXW9xIycoijLByEH6xcAmRMOL8yZ+tuJPQLVOu vZTohJtD6NybYDwCq9yaEd7ZK3Mhgzpxs/VdEYL6h7PkJWe4CreG+6HQ9nBadC5E+0dY uFGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aSTeDwPaqQEtMzC2ib6lB1DqSTk7wFZjV/NwlrctUvU=; b=kBkj3mxp7bK8xkCD1M3VQNdwf6QAotx8Jlc6SsgSMgnHmUzQjeZDyEgfnihflsKO9O IFvdZpVnu3cpFppwXrwdUwfk76GOHa3R8A5/pZUoId/FXOIcNMAfHs06tu0iimFgG4oC 8XoSk5zvriOF9U2o72zzWHyLVE/XiJdmbg34HUmpqIZfrAK5gDxPa5FGIZQnTHB6R+SP Coj5ZMSSOs7gRi1R5yk9vwayYfo/ycxkGi+QEa+kNdjBxBX/ucODT5KDKDcotYhimxzm 3FN2pxqZES5WCheXVbeeKJL56s+XTI17ItkEIGCSmYz5E5eT6qrFXLjtnN/ODSTyZKC7 CaXQ== X-Gm-Message-State: AOAM532zO65Ls9uoa9YPs776rZh1loDxz+5xsHK8tx9JNOX5KySl+A3j /31DbTKQiVH2uVEcy42Ct9OHTgj1nUv6Cg== X-Received: by 2002:a05:600c:3d13:b0:37b:b8e5:ed80 with SMTP id bh19-20020a05600c3d1300b0037bb8e5ed80mr20136491wmb.183.1645435694690; Mon, 21 Feb 2022 01:28:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/26] hw/arm/armv7m: Handle disconnected clock inputs Date: Mon, 21 Feb 2022 09:27:49 +0000 Message-Id: <20220221092800.404870-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::331 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" In the armv7m object, handle clock inputs that aren't connected. This is always an error for 'cpuclk'. For 'refclk' it is OK for this to be disconnected, but we need to handle it by not trying to connect a sourceless-clock to the systick device. This fixes a bug where on the mps2-an521 and similar boards (which do not have a refclk) the systick device incorrectly reset with SYST_CSR.CLKSOURCE 0 ("use refclk") rather than 1 ("use CPU clock"). Cc: qemu-stable@nongnu.org Reported-by: Richard Petri Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208171643.3486277-1-peter.maydell@linaro.org --- hw/arm/armv7m.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index ceb76df3cd4..41cfca0f223 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -284,6 +284,12 @@ static void armv7m_realize(DeviceState *dev, Error **errp) return; } + /* cpuclk must be connected; refclk is optional */ + if (!clock_has_source(s->cpuclk)) { + error_setg(errp, "armv7m: cpuclk must be connected"); + return; + } + memory_region_add_subregion_overlap(&s->container, 0, s->board_memory, -1); s->cpu = ARM_CPU(object_new_with_props(s->cpu_type, OBJECT(s), "cpu", @@ -420,8 +426,18 @@ static void armv7m_realize(DeviceState *dev, Error **errp) &s->sysreg_ns_mem); } - /* Create and map the systick devices */ - qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "refclk", s->refclk); + /* + * Create and map the systick devices. Note that we only connect + * refclk if it has been connected to us; otherwise the systick + * device gets the wrong answer for clock_has_source(refclk), because + * it has an immediate source (the ARMv7M's clock object) but not + * an ultimate source, and then it won't correctly auto-select the + * CPU clock as its only possible clock source. + */ + if (clock_has_source(s->refclk)) { + qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "refclk", + s->refclk); + } qdev_connect_clock_in(DEVICE(&s->systick[M_REG_NS]), "cpuclk", s->cpuclk); if (!sysbus_realize(SYS_BUS_DEVICE(&s->systick[M_REG_NS]), errp)) { return; @@ -438,8 +454,10 @@ static void armv7m_realize(DeviceState *dev, Error **errp) */ object_initialize_child(OBJECT(dev), "systick-reg-s", &s->systick[M_REG_S], TYPE_SYSTICK); - qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "refclk", - s->refclk); + if (clock_has_source(s->refclk)) { + qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "refclk", + s->refclk); + } qdev_connect_clock_in(DEVICE(&s->systick[M_REG_S]), "cpuclk", s->cpuclk); From patchwork Mon Feb 21 09:27:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544426 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3111547imn; Mon, 21 Feb 2022 01:59:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzFCefz/G1pU/AV0950EWJLjov8nkmCcZSuL4hwr2YrY8jrEKV+0Z8cn9Yjq3XMFdVt6i4 X-Received: by 2002:ac8:4e41:0:b0:2dd:2c64:3c83 with SMTP id e1-20020ac84e41000000b002dd2c643c83mr17064078qtw.189.1645437556351; Mon, 21 Feb 2022 01:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437556; cv=none; d=google.com; s=arc-20160816; b=NEvQ/o7MmVsrbUK8PMxfQQE0JeEttYR6LA0wWged0yyLFSaGReA8Fnd2h+H07E+0Da 00c0NXGS4L8pB3+vyxeMeXbDiWvHCqHwzT5cf4uhWE0IJan/d0dCuogwyUwj+juVJInu XOZPR909QhNB9qoV7o6C6V6ueSsY79QRZ+/KGs+fMlAy+3A9nW+rhg+BT14AgSrATy9f cYUEeOCWHXT6xjeerA6tutrAOyN+ho9Qo/ebBABZkZDRT1OJ7lX+4BVNVwrW8Et/HrNb HWrX4HcMmNUCRDeAI7AON53GMLj6jUit80qHhR9EN2aENvhowdXlK+uEHDlyvn+bfJCt yE4A== 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:to:from :dkim-signature; bh=2qmZ+jadiCTJxwUfXjizFQ9g4vcYxHdDX3ngiXpe96w=; b=utnYqascidUUu84HKv4H2GOrxZ0p/qlDhIAYZxX34UbxYXB7S3woaIm57i5EPzg8VT bW/dw9SxZTrKm7eZkFItWQwndi8Q7KA9RizJBqik5SnBBMyjODlyupVIbPVZxOtX+2Jj doRICTbZmgogI/LCgy8mTjcPVFddZwfXCyTcUvYXDsR4MRCEzq0owlAPVA4YYJEEpJuG KGLIKgGoJkd8FL7Y+jBmi8sm/Dj3GlM9M3G/0JjZQtO8rZwSJGcYYhgldIiyPVD9uB5d 1+nNiyNgUFBC8aHuqWVo/lRL3n930CYUKOn95bvqalp3rB7ncYakiSuBt3WtYduChxA2 3aeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OU2xvp+t; 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 y12si15337462qtx.104.2022.02.21.01.59.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:59:16 -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=OU2xvp+t; 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]:34822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5TP-0001WD-Ty for patch@linaro.org; Mon, 21 Feb 2022 04:59:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-0008Jp-Fx for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:25 -0500 Received: from [2a00:1450:4864:20::32b] (port=46857 helo=mail-wm1-x32b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zQ-00012V-S1 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:19 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so1664211wmp.5 for ; Mon, 21 Feb 2022 01:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2qmZ+jadiCTJxwUfXjizFQ9g4vcYxHdDX3ngiXpe96w=; b=OU2xvp+tZ9i0pKLIZJGiq9fBMKeEvl+n75ygpeF5R23sb3KvhioWK7e+upNklUiawv ib1FN/PhdgKjrypOj4zkIgZddbsUdfPizLgcFZx/Oejs16C3tujtvETMXDd2Xzw9XWKM LwZaSXjJ3+W3xIoAPgI8jI5AJ4adndYMYX0QQyhl19czGKjHsjFdx9v/KsN3ExmSr/RS YTLo1t8UF3u/55zGha5lrKyd2IYuZiiBtdaJxe/OajHKXuvQxFu8E6QEGib2UIPNIZrV XQbSGHFY7Qic1CMXr9QZaXXWpp0KXWTTZVyTfs0mWUdDLM/m8/oyl4fsZdlWNgZzIRFU /iOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2qmZ+jadiCTJxwUfXjizFQ9g4vcYxHdDX3ngiXpe96w=; b=C5hwJLxjtAO17gpd/p4uJ15c7xriJd12SuBAgLRlIshJjTdJ3myf8VufruWxYfFS+E 3WlM2gtvERhyAPOXnNajg8XYulhf2J5Fcrc/o6uKU8F/Oj8Thyj3Cp4iPLas+vgCIFW8 nJca2z21pukyf4pDFNeuZiNVoSVQgXcC349E5Pqt4vzGOBjDQprQD/NW6c+wGVWYFslS CIZPQ1N8PB5pHHto0LB+3l8BhQRDn81lEr33HgZlUTwK/bJdw7vG4yzTXxzsJVySqJ8K YLDtD3ddWr3UrwyJ/HqMnYFz5UCeVoKmcZ5LfUh+jVilc8jMk1QwAJPyXgB2ihxfx4KC wytA== X-Gm-Message-State: AOAM531omXayBT0fL99X5jkW6/0DuN5Ef5a0fdcmpCQACdIEHh2x62PE ucLSZ9njTzJu47T1uyvBGYyZt+R1pouHNQ== X-Received: by 2002:a05:600c:14d5:b0:37c:2f5d:a396 with SMTP id i21-20020a05600c14d500b0037c2f5da396mr19863687wmh.77.1645435695545; Mon, 21 Feb 2022 01:28:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/26] include: Move qemu_madvise() and related #defines to new qemu/madvise.h Date: Mon, 21 Feb 2022 09:27:50 +0000 Message-Id: <20220221092800.404870-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" The function qemu_madvise() and the QEMU_MADV_* constants associated with it are used in only 10 files. Move them out of osdep.h to a new qemu/madvise.h header that is included where it is needed. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208200856.3558249-2-peter.maydell@linaro.org --- include/qemu/madvise.h | 95 ++++++++++++++++++++++++++++++++++++++ include/qemu/osdep.h | 82 -------------------------------- backends/hostmem-file.c | 1 + backends/hostmem.c | 1 + hw/virtio/virtio-balloon.c | 1 + migration/postcopy-ram.c | 1 + migration/qemu-file.c | 1 + migration/ram.c | 1 + softmmu/physmem.c | 1 + tcg/region.c | 1 + util/osdep.c | 1 + util/oslib-posix.c | 1 + 12 files changed, 105 insertions(+), 82 deletions(-) create mode 100644 include/qemu/madvise.h diff --git a/include/qemu/madvise.h b/include/qemu/madvise.h new file mode 100644 index 00000000000..e155f59a0df --- /dev/null +++ b/include/qemu/madvise.h @@ -0,0 +1,95 @@ +/* + * QEMU madvise wrapper functions + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_MADVISE_H +#define QEMU_MADVISE_H + +#define QEMU_MADV_INVALID -1 + +#if defined(CONFIG_MADVISE) + +#define QEMU_MADV_WILLNEED MADV_WILLNEED +#define QEMU_MADV_DONTNEED MADV_DONTNEED +#ifdef MADV_DONTFORK +#define QEMU_MADV_DONTFORK MADV_DONTFORK +#else +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#endif +#ifdef MADV_MERGEABLE +#define QEMU_MADV_MERGEABLE MADV_MERGEABLE +#else +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#endif +#ifdef MADV_UNMERGEABLE +#define QEMU_MADV_UNMERGEABLE MADV_UNMERGEABLE +#else +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#endif +#ifdef MADV_DODUMP +#define QEMU_MADV_DODUMP MADV_DODUMP +#else +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#endif +#ifdef MADV_DONTDUMP +#define QEMU_MADV_DONTDUMP MADV_DONTDUMP +#else +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#endif +#ifdef MADV_HUGEPAGE +#define QEMU_MADV_HUGEPAGE MADV_HUGEPAGE +#else +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#endif +#ifdef MADV_NOHUGEPAGE +#define QEMU_MADV_NOHUGEPAGE MADV_NOHUGEPAGE +#else +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#endif +#ifdef MADV_REMOVE +#define QEMU_MADV_REMOVE MADV_REMOVE +#else +#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED +#endif +#ifdef MADV_POPULATE_WRITE +#define QEMU_MADV_POPULATE_WRITE MADV_POPULATE_WRITE +#else +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID +#endif + +#elif defined(CONFIG_POSIX_MADVISE) + +#define QEMU_MADV_WILLNEED POSIX_MADV_WILLNEED +#define QEMU_MADV_DONTNEED POSIX_MADV_DONTNEED +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID + +#else /* no-op */ + +#define QEMU_MADV_WILLNEED QEMU_MADV_INVALID +#define QEMU_MADV_DONTNEED QEMU_MADV_INVALID +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_REMOVE QEMU_MADV_INVALID +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID + +#endif + +int qemu_madvise(void *addr, size_t len, int advice); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index ce12f64853e..5ebd737aebb 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -425,87 +425,6 @@ static inline void qemu_cleanup_generic_vfree(void *p) #define QEMU_MAP_NORESERVE (1 << 3) -#define QEMU_MADV_INVALID -1 - -#if defined(CONFIG_MADVISE) - -#define QEMU_MADV_WILLNEED MADV_WILLNEED -#define QEMU_MADV_DONTNEED MADV_DONTNEED -#ifdef MADV_DONTFORK -#define QEMU_MADV_DONTFORK MADV_DONTFORK -#else -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#endif -#ifdef MADV_MERGEABLE -#define QEMU_MADV_MERGEABLE MADV_MERGEABLE -#else -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#endif -#ifdef MADV_UNMERGEABLE -#define QEMU_MADV_UNMERGEABLE MADV_UNMERGEABLE -#else -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#endif -#ifdef MADV_DODUMP -#define QEMU_MADV_DODUMP MADV_DODUMP -#else -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#endif -#ifdef MADV_DONTDUMP -#define QEMU_MADV_DONTDUMP MADV_DONTDUMP -#else -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#endif -#ifdef MADV_HUGEPAGE -#define QEMU_MADV_HUGEPAGE MADV_HUGEPAGE -#else -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#endif -#ifdef MADV_NOHUGEPAGE -#define QEMU_MADV_NOHUGEPAGE MADV_NOHUGEPAGE -#else -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#endif -#ifdef MADV_REMOVE -#define QEMU_MADV_REMOVE MADV_REMOVE -#else -#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED -#endif -#ifdef MADV_POPULATE_WRITE -#define QEMU_MADV_POPULATE_WRITE MADV_POPULATE_WRITE -#else -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID -#endif - -#elif defined(CONFIG_POSIX_MADVISE) - -#define QEMU_MADV_WILLNEED POSIX_MADV_WILLNEED -#define QEMU_MADV_DONTNEED POSIX_MADV_DONTNEED -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID - -#else /* no-op */ - -#define QEMU_MADV_WILLNEED QEMU_MADV_INVALID -#define QEMU_MADV_DONTNEED QEMU_MADV_INVALID -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_REMOVE QEMU_MADV_INVALID -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID - -#endif #ifdef _WIN32 #define HAVE_CHARDEV_SERIAL 1 @@ -577,7 +496,6 @@ void sigaction_invoke(struct sigaction *action, struct qemu_signalfd_siginfo *info); #endif -int qemu_madvise(void *addr, size_t len, int advice); int qemu_mprotect_rw(void *addr, size_t size); int qemu_mprotect_rwx(void *addr, size_t size); int qemu_mprotect_none(void *addr, size_t size); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index cd038024fae..25141283c4a 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -14,6 +14,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qemu/madvise.h" #include "sysemu/hostmem.h" #include "qom/object_interfaces.h" #include "qom/object.h" diff --git a/backends/hostmem.c b/backends/hostmem.c index 4c05862ed5a..b2a5e905e86 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -19,6 +19,7 @@ #include "qemu/config-file.h" #include "qom/object_interfaces.h" #include "qemu/mmap-alloc.h" +#include "qemu/madvise.h" #ifdef CONFIG_NUMA #include diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 9a4f491b54d..e6c1b0aa46f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -17,6 +17,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qemu/madvise.h" #include "hw/virtio/virtio.h" #include "hw/mem/pc-dimm.h" #include "hw/qdev-properties.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index e662dd05ccf..2a2cc5faf8f 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -18,6 +18,7 @@ #include "qemu/osdep.h" #include "qemu/rcu.h" +#include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h" #include "qemu-file.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 6338d8e2ff5..1479cddad94 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" #include +#include "qemu/madvise.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "migration.h" diff --git a/migration/ram.c b/migration/ram.c index 91ca743ac88..781f0745dc0 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -30,6 +30,7 @@ #include "qemu/cutils.h" #include "qemu/bitops.h" #include "qemu/bitmap.h" +#include "qemu/madvise.h" #include "qemu/main-loop.h" #include "xbzrle.h" #include "ram.h" diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dddf70edf5d..a13289a594a 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -23,6 +23,7 @@ #include "qemu/cutils.h" #include "qemu/cacheflush.h" +#include "qemu/madvise.h" #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" diff --git a/tcg/region.c b/tcg/region.c index 9cc30d49225..c46021d1604 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/madvise.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/util/osdep.c b/util/osdep.c index 67fbf227789..8c5cd6e4316 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -38,6 +38,7 @@ extern int madvise(char *, size_t, int); #include "qemu/cutils.h" #include "qemu/sockets.h" #include "qemu/error-report.h" +#include "qemu/madvise.h" #include "monitor/monitor.h" static bool fips_enabled = false; diff --git a/util/oslib-posix.c b/util/oslib-posix.c index ac0dbc2adc2..f2be7321c59 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -36,6 +36,7 @@ #include "trace.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/madvise.h" #include "qemu/sockets.h" #include "qemu/thread.h" #include From patchwork Mon Feb 21 09:27:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544429 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3114514imn; Mon, 21 Feb 2022 02:03:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMbs3fklpBbw2UMeSGtOK9IijW0erbDNXoeuLLAUCSaRQCalB3myfpyZOqfjtiBSXSLG+h X-Received: by 2002:ac8:5b88:0:b0:2de:23e3:62c0 with SMTP id a8-20020ac85b88000000b002de23e362c0mr3841182qta.62.1645437814267; Mon, 21 Feb 2022 02:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437814; cv=none; d=google.com; s=arc-20160816; b=Vu+6UabT4XRAO2/OnO55Vwc32866gXTSHr2z3vMi+Q9L/fR40+fJrobPCADDyzm+N4 yVFTzzdNH4pH9i2d3icmeafHwvf9Elw0DxhYqfLEMQnjMuVj8BVqYWufq+2QEIVtkljj Yit5i4kXNwiGT6weiwdjNbgTczyRlemr1IwcgnWgc6lbYuSMfdsA8oewlXh/Od+5TPpv Tz7UQtaNMQzzLzmyxdS6EsfFngKpNkyczmHyg1B3c2NBwbbvLkNZZ8L1ngVr+DFDnm8N gPHfcRXbmlsaVWQI0mYMVybv7llutV/vuZV4mosOG5B1tljEIFsNS8h5d8/EEL4a3JPd ZZpQ== 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:to:from :dkim-signature; bh=eUdMWu06bcY55dS/XsZ8i6MlsWYYdQD9bxiTKRF3Fko=; b=by0H5C++k2Gu2wqpgk04i95aAGBWLAULt/DW4URpdW0rxc1IFwKUsVv+KAN0gEtIXr q6ItpHW1AeWGSVE1n4vLhP0NYv+COokMO1mFKobAdsk7k4viV30TVc/gv9buOCW/mo9n Tc+x9cK9PS3Luv94k3ztiK/IghTm5Iz/cMfU33DGlNa7YQ3kin0mW8jt3aGy1elAVhly Og5e27tfSrzPji41TmzH2JfaRI+mUGq2YMggPDAsuVx8fGjCqGi2oyaFRb1gyOjg3g6s dq/43CcSwlaHlSSS3VcouDR5visPn07Wds4kPcX6jlf7X4m6FMD3wOU927fWPOitSp6B WMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hc0bS1xk; 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 n22si5704482qtw.387.2022.02.21.02.03.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 02:03:34 -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=hc0bS1xk; 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]:41406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5XZ-0005zX-RK for patch@linaro.org; Mon, 21 Feb 2022 05:03:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zf-00006I-D9 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:31 -0500 Received: from [2a00:1450:4864:20::32d] (port=44895 helo=mail-wm1-x32d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00012o-4v for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:31 -0500 Received: by mail-wm1-x32d.google.com with SMTP id d14-20020a05600c34ce00b0037bf4d14dc7so10726887wmq.3 for ; Mon, 21 Feb 2022 01:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=eUdMWu06bcY55dS/XsZ8i6MlsWYYdQD9bxiTKRF3Fko=; b=hc0bS1xkNlepjaMBC0zbT6HGjw/soUjtVbaCHPO7O053Vuk10/48bfmleKMenOxnYu HJC3yEenXWMzgM9guZsg0ZbDThcT1XCD9TKeh+a/HOkBsLL30qXS8jMZZStJt2j6XC9s RufKFbYfP/rTGXaPX25Logqjwsq1C5tahBByQam85cf5Zg8SAMS3np0g49GJe+JdMbDL f6pCJQmnKptYDMW7xX9AUR0o+rrglP+wCHMsYD/rTz9GFDjCHAglVsPfGy+NgNogwwHz c8AAKUYf3kUH5oQ44+cJpqPfg95CovPc68MzmBq1iVDOxt8n37upQv9OI63aAWpf3Tfs pyRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eUdMWu06bcY55dS/XsZ8i6MlsWYYdQD9bxiTKRF3Fko=; b=LmdXavRWlyeACQg+MZ8Lyx7cCcaQ7ZqGQNfxu8ULdCC/l6yQakNuUQ/DZE3aEngE5Q WS3xvmW0qKLfbxytzftrWSeBQOqxaBTgcltHxNrgTZ4d1JREmxDMl9F8BAIbbGmYBvcC mpi0d0eNezD3t3KyQlkSQ+7QG2d65gV7Sl6zevJ9+MeYMJvd+8UBYCSTQWF5WbQJWeXC VYbIKT47+MEGPUZXQcB7xBRzbg6beVbahNVaxPhp1qmZtIpzmt2scr/8KQrQggRsdOBC tSErJeg2Yk7XVdzVoDTUPXz8yngwi+e2heAMVU2iYvokdS9/0OsJ4VJHqTUY2bmXlcqI 4h+g== X-Gm-Message-State: AOAM531H6+OSR8fKZKoD4gVfV6ozsU3d/c+0vcSc/VCIP8QiJ5yFrgT9 1jZ1AsG0aPDGEl99v6q7wki+dMRcFuGyfA== X-Received: by 2002:a7b:cb90:0:b0:37b:b88b:b4a2 with SMTP id m16-20020a7bcb90000000b0037bb88bb4a2mr17075674wmi.148.1645435696257; Mon, 21 Feb 2022 01:28:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/26] include: Move qemu_mprotect_*() to new qemu/mprotect.h Date: Mon, 21 Feb 2022 09:27:51 +0000 Message-Id: <20220221092800.404870-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" The qemu_mprotect_*() family of functions are used in very few files; move them from osdep.h to a new qemu/mprotect.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208200856.3558249-3-peter.maydell@linaro.org --- include/qemu/mprotect.h | 14 ++++++++++++++ include/qemu/osdep.h | 4 ---- tcg/region.c | 1 + util/osdep.c | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 include/qemu/mprotect.h diff --git a/include/qemu/mprotect.h b/include/qemu/mprotect.h new file mode 100644 index 00000000000..1e83d1433ee --- /dev/null +++ b/include/qemu/mprotect.h @@ -0,0 +1,14 @@ +/* + * QEMU mprotect functions + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_MPROTECT_H +#define QEMU_MPROTECT_H + +int qemu_mprotect_rw(void *addr, size_t size); +int qemu_mprotect_rwx(void *addr, size_t size); +int qemu_mprotect_none(void *addr, size_t size); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 5ebd737aebb..ca00899bbd2 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -496,10 +496,6 @@ void sigaction_invoke(struct sigaction *action, struct qemu_signalfd_siginfo *info); #endif -int qemu_mprotect_rw(void *addr, size_t size); -int qemu_mprotect_rwx(void *addr, size_t size); -int qemu_mprotect_none(void *addr, size_t size); - /* * Don't introduce new usage of this function, prefer the following * qemu_open/qemu_create that take an "Error **errp" diff --git a/tcg/region.c b/tcg/region.c index c46021d1604..7b4e65a52e8 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu/madvise.h" +#include "qemu/mprotect.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/util/osdep.c b/util/osdep.c index 8c5cd6e4316..5181f86b82f 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -39,6 +39,7 @@ extern int madvise(char *, size_t, int); #include "qemu/sockets.h" #include "qemu/error-report.h" #include "qemu/madvise.h" +#include "qemu/mprotect.h" #include "monitor/monitor.h" static bool fips_enabled = false; From patchwork Mon Feb 21 09:27:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544407 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3097468imn; Mon, 21 Feb 2022 01:31:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6LrxcPXlT0tUe19Zm6unZBSRRcig+9efHFrkhzAQWgsjvit34f1ENjieyVHVN2y7R4j87 X-Received: by 2002:a37:6712:0:b0:49b:4bb0:ea32 with SMTP id b18-20020a376712000000b0049b4bb0ea32mr11561549qkc.132.1645435881761; Mon, 21 Feb 2022 01:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645435881; cv=none; d=google.com; s=arc-20160816; b=J1H9DlT+4bPuVFjw9M5xLZ9F6sm6Q0NY4orE81CwD6HlHrHJYqO4pQexv1GqeUz6lX Nn7/+Zxhsx9Ynk8SHFYvm7K6SafTvQOAionohvA5TMNKr4TMNr8SDNetjhg9e3RC0Rrc TA9RopUHHIt/GfSl8TStPwG9L/GAQB5PPrv4fG2eadT/lQ08HYEIFYBs1GaoghjCdKwZ 8Ge8nCrhfS9Tu8cJd+NMgp/Ic9nxBenTDVNGoIva2p99fpF5UczUUBWzANOWCISx7Tch 7DfI+PNE/uXRhzOuMv9YrZpGtHE963TCWQghnGRXIAf6B5ei7Rq2SBgt0JIAjjk3LB4C R3/g== 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:to:from :dkim-signature; bh=47kr7ialX2Tci80N2MGQK32MRACMf87J895zSjNeWJ0=; b=KY3ze5G4EpWsNGrPOCvfLodmWYn0ViNWZAXl55Bdg8K1RuOgO9TgrVhSsOq1GyfgLc mEN61yo8jkK12JUvJYTh4NYhWnLcEBxQ2SgvDmfwfwXJWNaUjaDzjSl8eBChdlzL2VcL l94/jRKiCrgHyg30ukGdnRXfyMIsbWSWGbQk1XHSYFrj0OKXZLC+cd6abcOBUdAa0p5F XxIdQ49lOgT8is6ENa3U3PI7Xli4itZ9q2xG/ZCDwEBdwYJCJIbxoBll0xyD92AQ+PcM +W2UAbQZ4S9QQr0IpF2i8w6lAS1fcNu1vUcSzIbvamB6vjxQ6x9zjrE1r0jIK+Dc46Kv lg3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9vgzB1W; 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 i135si4583072qke.660.2022.02.21.01.31.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:31:21 -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=q9vgzB1W; 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]:40252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM52P-0000Iz-8n for patch@linaro.org; Mon, 21 Feb 2022 04:31:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zq-0000ET-Uw for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:47 -0500 Received: from [2a00:1450:4864:20::42a] (port=44922 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-000133-8V for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:42 -0500 Received: by mail-wr1-x42a.google.com with SMTP id u1so25877748wrg.11 for ; Mon, 21 Feb 2022 01:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=47kr7ialX2Tci80N2MGQK32MRACMf87J895zSjNeWJ0=; b=q9vgzB1Wqqy0YGRP6+Z+ejb+tINwC7S2rd4XLFNm7C62oMI+CZ1C42YSF0SiPjUGXg 3CeNB7jzf8Wt0Ft4oNQT5ybAhACVsud9JJZDGxnCEjY1h7D4Po1mBTstEYsuQRN4Z2Te 9zUXc3TdYzWQStZCqmBRJty6qgYsPg5cNuyr6Ghanc80Q1TYTHQ93aamkZhVE5KHI8hC v+46Af34pjpizw3lR/Mi7h4I+dmydmM4E5c1f85n95VjLq7zjRRR02CMQrd1N6P/X8GZ ucKVnnWTLIN13n/4IFaRJdvkUIGASmjfe/m1UdyKFmGGKi08Es0dfAFYS3wrNDeJtH0H BHjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=47kr7ialX2Tci80N2MGQK32MRACMf87J895zSjNeWJ0=; b=b5rfc+CIY631Ka5Zxo8ZhwdDtJ+0jK2UdJ3IbDSK5Wbs9DuMistfAP5m+45iz8LPT/ WEnOnbGwidLhMYuxa0zpi33Y3ik7x/FHLaeGntXroPko0jCDKZ41Vp8HlxKDQNZoEL4T ZotIPZmwRhymzOPL9hE6E2fAWSmWVcEIhwXH108/VtqpIy8HG/DFNdDAj1L6iB6h4AfD Ko5vPz0hzgL7yAN2PQyVf3bVNS4rR3axwLzEsf6bxV2w5buC2e+zDcaoi3MERNQtA1oJ 8zWlyps8DBqUmBPrmuIFCCT7/+vhG8lkKcsOE49BvOFPFooDKUSw2owErsyK5yLheeI8 xKiA== X-Gm-Message-State: AOAM530tfd3+FDSsF4Ktt/ka9sSaCvw4cm0rqFc7pD7mT2C+yAF5OJg9 G4tM2srGDOg7wqCJG30Af7SNBy041GYikA== X-Received: by 2002:adf:fb8e:0:b0:1e3:241b:218c with SMTP id a14-20020adffb8e000000b001e3241b218cmr15087521wrr.359.1645435697023; Mon, 21 Feb 2022 01:28:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/26] include: Move QEMU_MAP_* constants to mmap-alloc.h Date: Mon, 21 Feb 2022 09:27:52 +0000 Message-Id: <20220221092800.404870-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" The QEMU_MAP_* constants are used only as arguments to the qemu_ram_mmap() function. Move them to mmap-alloc.h, where that function's prototype is defined. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208200856.3558249-4-peter.maydell@linaro.org --- include/qemu/mmap-alloc.h | 23 +++++++++++++++++++++++ include/qemu/osdep.h | 25 ------------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h index 90d0eee7053..5076695cc81 100644 --- a/include/qemu/mmap-alloc.h +++ b/include/qemu/mmap-alloc.h @@ -35,4 +35,27 @@ void *qemu_ram_mmap(int fd, void qemu_ram_munmap(int fd, void *ptr, size_t size); +/* + * Abstraction of PROT_ and MAP_ flags as passed to mmap(), for example, + * consumed by qemu_ram_mmap(). + */ + +/* Map PROT_READ instead of PROT_READ | PROT_WRITE. */ +#define QEMU_MAP_READONLY (1 << 0) + +/* Use MAP_SHARED instead of MAP_PRIVATE. */ +#define QEMU_MAP_SHARED (1 << 1) + +/* + * Use MAP_SYNC | MAP_SHARED_VALIDATE if supported. Ignored without + * QEMU_MAP_SHARED. If mapping fails, warn and fallback to !QEMU_MAP_SYNC. + */ +#define QEMU_MAP_SYNC (1 << 2) + +/* + * Use MAP_NORESERVE to skip reservation of swap space (or huge pages if + * applicable). Bail out if not supported/effective. + */ +#define QEMU_MAP_NORESERVE (1 << 3) + #endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index ca00899bbd2..165448b12f8 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -401,31 +401,6 @@ static inline void qemu_cleanup_generic_vfree(void *p) */ #define QEMU_AUTO_VFREE __attribute__((cleanup(qemu_cleanup_generic_vfree))) -/* - * Abstraction of PROT_ and MAP_ flags as passed to mmap(), for example, - * consumed by qemu_ram_mmap(). - */ - -/* Map PROT_READ instead of PROT_READ | PROT_WRITE. */ -#define QEMU_MAP_READONLY (1 << 0) - -/* Use MAP_SHARED instead of MAP_PRIVATE. */ -#define QEMU_MAP_SHARED (1 << 1) - -/* - * Use MAP_SYNC | MAP_SHARED_VALIDATE if supported. Ignored without - * QEMU_MAP_SHARED. If mapping fails, warn and fallback to !QEMU_MAP_SYNC. - */ -#define QEMU_MAP_SYNC (1 << 2) - -/* - * Use MAP_NORESERVE to skip reservation of swap space (or huge pages if - * applicable). Bail out if not supported/effective. - */ -#define QEMU_MAP_NORESERVE (1 << 3) - - - #ifdef _WIN32 #define HAVE_CHARDEV_SERIAL 1 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ From patchwork Mon Feb 21 09:27:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544424 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3110445imn; Mon, 21 Feb 2022 01:56:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZeXxevLX+z6NKFf3EJG8x2az39byCc121kf6OaeyBaYOtPsSYIeuRJACofRVtUtG+rXpT X-Received: by 2002:ad4:5688:0:b0:42c:5086:686f with SMTP id bc8-20020ad45688000000b0042c5086686fmr15171169qvb.76.1645437404594; Mon, 21 Feb 2022 01:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437404; cv=none; d=google.com; s=arc-20160816; b=nAeeKz5CZ4GF7SDU2xq0FCGP+cVhVNNXH0nlJK1knNAoQIu7zWc384oE8RP6PMzFiY vu1KQITZFiRjQvdF+SRNqVbUy5n+XCQI4O2+Y5IcEbPlS/wQy6BXoogdV/qmU9QZRNpc Z7GjZMqF66CJl8zPccjvnrZHonxpdk6e3zwS1Irr4UBN2D1i0MSq0BOXAvpbzmX/3YfB Im0wylSEseGRbMe4oBaznaT3vs4NJ89T/JSiO0xeBnQrV4gJhVpEmH3Fr1Zs3DNqePDY GTddHmGQZIyCsL5S2ik91VoledAStULj3s3vK0kYQgRLtK7F280alDPPZ52XfikORO6k dxdw== 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:to:from :dkim-signature; bh=fmYyVBia74m6vtBMKDMDPPY8ORAeWnoGyOrzfR/JNX4=; b=VY4sbQ1+Q2AkxU4BMU0UZuYqF2sfepHZlcfeWb+Tg5WAqLyek1E0NbfH59NzAnpUis awK8KLf0Dzm3+UoruVYZiC5096tt5CZ1di/F2uV/7kMyIa/U+e+kLCDMENXTs61rq6aP vuzfohY/NyhNqtb3IfIPyTNSK2qGw2Sji065eED7aKDJv40yn7LF9bMUMsLfO3gaHX0+ qKkLW0TVQ8VNRQSu8Q0YTNXNesBtQKLxP1ZqShTChfh+ts4LAOG96C/3ChxbswnnWbsX LbXLk5IJoqr49F5euzq9kVzymtulQXZOI4BCfWomJrBU15VBvP2ae0J+oy5tHYZgLraX 6B1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="D4/l/gBO"; 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 e6si3043305qte.611.2022.02.21.01.56.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:56:44 -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="D4/l/gBO"; 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]:56834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Qy-0005ew-1Q for patch@linaro.org; Mon, 21 Feb 2022 04:56:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zf-00006X-Fl for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:31 -0500 Received: from [2a00:1450:4864:20::42b] (port=36533 helo=mail-wr1-x42b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-000139-5s for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:31 -0500 Received: by mail-wr1-x42b.google.com with SMTP id o24so25919430wro.3 for ; Mon, 21 Feb 2022 01:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fmYyVBia74m6vtBMKDMDPPY8ORAeWnoGyOrzfR/JNX4=; b=D4/l/gBOik5biplI74uCXbWVQXlVbuu5gZVgdz/ejetxES3MyOysupgexJNWdzLzYb rvpIkBxkMUrMAnM48dJs0+YSxVJjlsDSHf7X7xA5taWWtXUDjRk0sPyhtPdqcRR9kXzU Qqt0WQBgPYiL4SjOQplfTZ7YSKfClPRPHT/Cf4ecxuTI2UJ2iJYNJ7HBhiNKDYv8g6YB oK4G8qbeTO5y5HgT5KrkMlv3RssIlV8WC78d1lu02WxfFYwDeWeIbkaGW1oZJUvEpfg1 oh4+ua+vCVOKPeCnojlxWjMzyqmDOSTFunOLz3HGw96BO0sySwLzDSsOALrq+x1fUaI/ WiTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fmYyVBia74m6vtBMKDMDPPY8ORAeWnoGyOrzfR/JNX4=; b=JWdZX43VnnGETcC6y4J/j41PnZykCz4HmIK2Lwjvgt7gsNqiL4j15QjZPne0YES+XN CUcQgxmCC5e4OqEjwgAPN2SRqDdXCob1me1PRtoJpduRG0q/WSPYFk6BB+B5tDcCNOti j4K4dZgs7kJjyQyHvHnnvBR+BuumMby/MURAqlG/xXWo1HLSonVWJxXtExa+SxsAJegB wldWXSZr8hOr38xEa/yedwCsLhSZZ3kUpT2beZv9+9MtQ9q8Q5vfN0iWXwH8IcpUm7xK JscKV1oMlRYtQFN7GbBBhrn9k8er1gpwtMUy4o6Hh3+ES0iGlV1NhdxC62Aj7ENY+xGX dQdw== X-Gm-Message-State: AOAM532sBcPKLrRjZ1c+XR6tuuTtlhw0DTMeEHH4hOi6afymS4/x78GA 36uW9nQFVgG8PrrjmR9ThRb5drfo9HAMjw== X-Received: by 2002:adf:ce8f:0:b0:1e4:bcd3:3aa6 with SMTP id r15-20020adfce8f000000b001e4bcd33aa6mr14460115wrn.561.1645435697835; Mon, 21 Feb 2022 01:28:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/26] include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h Date: Mon, 21 Feb 2022 09:27:53 +0000 Message-Id: <20220221092800.404870-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" The qemu_icache_linesize, qemu_icache_linesize_log, qemu_dcache_linesize, and qemu_dcache_linesize_log variables are not used in many files. Move them out of osdep.h to a new qemu/cacheinfo.h, and document them. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208200856.3558249-5-peter.maydell@linaro.org --- include/qemu/cacheinfo.h | 21 +++++++++++++++++++++ include/qemu/osdep.h | 5 ----- accel/tcg/translate-all.c | 1 + plugins/loader.c | 1 + tcg/region.c | 1 + tcg/tcg.c | 1 + util/atomic64.c | 1 + util/cacheflush.c | 1 + util/cacheinfo.c | 1 + 9 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 include/qemu/cacheinfo.h diff --git a/include/qemu/cacheinfo.h b/include/qemu/cacheinfo.h new file mode 100644 index 00000000000..019a157ea08 --- /dev/null +++ b/include/qemu/cacheinfo.h @@ -0,0 +1,21 @@ +/* + * QEMU host cacheinfo information + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_CACHEINFO_H +#define QEMU_CACHEINFO_H + +/* + * These variables represent our best guess at the host icache and + * dcache sizes, expressed both as the size in bytes and as the + * base-2 log of the size in bytes. They are initialized at startup + * (via an attribute 'constructor' function). + */ +extern int qemu_icache_linesize; +extern int qemu_icache_linesize_log; +extern int qemu_dcache_linesize; +extern int qemu_dcache_linesize_log; + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 165448b12f8..61808edc69f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -616,11 +616,6 @@ pid_t qemu_fork(Error **errp); extern uintptr_t qemu_real_host_page_size; extern intptr_t qemu_real_host_page_mask; -extern int qemu_icache_linesize; -extern int qemu_icache_linesize_log; -extern int qemu_dcache_linesize; -extern int qemu_dcache_linesize_log; - /* * After using getopt or getopt_long, if you need to parse another set * of options, then you must reset optind. Unfortunately the way to diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index bd71db59a9a..5971cd53ab9 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -51,6 +51,7 @@ #include "qemu/qemu-print.h" #include "qemu/timer.h" #include "qemu/main-loop.h" +#include "qemu/cacheinfo.h" #include "exec/log.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h" diff --git a/plugins/loader.c b/plugins/loader.c index a4ec2816922..4883b0a1cbc 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -24,6 +24,7 @@ #include "qemu/rcu_queue.h" #include "qemu/qht.h" #include "qemu/bitmap.h" +#include "qemu/cacheinfo.h" #include "qemu/xxhash.h" #include "qemu/plugin.h" #include "hw/core/cpu.h" diff --git a/tcg/region.c b/tcg/region.c index 7b4e65a52e8..72afb357389 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -26,6 +26,7 @@ #include "qemu/units.h" #include "qemu/madvise.h" #include "qemu/mprotect.h" +#include "qemu/cacheinfo.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/tcg/tcg.c b/tcg/tcg.c index 5d2f0d8b103..528277d1d3c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -36,6 +36,7 @@ #include "qemu/qemu-print.h" #include "qemu/timer.h" #include "qemu/cacheflush.h" +#include "qemu/cacheinfo.h" /* Note: the long term plan is to reduce the dependencies on the QEMU CPU definitions. Currently they are used for qemu_ld/st diff --git a/util/atomic64.c b/util/atomic64.c index 93037d5b116..22983a970f1 100644 --- a/util/atomic64.c +++ b/util/atomic64.c @@ -7,6 +7,7 @@ #include "qemu/osdep.h" #include "qemu/atomic.h" #include "qemu/thread.h" +#include "qemu/cacheinfo.h" #ifdef CONFIG_ATOMIC64 #error This file must only be compiled if !CONFIG_ATOMIC64 diff --git a/util/cacheflush.c b/util/cacheflush.c index 933355b0c99..4b57186d89c 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -7,6 +7,7 @@ #include "qemu/osdep.h" #include "qemu/cacheflush.h" +#include "qemu/cacheinfo.h" #include "qemu/bitops.h" diff --git a/util/cacheinfo.c b/util/cacheinfo.c index b182f0b6936..ab1644d490f 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/host-utils.h" #include "qemu/atomic.h" +#include "qemu/cacheinfo.h" int qemu_icache_linesize = 0; int qemu_icache_linesize_log; From patchwork Mon Feb 21 09:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544430 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3117010imn; Mon, 21 Feb 2022 02:07:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR60ln4zdSLHcagQHDwSK+Yp2OxFxCu6Kvt/hpddB6kF19AA1iPDnTMBuOzCOVzjI/39tQ X-Received: by 2002:a05:620a:9c4:b0:646:d1a3:37c1 with SMTP id y4-20020a05620a09c400b00646d1a337c1mr7189404qky.475.1645438044894; Mon, 21 Feb 2022 02:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645438044; cv=none; d=google.com; s=arc-20160816; b=XC4IW6lXX414dXWaxCGTXpUbHE40UnbghBV/Bp7/tCDAbBIt9dDNFX5R5H6+je0nWd Fv+t5fC3qKbyoHR3dQ11vlkWrCqQOGbOiJaZTynsea/xcwyUv7B2lkMu3GP+goIVFTb+ sdIsxBKuvZ9ogLSyFfTg3VBkXbP50ZchyDHHsvr9h6UEep3c5kFOuyQ6YN1mlSrZI3O/ IQ6VbaNt7l5uLfczYFu7PfAThMglQ5r9HYJ12Z/o9GSXhDpUMO2TghqfkY2LahBe6Wvs c9B7p7/yJgITopmoaX1A8soylLMZZKSKOduUYc68cAkiaYaCtbYT+tNqRahELhHiLjXJ ZFjQ== 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:to:from :dkim-signature; bh=r8blyhj+o1PQzGuFaBU48Q/kv60nhZW403nGA4koXMo=; b=zVeV7Kp4T6dPKIScw6QA44t5PJ31Q0i/AeMKo9wDA8iKj5Bojxe0hOHqwPsuYUjjld RAQbu6K2fx2XaM8YpCNcjaKvSJ8SKK6yMmTzhJRy9DAIT/TP5ezlzXb0GhWEIn6362jn 6rkzn+r37ov6df41hPYQvtTVMSINuIRdiOJwARsbjpJXM4wkcufFv5NSJkVy5g8dtYrg a9WKywyCyGLntyifXcHjiaNBndNv0/1HS8WGSRhq651VMN/jgeu+ZfBRJIoxZFWQPIWB xPG1s2KgkT4H5cD0UxCeZd9BBsNVMF30dZMXPMcanOj/kjL/zYs2k31FqdkQBqfxRkCK ghag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pts+hHiM; 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 fq2si11230141qvb.252.2022.02.21.02.07.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 02:07:24 -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=Pts+hHiM; 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]:47768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5bI-0001y7-Cx for patch@linaro.org; Mon, 21 Feb 2022 05:07:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zo-0000Dr-DM for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:42 -0500 Received: from [2a00:1450:4864:20::436] (port=35606 helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013F-6S for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:37 -0500 Received: by mail-wr1-x436.google.com with SMTP id v12so25926500wrv.2 for ; Mon, 21 Feb 2022 01:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=r8blyhj+o1PQzGuFaBU48Q/kv60nhZW403nGA4koXMo=; b=Pts+hHiMut9F//bV4m7Dchoe/4aQYfRgh0eBVKL8NT/Tz866ktkAYF7UTbivfd1NFj ppzXdSqie5YskpXOcw9aQfJw1vyZARPoCofpuboN2QG+IQfDoL+febR+RMhOsFenhqOz Ha7/Qi2sxfyQ7DQ8B0vh1kt58pmSjaWY8JvymnKgqbWSajt5nxUHdBcrlY2LEhdWa0We doMAokznKEK5pM+PdJt0qlm+D1VVZbQBnYo4AGNzKl7qK35ybQNha5l8nQd/p1aPfStZ yQ5KKnw0CvROSOyETcEfQu9B1P0NMrid18pnBzmUYD1w5x1aOlAkqxtj70DlCRQaiPwC s4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r8blyhj+o1PQzGuFaBU48Q/kv60nhZW403nGA4koXMo=; b=ickkpmqELzS2XYXiZecNMJX/vT5O9fkauNpwBpReObX17lXeB/sYqkemkmhRn2huu6 2JZ97fEXYdV/tHGkNN6H29+qM7B9FCCeglvCnfwuHQnP515XuE+mU17rzRnS5GZqX4YM UeOFB+JgmnlDMFW+jcrp8brSYrL8wysNL8j1xgO4nYO9NNYQ10aRsVkZ1c2s/z+tchNs YGa70Y7Hnf9ZT9iO4VkZ0xZ+0VnjjV2V8NiB3gNPUpsiYAlIgrMJSyfPmIvJMTElUJYr Qq0i3Hj5Ptup4pgpziYI1DZd8AlMUozR8X6h5C+qsB0UITgkleanaEi1sYRHFvnPxoR8 HylA== X-Gm-Message-State: AOAM531PXg5Pk36DewTAlwTBSgyAvEPCGR+J/rCMDD2wp1Oe2OtDTBZd nwpWW4bRJExSzr/Mc3RBBW4DB2KZvp88WQ== X-Received: by 2002:adf:f68d:0:b0:1e1:db49:a721 with SMTP id v13-20020adff68d000000b001e1db49a721mr15101706wrp.297.1645435698684; Mon, 21 Feb 2022 01:28:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/26] include: Move hardware version declarations to new qemu/hw-version.h Date: Mon, 21 Feb 2022 09:27:54 +0000 Message-Id: <20220221092800.404870-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" The "hardware version" machinery (qemu_set_hw_version(), qemu_hw_version(), and the QEMU_HW_VERSION define) is used by fewer than 10 files. Move it out from osdep.h into a new qemu/hw-version.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220208200856.3558249-6-peter.maydell@linaro.org --- include/qemu/hw-version.h | 27 +++++++++++++++++++++++++++ include/qemu/osdep.h | 16 ---------------- hw/arm/nseries.c | 1 + hw/ide/core.c | 1 + hw/scsi/megasas.c | 1 + hw/scsi/scsi-bus.c | 1 + hw/scsi/scsi-disk.c | 1 + softmmu/vl.c | 1 + target/i386/cpu.c | 1 + target/s390x/cpu_models.c | 1 + util/osdep.c | 1 + 11 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 include/qemu/hw-version.h diff --git a/include/qemu/hw-version.h b/include/qemu/hw-version.h new file mode 100644 index 00000000000..730a8c904d9 --- /dev/null +++ b/include/qemu/hw-version.h @@ -0,0 +1,27 @@ +/* + * QEMU "hardware version" machinery + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_HW_VERSION_H +#define QEMU_HW_VERSION_H + +/* + * Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default + * instead of QEMU_VERSION, so setting hw_version on MachineClass + * is no longer mandatory. + * + * Do NOT change this string, or it will break compatibility on all + * machine classes that don't set hw_version. + */ +#define QEMU_HW_VERSION "2.5+" + +/* QEMU "hardware version" setting. Used to replace code that exposed + * QEMU_VERSION to guests in the past and need to keep compatibility. + * Do not use qemu_hw_version() in new code. + */ +void qemu_set_hw_version(const char *); +const char *qemu_hw_version(void); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 61808edc69f..7bcce3bceb0 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -534,22 +534,6 @@ static inline void qemu_timersub(const struct timeval *val1, void qemu_set_cloexec(int fd); -/* Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default - * instead of QEMU_VERSION, so setting hw_version on MachineClass - * is no longer mandatory. - * - * Do NOT change this string, or it will break compatibility on all - * machine classes that don't set hw_version. - */ -#define QEMU_HW_VERSION "2.5+" - -/* QEMU "hardware version" setting. Used to replace code that exposed - * QEMU_VERSION to guests in the past and need to keep compatibility. - * Do not use qemu_hw_version() in new code. - */ -void qemu_set_hw_version(const char *); -const char *qemu_hw_version(void); - void fips_set_state(bool requested); bool fips_get_state(void); diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index af3164c5519..9c1cafae86b 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -24,6 +24,7 @@ #include "chardev/char.h" #include "qemu/cutils.h" #include "qemu/bswap.h" +#include "qemu/hw-version.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" diff --git a/hw/ide/core.c b/hw/ide/core.c index e28f8aad611..33463d9b8f2 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/timer.h" +#include "qemu/hw-version.h" #include "sysemu/sysemu.h" #include "sysemu/blockdev.h" #include "sysemu/dma.h" diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index cd43945827c..d5dfb412bac 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -28,6 +28,7 @@ #include "hw/pci/msix.h" #include "qemu/iov.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h" #include "trace.h" diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 4057e04ce89..b2e2bc3c96c 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -3,6 +3,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qemu/hw-version.h" #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" #include "migration/qemu-file-types.h" diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 9c0dc7b9468..3666b8d9468 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -25,6 +25,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "hw/scsi/scsi.h" #include "migration/qemu-file-types.h" #include "migration/vmstate.h" diff --git a/softmmu/vl.c b/softmmu/vl.c index 5e1b35ba489..1fe028800fd 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -36,6 +36,7 @@ #include "qemu-version.h" #include "qemu/cutils.h" #include "qemu/help_option.h" +#include "qemu/hw-version.h" #include "qemu/uuid.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa9e6368004..c9954df4a74 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -21,6 +21,7 @@ #include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/qemu-print.h" +#include "qemu/hw-version.h" #include "cpu.h" #include "tcg/helper-tcg.h" #include "sysemu/reset.h" diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 11e06cc51fa..17ae771939b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -19,6 +19,7 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "qemu/qemu-print.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" diff --git a/util/osdep.c b/util/osdep.c index 5181f86b82f..723cdcb004f 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -40,6 +40,7 @@ extern int madvise(char *, size_t, int); #include "qemu/error-report.h" #include "qemu/madvise.h" #include "qemu/mprotect.h" +#include "qemu/hw-version.h" #include "monitor/monitor.h" static bool fips_enabled = false; From patchwork Mon Feb 21 09:27:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544411 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3101161imn; Mon, 21 Feb 2022 01:38:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw77nKKNCF0NZnRB7DO8oM5bx2FIrg1jAtuhLssg5c/ugEBmQX7PCWkXNhOC8pImAP9omyg X-Received: by 2002:a0c:e8c5:0:b0:42c:272b:4e12 with SMTP id m5-20020a0ce8c5000000b0042c272b4e12mr14313064qvo.62.1645436289195; Mon, 21 Feb 2022 01:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645436289; cv=none; d=google.com; s=arc-20160816; b=sfjw/q8v3tCfoobgYjVwjOHk11enSHH72LgZ1IAhojgqrMS0+XQdVhsUsOPLDPq5BA ANaS0SZUI8cUWXmpFxZ6boMXJzd7Ik7fEauaEWxRE1AZU+xnGMxM8Lg8tp3eoKTavXAb 69/rOWsgkZWLOWbpLJqOUebSO2yTDyZv32CPCV6YFnjAwPxeLsyvBa6j7blUaHhxCVOe 9/w/D0Pgwb4MELTVfBm3T5iOwm2hvj33wm9NXbFnr6sKmXfJusetOuIJpEqel3UZ/KqH sHjLIDHiAZLiJ3RM2Mqw3froIoN3fpz6dRi71BqsTZqGbIB44lJkciPJYiDiERSzYeaC 8Csg== 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:to:from :dkim-signature; bh=6ix9Jd7ujoLN6zvd7GKMtecksWWqdBl2l3FdxLEHMeA=; b=1AnmbycBNm2zoG9tQtMbouN8DXqtWvAfOcBdDKt05taPNp2zMz5ZEWhMHRzHTYxV1Z dk0YJzKhKOTBHHbQMIomYSp3B8SwduCbxbMqhAAJzQDTtjE9WQty5tc6wYfQGdb3JIKw Pu7/4gPJG+cCGB3WOnJ0bdflu+JCqNBTB9A1nrLjrTz0nzuOdigHtSuJwZAfJwwZeVzg izDfg5/TeKufE45VigLXOJb0oqb9TxIiXWU4plZTV/cnG5wfA89Fqt1I9Bu9NHh0GMVx WXRPCZ6NAXaXezoJ7d02TpGXRPVRiNNczw701ajZ/g9ooECAi0xmjNmIk3gI/HZEf18U kzlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=npk26G5k; 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 l197si4762797qke.684.2022.02.21.01.38.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:38:09 -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=npk26G5k; 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]:48886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM58y-0006L0-N5 for patch@linaro.org; Mon, 21 Feb 2022 04:38:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zo-0000Ds-DM for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:45 -0500 Received: from [2a00:1450:4864:20::334] (port=50870 helo=mail-wm1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013J-6W for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:36 -0500 Received: by mail-wm1-x334.google.com with SMTP id k41so9138423wms.0 for ; Mon, 21 Feb 2022 01:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6ix9Jd7ujoLN6zvd7GKMtecksWWqdBl2l3FdxLEHMeA=; b=npk26G5km2nutogqIgI+NiUuJjqv31bL/NVqXD4r6JfieEb+9RbsOU3mCCXoPRyvEU sXMCLRsyI+FJwYi3eaQ4xM3gmzDE9BjfHI194IPoVXIVkbwMMBFJvXZDZ+NqAp9npaN2 X9dPS+z0hKQO95GVfNM0PY5d6mDW1BGnfrPo4iDIzkcW8vQb3o8qlvA2jHDxPd6KOHI+ qpF+vSebholvYiREu8XzJ+drkiQQ+1gZc30frYcrMyhOg8xGB8myIU/uobv/CtJbunY0 FZSrylfYd503H0ptXlSAvvL/ImNYd72ouZ53fkp6IQ7eNeUIH5UGa3B7ack194K7Afsr XYiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6ix9Jd7ujoLN6zvd7GKMtecksWWqdBl2l3FdxLEHMeA=; b=qSz5jiwyzBT4QLGaFxFHrK/agRILnrjtZ8X3MDj2t6+u3C113Fu3fnNL6R/BJTElzl xf0L7h1Z5elA8e3PhTAptNzvsFAUFFGbAqt95NpqUOL3iyjDRwgm/XaiZ9Ld2+8MELWc 17H8hpZBYaMM3F/QYlhjZc9Bfv98pFhclORpCWbIXMhgn7jKUR7SPtH4voAOr8DRwACn vmguS3PFQDdrVaZa43Y9jZc3sTGQ611g2Zq5KLYN8R5lF8dDlBgk5GK5Ypm7FpM0JJdp tGDqUObClDYQ5JELycVn2NNjTMnKccLS3bW+4/MK4Fjpm+AZPyHpy/kgdBimGQK7gnTi 7thw== X-Gm-Message-State: AOAM533v6VkKiOv+XbWMQyJvUWXmPJYqbQaB5oZgc2w/h9JBkGp54ayu +0RKtxDcsUaluZBJXliK7ifTsOA0mmlIuw== X-Received: by 2002:a05:600c:3512:b0:352:d502:bd0c with SMTP id h18-20020a05600c351200b00352d502bd0cmr20154487wmq.164.1645435699459; Mon, 21 Feb 2022 01:28:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/26] MAINTAINERS: Add Akihiko Odaki to macOS-relateds Date: Mon, 21 Feb 2022 09:27:55 +0000 Message-Id: <20220221092800.404870-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::334 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Akihiko Odaki Signed-off-by: Akihiko Odaki Reviewed-by: Christian Schoenebeck Reviewed-by: Philippe Mathieu-Daudé Message-id: 20220213021215.1974-1-akihiko.odaki@gmail.com Signed-off-by: Peter Maydell --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bd85e27889f..c3b500345cf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2416,6 +2416,7 @@ F: audio/alsaaudio.c Core Audio framework backend M: Gerd Hoffmann R: Christian Schoenebeck +R: Akihiko Odaki S: Odd Fixes F: audio/coreaudio.c @@ -2668,6 +2669,7 @@ F: util/drm.c Cocoa graphics M: Peter Maydell +R: Akihiko Odaki S: Odd Fixes F: ui/cocoa.m From patchwork Mon Feb 21 09:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544427 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3111799imn; Mon, 21 Feb 2022 01:59:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsVYNSrpSj6QjaeJsgjMn/DEuzVMqELkJdO62uWpZR6gKtDDjFeVUBaCrjDDZwomRamNF4 X-Received: by 2002:a37:b4c6:0:b0:508:b101:75b9 with SMTP id d189-20020a37b4c6000000b00508b10175b9mr11562502qkf.550.1645437583022; Mon, 21 Feb 2022 01:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437583; cv=none; d=google.com; s=arc-20160816; b=gTwA+CfifyVVz38ipyAT49FbfgXZXSyFPBep+CTSd41aT6/Liu0dFN47HStV+wrxjU DDkRyavBpEc5EX8owQvW56qiZXpHVZYB/FLemYOUGGYGa2JzC+5d5fscM0McaIj8B3R0 Upt4MNHn4lvWWiLBPIJRzJlg7seQe6W1WHUln1DZitz9QS21MHfod7MWY5dJ/Wpitul8 hqClToUhusRu7B3WO25oRKI5e/NUgVbqJ+5XH9zettxjUQ7BzvtyWGItUHIEExdoDqVX c/yp5OZNFXSqKDZFv6IsKyEqoOf55Bm0feNSb/kA0+GT9gDjtYOHqI5AXftr6WkTFPgK OfMQ== 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:to:from :dkim-signature; bh=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=l/7+Lp87HfLRSMJ2clG5g619ThkFdPQE7y0Vp9Y+xI3uIkMnqXcgxrCNomw0aLyxmk PDsDe4dkEhl44JPfx5GaXZR5NYvHVMTA0GQR9TaTW8gFf2HdHjrq0qGk5/UmYEa/xJH2 4YjyrZmypH1EtTOvj3kiCAPHTNvd6GYa9A14hmB4qZ4BQCgdrf8bPMicD97MHg60aDCQ rJezGvuwj+8uZcWyfU9JSG5FI4IdscQRchYjwneTp4Q9QdGJWnWx7R9a7mXWNheXlkmt oMuU382TobuknRDqoWVP6TV9vU50jnRpqglL8jB/J0n0JOaHpgLdx4Mf+VMF4twurXc+ DEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Umxc8GeS; 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 n8si6557842qtx.375.2022.02.21.01.59.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:59:43 -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=Umxc8GeS; 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]:36748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Tq-0002oB-K6 for patch@linaro.org; Mon, 21 Feb 2022 04:59:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zr-0000EU-6w for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:47 -0500 Received: from [2a00:1450:4864:20::42c] (port=36535 helo=mail-wr1-x42c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013M-9v for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:42 -0500 Received: by mail-wr1-x42c.google.com with SMTP id o24so25919601wro.3 for ; Mon, 21 Feb 2022 01:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=Umxc8GeSNitwwVItnKjCuq2IsWSGURRKTnRHhHLf4Y1nX0/CvKTlyGuN+4NWs4oaLc grXAfnaQfMs0OqBban+nzdZR77q8VW6RaZdQeWlL1WQE1QBS520fV2fZJiUgGbueT96r QrsJrBXVd5xF+ZvyumXYJsVfJaie3HUC9N8uxPYKDx0wOCYZpQVRN0fRTzdRqsnFLgjb PI8jSvgSQ1HGX0n9y6VGxQOu8Vpvi32WhQZbcnXedMY0Mata7z3fmTxpJWT9MsM34rCO i8tbdc1nNNt37zVB97PGapflKO8IirzgfVRa2KUmfl8R9eoVtkjhGreDuI58YNQ0PMZP +WbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=17Me5f+fhTYmiaiAYpa65qPDI/6lv7pnz6ddXONzFsNomc4quUqGWH/taThlDbotCR 3e8oaldJV9NL6WByzpUxP9Dj5tyM0ALavK45JcrUN3BVO3DYxNCE9Jw1M1OQmUcXMNI7 f97olMGSlnc2AKvp7w7Rbuuz6Px0etktjlwpFKvi8MuKBN5NytoVO20wnqf7O6UscePH cfEXDA2JzsOhKugpoJ76SClDnI4WYX+qeX9RwoVM0gH5iVdjEqaOnfFBL2x1qk52IepC CJhm/KXZmGboXSy7FP1EgpAsP8nIRT4hKLa/l6AXaB8rx/DKEYmuuFvxf8sp6LCmd5/Z XUZQ== X-Gm-Message-State: AOAM532Wiwn0UdyyUNYKHDPP3kZ0dHgtymRJs5V98QUTOwaotDArMcBo kadPExwkQESc+vJpHSZ3jEPHZzup0Hifkw== X-Received: by 2002:a5d:6482:0:b0:1e8:330e:e442 with SMTP id o2-20020a5d6482000000b001e8330ee442mr15166210wri.107.1645435700234; Mon, 21 Feb 2022 01:28:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/26] hw/timer: fix a9gtimer vmstate Date: Mon, 21 Feb 2022 09:27:56 +0000 Message-Id: <20220221092800.404870-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Pavel Dovgalyuk A9 gtimer includes global control field and number of per-cpu fields. But only per-cpu ones are migrated. This patch adds a subsection for global control field migration. Signed-off-by: Pavel Dovgalyuk Message-id: 164422345976.2186660.1104517592452494510.stgit@pasha-ThinkPad-X280 Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/a9gtimer.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c index 7233068a37f..5e959b6d09f 100644 --- a/hw/timer/a9gtimer.c +++ b/hw/timer/a9gtimer.c @@ -318,6 +318,12 @@ static void a9_gtimer_realize(DeviceState *dev, Error **errp) } } +static bool vmstate_a9_gtimer_control_needed(void *opaque) +{ + A9GTimerState *s = opaque; + return s->control != 0; +} + static const VMStateDescription vmstate_a9_gtimer_per_cpu = { .name = "arm.cortex-a9-global-timer.percpu", .version_id = 1, @@ -331,6 +337,17 @@ static const VMStateDescription vmstate_a9_gtimer_per_cpu = { } }; +static const VMStateDescription vmstate_a9_gtimer_control = { + .name = "arm.cortex-a9-global-timer.control", + .version_id = 1, + .minimum_version_id = 1, + .needed = vmstate_a9_gtimer_control_needed, + .fields = (VMStateField[]) { + VMSTATE_UINT32(control, A9GTimerState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_a9_gtimer = { .name = "arm.cortex-a9-global-timer", .version_id = 1, @@ -344,6 +361,10 @@ static const VMStateDescription vmstate_a9_gtimer = { 1, vmstate_a9_gtimer_per_cpu, A9GTimerPerCPU), VMSTATE_END_OF_LIST() + }, + .subsections = (const VMStateDescription*[]) { + &vmstate_a9_gtimer_control, + NULL } }; From patchwork Mon Feb 21 09:27:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544431 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3118086imn; Mon, 21 Feb 2022 02:09:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwo9f6m7nL+2QG0hIPG79TtIvwsZVpfd73Q6mXgIxrvdrX52m7QfmAylvqUou5HDpxmleYz X-Received: by 2002:a0c:8051:0:b0:42d:ef02:183c with SMTP id 75-20020a0c8051000000b0042def02183cmr14787823qva.28.1645438156867; Mon, 21 Feb 2022 02:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645438156; cv=none; d=google.com; s=arc-20160816; b=rPrXnpRB3J4HF3wInM5jwUdKfpiEYEkDo8FQKr3voNBx2G0ts2JY0z6W8VoE+OKrxI qedk1mvHiFZ3i0dcHFQKsZRl9J+U5TosHJJjNFLBSLhdd6X4OASU22DUNz8Q9sdK+qnM jpl4aqsoLoxKzBSsgXqb19SJNUvWh0TLWzVDe0G7sli0iciY3OixCnCATd0CBabLxFcF LsXJrfxOlvy1/2rP12dvOHEDJvxkVe2z39uQznuhMRjav80UzBC3E9PAyQIikWcWpZKu /jXzwM5KbdOWiRHnFWDPn7Mx8VZdhvOBiqCRnEGAnCAAOiTxGQZSOEOq5n+NS6EiKJPT 4efg== 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:to:from :dkim-signature; bh=NofIEc0Y2hiRFl6rcfetddRUollXOWZIliDCYgCWghU=; b=qXLCmk6j3/VoeydImtKoQ5V5dflfb1F49HL4HAlLnjxxZt+RlN6iU2Bf9Ww0m7ppYZ Ub5pt9yYyKH1z56VCldDF7ZPwwXH5zJG5NZFxOzTFduO8x67UqwZQY2A8SzXxYXnB3y/ aUAPE/RGCissa2dAA5K+1C0LFhar+59Z8GvFva5rcZOCZ+W7RasxSnTpXYCivFDQUQKY MLgpjJjAtwEbTtL2QH9xjRWD1+1c9QnMi28xj7qvu5TqyWH3Z9lj/yiZ1A7yrfd4wuG3 rOAYU1kwqABMfQC9eEspW6gAZkPnCgx90cJ868yiFbU0VnMDklR4wAWF5y2GOI71R/vY zFnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TQ5e8hjG; 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 ey15si8957213qvb.317.2022.02.21.02.09.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 02:09:16 -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=TQ5e8hjG; 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]:52142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5d6-0004uz-G0 for patch@linaro.org; Mon, 21 Feb 2022 05:09:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zo-0000Du-Dv for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:43 -0500 Received: from [2a00:1450:4864:20::42a] (port=38508 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013R-7m for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:37 -0500 Received: by mail-wr1-x42a.google.com with SMTP id d27so25926427wrb.5 for ; Mon, 21 Feb 2022 01:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NofIEc0Y2hiRFl6rcfetddRUollXOWZIliDCYgCWghU=; b=TQ5e8hjGjYN+a3CxhQVMevyBZUQ2jJSjexn9ArTPLrFlvMrP7vpow94Ln6AWJnupDZ CU4YWi/5fMoFORPL8sSt8sV1t5+aqUBWNFL8vhyv7+S3cYzk+wJGdDHa1abModGhQmvR t7y4DbQu4E+1x5x9m8SnawB2takGC8SEEO8eYQ/HxrKiwLj1Pbd5g//am+LCzXK1alyt R71n3fknwa0nWdwu3KrkmlceOfBbO0IlMXVFvOyeevTSRAsl3rOJ2nIsmFjullaAD5tp 1umTr94yG5rHdHsE1qCg3bTmtNXH2rbbk6raBXtw2/VLsnOv/N8dACSfVMrbN+8HKtY6 8H9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NofIEc0Y2hiRFl6rcfetddRUollXOWZIliDCYgCWghU=; b=GEkiPBiIdTcxT3L7qSW5LyYv4Lv4qKLEChRl2AumJVZgwuqZDKO4ogJBLc0JdqoX1L o5f0eYJtPAzRysiQ04GMcrslTB5SneX4L9dHjzEHtlVKOl+5IqKw0raai6ZRIh6+Wp7z ZBlfRD2cL3OVdGe9YZsAysBSfuIB8FIkdjSCEcq2k6qX6dLjAhlnL5UmktTbdMi3+5y6 bLY/c/91NcIko7zTlZCquI5EAwynCozKgPRxc4rfZDhOIzXh78N8Np0v1pA9R1rUwZSW p1GoObZbIv+J3scKxwYg+IkiW6C6h3sLSBMxoUNk6qyVzBuIkGNy8Yb22LKMBhscdMu/ 70xQ== X-Gm-Message-State: AOAM533V5yf8NeM7+gb0d9kuNdM9qsiKulU2M+2G8JDdIeA6+uW/icaW EYlnDupA1YdHghZRwb9s2oZaV7T8JKkmyA== X-Received: by 2002:a5d:65c4:0:b0:1e3:ed0:a6df with SMTP id e4-20020a5d65c4000000b001e30ed0a6dfmr14808103wrw.3.1645435700953; Mon, 21 Feb 2022 01:28:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/26] hw/arm: add initial mori-bmc board Date: Mon, 21 Feb 2022 09:27:57 +0000 Message-Id: <20220221092800.404870-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Patrick Venture This is the BMC attached to the OpenBMC Mori board. Signed-off-by: Patrick Venture Reviewed-by: Chris Rauer Reviewed-by: Ilkyun Choi Message-id: 20220208233104.284425-1-venture@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- docs/system/arm/nuvoton.rst | 1 + hw/arm/npcm7xx_boards.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/docs/system/arm/nuvoton.rst b/docs/system/arm/nuvoton.rst index adf497e6791..ef2792076aa 100644 --- a/docs/system/arm/nuvoton.rst +++ b/docs/system/arm/nuvoton.rst @@ -21,6 +21,7 @@ Hyperscale applications. The following machines are based on this chip : - ``quanta-gbs-bmc`` Quanta GBS server BMC - ``quanta-gsj`` Quanta GSJ server BMC - ``kudo-bmc`` Fii USA Kudo server BMC +- ``mori-bmc`` Fii USA Mori server BMC There are also two more SoCs, NPCM710 and NPCM705, which are single-core variants of NPCM750 and NPCM730, respectively. These are currently not diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index d701e5cc55a..0678a56156f 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -34,6 +34,7 @@ #define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff #define QUANTA_GBS_POWER_ON_STRAPS 0x000017ff #define KUDO_BMC_POWER_ON_STRAPS 0x00001fff +#define MORI_BMC_POWER_ON_STRAPS 0x00001fff static const char npcm7xx_default_bootrom[] = "npcm7xx_bootrom.bin"; @@ -429,6 +430,21 @@ static void kudo_bmc_init(MachineState *machine) npcm7xx_load_kernel(machine, soc); } +static void mori_bmc_init(MachineState *machine) +{ + NPCM7xxState *soc; + + soc = npcm7xx_create_soc(machine, MORI_BMC_POWER_ON_STRAPS); + npcm7xx_connect_dram(soc, machine->ram); + qdev_realize(DEVICE(soc), NULL, &error_fatal); + + npcm7xx_load_bootrom(machine, soc); + npcm7xx_connect_flash(&soc->fiu[1], 0, "mx66u51235f", + drive_get(IF_MTD, 3, 0)); + + npcm7xx_load_kernel(machine, soc); +} + static void npcm7xx_set_soc_type(NPCM7xxMachineClass *nmc, const char *type) { NPCM7xxClass *sc = NPCM7XX_CLASS(object_class_by_name(type)); @@ -501,6 +517,18 @@ static void kudo_bmc_machine_class_init(ObjectClass *oc, void *data) mc->default_ram_size = 1 * GiB; }; +static void mori_bmc_machine_class_init(ObjectClass *oc, void *data) +{ + NPCM7xxMachineClass *nmc = NPCM7XX_MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_CLASS(oc); + + npcm7xx_set_soc_type(nmc, TYPE_NPCM730); + + mc->desc = "Mori BMC (Cortex-A9)"; + mc->init = mori_bmc_init; + mc->default_ram_size = 1 * GiB; +} + static const TypeInfo npcm7xx_machine_types[] = { { .name = TYPE_NPCM7XX_MACHINE, @@ -525,6 +553,10 @@ static const TypeInfo npcm7xx_machine_types[] = { .name = MACHINE_TYPE_NAME("kudo-bmc"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = kudo_bmc_machine_class_init, + }, { + .name = MACHINE_TYPE_NAME("mori-bmc"), + .parent = TYPE_NPCM7XX_MACHINE, + .class_init = mori_bmc_machine_class_init, }, }; From patchwork Mon Feb 21 09:27:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544425 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3111533imn; Mon, 21 Feb 2022 01:59:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJySYJADFXKXnEn8YTKT0TtPtWxcCTJM2wjYiHN8sPAhWX/AeawLZmgOP9ebOFwqZmum14SH X-Received: by 2002:ad4:5742:0:b0:424:5147:3f79 with SMTP id q2-20020ad45742000000b0042451473f79mr14509215qvx.45.1645437555111; Mon, 21 Feb 2022 01:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437555; cv=none; d=google.com; s=arc-20160816; b=aZl6yHlMS8KGSlBGPdwJmbNJVSSFHPsaoz0MPH3mm1EREw/rU65c89OClUGfK2w9IQ 3p7CuONksSx2aVsWtXtSYVvVqKCbXGs8iBz2jH+YBZkZAsk0BaivbuSFitbFTCyHAdUJ aqy9v83L9RNl2cu4JtOKlgrywAsJuuc2JFIOhkHW4EeGQTc39DzJO5pJ/SqVvvx7XGF8 EDsT2ndZQgeQkm+E/Yspb/OlH2foaa38Y38ABVB+wt1RUEBD1YHbVsiz4MQBtyEEdcEe ZNOWJjCJjCgiNkQVzfJnUXGa9RJetXk2jxvLW4lzvyKMRFe/6icnQ50U5YTdakYjFPa3 NcDQ== 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:to:from :dkim-signature; bh=61CEyeaEKqT0X+d8dF55OnjNbWRRBgVyMed22FgL4ns=; b=xT0IxC2rrDEec0RCBL/dN1Uw5abFzD+Qr0u8tKSvVErv9EdgYHhXJfnxhd5K05PtOx EU43u2ZuDCb5mg0hJ3ycjgIHInpriK5NOQy2VhvfLSbgRnBserxzKa1qlTr9OproyNVH OGQdpjNhoatDuGdcKnv0bHxsMNnv5dWYKceZ/y7S3fmL5YJKBHLSVg61SjnG0+YgIWNu 7/zM2puFOKnhM4ECVoBBJHTl64QVlIXQ8x9zG8CjpfzlRQDxMeqYfJm2aEZwmEdRSBxS z11R6HN2W6O2/tGlVe6R4LjezZdBcwNq2bAxe4WNQK2aXAFH/fdxkW96IKFcRVoLZVEj uwZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VJ2Fqpq6; 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 f5si12069701qvd.470.2022.02.21.01.59.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:59:15 -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=VJ2Fqpq6; 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]:34712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5TO-0001Qi-Lq for patch@linaro.org; Mon, 21 Feb 2022 04:59:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zo-0000Dt-Do for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:45 -0500 Received: from [2a00:1450:4864:20::32f] (port=38467 helo=mail-wm1-x32f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013Z-8C for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:37 -0500 Received: by mail-wm1-x32f.google.com with SMTP id k127-20020a1ca185000000b0037bc4be8713so13069668wme.3 for ; Mon, 21 Feb 2022 01:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=61CEyeaEKqT0X+d8dF55OnjNbWRRBgVyMed22FgL4ns=; b=VJ2Fqpq6i2TAtDDhwxGjufmn9e3g6/sg9n+qJUXhOnGF8GZB4rcxaMPU79WLRr4gpa Mm4QKNd1n6xKOpCyjMwDi7Ih6MyXSM0vT1ZMCWCgXWYy/JadqyGOIMp20X04irAhCP5k ZhZ31M+57eInoT8RqBdQt3bSAyDJrlrCGNCfqkHDVisCH4F20xZY1KR/6odY9/GlAEVy 3iH1RtuJfyRxt3KsR6TZlLnnpXSMxsFhLx7I3dzVctSXPX8ySv7cdbWH7AKScETCHCZi xYNliXXDZkfOZ55pZd/nOYI61uEPskovicOpRKoKbMX/dLfD9oKR/HnczuXy0teX3VGL nLWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=61CEyeaEKqT0X+d8dF55OnjNbWRRBgVyMed22FgL4ns=; b=DOncxj0LBmX+DRHfqFvqa8gmxzjC+PHjsh+V5BIAJ8jqQf0EDQsKDJ2mJf1pRqSnWw cbLmt8u1QQUdvOrS/j/sGd4CQx3aUF9FTZ2nyD9BQ1fU/wx/IJwZe59LqJxF079E9rph hNziHN/QyTGQGb1j8CfkwMggsuXgU+UozGpyojiy2D2uuvpXoypzCOXeectIo8FYWLR+ G5xG4z0RiElAxdq0aXwyvHd5Ml1EeTU0brStr7BuX5cEvtD3DDDFnSYu7CJjERg3DO3/ 8W/1F+jN0vziVFy227tjaV8TQbESYjBQ16G6WyzC9qg6Kl+o+qZuMLgYWAzquxIGIegD 9RIA== X-Gm-Message-State: AOAM533XEpG+PRjByKGdChtvBZPwhtpq4eFamquD8UsnjsvKepbc9igM 4qAPWHS3WP6/tQKN/RcMh4NRZ954sZG9wA== X-Received: by 2002:a05:600c:19ce:b0:37c:6fe:68b6 with SMTP id u14-20020a05600c19ce00b0037c06fe68b6mr20062988wmq.90.1645435701706; Mon, 21 Feb 2022 01:28:21 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/26] ui/cocoa: Remove allowedFileTypes restriction in SavePanel Date: Mon, 21 Feb 2022 09:27:58 +0000 Message-Id: <20220221092800.404870-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_SUBJ_WIPE_DEBT=1.004, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Philippe Mathieu-Daudé setAllowedFileTypes is deprecated in macOS 12. Per Akihiko Odaki [*]: An image file, which is being chosen by the panel, can be a raw file and have a variety of file extensions and many are not covered by the provided list (e.g. "udf"). Other platforms like GTK can provide an option to open a file with an extension not listed, but Cocoa can't. It forces the user to rename the file to give an extension in the list. Moreover, Cocoa does not tell which extensions are in the list so the user needs to read the source code, which is pretty bad. Since this code is harming the usability rather than improving it, simply remove the [NSSavePanel allowedFileTypes:] call, fixing: [2789/6622] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ui/cocoa.m:1411:16: error: 'setAllowedFileTypes:' is deprecated: first deprecated in macOS 12.0 - Use -allowedContentTypes instead [-Werror,-Wdeprecated-declarations] [openPanel setAllowedFileTypes: supportedImageFileTypes]; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: property 'allowedFileTypes' is declared deprecated here @property (nullable, copy) NSArray *allowedFileTypes API_DEPRECATED("Use -allowedContentTypes instead", macos(10.3,12.0)); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: 'setAllowedFileTypes:' has been explicitly marked deprecated here FAILED: libcommon.fa.p/ui_cocoa.m.o [*] https://lore.kernel.org/qemu-devel/4dde2e66-63cb-4390-9538-c032310db3e3@gmail.com/ Suggested-by: Akihiko Odaki Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Reviewed-by: Christian Schoenebeck Signed-off-by: Philippe Mathieu-Daudé Message-id: 20220215080307.69550-11-f4bug@amsat.org Reviewed by: Cameron Esfahani Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- ui/cocoa.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index ac18e14ce01..7a1ddd4075f 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -100,7 +100,6 @@ static int gArgc; static char **gArgv; static bool stretch_video; static NSTextField *pauseLabel; -static NSArray * supportedImageFileTypes; static QemuSemaphore display_init_sem; static QemuSemaphore app_started_sem; @@ -1168,10 +1167,6 @@ QemuCocoaView *cocoaView; [pauseLabel setTextColor: [NSColor blackColor]]; [pauseLabel sizeToFit]; - // set the supported image file types that can be opened - supportedImageFileTypes = [NSArray arrayWithObjects: @"img", @"iso", @"dmg", - @"qcow", @"qcow2", @"cloop", @"vmdk", @"cdr", - @"toast", nil]; [self make_about_window]; } return self; @@ -1414,7 +1409,6 @@ QemuCocoaView *cocoaView; openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseFiles: YES]; [openPanel setAllowsMultipleSelection: NO]; - [openPanel setAllowedFileTypes: supportedImageFileTypes]; if([openPanel runModal] == NSModalResponseOK) { NSString * file = [[[openPanel URLs] objectAtIndex: 0] path]; if(file == nil) { From patchwork Mon Feb 21 09:27:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544428 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3114384imn; Mon, 21 Feb 2022 02:03:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxk4b/L58dAWaU4YGWa1F2fdUIXN0+wtWI/LA/x7bmkpRcQHR9qZIucouJcURe1pr9D208 X-Received: by 2002:ac8:5742:0:b0:2cb:96f2:a4da with SMTP id 2-20020ac85742000000b002cb96f2a4damr16796115qtx.634.1645437804417; Mon, 21 Feb 2022 02:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437804; cv=none; d=google.com; s=arc-20160816; b=jaEJ57Zl+kiX+dGxTv29vmpojOjsb/BX5uU44sHKOavi+ErhxRUzfF3QokgkSK1Gly sk7fXYDoVNOPFc4rcuMg5Mxg9jip5DwIhJUxenB5JnbjaUSacf9WGTJpg7kIHMZwnwFN yYWaQR1+VI2iyPyrYg2kDS3+ejf4XANtCYL3e1rHSqSfu7NlpCvrIF/y8AuMG4DUdTAr mk2TtCtwg41/zYKdVDGeB52Uqyn9NVJHIc8Annnv/YtIGsi92XxKn35znuSa1mhJMOph fWdiwQ3r/YJzLCzb+lnKnZrGk99xqgtDb2EWoCdNd0TxdJF62KxK7bUo8rKi/QoOCEji rolA== 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:to:from :dkim-signature; bh=shiikXU0x3kJ4rRPp+Q84tEp6CxEG3V5LoAvTu9ia4Y=; b=TDwFOD8tNA+EnMz40MbwZD6K9tPpLJi3AivIMo4WD4EAGBy2wKWm6BywKKp/Maw73d uCf4jFWIr/zKjRZC6Ogm6rliqWcWJlF2eo1US4x7TufFpidfE9vz2+tR4uiSxVXdTCiq vPWMurqa0E39Lg5UqRSo9v60p9wkIamaN85uk+e+vAhFFPqGS0+QDQXQAXOn2KxeHbiX pZTEGBAy3LCkBXsCRnjvw8nDV4xtyUwkUS+91RriaRSbIH3BQudJlKgdUpO/YT4wl5KS blmXK5mkFqUwy4Bgo7Q6oiYBHo46fNtL0B9FlanfbadDDeCyfVCELFH4wgF2XsHzybkc hJBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ktOsIhpQ; 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 h9si69882qkn.632.2022.02.21.02.03.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 02:03:24 -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=ktOsIhpQ; 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]:41336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5XP-0005wo-VG for patch@linaro.org; Mon, 21 Feb 2022 05:03:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zq-0000ES-Ub for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:47 -0500 Received: from [2a00:1450:4864:20::430] (port=38514 helo=mail-wr1-x430.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013f-9M for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:42 -0500 Received: by mail-wr1-x430.google.com with SMTP id d27so25926572wrb.5 for ; Mon, 21 Feb 2022 01:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=shiikXU0x3kJ4rRPp+Q84tEp6CxEG3V5LoAvTu9ia4Y=; b=ktOsIhpQ4i6S/PqMh8IrilValkUrZX+aTHowsw7YT8FiM5TmmhhlNBJLnQceiuUBJa oA9+6nXp3FvDhHx+vyDw9fPl60jcdXQo/7ZKKpWxrgPR4to6GIbODXN84QGEMZLNoiki l/RLNllRGrX1WVW54/TvbnF4qwoeEiaNErCdXEqYJjNbE7whPiphlMowBhTiJCF3iTdo HRHXxB8KFalU7Z168sbDoYfAzoHgiBBa/iZRQTmtlRHUSEHhJhwLFLtARY/Ko2/Yx7/3 5e/CYCm9D+n0tg2pCPNkI0vYSHPH6w0k6NTpoDzMXvIxWMyx6H/Z7TkS6Qkt8E82dKny o38A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=shiikXU0x3kJ4rRPp+Q84tEp6CxEG3V5LoAvTu9ia4Y=; b=LTIIu3nm3M5uWDvDpfurr4eWw4aAn6cKrrUpihiX9mBLYWpFzPCjPTvT5ey8IsYN47 sorGS3Jy1NICweV6M7WKy0F6EtyBQ7V8cks7/84FI21yyRaS5pK08YFBLWQFTOzDszvk wimg5s6z3Ebgieqt7zyYBx1iQqlTpo5E9/j08f4Sz/qpe4xjaxIROitCWgSHpFr8bEj2 cV2KYrTjwEnCDyHInUj0h6ZpmGlqQvd6v1zNwAwGeu77xmAJ1hjH85Fz/6afm5b3RRcO YeS+c4h2PXRDrItrqKfoTkKkJi8D5Bg9PYbKEmBrBHb8YDXT7tFfWJr9a/llSkw4nJoc CvAA== X-Gm-Message-State: AOAM532GLiGD0+qC4tz7lfA5FMvHs+P3aj+noyAYvZSj/nQ4ewjqPAnd 8fCOVNJQFcb/sggCSPOTI0kQIXpt/qkEVw== X-Received: by 2002:a05:6000:18ad:b0:1e8:cbe1:afd with SMTP id b13-20020a05600018ad00b001e8cbe10afdmr14676674wri.352.1645435702404; Mon, 21 Feb 2022 01:28:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/26] ui/cocoa: Do not alert even without block devices Date: Mon, 21 Feb 2022 09:27:59 +0000 Message-Id: <20220221092800.404870-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::430 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Akihiko Odaki Signed-off-by: Akihiko Odaki Message-id: 20220215080307.69550-13-f4bug@amsat.org Message-Id: <20220213021418.2155-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- ui/cocoa.m | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 7a1ddd4075f..f585a5c177d 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1709,11 +1709,6 @@ static void addRemovableDevicesMenuItems(void) currentDevice = qmp_query_block(NULL); pointerToFree = currentDevice; - if(currentDevice == NULL) { - NSBeep(); - QEMU_Alert(@"Failed to query for block devices!"); - return; - } menu = [[[NSApp mainMenu] itemWithTitle:@"Machine"] submenu]; From patchwork Mon Feb 21 09:28:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544422 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3109353imn; Mon, 21 Feb 2022 01:54:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFJRNzpJxZ0I9LjV+90f31yXDjYcoda9V1g3iEOB+A+RZBQOmM18XN9PkP0TDXgKSogK4t X-Received: by 2002:ad4:42d1:0:b0:42c:41b2:255a with SMTP id f17-20020ad442d1000000b0042c41b2255amr14606749qvr.55.1645437272042; Mon, 21 Feb 2022 01:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437272; cv=none; d=google.com; s=arc-20160816; b=K1c+3vX1JIa2Ubp2vazIBAQEygol6IF8V47UMg6kGNj6/R3fVrY67NTKQRH/+3PN7i 7LNatFuqsJaA8rTmueGv0QkhyuGHTfquJzlmMADI1pby5+vhvovM9F+1HmVUbyn71CTb W5/gokpeEWxfxK1wKM/odHz5DVt89armA4rfH2DAIxJqhPG80lgCGDHV0EoMQxwEOLWc sFqWwPISaVPLWiXChNndvnzxupwH64oxsZ3PEFX3pJdZmXFuM06a5mUAE5MHbpcV2blf WQ23itplP7kBbX05Ps81qOvwTK6cl1Wq39IekwSbf8qikzAeFnGAmHven6naYnMOyT5v R3DA== 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:to:from :dkim-signature; bh=hGBHyIm/ItY31LIZrGmDJbF5fU6iafmLA90Y6AKoCU4=; b=z8aaltarL6v87DdM/nDHn86K3PWkxlJR+IDBxq726PwoAx0OT6DMswqUIPFbaw+aLL Sijeav+CCW5Kguhn3N8jQzkk2M2XG/d1kJiokq7Ecw7RHOmeObxQ7RzQm06m7iaHCYTX x77IRJlwRnJv86okFMsvYmgrNDkx2H6B77pIr8R7GjwfjMWG8LpI3PyROfy9dyCQIRuu lTR0cxQIEYlghWmohDZg7yWMn3OXvCeskvPqU+E5dc/2vPF9uSRxZ7x5l9CcIoFDXfTv n+7PwIuWvfSuP/jYW1aFgBtLgjdVC2EijRAjCDaHzDtYL5SIZZ4ZSumiJN+0D31CgRSL Ojbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tmmD1k++; 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 m6si14454203qtk.177.2022.02.21.01.54.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:54:32 -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=tmmD1k++; 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]:54352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Op-00042o-Ki for patch@linaro.org; Mon, 21 Feb 2022 04:54:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zo-0000Dw-Ey for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:43 -0500 Received: from [2a00:1450:4864:20::432] (port=42610 helo=mail-wr1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013p-7c for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:36 -0500 Received: by mail-wr1-x432.google.com with SMTP id h6so25879614wrb.9 for ; Mon, 21 Feb 2022 01:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=hGBHyIm/ItY31LIZrGmDJbF5fU6iafmLA90Y6AKoCU4=; b=tmmD1k++Yf9uqY7ElITtBruD7iSNu6r8eLI72rujHqpX0id05bQKxA6tlDD3v3kknI Bnu8DU8s3PP9k8BVjvaNQMUTqZAyxybJ/MVUdB9WQIfvhlmUFcxFd1C1Aw60kz7IRxtV zgIca79GJG6wiWLRr7LZ74ug0HK7KH+BnWy8PKheSsjF0PImsiDoAn3Fwo52CRfPi1zb Uq35HCD98KJDbPappgj/qDrmbrzbU0H8ote/VLee9DVq7srqpXpLKZ73f7bKrrnlqwbZ 5Heeu9l2TdD3wSdD1r4oI6gTHtSAe5IpL5XACFv7KYB7Wo4KYOnSFSJdOBm8b9C3K9hD INNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hGBHyIm/ItY31LIZrGmDJbF5fU6iafmLA90Y6AKoCU4=; b=K71tCrCmp3ipR1jH/L4sUr2GGYxDFndxD3fOf+Z3koxkhBhf2ijQ+KSXODiq/xPzK3 3Gj9h/5B88TN2wJe2mhFYiL8wEAQSddHJmrSptoIv+x4QN4BxVBqxWgl/PHmGLSVACg7 d4VYYynV+XpJXPCsY1a46zzCZoXpJ/pPZx0urgjWJEfwB+qQc2dLRT8QJHYQKtSKS1dn 9x8YSn8H1kfFfmx6EuLaC3YGJyuIOmOX33IPnyqKHgz4BVBhvxysCN7/OG4WkvTR/MAv tTodPIt+LvEuH3b99lwk85KAvhLXRDzYBHLg6FcL9GoV+ZgDHZKN3BHhd/58yDxhGDke X6jg== X-Gm-Message-State: AOAM530om92rJIB8mPIfEwqp38shkVZALYGEo3m99hrehSfsoLjgH7e/ CCgx6KlBfHEFgvZ5iefzg5DFvZ8Ntnl30g== X-Received: by 2002:adf:9f45:0:b0:1e3:20e8:489a with SMTP id f5-20020adf9f45000000b001e320e8489amr14457565wrg.602.1645435703096; Mon, 21 Feb 2022 01:28:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/26] ui/cocoa: Fix the leak of qemu_console_get_label Date: Mon, 21 Feb 2022 09:28:00 +0000 Message-Id: <20220221092800.404870-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::432 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Akihiko Odaki Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-id: 20220215080307.69550-14-f4bug@amsat.org Message-Id: <20220213021329.2066-1-akihiko.odaki@gmail.com> [PMD: Use g_autofree, suggested by Zoltan BALATON] Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- ui/cocoa.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index f585a5c177d..a8f1cdaf926 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1674,7 +1674,9 @@ static void create_initial_menus(void) /* Returns a name for a given console */ static NSString * getConsoleName(QemuConsole * console) { - return [NSString stringWithFormat: @"%s", qemu_console_get_label(console)]; + g_autofree char *label = qemu_console_get_label(console); + + return [NSString stringWithUTF8String:label]; } /* Add an entry to the View menu for each console */