From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167256; cv=none; d=zohomail.com; s=zohoarc; b=Qzd3Z4ih2LRnbMRDT7OV3zKOANgLeowukO+8n54mT6bGV24HNwsv1WG7/9zC8edLa5wZYO7ulMyfunoxWYJstt96liVlX2kiTQ/JkOyhnnQKIuiFLBKXlD5DwtRPmVKWcJkeHeVK7SyPmezgc0rvJiep0CQBjZ+6HJvGMtqMUWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167256; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9RUnT5Ix7DudVKkch5jxVyO4juXX54tuStniLRWABm0=; b=RPf33Ow35KOIMFHN/mwfX8Cw9Kl9NSnaRXi6zv8FEBsDCmlJUT1DZD/3bao4Owdpk4bxIYjpS539A/Q2463dxvuhj02kr+FpfGuB5xMnoplkmtP2lAsAwNPM3UNLwlXwyR2gs95Uqrv5nU79bKgivBGmeAM62FnXsJlyGence7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167256499663.6714226703166; Thu, 8 Oct 2020 07:27:36 -0700 (PDT) Received: from localhost ([::1]:45136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWtL-0005oS-7G for importer@patchew.org; Thu, 08 Oct 2020 10:27:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWrv-0004BD-EH for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:07 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWrr-0005y1-Kr for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:07 -0400 Received: by mail-wr1-x432.google.com with SMTP id n6so6546895wrm.13 for ; Thu, 08 Oct 2020 07:26:02 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:00 -0700 (PDT) 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=9RUnT5Ix7DudVKkch5jxVyO4juXX54tuStniLRWABm0=; b=Vnna0l4au39C+KvMxRPK6rYHXMji8mnakh9bnZWGE5Ce4dhdphB4j+8LiPvAq9PuaN M+SuZ6+7hI3gZiyh3g6ro13Dh5nfZwfzXS0ITuSOtPVqPdFeX3NKsIKiC8DPk5Sjezmb /M25SHHuuppu64cqee08V7BzpFWj7d9jZAJuSgGAe5YP53T3oLR8iJDQnHrZQ+boEKJN Uvjahmmaf476lOCFzkQAqQxSt3ot0ql2XyEp1Fm+3wrHOU1kazLWiY2/oxUzuZ/Legj2 rr954683SC+Oga7vMxx3d6RRG1KKkiwNChtWVJoHkrUuuzNSDi1cWK//4TIj0BCNl7op XQGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9RUnT5Ix7DudVKkch5jxVyO4juXX54tuStniLRWABm0=; b=Puie3PJCGqtNBSibT+rxuNwAz8lUknL06d6MxL73pKjH2j+mNozOdegECuPMV3SaFZ ShBmPqnEjg8n1YR5kL5UCmvvqZzadXpdQaDgdg+3d83YTaWBqgh2QfZlU+OrmnSb60eI sx8BeM/2II0CJhM2gcS6fKpQlS49yqQOMe1AsBqyq7aQa6Jp5zRylXEFC36MTQfvBYSw 724oawwBg67ExEaKtM28I/OwOTEBbQr2X2ryrUpglOsvlHQwbHAiTGkfppQl+pSb3S2B FZNXNBQ85aYCYNJ1Aw7k2DOMr6uygT3w77DJ2AEsfRvbADlJX05PFCWaTpfuiXIMo++w 4vag== X-Gm-Message-State: AOAM530rdq3kStnfdlkLTIWAW0vErgBZmfStVy0rTj1Cmwmtzlt+WL6M YpWnURHU/ZdQGg3t4ELk3fofLERRqdJs8ycp X-Google-Smtp-Source: ABdhPJyl6SrHluJmalYx4QMGHgUqjX9qAApH/jWThyls+ErkEluXi8cqAhjSbz8wYHXn82M/qXQxNA== X-Received: by 2002:adf:e445:: with SMTP id t5mr9271764wrm.387.1602167161584; Thu, 08 Oct 2020 07:26:01 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/12] hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer Date: Thu, 8 Oct 2020 15:25:46 +0100 Message-Id: <20201008142557.9845-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 Fix integer handling issues handling issue reported by Coverity: hw/ssi/npcm7xx_fiu.c: 162 in npcm7xx_fiu_flash_read() >>> CID 1432730: Integer handling issues (NEGATIVE_RETURNS) >>> "npcm7xx_fiu_cs_index(fiu, f)" is passed to a parameter that cann= ot be negative. 162 npcm7xx_fiu_select(fiu, npcm7xx_fiu_cs_index(fiu, f)); hw/ssi/npcm7xx_fiu.c: 221 in npcm7xx_fiu_flash_write() 218 cs_id =3D npcm7xx_fiu_cs_index(fiu, f); 219 trace_npcm7xx_fiu_flash_write(DEVICE(fiu)->canonical_path, cs= _id, addr, 220 size, v); >>> CID 1432729: Integer handling issues (NEGATIVE_RETURNS) >>> "cs_id" is passed to a parameter that cannot be negative. 221 npcm7xx_fiu_select(fiu, cs_id); Since the index of the flash can not be negative, return an unsigned type. Reported-by: Coverity (CID 1432729 & 1432730: NEGATIVE_RETURNS) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Havard Skinnemoen Message-id: 20200919132435.310527-1-f4bug@amsat.org Signed-off-by: Peter Maydell --- hw/ssi/npcm7xx_fiu.c | 12 ++++++------ hw/ssi/trace-events | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ssi/npcm7xx_fiu.c b/hw/ssi/npcm7xx_fiu.c index 104e8f2b963..5040132b074 100644 --- a/hw/ssi/npcm7xx_fiu.c +++ b/hw/ssi/npcm7xx_fiu.c @@ -103,7 +103,8 @@ enum NPCM7xxFIURegister { * Returns the index of flash in the fiu->flash array. This corresponds to= the * chip select ID of the flash. */ -static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, NPCM7xxFIUFlash *fla= sh) +static unsigned npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, + NPCM7xxFIUFlash *flash) { int index =3D flash - fiu->flash; =20 @@ -113,20 +114,19 @@ static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu,= NPCM7xxFIUFlash *flash) } =20 /* Assert the chip select specified in the UMA Control/Status Register. */ -static void npcm7xx_fiu_select(NPCM7xxFIUState *s, int cs_id) +static void npcm7xx_fiu_select(NPCM7xxFIUState *s, unsigned cs_id) { trace_npcm7xx_fiu_select(DEVICE(s)->canonical_path, cs_id); =20 if (cs_id < s->cs_count) { qemu_irq_lower(s->cs_lines[cs_id]); + s->active_cs =3D cs_id; } else { qemu_log_mask(LOG_GUEST_ERROR, "%s: UMA to CS%d; this module has only %d chip selec= ts", DEVICE(s)->canonical_path, cs_id, s->cs_count); - cs_id =3D -1; + s->active_cs =3D -1; } - - s->active_cs =3D cs_id; } =20 /* Deassert the currently active chip select. */ @@ -206,7 +206,7 @@ static void npcm7xx_fiu_flash_write(void *opaque, hwadd= r addr, uint64_t v, NPCM7xxFIUFlash *f =3D opaque; NPCM7xxFIUState *fiu =3D f->fiu; uint32_t dwr_cfg; - int cs_id; + unsigned cs_id; int i; =20 if (fiu->active_cs !=3D -1) { diff --git a/hw/ssi/trace-events b/hw/ssi/trace-events index 2f83ef833fb..612d3d6087a 100644 --- a/hw/ssi/trace-events +++ b/hw/ssi/trace-events @@ -19,4 +19,4 @@ npcm7xx_fiu_deselect(const char *id, int cs) "%s deselect= CS%d" npcm7xx_fiu_ctrl_read(const char *id, uint64_t addr, uint32_t data) "%s of= fset: 0x%04" PRIx64 " value: 0x%08" PRIx32 npcm7xx_fiu_ctrl_write(const char *id, uint64_t addr, uint32_t data) "%s o= ffset: 0x%04" PRIx64 " value: 0x%08" PRIx32 npcm7xx_fiu_flash_read(const char *id, int cs, uint64_t addr, unsigned int= size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%"= PRIx64 -npcm7xx_fiu_flash_write(const char *id, int cs, uint64_t addr, unsigned in= t size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%= " PRIx64 +npcm7xx_fiu_flash_write(const char *id, unsigned cs, uint64_t addr, unsign= ed int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value= : 0x%" PRIx64 --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167396; cv=none; d=zohomail.com; s=zohoarc; b=E+W8O/XtZRmfiQY3PC4dacR29H32E/jQXdT+vYfTUH9qxXx8gCGmAG3svP4wXWQgAuzgymH/ioyhYIL4UcsDQBiRooVlktn7R0RxKioUrKPmy7Gh5e5zRlpcbLyAfBZ/jgn4s4jfFrFZfpsxH8qBxuX4cy/Oi7yq1nbbHFynEK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167396; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=15TOMWdMbV0LEopJFhIt4fA//f4P0yQsJTt3fedk460=; b=Ls6U8qawpTLoO/9ym2LU/VNF8OhKKwavywf6q75ty82Rn4vB0dWDTfOEyEdokH64qpBfX6P67t+QuXQmPCwevJUO1MbpClgxiApaoOWwBIQ/mduunDVyzYb3PShGV/WCHw2gC8BvqRB3LDU7X/N7n8m7ZTpa8d5mPwBT6K3SHKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167395617353.5444345404752; Thu, 8 Oct 2020 07:29:55 -0700 (PDT) Received: from localhost ([::1]:53276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWva-0000mI-Bz for importer@patchew.org; Thu, 08 Oct 2020 10:29:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWrv-0004B2-1I for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:07 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWrs-0005y5-Cf for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:06 -0400 Received: by mail-wr1-x42c.google.com with SMTP id w5so6835368wrp.8 for ; Thu, 08 Oct 2020 07:26:03 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:01 -0700 (PDT) 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=15TOMWdMbV0LEopJFhIt4fA//f4P0yQsJTt3fedk460=; b=vUveLQWW+sygA6daERBU++h/VL1X77e//KmVsbL/lgu3082A7FN1z3G+E2kvnUjD2Z LvT+3s/B60nn1u1rtwm5Mh2KFOd8/0eESGbhN4rr5ibo6IC9C2jIXnlm7yt/n2cHWkBP JXfJtFD+L7wHVPq2q+MVoOtt15SEpzUjXDHJV6dXCMgefmLjCkqJ2wUy36E52dvcIL2u AGKQDHJcGdrDgXraZJpmc3N/JiVH+YkbT0JYAwUd829OCYq0wbUfMSssJQDUqQbGPatv 4MWKdwDCiwO2CzZZj5F6yEozXmKokVRU0dVppa8XCPoa43YTBYQpytlS45Np5O8+q2o0 kwbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=15TOMWdMbV0LEopJFhIt4fA//f4P0yQsJTt3fedk460=; b=n0eJnB1DySZG9ard4pKcl3YN+SZIIM9yG3XmnsTvBHYfq/Qkegm06qN5V/WrJlHFQB QnmVNboz+lNXyZVb7w3usEMNx7eqVos93exbRDi0YZk0qUw6T2NpiCXmz0C+wre1VxIi pht9ehwcc5IC8dh6LMhNoJu3Pra62x9HBtxAQb/5wVQGDBRRUSGAzm8mApm/KLBoHgW+ YjQvK/ueYTzAAiq9nK/nRevMOqRWm47OM3CnWG0RG7k/KwkS6b+iymN4bQelR4apIDoX 1Lbzx62ZuIyq70DGP0khK/6Ttr35yow8eSb90v0o/RM4qaPKH+7vH8SxJupNm1WtJZUk I0lA== X-Gm-Message-State: AOAM530g15e5XLUqchy8Q87ciKsVWFRJSsac0WfF5lgzJYQPUsqOVRR6 LUPZyYgE3meyilOdHRYPvzWeWqScflcTa14X X-Google-Smtp-Source: ABdhPJxD6iyXzxcUFdZj2VTJX3ZpMKIgmx1c4dSGEAEyFPyFsa/CpF5P/oPzCcwjhRJTKkELd4dqNg== X-Received: by 2002:adf:9ec2:: with SMTP id b2mr9798466wrf.107.1602167162690; Thu, 08 Oct 2020 07:26:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/12] hw/arm/fsl-imx25: Fix a typo Date: Thu, 8 Oct 2020 15:25:47 +0100 Message-Id: <20201008142557.9845-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20201002080935.1660005-1-f4bug@amsat.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/arm/fsl-imx25.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 971f35dd161..c1603b2ac21 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -179,7 +179,7 @@ struct FslIMX25State { * 0xBB00_0000 0xBB00_0FFF 4 Kbytes NAND flash main area buffer * 0xBB00_1000 0xBB00_11FF 512 B NAND flash spare area buffer * 0xBB00_1200 0xBB00_1DFF 3 Kbytes Reserved - * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control regisers + * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control registers * 0xBB01_2000 0xBFFF_FFFF 96 Mbytes (minus 8 Kbytes) Reserved * 0xC000_0000 0xFFFF_FFFF 1024 Mbytes Reserved */ --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167255; cv=none; d=zohomail.com; s=zohoarc; b=C2C0YEXlo3keN2s742MQ51d4AAkx1ONZE/hnE7HcyH5PL7YhWsNQojHs4+AszXX92kHg3i+7QdsGIqwcSHcnyHDIYKUvp8UTXW8u/f+DqtJrXZTIK3ta0rfRNedG14X/SlUmFhz0eaCq6logVQZcU+okBX1E8YBw/YKTAhU6YBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167255; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TbWCRJ0BVkq6j07LdMSc/WFxA1HsyjcaL+7Jf66AQ7w=; b=PlVg22mBhpHJGnhTRlVU/u/BMpchXZY28rW9ata8uBXOSrsXo5Usi9loSUQ/O74OLWq6Ep1OLuODVHN1cRSoDhxmJ51cH7sbfsbmilHPGwWJx0NABdGjYzjIXCF+z1v/5bf66npy26K6ZMHZooxAA7VZ6SXy5lLbj+0xnPGGztk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167255464412.66202225315214; Thu, 8 Oct 2020 07:27:35 -0700 (PDT) Received: from localhost ([::1]:45018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWtJ-0005lY-SY for importer@patchew.org; Thu, 08 Oct 2020 10:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWrw-0004BJ-SB for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:08 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWrt-0005yA-Gu for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:08 -0400 Received: by mail-wr1-x444.google.com with SMTP id i1so721129wro.1 for ; Thu, 08 Oct 2020 07:26:05 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:03 -0700 (PDT) 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=TbWCRJ0BVkq6j07LdMSc/WFxA1HsyjcaL+7Jf66AQ7w=; b=YDQ3vaem4ICMjOVnbiqey4nL89QKVk13emEsRvcQQm/ut4obgmVAuMCOjHwq1NI3e+ SmCjxybbevPAq2Z6+xNMXeeAt4xoAjb9Z4yfHnyrpu0KUdI1vpNKG/dE+H8sChe6wijY gqzP4idO++OcAa9++aEvDKOzywADrwIqWW7sX4nGfVPcu7uff7GkcL7L4TmOtsaBVNzB 4F94I7G2UWmqJFDCI8AjzJYi9L9yZyGL1hPOgjAZ2WYoI7I8l7yTs/9O+zc+ZQMdTnFV 9ftkFj2pG/6tYCZga5VRufxr+pnpayVEBpzB68wOfCM6t0cyBkGFpvITm4UNGamveilr CN2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TbWCRJ0BVkq6j07LdMSc/WFxA1HsyjcaL+7Jf66AQ7w=; b=Ypiq6poSzQ/ikdJortlPanPjBwJrot5/iLiP4SWio4Whw1Aw+2l4qLNlYxagebkFfi 5Cd9ZT3WhVuv1HlmsRRQMORdIAvVjyTpvbuEgNW2XLn4qRHy1FRy9BvFyiVcZNkuCjbL AxteSCRrUHXPniIdD5FS7htQkSjgTBCqaULRIpCP3ztswU/fkC0RANnK3x6k8rHQcSk6 h9cJ1WcPC++tYGBCIVxW0xhHuoPAPezHj2niX2RbO7JwI96k5DnCDlf2kkO0EixeKVnU WyrbSeo7380HhlcJKV0nQD+uj0uKECzKSGmdNzf8UyLuPdqKnUD2Qy045rETmBooemlJ W+WA== X-Gm-Message-State: AOAM532lHA205mHv7qXvfUzR3AfgRa8YPZ4GKmjxrAC4my8TXn1lzR2p mHfx7UqGjYRBjVW1L+G2yWSPQxnckBFUFxcS X-Google-Smtp-Source: ABdhPJzLE6wM4Bw79RbfLk7iclCb7xJ+uXH8Y0xvdosuzPhItjg0aaAJhBhNaYkRzOihfCpYBWEUnQ== X-Received: by 2002:a5d:4c52:: with SMTP id n18mr9396386wrt.267.1602167163710; Thu, 08 Oct 2020 07:26:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/12] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation Date: Thu, 8 Oct 2020 15:25:48 +0100 Message-Id: <20201008142557.9845-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Graeme Gregory SMMUv3 has an error in a previous patch where an i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance. Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the ma= chine state") Signed-off-by: Graeme Gregory Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Message-id: 20201007100732.4103790-2-graeme@nuviainc.com Signed-off-by: Peter Maydell --- hw/arm/sbsa-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 9c3a893bedf..65e64883b51 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -525,7 +525,7 @@ static void create_smmu(const SBSAMachineState *sms, PC= IBus *bus) sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); for (i =3D 0; i < NUM_SMMU_IRQS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, - qdev_get_gpio_in(sms->gic, irq + 1)); + qdev_get_gpio_in(sms->gic, irq + i)); } } =20 --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167609; cv=none; d=zohomail.com; s=zohoarc; b=lhIorNSgUITY+o4KuQ8cTIAFtPxnnYF7GSZNVnAl12quhP2+b0Hysn05G+f0zYUj/yKgRfsSzLhugkqvyQd8DwTsmLpY+TrVw5DTbwkPff6VVD4RUEIoBz2vyis9axB2IL0PkHpXGJcgOQjIaZE2VkunhnZlWjaBcHURoznRou4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167609; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kVcdD0KzUJAO3jRrFwWmt99n+ZYoK7ZLoVAUEZINIj4=; b=Hq6PlqA8rFZAWQMQt7UDaIf24ZDtAWv+vcdlpB4kcCUqh4SWr+9gAiRhc3rvG21YSx29A1dyNcnvRvkafefmvdwbzs8CDZtSl2Do6o4Yq4w8Ic3DBwJG0hdjvL89X2fNaPjTvVlKV/har0D3JNblLNMmARqk2d/DxuUnMmZ/Mq8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167609218954.7974888844291; Thu, 8 Oct 2020 07:33:29 -0700 (PDT) Received: from localhost ([::1]:32944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWyz-0004BN-Ge for importer@patchew.org; Thu, 08 Oct 2020 10:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWrx-0004Bi-O3 for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:09 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:39923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWru-0005yQ-GC for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:09 -0400 Received: by mail-wm1-x333.google.com with SMTP id d3so6722620wma.4 for ; Thu, 08 Oct 2020 07:26:05 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:04 -0700 (PDT) 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=kVcdD0KzUJAO3jRrFwWmt99n+ZYoK7ZLoVAUEZINIj4=; b=kCT2ewGmGfgub88ar9ltrPiiRo6Jzw4UK4iAJ/zLevuIOlw2RxB7pif8xQt1LUMWho YUJ1CY+zriqUVq3z90Ez31xW/VUhhGShgM0fY37sYiZCJxaSMJ7bXzr8U3QrTaYt3Dqv djob/hd4fBZxjKuMI1gYza7Hvjw8+EzuBmQG2ANlU0HWnPk0RRSys+MWp3UnbbD/CdtY 36gof5AW2ZfG7Afv3ldZaYAeflwZ5t2LidDu4NzuavB08l/tnJHbZYLhB4wig9Ju9Dj6 gcTNVj+tng8hu2Rfr6tJO+s88uEuvxu0uiJKyQ4ecq7rkrLUwaKylnz7r91vMgiZzBJb SMpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kVcdD0KzUJAO3jRrFwWmt99n+ZYoK7ZLoVAUEZINIj4=; b=bOTZ6NIwdEqnpIykDeeZhYHU+OGVgMRYPKfa49OtQfTQg50Q/EHEoY7oG5pwUKH5TS yXpzYlEh02TS27M3QkLdlmEUoc1Ex/T9Tm/gJRuTsflLYJQWR6ziGeWD4SVVXkhaCCxf VhVMYhGCrBF1W96um0eVqKBmnWs1PvuGoK9OVWRecgksLI/70evzSHEnIyJjKJrcTWNy zs+F1djv+W1wznk5VTqR8J7rngoaQibqMGrBMBR1ajxENKAmkbF0Ds+KfSzYzJvlF/fu ZpndHv25pRw5HWb63NH6Yk2BHyyftGBDrcB+jdjtAP0eCC0xqdM7KASPAwnErd4rIvFP FFhw== X-Gm-Message-State: AOAM531ZZMMPa2F31bWluyqS2rXsoJV1Llpr617Es8WgHOe6HX3wB/fr S2gHEX/VoUxPq6tkD4ayBLUS1lSbjlmlEKtT X-Google-Smtp-Source: ABdhPJwUKmppUgRKJTfm0XMn2McqTBLyIhTFTmjzmnJLZEXhdygTJ+XqhDRngYysXjoOh/+e28SmIQ== X-Received: by 2002:a1c:1bd1:: with SMTP id b200mr9521154wmb.171.1602167164754; Thu, 08 Oct 2020 07:26:04 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/12] hw/arm/sbsa-ref : allocate IRQs for SMMUv3 Date: Thu, 8 Oct 2020 15:25:49 +0100 Message-Id: <20201008142557.9845-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Graeme Gregory Original commit did not allocate IRQs for the SMMUv3 in the irqmap effectively using irq 0->3 (shared with other devices). Assuming original intent was to allocate unique IRQs then add an allocation to the irqmap. Fixes: e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Graeme Gregory Reviewed-by: Eric Auger Message-id: 20201007100732.4103790-3-graeme@nuviainc.com Signed-off-by: Peter Maydell --- hw/arm/sbsa-ref.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 65e64883b51..01863510d0f 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -133,6 +133,7 @@ static const int sbsa_ref_irqmap[] =3D { [SBSA_SECURE_UART_MM] =3D 9, [SBSA_AHCI] =3D 10, [SBSA_EHCI] =3D 11, + [SBSA_SMMU] =3D 12, /* ... to 15 */ }; =20 static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167887; cv=none; d=zohomail.com; s=zohoarc; b=XknLcYOVe3cne8AWVsmsN4TMaARcExAqy7iY2Pvii6fquCivVJeidNujl+/EvS1e8j1dd0eNQibLAqnPWhy2m1/T4bsQJ1jKfkPVcKhwCqLUiWyBH1cKYZsCXJmLiMbyuncyhOEm2m8r+tJ3XE5qzI9rxidIeqanHGEe5OUq7Bc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167887; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+vfXC1GgsBMwnsH6E6kbQ/y0jQGmL+x6ugfMXRWI8gA=; b=iAWz0vo5CjtuIuFV5eAl+xuLIhjnglGTagpKCUTvO5kSpMqHwLrZoFlGvpjcQXABSaefrN5W6PkmwUkDUGM9A212RF393jEYFDXZtGcyeomAdswB//H6+3KxrnwtWkI9EZecNxM+Cwh3A2jFgLPAVawhlgGtaJRcP9XEbKl7KkM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167887023711.522082434737; Thu, 8 Oct 2020 07:38:07 -0700 (PDT) Received: from localhost ([::1]:44574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQX3V-0000kk-CO for importer@patchew.org; Thu, 08 Oct 2020 10:38:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs0-0004IR-Hg for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:12 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWry-0005zD-J3 for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:12 -0400 Received: by mail-wm1-x32c.google.com with SMTP id d3so6722834wma.4 for ; Thu, 08 Oct 2020 07:26:10 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:05 -0700 (PDT) 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=+vfXC1GgsBMwnsH6E6kbQ/y0jQGmL+x6ugfMXRWI8gA=; b=EeIebk0dG75HOMschTihPaxztknWltWItiQQn4qMVGL2jTkeZRP8lsW3f6Y/Bh9RUB Fz9w2G5VfFR2tIgeGSk4IuXabcnHH3fZw00FKRDBmFBJrWobfV0A0/WCGFxE19HItCfj IWDMTNm0PkiXnIUEoDhogduw0/SB/QJkSVfPLft8saBXIpZna+rDonNB4QZ41rfmQbK+ j3hcAwxmHEzuflG5owxt6VijsatpqDa1Fpy8BK2u3Nt6YS+g4YDBZWyKLxXlk+m4whdp fQklEYWwVFVlcy0m9kCSMtvoXl5v5fkfvVHtV6rg0VPJ4emLxkxbhbi5w3+uUt+g558L wqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+vfXC1GgsBMwnsH6E6kbQ/y0jQGmL+x6ugfMXRWI8gA=; b=r/MXRTVLUJXsm6TEobfj6R2OPXKWhClY0DlQte1X4EeGuGM5Zd7nVmYv1jCreiTiXI vVeEuWP91WBcCAXpA6gjgOjP6qGaWLNbp7biJVpVQ9tjOssDtJ6Q6whSM4hrLq0qW8Lj 9oEGcFQeQoKVbnPd6NI8SsHxialJEz7ebn4XGUdrRbll87JLGwJ4118F2PDnjqbZOshX NHEWys8TvwzfVh0f2lydvuLujJaQDzP8M/WbUPxWotrajRcgaX9GaQ/mBDT86CbNJiUn aOx76bV4DtFTIb5X3860k4uitUyg74tOhROoNzDtVXDYuXNSPMsaMR6B/99G3/LSWV2b lo2Q== X-Gm-Message-State: AOAM533QWUOUsPi7ykyoC6dlfSqidGySdPgxmKcgoqiUyr2Xw/NjedFt yicjLL5o2mzSLILbQfE0an91qYinRthBrHCz X-Google-Smtp-Source: ABdhPJyK3t04ARNtSEnUNnaIJAZviTAhbH71ZdU1X9AJCe3cdYDyAwfGboYMZg1/qo21+9ekKtXD+A== X-Received: by 2002:a1c:ed05:: with SMTP id l5mr9154961wmh.106.1602167165781; Thu, 08 Oct 2020 07:26:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/12] hw/char/bcm2835_aux: Allow less than 32-bit accesses Date: Thu, 8 Oct 2020 15:25:50 +0100 Message-Id: <20201008142557.9845-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 The "BCM2835 ARM Peripherals" datasheet [*] chapter 2 ("Auxiliaries: UART1 & SPI1, SPI2"), list the register sizes as 3/8/16/32 bits. We assume this means this peripheral allows 8-bit accesses. This was not an issue until commit 5d971f9e67 which reverted ("memory: accept mismatching sizes in memory_region_access_valid"). The model is implemented as 32-bit accesses (see commit 97398d900c, all registers are 32-bit) so replace MemoryRegionOps.valid as MemoryRegionOps.impl, and re-introduce MemoryRegionOps.valid with a 8/32-bit range. [*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals= .pdf Fixes: 97398d900c ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) b= lock") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20201002181032.1899463-1-f4bug@amsat.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/char/bcm2835_aux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c index ee3dd40e3c7..dade2ab5fd5 100644 --- a/hw/char/bcm2835_aux.c +++ b/hw/char/bcm2835_aux.c @@ -249,7 +249,9 @@ static const MemoryRegionOps bcm2835_aux_ops =3D { .read =3D bcm2835_aux_read, .write =3D bcm2835_aux_write, .endianness =3D DEVICE_NATIVE_ENDIAN, - .valid.min_access_size =3D 4, + .impl.min_access_size =3D 4, + .impl.max_access_size =3D 4, + .valid.min_access_size =3D 1, .valid.max_access_size =3D 4, }; =20 --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167762; cv=none; d=zohomail.com; s=zohoarc; b=bb8TYRXBlp2qFewTS+jav/tdZMhsEVxCZNLgKAE74LtYbDFg5gT8mcp+CYQcB3eH3N/amENvw5GrnpI09reRUBfIrGVydVsAZeLxGn79RZ22RGO2BJyC/FrvlttCRchrpFapT4YN8chXANJ0okiTKjR7QLRZrNq1a0LDqfAfsow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167762; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Cib7h5O8hVbj+spr2llldc/VxswC85k/oqNZL/L3+bw=; b=iMqrXGCgUW/+dbmLLZZFw0TAZpP8EwZiCG256TWPF9CjsKDOevaFBH+cTfGIQlrzxlGAlt3p0PmIBot9ZnIO87R41ZtCnJCHw8wBUgfMri/JJ+PD9YJDrSV6cOJP6HJe0N0wvRMPno5Woj17FU0Hbhycve6XjvxPB7h7NaSaiO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167762669581.0811618721654; Thu, 8 Oct 2020 07:36:02 -0700 (PDT) Received: from localhost ([::1]:40014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQX1V-0007Cs-G6 for importer@patchew.org; Thu, 08 Oct 2020 10:36:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWry-0004CK-7P for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:10 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:55618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWrw-0005yj-Gz for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:09 -0400 Received: by mail-wm1-x336.google.com with SMTP id d4so6649573wmd.5 for ; Thu, 08 Oct 2020 07:26:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:06 -0700 (PDT) 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=Cib7h5O8hVbj+spr2llldc/VxswC85k/oqNZL/L3+bw=; b=wuqsaS5Og1u/eW9LszG31h+NHB5rtFm1sm747FDgLlMdpXRhlGKbtkbcPH5f/QrbOb 3KEc+hFhfcywF7+FjmcYoSzadN21ECEv5oPLK3g4EAiN74CK16DnuRHNMGrYr/vT+4a7 yvs20zt+4DanpJVR8vLDPcOzSj0kFBkRCjs97lblwkGSnw1+liv8vMc8TuYxIlL14z+9 EIy4wBLMRKakzSOFEtwzO14Umio0RF4ZAauzSld8y7kf5/fNkyZ2qg1OS61Kvd37OmWa gjYu+hJXGI7cQ7aMJNWp8Ffl7avKWSduil6wBWjSP5/25/uuSZR19sYTMd6YMV3yHLZT mDbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cib7h5O8hVbj+spr2llldc/VxswC85k/oqNZL/L3+bw=; b=c/OWRPOWe5p9owCdaqTePKJ9SK5NxtnB+cd3ebUhsZoSjj/Mu02uH2a/cr9qKrP50n h+HFieT1C4UuJSj57HCDvdJZbMJO+g2wxZ9DUZB9ZGR6Zm5WbqT0L8MGju0DIrFKvSOJ 6Ez11YR0UGbr39C4ATv87L8Xzvffl1+micKPZJUlM6JUex0muXQM5ionCW64cYa3c2jG uCwDTM1IxuJeFrN/znrDi9YPzgrZOBhldEGpXkhtscooVAY8mzxxgQtQOo/BMGawlCNN SH2TtDtBtXB2NqI7wlSTb8FHmdolOYlDpA1QV2JxCC23hFbIjWLZZECUF1DbeCMXgxrB LHHg== X-Gm-Message-State: AOAM530KpRBipOJlxpXl3r5TCv3gQRBbJd7sH9ST8AgAwNPygV44rRlk 6LNzVLBrheEp+pLmHYH16symF6hvwQrLdXTH X-Google-Smtp-Source: ABdhPJyaA+NOFA9UvQHBfpBWGYoFUk8Cvi5jc2e9EnVOGjnlRbAsLwovsHDldtd3zLWSDZIf/VqQZw== X-Received: by 2002:a1c:2b05:: with SMTP id r5mr9082696wmr.179.1602167166653; Thu, 08 Oct 2020 07:26:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/12] linux headers: sync to 5.9-rc7 Date: Thu, 8 Oct 2020 15:25:51 +0100 Message-Id: <20201008142557.9845-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones Update against Linux 5.9-rc7. Cc: Paolo Bonzini Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-2-drjones@redhat.com Signed-off-by: Peter Maydell --- linux-headers/linux/kvm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 6683e2e1b0a..43580c767c3 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -790,9 +790,10 @@ struct kvm_ppc_resize_hpt { #define KVM_VM_PPC_HV 1 #define KVM_VM_PPC_PR 2 =20 -/* on MIPS, 0 forces trap & emulate, 1 forces VZ ASE */ -#define KVM_VM_MIPS_TE 0 +/* on MIPS, 0 indicates auto, 1 forces VZ ASE, 2 forces trap & emulate */ +#define KVM_VM_MIPS_AUTO 0 #define KVM_VM_MIPS_VZ 1 +#define KVM_VM_MIPS_TE 2 =20 #define KVM_S390_SIE_PAGE_OFFSET 1 =20 @@ -1035,6 +1036,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_LAST_CPU 184 #define KVM_CAP_SMALLER_MAXPHYADDR 185 #define KVM_CAP_S390_DIAG318 186 +#define KVM_CAP_STEAL_TIME 187 =20 #ifdef KVM_CAP_IRQ_ROUTING =20 --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167400; cv=none; d=zohomail.com; s=zohoarc; b=ZKBDzdj9aTelNFmsv0m5fCIB55ebrc3KnVgnmz//NdO/FLZ+Dk1bnEkKgHQtybFNeHTRduOh6Pmnfqgk+VrvO9N9RLQfb0+ITH16vEVEmR5HRjxDnJkJVgaXuSsvjM30zi4xNlhVm2aLnDKRKamfnk6JMRy/p706wsHPU6ndV8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167400; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PNZt5eZzpygN/NHe9hxZ5YJUWkGZkxNu5QAdM0lAEmk=; b=azwLs1zMIdcPioas0V7m5aVWR9m3Q/a9wSECf9gdIM3L/wXAHR4ane3mrne7E6K1+6qDbvKacxiFxYxnkaqqgnT3niWfixnQ3o/SKMzqj59x4xVnsEm1HvMWzkjNsOyyQxeWPSAzM9+SwKnbJCsdI97sUFylc2mY2OTlnulblI0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167400050110.39002543274626; Thu, 8 Oct 2020 07:30:00 -0700 (PDT) Received: from localhost ([::1]:53574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWvc-0000tb-OJ for importer@patchew.org; Thu, 08 Oct 2020 10:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWrz-0004F8-4M for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:11 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:36075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWrx-0005yu-9A for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:10 -0400 Received: by mail-wr1-x431.google.com with SMTP id z1so6839757wrt.3 for ; Thu, 08 Oct 2020 07:26:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:07 -0700 (PDT) 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=PNZt5eZzpygN/NHe9hxZ5YJUWkGZkxNu5QAdM0lAEmk=; b=Bz7sT2IxENPOnXhADBS8vO95PRsgXG8s2Wmn91ibGAKf4Uy31SR6glksxl9ZKvX4dU GELfriuECpAWudyTRdIE2PYpUzAZoWVUIA+IT9Ed8Hx90rEmDUn/VDm2fNSuc5wKKrMT WKTNFavJaEHu6DunemAqGmvCJy72wSUqN/Qnto6NgELQyFAqA3yCfwJ61ui9xnWppcFK xSiax+Qehli/0OM9HhPN5jjUhGwSBl9cmLBbi9kONHnlqX5BgZUCek5nwRHTvpwINExz E7GerzVss8jKIVCT3L3Q5rpQn4hmi7/jTn4kxt5abz/a/kMzvpFIYHSBPYsKEKD0L4h8 7urg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PNZt5eZzpygN/NHe9hxZ5YJUWkGZkxNu5QAdM0lAEmk=; b=CQjexUlg+s7F4csxI87a50WMjXoe7biFoZYNGsVcnce+kajvEnbXROicyV6RYOp6zZ kP0WvqWOlkldJ7MyARvvGQmoNI/b1KsKgjSosrPT0spMpWe3/R1nHDwLlb3FiG20ineD /HPaYJZHz2BMSat0qxR8rPCI5x9IJY7T+oTrfVtTR7t+KAbkqPZ4X1Pmo7ec5kDYXIxG j/QGL1YIXStflUwgCKuF6U/8FJNgMDCOq6Ab0ZDpW6BY/gfgGwzjICwwzO98GgtPIfMZ HzMHu4PBNsWOQt4ikgI2pMEiAVOG6vW6z+yZ2oBssRkZhowg2c12fNsp6oP5lhuOltlB EmzQ== X-Gm-Message-State: AOAM533Xq2skYvpYBFHHzdpCijrmkCu94FwWuB+/F1tsx8mB6fLadKDx bpQkpydoVs0LTKx+QiYZNzbs8zrZmimdhSkl X-Google-Smtp-Source: ABdhPJzTz4W4vRf0BmDvs2r9WCbTf+uVPH33bkoaSdMCNLr70NWRy1eubSi8UhVeESwzCH7RC1E2mw== X-Received: by 2002:adf:a405:: with SMTP id d5mr3456528wra.421.1602167167647; Thu, 08 Oct 2020 07:26:07 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/12] target/arm/kvm: Make uncalled stubs explicitly unreachable Date: Thu, 8 Oct 2020 15:25:52 +0100 Message-Id: <20201008142557.9845-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones When we compile without KVM support !defined(CONFIG_KVM) we generate stubs for functions that the linker will still encounter. Sometimes these stubs can be executed safely and are placed in paths where they get executed with or without KVM. Other functions should never be called without KVM. Those functions should be guarded by kvm_enabled(), but should also be robust to refactoring mistakes. Putting a g_assert_not_reached() in the function should help. Additionally, the g_assert_not_reached() calls may actually help the linker remove some code. We remove the stubs for kvm_arm_get/put_virtual_time(), as they aren't necessary at all - the only caller is in kvm.c Reviewed-by: Eric Auger Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-3-drjones@redhat.com Signed-off-by: Peter Maydell --- target/arm/kvm_arm.h | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index bc178eeb84c..f513702176a 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -344,18 +344,10 @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, in= t level); =20 #else =20 -static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) -{ - /* - * This should never actually be called in the "not KVM" case, - * but set up the fields to indicate an error anyway. - */ - cpu->kvm_target =3D QEMU_KVM_ARM_TARGET_NONE; - cpu->host_cpu_probe_failed =3D true; -} - -static inline void kvm_arm_add_vcpu_properties(Object *obj) {} - +/* + * It's safe to call these functions without KVM support. + * They should either do nothing or return "not supported". + */ static inline bool kvm_arm_aarch32_supported(void) { return false; @@ -371,23 +363,44 @@ static inline bool kvm_arm_sve_supported(void) return false; } =20 +/* + * These functions should never actually be called without KVM support. + */ +static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) +{ + g_assert_not_reached(); +} + +static inline void kvm_arm_add_vcpu_properties(Object *obj) +{ + g_assert_not_reached(); +} + static inline int kvm_arm_get_max_vm_ipa_size(MachineState *ms) { - return -ENOENT; + g_assert_not_reached(); } =20 static inline int kvm_arm_vgic_probe(void) { - return 0; + g_assert_not_reached(); } =20 -static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) {} -static inline void kvm_arm_pmu_init(CPUState *cs) {} +static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) +{ + g_assert_not_reached(); +} =20 -static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) {} +static inline void kvm_arm_pmu_init(CPUState *cs) +{ + g_assert_not_reached(); +} + +static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) +{ + g_assert_not_reached(); +} =20 -static inline void kvm_arm_get_virtual_time(CPUState *cs) {} -static inline void kvm_arm_put_virtual_time(CPUState *cs) {} #endif =20 static inline const char *gic_class_name(void) --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167399; cv=none; d=zohomail.com; s=zohoarc; b=RJTJxVKoYyToz0Jh2yDfPnBN2LaAk3jwHQiQ14xN0DfHx40N9POIBF1hYqmGq8xBrJhquHech2rDC8TMYwAarBqX6sFVncOuFvIz7YJRURi0bOZTL+hAy/DDyLbpfopIdYt3q1rB6ml94EMmUU8F2UkDL0OQQBd0zuWbgilPBJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167399; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mUWxkTyEIk2JnpjsU6rZN6KvWfmkqRnVuhjHNTzz8/o=; b=j2pNYxD+lz3FE8p+FmbQJcsYU5eh6DRMgY9Jo2PDPKdLl+zWSvALxZnrbZWF0TcBg0y3mDodnkSHfhlCqwNAsAD3mIcddWodE/75KhCHRzM8AqeUSrhSyb4LLDV6F1vFtAR2Gqbl/XmT86PWgVl8VmRyTDahk9qurLinworSsvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167399515695.3578953041452; Thu, 8 Oct 2020 07:29:59 -0700 (PDT) Received: from localhost ([::1]:53386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWvb-0000p7-9X for importer@patchew.org; Thu, 08 Oct 2020 10:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs0-0004HY-5h for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:12 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWry-0005z6-9A for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:11 -0400 Received: by mail-wr1-x432.google.com with SMTP id n6so6547346wrm.13 for ; Thu, 08 Oct 2020 07:26:09 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:07 -0700 (PDT) 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=mUWxkTyEIk2JnpjsU6rZN6KvWfmkqRnVuhjHNTzz8/o=; b=Osvai1zWywsVacRiXBoozskA6yIXXa6/t2kk+5/EudrH7s6RMf7cy94gqsxIGQQxfF F++CJ6AT5gN8fbB5Z1o5R8PGjveoN8Ra1it7w2Z+qRCMpiDtLw0/O0J93ZguqO9c4OXk L0KS9C71objpe+6pf5LdyIsfvcU76uPGrj4LVP1EYhhr+jEPVE8Rt5x4hSbLNfsqN1PI 7M/h7Pt78zxrPKnQT4H6c8XPhH8kuKm0qHoiqpgEDlxlrLlkTneotoyM1wMkMD0B1LnF m5/BIqltJYHg9YY7vpn9x5AyKpwSS79cZAAisAArjRQmn943ZTZGTER6jbUKPAGkcrEi XI6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mUWxkTyEIk2JnpjsU6rZN6KvWfmkqRnVuhjHNTzz8/o=; b=YRMeQoZ3KoI1uWdmg5OSWkLJeBpgbArhMIBPKagUbWNdV/3HVI1Ps4SequI1JJgyJ4 3DrpWKSB6ye2QjUiXHyhBtYGxR/IYVl1ggyHoZANsKUUudLNFT824jowEzyDSxIyBxir XmpMcsJPtnFQCLuZKWVr5/m15EjfljHqlzbVgg7SzqauFTQs5ZwVZRfNsCFMNjJxgQD4 /Xf2ArSNvTfArVpIPtdZV73i5H+6oDFnb54xGr8pKJxl5DPT8pnhRUXLEqUE0U2xmSin TQk1flI6Amf2BDKPGha3m+FzC2ruPXa2V0AD9chbZWWsd1HQnY5lt+4lkBj8cl4cbU4l NbUg== X-Gm-Message-State: AOAM531pxYx9Utn31+XoJHoPBntZJsDnt09E46O/CpVSfE7eWafDer9G /+b2j4Opfs4aeFi6RCFANv4o7+m+MjPR5Utm X-Google-Smtp-Source: ABdhPJx3VhDl4Fw63VIG0fiNgzKwP9fiPyKmvfSiAyVurjGchvFqpmwtnb04ugQQbujx/ailRwmxfQ== X-Received: by 2002:a05:6000:8e:: with SMTP id m14mr9616520wrx.400.1602167168691; Thu, 08 Oct 2020 07:26:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/12] hw/arm/virt: Move post cpu realize check into its own function Date: Thu, 8 Oct 2020 15:25:53 +0100 Message-Id: <20201008142557.9845-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones We'll add more to this new function in coming patches so we also state the gic must be created and call it below create_gic(). No functional change intended. Reviewed-by: Eric Auger Reviewed-by: Peter Maydell Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-4-drjones@redhat.com Signed-off-by: Peter Maydell --- hw/arm/virt.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1231a197c85..524eafe22df 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1672,6 +1672,31 @@ static void finalize_gic_version(VirtMachineState *v= ms) } } =20 +/* + * virt_cpu_post_init() must be called after the CPUs have + * been realized and the GIC has been created. + */ +static void virt_cpu_post_init(VirtMachineState *vms) +{ + bool aarch64; + + aarch64 =3D object_property_get_bool(OBJECT(first_cpu), "aarch64", NUL= L); + + if (!kvm_enabled()) { + if (aarch64 && vms->highmem) { + int requested_pa_size =3D 64 - clz64(vms->highest_gpa); + int pamax =3D arm_pamax(ARM_CPU(first_cpu)); + + if (pamax < requested_pa_size) { + error_report("VCPU supports less PA bits (%d) than " + "requested by the memory map (%d)", + pamax, requested_pa_size); + exit(1); + } + } + } +} + static void machvirt_init(MachineState *machine) { VirtMachineState *vms =3D VIRT_MACHINE(machine); @@ -1886,22 +1911,6 @@ static void machvirt_init(MachineState *machine) fdt_add_timer_nodes(vms); fdt_add_cpu_nodes(vms); =20 - if (!kvm_enabled()) { - ARMCPU *cpu =3D ARM_CPU(first_cpu); - bool aarch64 =3D object_property_get_bool(OBJECT(cpu), "aarch64", = NULL); - - if (aarch64 && vms->highmem) { - int requested_pa_size, pamax =3D arm_pamax(cpu); - - requested_pa_size =3D 64 - clz64(vms->highest_gpa); - if (pamax < requested_pa_size) { - error_report("VCPU supports less PA bits (%d) than request= ed " - "by the memory map (%d)", pamax, requested_pa_= size); - exit(1); - } - } - } - memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base, machine->ram); if (machine->device_memory) { @@ -1913,6 +1922,8 @@ static void machvirt_init(MachineState *machine) =20 create_gic(vms); =20 + virt_cpu_post_init(vms); + fdt_add_pmu_nodes(vms); =20 create_uart(vms, VIRT_UART, sysmem, serial_hd(0)); --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167610; cv=none; d=zohomail.com; s=zohoarc; b=DzgLJyXcjPbsFCMERr0UtxuOAxEFv8v5NygjbLiVjo981M03TjrUNAQUebaZuZ3VYQTDoPDkN6HxHxucvjEZI/Ktwka1p2DHb8bSPI/t0cD0Ht4Ps1M7LpFDKqkN8sIc95q4J0WSCwqEQv3rZCQkGzKw9T6Ky81VNMp2cL2IXbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167610; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fh60qRB84VIWqP7kSGXYTzN89LDnF2hd21jrv979hxw=; b=Nb3Vx4cinJcycKIXY5hZAYraay6TNKaeeApl8o/I9S43TJT50wyun5MXyrW5K/3SahqKplvC9yZSmRE1q7CxYGNBO4kqClT+qBeMaNwig0kVJMY9wl8Hzp2riBUjZUY+AB5XdJU5ryVV8MVFNrK5NJjna5gVDDEdRVrmD7QWJuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167610135545.9849688926234; Thu, 8 Oct 2020 07:33:30 -0700 (PDT) Received: from localhost ([::1]:33214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWz2-0004Hl-Gl for importer@patchew.org; Thu, 08 Oct 2020 10:33:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs2-0004Mp-Q5 for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:14 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWs0-000607-QS for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:14 -0400 Received: by mail-wr1-x443.google.com with SMTP id g12so6831670wrp.10 for ; Thu, 08 Oct 2020 07:26:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:09 -0700 (PDT) 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=fh60qRB84VIWqP7kSGXYTzN89LDnF2hd21jrv979hxw=; b=G2+35uVMZ80Fa0HIA18JxWvgc11idcrouWa5XllisIL/QwxTceDvpEN7a6NbErOiYW 5RBj0x+NtOvlnm/RAP0iP+Xs0VSR91S0QruOwneyvYRq4FQewq+SQIhoS+zVmcx76zjE Rl824uP6xDp2SQkdd2VDmIWU8OGBLMz2QQId12gxeF3lV6MBZaItyIyiZVH+52wPWRlz UG7zI/dDdlrJPZjKOiAaqjxpjcNjPd6nrpSlNkCL3cYbWM+KGYEYRzdU1BhLZZcz7tOG A/j+X8y5u84YTvcwoaXXRooGOLdHlYdZy6XgJJdorTtEBCNoplvtEfc9YDGyPQP8PN8j 9TQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fh60qRB84VIWqP7kSGXYTzN89LDnF2hd21jrv979hxw=; b=qFQelJVxzqwu9vY4V1tza//r920f2R1svwJmRwOItdM8amu7cNtlOrVJcVVvlHC7nL ap6D6Z1mWS7QcrPUNPYXK1SB/WkNmzYZgd/4g/C7ahc3TYt42RSUrqCtrHK1yEDS0QGz rMje7StG3jUNMye0X9hs1D62P+roCAClyAgBqu4NbTA54+vgbybIUa8vDSwRbsLtVJ3h bNAj3Btk7Rj5RzOeJfLKv/m/9YRHXUR1whNQja14oOz0oAn5Idz8XJ2m1J4TPdW2aDww tFF03pNPDBZVg839HyAnen2ryJg8yMuA3KbVWAw/2nLg55DzR5+A7j/yC68Hlu4i+qBJ mFmw== X-Gm-Message-State: AOAM530CHG0uJLVnOA6Vn31Cjfu57yeinarQkyd2hHPYpzL8CSTUsDIw 7NBKDJRwHBzSQWZl/r7zEblA+s74ENNjMGMS X-Google-Smtp-Source: ABdhPJw1+7pe7unFc1Up5Vbk8ujn2WdXRJEz7k35/1W4aASOCxGhY6hieH2JMTezzy5ZOUxV4SMf4g== X-Received: by 2002:adf:91a4:: with SMTP id 33mr10229860wri.170.1602167170351; Thu, 08 Oct 2020 07:26:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/12] hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init Date: Thu, 8 Oct 2020 15:25:54 +0100 Message-Id: <20201008142557.9845-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones Move the KVM PMU setup part of fdt_add_pmu_nodes() to virt_cpu_post_init(), which is a more appropriate location. Now fdt_add_pmu_nodes() is also named more appropriately, because it no longer does anything but fdt node creation. No functional change intended. Reviewed-by: Peter Maydell Reviewed-by: Eric Auger Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-5-drjones@redhat.com Signed-off-by: Peter Maydell --- hw/arm/virt.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 524eafe22df..92ab0fd094d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -521,21 +521,12 @@ static void fdt_add_gic_node(VirtMachineState *vms) =20 static void fdt_add_pmu_nodes(const VirtMachineState *vms) { - CPUState *cpu; - ARMCPU *armcpu; + ARMCPU *armcpu =3D ARM_CPU(first_cpu); uint32_t irqflags =3D GIC_FDT_IRQ_FLAGS_LEVEL_HI; =20 - CPU_FOREACH(cpu) { - armcpu =3D ARM_CPU(cpu); - if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { - return; - } - if (kvm_enabled()) { - if (kvm_irqchip_in_kernel()) { - kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ)); - } - kvm_arm_pmu_init(cpu); - } + if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { + assert(!object_property_get_bool(OBJECT(armcpu), "pmu", NULL)); + return; } =20 if (vms->gic_version =3D=3D VIRT_GIC_VERSION_2) { @@ -544,7 +535,6 @@ static void fdt_add_pmu_nodes(const VirtMachineState *v= ms) (1 << vms->smp_cpus) - 1); } =20 - armcpu =3D ARM_CPU(qemu_get_cpu(0)); qemu_fdt_add_subnode(vms->fdt, "/pmu"); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { const char compat[] =3D "arm,armv8-pmuv3"; @@ -1678,11 +1668,23 @@ static void finalize_gic_version(VirtMachineState *= vms) */ static void virt_cpu_post_init(VirtMachineState *vms) { - bool aarch64; + bool aarch64, pmu; + CPUState *cpu; =20 aarch64 =3D object_property_get_bool(OBJECT(first_cpu), "aarch64", NUL= L); + pmu =3D object_property_get_bool(OBJECT(first_cpu), "pmu", NULL); =20 - if (!kvm_enabled()) { + if (kvm_enabled()) { + CPU_FOREACH(cpu) { + if (pmu) { + assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); + if (kvm_irqchip_in_kernel()) { + kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ)); + } + kvm_arm_pmu_init(cpu); + } + } + } else { if (aarch64 && vms->highmem) { int requested_pa_size =3D 64 - clz64(vms->highest_gpa); int pamax =3D arm_pamax(ARM_CPU(first_cpu)); --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167608; cv=none; d=zohomail.com; s=zohoarc; b=n6LCf9zB/qXNB96d6LFk4pXARqqez4ZSW88fP59HRccHZr3v7rSDOjzyY7srV5t4tW5lKnLylVCyT/RPFl5XREFEX3RuWTu+rjd3Q75lPwWSDYCqhk1JFnjiH4Kwt2TBAtJwwQrDhtxtsqjWitixYVwki84hkd+blbiFqYRA3iE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167608; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zyXdfXYrOKepRXbRJutbH2Bb8nSc3k6lkoxjaH6/PAI=; b=AUa97blf3aLLcR1gY8gx/23Aak6o59omF2SRmrx9fL4pgCE6gbiRSonGetzJ2yDkKFsgdyQTaQTnCnz+Fzb/dmWpIAj/nO2iUoECr4fyrkgwKFNoO2zoS/LkD3LftfTAsEq8ziCnjOOfj/z28x0A+5NtptDBzlftU/xN8kzfjX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167608476141.36443852537332; Thu, 8 Oct 2020 07:33:28 -0700 (PDT) Received: from localhost ([::1]:32996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWz0-0004CY-3k for importer@patchew.org; Thu, 08 Oct 2020 10:33:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs5-0004T1-LP for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:17 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWs1-00060w-RL for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:17 -0400 Received: by mail-wr1-x42f.google.com with SMTP id z1so6840087wrt.3 for ; Thu, 08 Oct 2020 07:26:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:11 -0700 (PDT) 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=zyXdfXYrOKepRXbRJutbH2Bb8nSc3k6lkoxjaH6/PAI=; b=Cl4uMKzaGFnrpiYfC/UTyBoZA+6CV7ILmY5Z4qeuZty6rE9WSYvuVJ0sNvYvvMtGYD QSCNBynfqChBiTFWksGgo7S9YfV0eaA9UyBhdhG/rjUTA0TsPAgzu2MX20veo3fLCvav Jzo2PvVJHMMFL4o7AQInDwGAR2lPIP1/G9oxgRlMSVXT84w0PWsC6WQJVn/Z/3ltxKIr BFRG4esipREp1/2A8+I2yg8Q7O7j2Mc++KEpWuol+qCconzImjijvOeMCLwWKmxFhuEe 8Ig66mdgOnIc7oDEBP9il+vd5s4tJJ59Y2u7iK7yH/qhgqZW5shZu3qiGhwRYfDG6DlY RS/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zyXdfXYrOKepRXbRJutbH2Bb8nSc3k6lkoxjaH6/PAI=; b=cZPt+fIh421fUOUJ+eRpGsN5fa2/Zp3F696A3m7gYW5H0PrYRp8eV64Cnl0aIHZfvi 1XMLUfl773JRjU5ZcEYWqvelfu40n9rHm3uSvhRVZ4ZfRjxTYZiSdhoei7CWtSebnHES qnjQ7iKDwWghwb+EvSijyWa+5BGomR04h6v56zhjuFiLzG/YGJs9Z0sQU7fCFVO3I427 bZLFPRec0AY0VfSoD04Zq1vA8Uq0isA4BLvrE+gaGeRrB9JLV5nBdF5zGQVCSr67eBBq 3nZft3IwopNd+Owcc4ol2vTpmOWUrRq+ZsnxcqSrhqPFNL98Mm/f+DUTpyQc7xQwwTbe 1ZgQ== X-Gm-Message-State: AOAM533ZRcil4JssqWxGSx6a4J7n9pwXJzf5gxyi4IRZGAHBs/8lFJyZ UaodVOoyy7X6FzGxpiEOaoTE1tsN29wy2Eqf X-Google-Smtp-Source: ABdhPJxrF/cUTlDWgwmMxcoR2c2w+OGbRBDoJ74lTO9S8kNvSjWQeLHOqqYBFSw374/Ut4TBc/s3Pg== X-Received: by 2002:a5d:6591:: with SMTP id q17mr9561980wru.173.1602167172215; Thu, 08 Oct 2020 07:26:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/12] tests/qtest: Restore aarch64 arm-cpu-features test Date: Thu, 8 Oct 2020 15:25:55 +0100 Message-Id: <20201008142557.9845-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones arm-cpu-features got dropped from the AArch64 tests during the meson conversion shuffle. Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-6-drjones@redhat.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- tests/qtest/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index ad33ac311d0..0f32ca08950 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -146,7 +146,8 @@ qtests_aarch64 =3D \ (cpu !=3D 'arm' ? ['bios-tables-test'] : []) + = \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-= test'] : []) + \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-= swtpm-test'] : []) + \ - ['numa-test', + ['arm-cpu-features', + 'numa-test', 'boot-serial-test', 'migration-test'] =20 --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167342; cv=none; d=zohomail.com; s=zohoarc; b=bsryYAB5xsyaAF4wE6idf5sL7rqATLtq0kqPZr26dQidYIeGH8BYL3vA4zUdDAzl4t70XFOkWmQEWRAY+QUEqhqc5pnZ5p4VxAJf0PfGUQYWyM8PvzD3SnwqwWF/v049b5j22iQRW0BJLa8/Skljr7QjAuo8vVtkTBXczuUOa9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167342; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KJ/bQldPYsaCR4+FndR920ZofeGys1yXjN1RcJSmlhQ=; b=hTZuMma4eut4HgkX4JZDrYaWWF1yGsZx8siBo60nNhnyxu/zCm25C6A/L/gLO2AVA9/QMOlIkjEkiKmR1f8ww1Op2zMHPdgA93NqdnNp+KQhhlFZ1Mdl0bVAUlYhvc7GhwDyuK8gAd+WSJXkS6m9CeiaSJ/0slGpn697MaOB7cg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167342511166.57930686685847; Thu, 8 Oct 2020 07:29:02 -0700 (PDT) Received: from localhost ([::1]:48992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQWuj-0007PV-5t for importer@patchew.org; Thu, 08 Oct 2020 10:29:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs7-0004Wh-FY for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:19 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:41885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWs3-00061B-NG for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:19 -0400 Received: by mail-wr1-x42d.google.com with SMTP id w5so6836126wrp.8 for ; Thu, 08 Oct 2020 07:26:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:12 -0700 (PDT) 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=KJ/bQldPYsaCR4+FndR920ZofeGys1yXjN1RcJSmlhQ=; b=gtz1avypSEGKTSPp0NcGlCqZNS+G3aIwONL1ReP+Ewl4aTgsVYUVTJMOnKb1TSqRhO W2z21dpkLuIW3aB0vbcQU1dvAcmdOa9WG16pLMs8GpRj+Q77K+ipdWHEZsN0KnPVs0eJ urWBETnCfnUIvDZkcxQilq0WXwbMzPWuno1q6NmvooFz/CswzFCv8zFEAJZW/MR5P6Dd dk7iCESWr1Ng6eKuEQAuwT2/Ct7Bx9bSgfYgthB5v1lLRqzUnJ61Xz5yfm5NTS6yQSwL 7Ua1SjADQMetgHDCfStyskMARdjDduMDFP9nu1Vf9R8SgkNnwwLCfdd2fahS+q6KqaIU x7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KJ/bQldPYsaCR4+FndR920ZofeGys1yXjN1RcJSmlhQ=; b=lUbdai1OdCQD9D+CNTeGLefqVEh32+aSfBmReLevLb+ZHerMFfs0Co+CWBJ2bnwqch ixAvxa/C7OhNNprPblpbfuMbnKXXC9MLipi7RyB44xKxbn6QSeYtXINWM4zRqlFe6s5t 9N731z4CGdpIsmO+C2T0SyYgnUrvDAGNGGoMV/cbl+kxm00d8tNt0LZ1gS6R1pEC/Uxs byq1y1PIZqw1FdzEilfFJITulRSrrJf4DCTtiCRvEhGI7Erta/KPNtcsAm0+fi49ltfy n88fjADT284P2eIBNQFFYgIMLDLK2GPv9KNmlyBCUfBtTlmyDjxPjmg+yPHO934HO0KC 77bw== X-Gm-Message-State: AOAM530oDfUOYIhldhh0dk+L6wkxG9lph6qNaugYqHq7EE7rn0y2eDTh bUOgP8cD2q9xuTSbO01PEZvBewGnwDRm0Yrg X-Google-Smtp-Source: ABdhPJwF7n26oDmmy14syH4JVwxXT0063nF3UHaptmrNtDDRcvCGLCFEGHXdlAQt4MSBc4Lf0BaDhw== X-Received: by 2002:a5d:4709:: with SMTP id y9mr9727806wrq.59.1602167173383; Thu, 08 Oct 2020 07:26:13 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/12] hw/arm/virt: Implement kvm-steal-time Date: Thu, 8 Oct 2020 15:25:56 +0100 Message-Id: <20201008142557.9845-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Andrew Jones We add the kvm-steal-time CPU property and implement it for machvirt. A tiny bit of refactoring was also done to allow pmu and pvtime to use the same vcpu device helper functions. Reviewed-by: Eric Auger Signed-off-by: Andrew Jones Message-id: 20201001061718.101915-7-drjones@redhat.com Signed-off-by: Peter Maydell --- docs/system/arm/cpu-features.rst | 11 ++++++ include/hw/arm/virt.h | 5 +++ target/arm/cpu.h | 4 ++ target/arm/kvm_arm.h | 43 +++++++++++++++++++++ hw/arm/virt.c | 43 +++++++++++++++++++-- target/arm/cpu.c | 8 ++++ target/arm/kvm.c | 16 ++++++++ target/arm/kvm64.c | 64 +++++++++++++++++++++++++++++--- target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 25 +++++++++++-- 10 files changed, 208 insertions(+), 13 deletions(-) diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-feature= s.rst index 2d5c06cd016..35196a6b759 100644 --- a/docs/system/arm/cpu-features.rst +++ b/docs/system/arm/cpu-features.rst @@ -200,6 +200,17 @@ the list of KVM VCPU features and their descriptions. adjustment, also restoring the legacy (pre-5.0) behavior. =20 + kvm-steal-time Since v5.2, kvm-steal-time is enabled by + default when KVM is enabled, the feature is + supported, and the guest is 64-bit. + + When kvm-steal-time is enabled a 64-bit guest + can account for time its CPUs were not running + due to the host not scheduling the corresponding + VCPU threads. The accounting statistics may + influence the guest scheduler behavior and/or be + exposed to the guest userspace. + SVE CPU Properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 655b895d5eb..aad6d698412 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -54,6 +54,9 @@ =20 #define PPI(irq) ((irq) + 16) =20 +/* See Linux kernel arch/arm64/include/asm/pvclock-abi.h */ +#define PVTIME_SIZE_PER_CPU 64 + enum { VIRT_FLASH, VIRT_MEM, @@ -81,6 +84,7 @@ enum { VIRT_PCDIMM_ACPI, VIRT_ACPI_GED, VIRT_NVDIMM_ACPI, + VIRT_PVTIME, VIRT_LOWMEMMAP_LAST, }; =20 @@ -121,6 +125,7 @@ struct VirtMachineClass { bool no_highmem_ecam; bool no_ged; /* Machines < 4.2 has no support for ACPI GED device */ bool kvm_no_adjvtime; + bool no_kvm_steal_time; bool acpi_expose_flash; }; =20 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index e4549a8cc0c..cfff1b5c8fe 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -24,6 +24,7 @@ #include "hw/registerfields.h" #include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "qapi/qapi-types-common.h" =20 /* ARM processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0) @@ -863,6 +864,9 @@ struct ARMCPU { bool kvm_vtime_dirty; uint64_t kvm_vtime; =20 + /* KVM steal time */ + OnOffAuto kvm_steal_time; + /* Uniprocessor system with MP extensions */ bool mp_is_up; =20 diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index f513702176a..eb81b7059eb 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -267,6 +267,24 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); */ void kvm_arm_add_vcpu_properties(Object *obj); =20 +/** + * kvm_arm_steal_time_finalize: + * @cpu: ARMCPU for which to finalize kvm-steal-time + * @errp: Pointer to Error* for error propagation + * + * Validate the kvm-steal-time property selection and set its default + * based on KVM support and guest configuration. + */ +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp); + +/** + * kvm_arm_steal_time_supported: + * + * Returns: true if KVM can enable steal time reporting + * and false otherwise. + */ +bool kvm_arm_steal_time_supported(void); + /** * kvm_arm_aarch32_supported: * @@ -340,6 +358,16 @@ int kvm_arm_vgic_probe(void); =20 void kvm_arm_pmu_set_irq(CPUState *cs, int irq); void kvm_arm_pmu_init(CPUState *cs); + +/** + * kvm_arm_pvtime_init: + * @cs: CPUState + * @ipa: Per-vcpu guest physical base address of the pvtime structures + * + * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa. + */ +void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); + int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); =20 #else @@ -363,6 +391,11 @@ static inline bool kvm_arm_sve_supported(void) return false; } =20 +static inline bool kvm_arm_steal_time_supported(void) +{ + return false; +} + /* * These functions should never actually be called without KVM support. */ @@ -396,6 +429,16 @@ static inline void kvm_arm_pmu_init(CPUState *cs) g_assert_not_reached(); } =20 +static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +{ + g_assert_not_reached(); +} + +static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) +{ + g_assert_not_reached(); +} + static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) { g_assert_not_reached(); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 92ab0fd094d..d5095046315 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -151,6 +151,7 @@ static const MemMapEntry base_memmap[] =3D { [VIRT_PCDIMM_ACPI] =3D { 0x09070000, MEMORY_HOTPLUG_IO_LEN }, [VIRT_ACPI_GED] =3D { 0x09080000, ACPI_GED_EVT_SEL_LEN }, [VIRT_NVDIMM_ACPI] =3D { 0x09090000, NVDIMM_ACPI_IO_LEN}, + [VIRT_PVTIME] =3D { 0x090a0000, 0x00010000 }, [VIRT_MMIO] =3D { 0x0a000000, 0x00000200 }, /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that siz= e */ [VIRT_PLATFORM_BUS] =3D { 0x0c000000, 0x02000000 }, @@ -1666,15 +1667,39 @@ static void finalize_gic_version(VirtMachineState *= vms) * virt_cpu_post_init() must be called after the CPUs have * been realized and the GIC has been created. */ -static void virt_cpu_post_init(VirtMachineState *vms) +static void virt_cpu_post_init(VirtMachineState *vms, int max_cpus, + MemoryRegion *sysmem) { - bool aarch64, pmu; + bool aarch64, pmu, steal_time; CPUState *cpu; =20 aarch64 =3D object_property_get_bool(OBJECT(first_cpu), "aarch64", NUL= L); pmu =3D object_property_get_bool(OBJECT(first_cpu), "pmu", NULL); + steal_time =3D object_property_get_bool(OBJECT(first_cpu), + "kvm-steal-time", NULL); =20 if (kvm_enabled()) { + hwaddr pvtime_reg_base =3D vms->memmap[VIRT_PVTIME].base; + hwaddr pvtime_reg_size =3D vms->memmap[VIRT_PVTIME].size; + + if (steal_time) { + MemoryRegion *pvtime =3D g_new(MemoryRegion, 1); + hwaddr pvtime_size =3D max_cpus * PVTIME_SIZE_PER_CPU; + + /* The memory region size must be a multiple of host page size= . */ + pvtime_size =3D REAL_HOST_PAGE_ALIGN(pvtime_size); + + if (pvtime_size > pvtime_reg_size) { + error_report("pvtime requires a %ld byte memory region for= " + "%d CPUs, but only %ld has been reserved", + pvtime_size, max_cpus, pvtime_reg_size); + exit(1); + } + + memory_region_init_ram(pvtime, NULL, "pvtime", pvtime_size, NU= LL); + memory_region_add_subregion(sysmem, pvtime_reg_base, pvtime); + } + CPU_FOREACH(cpu) { if (pmu) { assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); @@ -1683,6 +1708,10 @@ static void virt_cpu_post_init(VirtMachineState *vms) } kvm_arm_pmu_init(cpu); } + if (steal_time) { + kvm_arm_pvtime_init(cpu, pvtime_reg_base + + cpu->cpu_index * PVTIME_SIZE_PER_= CPU); + } } } else { if (aarch64 && vms->highmem) { @@ -1853,6 +1882,11 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL= ); } =20 + if (vmc->no_kvm_steal_time && + object_property_find(cpuobj, "kvm-steal-time")) { + object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL= ); + } + if (vmc->no_pmu && object_property_find(cpuobj, "pmu")) { object_property_set_bool(cpuobj, "pmu", false, NULL); } @@ -1924,7 +1958,7 @@ static void machvirt_init(MachineState *machine) =20 create_gic(vms); =20 - virt_cpu_post_init(vms); + virt_cpu_post_init(vms, possible_cpus->len, sysmem); =20 fdt_add_pmu_nodes(vms); =20 @@ -2566,8 +2600,11 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 2) =20 static void virt_machine_5_1_options(MachineClass *mc) { + VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + virt_machine_5_2_options(mc); compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); + vmc->no_kvm_steal_time =3D true; } DEFINE_VIRT_MACHINE(5, 1) =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 858c5a4bcb3..056319859fb 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1310,6 +1310,14 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **= errp) return; } } + + if (kvm_enabled()) { + kvm_arm_steal_time_finalize(cpu, &local_err); + if (local_err !=3D NULL) { + error_propagate(errp, local_err); + return; + } + } } =20 static void arm_cpu_realizefn(DeviceState *dev, Error **errp) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 0dcb9bfe137..ffe186de8d1 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -192,6 +192,16 @@ static void kvm_no_adjvtime_set(Object *obj, bool valu= e, Error **errp) ARM_CPU(obj)->kvm_adjvtime =3D !value; } =20 +static bool kvm_steal_time_get(Object *obj, Error **errp) +{ + return ARM_CPU(obj)->kvm_steal_time !=3D ON_OFF_AUTO_OFF; +} + +static void kvm_steal_time_set(Object *obj, bool value, Error **errp) +{ + ARM_CPU(obj)->kvm_steal_time =3D value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_= OFF; +} + /* KVM VCPU properties should be prefixed with "kvm-". */ void kvm_arm_add_vcpu_properties(Object *obj) { @@ -207,6 +217,12 @@ void kvm_arm_add_vcpu_properties(Object *obj) "the virtual counter. VM stopped t= ime " "will be counted."); } + + cpu->kvm_steal_time =3D ON_OFF_AUTO_AUTO; + object_property_add_bool(obj, "kvm-steal-time", kvm_steal_time_get, + kvm_steal_time_set); + object_property_set_description(obj, "kvm-steal-time", + "Set off to disable KVM steal time."); } =20 bool kvm_arm_pmu_supported(void) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index fae07c3f043..f74bac24574 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -17,6 +17,7 @@ #include =20 #include "qemu-common.h" +#include "qapi/error.h" #include "cpu.h" #include "qemu/timer.h" #include "qemu/error-report.h" @@ -397,19 +398,20 @@ static CPUWatchpoint *find_hw_watchpoint(CPUState *cp= u, target_ulong addr) return NULL; } =20 -static bool kvm_arm_pmu_set_attr(CPUState *cs, struct kvm_device_attr *att= r) +static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *= attr, + const char *name) { int err; =20 err =3D kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr); if (err !=3D 0) { - error_report("PMU: KVM_HAS_DEVICE_ATTR: %s", strerror(-err)); + error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err)); return false; } =20 err =3D kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr); if (err !=3D 0) { - error_report("PMU: KVM_SET_DEVICE_ATTR: %s", strerror(-err)); + error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err)); return false; } =20 @@ -426,7 +428,7 @@ void kvm_arm_pmu_init(CPUState *cs) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_pmu_set_attr(cs, &attr)) { + if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { error_report("failed to init PMU"); abort(); } @@ -443,12 +445,29 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_pmu_set_attr(cs, &attr)) { + if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { error_report("failed to set irq for PMU"); abort(); } } =20 +void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +{ + struct kvm_device_attr attr =3D { + .group =3D KVM_ARM_VCPU_PVTIME_CTRL, + .attr =3D KVM_ARM_VCPU_PVTIME_IPA, + .addr =3D (uint64_t)&ipa, + }; + + if (ARM_CPU(cs)->kvm_steal_time =3D=3D ON_OFF_AUTO_OFF) { + return; + } + if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) { + error_report("failed to init PVTIME IPA"); + abort(); + } +} + static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id) { uint64_t ret; @@ -655,6 +674,36 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures = *ahcf) return true; } =20 +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) +{ + bool has_steal_time =3D kvm_arm_steal_time_supported(); + + if (cpu->kvm_steal_time =3D=3D ON_OFF_AUTO_AUTO) { + if (!has_steal_time || !arm_feature(&cpu->env, ARM_FEATURE_AARCH64= )) { + cpu->kvm_steal_time =3D ON_OFF_AUTO_OFF; + } else { + cpu->kvm_steal_time =3D ON_OFF_AUTO_ON; + } + } else if (cpu->kvm_steal_time =3D=3D ON_OFF_AUTO_ON) { + if (!has_steal_time) { + error_setg(errp, "'kvm-steal-time' cannot be enabled " + "on this host"); + return; + } else if (!arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { + /* + * DEN0057A chapter 2 says "This specification only covers + * systems in which the Execution state of the hypervisor + * as well as EL1 of virtual machines is AArch64.". And, + * to ensure that, the smc/hvc calls are only specified as + * smc64/hvc64. + */ + error_setg(errp, "'kvm-steal-time' cannot be enabled " + "for AArch32 guests"); + return; + } + } +} + bool kvm_arm_aarch32_supported(void) { return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL1_32BIT); @@ -665,6 +714,11 @@ bool kvm_arm_sve_supported(void) return kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE); } =20 +bool kvm_arm_steal_time_supported(void) +{ + return kvm_check_extension(kvm_state, KVM_CAP_STEAL_TIME); +} + QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN !=3D 1); =20 void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) diff --git a/target/arm/monitor.c b/target/arm/monitor.c index 375f34bfaa7..169d8a64b65 100644 --- a/target/arm/monitor.c +++ b/target/arm/monitor.c @@ -103,7 +103,7 @@ static const char *cpu_model_advertised_features[] =3D { "sve128", "sve256", "sve384", "sve512", "sve640", "sve768", "sve896", "sve1024", "sve1152", "sve1280", "sve1408", "sve1536", "sve1664", "sve1792", "sve1920", "sve2048", - "kvm-no-adjvtime", + "kvm-no-adjvtime", "kvm-steal-time", NULL }; =20 diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 77b5e30a9cf..d20094d5a70 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -452,6 +452,7 @@ static void test_query_cpu_model_expansion(const void *= data) assert_set_feature(qts, "max", "pmu", true); =20 assert_has_not_feature(qts, "max", "kvm-no-adjvtime"); + assert_has_not_feature(qts, "max", "kvm-steal-time"); =20 if (g_str_equal(qtest_get_arch(), "aarch64")) { assert_has_feature_enabled(qts, "max", "aarch64"); @@ -493,6 +494,7 @@ static void test_query_cpu_model_expansion_kvm(const vo= id *data) assert_set_feature(qts, "host", "kvm-no-adjvtime", false); =20 if (g_str_equal(qtest_get_arch(), "aarch64")) { + bool kvm_supports_steal_time; bool kvm_supports_sve; char max_name[8], name[8]; uint32_t max_vq, vq; @@ -500,6 +502,10 @@ static void test_query_cpu_model_expansion_kvm(const v= oid *data) QDict *resp; char *error; =20 + assert_error(qts, "cortex-a15", + "We cannot guarantee the CPU type 'cortex-a15' works " + "with KVM on this host", NULL); + assert_has_feature_enabled(qts, "host", "aarch64"); =20 /* Enabling and disabling pmu should always work. */ @@ -507,16 +513,26 @@ static void test_query_cpu_model_expansion_kvm(const = void *data) assert_set_feature(qts, "host", "pmu", false); assert_set_feature(qts, "host", "pmu", true); =20 - assert_error(qts, "cortex-a15", - "We cannot guarantee the CPU type 'cortex-a15' works " - "with KVM on this host", NULL); - + /* + * Some features would be enabled by default, but they're disabled + * because this instance of KVM doesn't support them. Test that the + * features are present, and, when enabled, issue further tests. + */ + assert_has_feature(qts, "host", "kvm-steal-time"); assert_has_feature(qts, "host", "sve"); + resp =3D do_query_no_props(qts, "host"); + kvm_supports_steal_time =3D resp_get_feature(resp, "kvm-steal-time= "); kvm_supports_sve =3D resp_get_feature(resp, "sve"); vls =3D resp_get_sve_vls(resp); qobject_unref(resp); =20 + if (kvm_supports_steal_time) { + /* If we have steal-time then we should be able to toggle it. = */ + assert_set_feature(qts, "host", "kvm-steal-time", false); + assert_set_feature(qts, "host", "kvm-steal-time", true); + } + if (kvm_supports_sve) { g_assert(vls !=3D 0); max_vq =3D 64 - __builtin_clzll(vls); @@ -577,6 +593,7 @@ static void test_query_cpu_model_expansion_kvm(const vo= id *data) assert_has_not_feature(qts, "host", "aarch64"); assert_has_not_feature(qts, "host", "pmu"); assert_has_not_feature(qts, "host", "sve"); + assert_has_not_feature(qts, "host", "kvm-steal-time"); } =20 qtest_quit(qts); --=20 2.20.1 From nobody Fri Dec 19 04:27:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1602167767; cv=none; d=zohomail.com; s=zohoarc; b=NW1WjefqhDXxLFwRHjNo8teGo0evtZGa2aNBlYU0jKEP3shXIQgEohZq9EvVyegdTOukReH60S6Rn/WkMk4L2wo+LxA1Aos7Pn69nR0TiG9gcVo+xrnQZBQirY/nvIptWQFOrPwzYfVrFWKsYxkBZFMOriVH8HsSPJh9adUdklU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602167767; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7WypgywffyK5TRi7PnYgrX30P78iXnGl8x7fIn/+Sxg=; b=FZSkJHzHYUdo8wYPiQWewtHxvwaZyc2IIfTUrfr/kf+tYHWpxpBaDaowzUUwwcrM8hPl8VgZ34YGPp7iTt9mGNsnVVU8MUHeJTher/Sw6obJZerWkUB7zp8EdI3RpDanEARkJMNFG5HteSPGrWJi1+L9XhKtKv3OTiEDXHsW18Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602167767871566.8459551848264; Thu, 8 Oct 2020 07:36:07 -0700 (PDT) Received: from localhost ([::1]:40342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQX1a-0007Ky-Kn for importer@patchew.org; Thu, 08 Oct 2020 10:36:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWs6-0004Uq-Jr for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:18 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQWs3-00061D-V3 for qemu-devel@nongnu.org; Thu, 08 Oct 2020 10:26:18 -0400 Received: by mail-wm1-x341.google.com with SMTP id q5so6728669wmq.0 for ; Thu, 08 Oct 2020 07:26:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j1sm7905104wrc.28.2020.10.08.07.26.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 07:26:13 -0700 (PDT) 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=7WypgywffyK5TRi7PnYgrX30P78iXnGl8x7fIn/+Sxg=; b=YG4C3v1xccGZJdaRmDz5XSS7dbfYzYSSJoRPP97+KYtvEsBt11JchWP5dCaIiWMeeO 3eCbTUxH82I+nct59BD84/zLkywPrISE1OTKd4W1UGl+bTGLyBayt71esAYCRd/XnBR7 Td3HUIewWGOw0HsF6Zcb77XrDcZET9uHNRMjJg2K7jJfnaCdmVfV4xVmujty1OpaIPHy D7TPHuDKtbvzQ3ov3FHieP97rtKANUB6v4lNL0PYxoEKdTdlgYWq7MpoyhTZhM1763xc MLkb9aYG3efaxiKftEWcGe5t2QBKd2uLGdZbU0NpeVkAkS7KtrPAvguhywiciKarLYs8 +5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7WypgywffyK5TRi7PnYgrX30P78iXnGl8x7fIn/+Sxg=; b=r66seSgNAhrBXWqArIKKZBTJwOjc0Ccocp7lfS7nZfNrdNkt2ZWnKRu0zzomq7AwwJ kdgtKWheZ7msbAcLRrZX89pnczjbi/XvXHT2uYIa0pQxVk06ZG3iSK60L7qeLdzI5LHX y9leoQuSPOl3yWyQ5BerthJzjKJzyWirf68kEbs1jZsKlEXcEbTr5rj/8IL5NJPo1t7T pZ1GywwBZGIx9YzWVjJwf5yfUOIjmLyzBXeNFDV/9l8WhHql6Zz+PQqiX/E/Tgxb0cl3 JN67/dCkMIEI6ZRTbHmmQlxPhxHHKyFPlYz7/aNZzKGI1GG//G3YaGJKDgg7Odw5UkTT EEPw== X-Gm-Message-State: AOAM532qJcvUM+KFuwIz4hwbcn1z/HT45FPSNemIMBxukRtrdWyofY3C VVB/PY0hCYwoZOcyka8vc9+E3PxfoR4ilMIo X-Google-Smtp-Source: ABdhPJy3Ub/m9TUnoKIHdcFe+qG+5mMGcFHZ75TUwO9aOc1XRr5t8kkAFUdpbZq5JTX2pkWz7T8/Lg== X-Received: by 2002:a7b:cb8d:: with SMTP id m13mr328793wmi.59.1602167174165; Thu, 08 Oct 2020 07:26:14 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/12] target/arm: Make '-cpu max' have a 48-bit PA Date: Thu, 8 Oct 2020 15:25:57 +0100 Message-Id: <20201008142557.9845-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201008142557.9845-1-peter.maydell@linaro.org> References: <20201008142557.9845-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" QEMU supports a 48-bit physical address range, but we don't currently expose it in the '-cpu max' ID registers (you get the same range as Cortex-A57, which is 44 bits). Set the ID_AA64MMFR0.PARange field to indicate 48 bits. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20201001160116.18095-1-peter.maydell@linaro.org --- target/arm/cpu64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index e00271b932f..649213082ff 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -653,6 +653,10 @@ static void aarch64_max_initfn(Object *obj) t =3D FIELD_DP64(t, ID_AA64PFR1, MTE, 2); cpu->isar.id_aa64pfr1 =3D t; =20 + t =3D cpu->isar.id_aa64mmfr0; + t =3D FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 5); /* PARange: 48 bits= */ + cpu->isar.id_aa64mmfr0 =3D t; + t =3D cpu->isar.id_aa64mmfr1; t =3D FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ t =3D FIELD_DP64(t, ID_AA64MMFR1, LO, 1); --=20 2.20.1