From patchwork Tue Feb 8 11:39:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 540778 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp483802imo; Tue, 8 Feb 2022 05:20:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk83baiZ8Jf6wRFiWUoushwHZ/pIhEP/CoBBIOtGAjel6ZRoyClW1rOSg93NfXvshzpR8Q X-Received: by 2002:a25:2943:: with SMTP id p64mr4472005ybp.37.1644326405236; Tue, 08 Feb 2022 05:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644326405; cv=none; d=google.com; s=arc-20160816; b=FapPtqb87qTSf6NOG2KssAIDAD6EHAeg7KLVVNQjoCswYtCBaOlH6ChWILq9s9Q1mq XZhZddyogofuN88zoPIlFpsMEI+RR91GU0g5R7HIm+SGafeCB19J93boyxlZcHizD5us EsC1JcHVn1Qn51elQtWS2Lvw72dpE2pvo5GrejOZZYogq3FVSFeaYI7bch5Vy1VQviP3 /jLOllTDNwixu0l49qln28fS4Uu949raobyCE8LoH3WPaDbw5SLfKRtgFU8Ztoy/JVHA Ih8mF572e8vTDTQqnEbDI4xCDb1XVaxGi4nlzpDQvguckUW2QUcLOHwaf+bHC73JTr0r hEVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=F8KmHfDV6ISGjnmWH8Yf3Cv+WlIGIG6n+5ETsKdMSPc=; b=w4199vsl6/XFTuj81YMZPgkoxm58+BjeT7J6P8iD0/E7sM5CNPGrzbODJEsnv1av6/ 1zvsBenrM15672KgMpgsWN6NYsxcbZfsYrxV2RSzQedMcRFP3LlqptOjbZJup9JMEryi iW0uYYn7cHO6cIXvSU+qcIJRFXo0h6yByFbt/0gTkcjuPx35TF2b//sCP5IW5Eyuiniy PNVU0sVHifLRXlJq7e0v2t7V/Rhu+5STQaG1VQ6COcoznvqB96CXjpb8pAizM9uHelra fiFP/3wHQPwjNaYGXGRgnx1D2TLYZg9Ofy7u8+4ZhqGb5nIVMYAUmmofKOCQJVhu8gHm 9E2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lib5BiB7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t12si922774ybl.34.2022.02.08.05.20.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 05:20:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lib5BiB7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHQPc-0003Ua-NK for patch@linaro.org; Tue, 08 Feb 2022 08:20:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHOrT-000167-4H for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:44 -0500 Received: from [2a00:1450:4864:20::32a] (port=52219 helo=mail-wm1-x32a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHOr2-0002Nj-1r for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:23 -0500 Received: by mail-wm1-x32a.google.com with SMTP id r131so6389188wma.1 for ; Tue, 08 Feb 2022 03:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=F8KmHfDV6ISGjnmWH8Yf3Cv+WlIGIG6n+5ETsKdMSPc=; b=Lib5BiB7MViK2iEssWJCvEguDuJSMwzQNrrTCP38aKqT7SJzHaT8ZNo4OdKUcw7vOA H6BS98e+VagHow1EEOv0F2OfrBHyUNOGGqh2Iu0YKnjJ+gvNGkALV5Pf6NjZtmuCdJPV WifZHJHNP6ShQS54NQZgzEEOA1P8wqcdgqGD643NH6hIw5D8wizJu3vwOvqvar9SmhGL jMRCtaNsBtq7CHF45TsnTr7CGDE2MwLIy8yyF/7NpWpZgA/AxYUofAGqHV5jIglaWrD4 iXMjC8BNjdrYOFjqJPVw9wObkmTl1e5pdp3Scfh5RaoLNyuSNS+vtJz0jklEjW8f3fpt shJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F8KmHfDV6ISGjnmWH8Yf3Cv+WlIGIG6n+5ETsKdMSPc=; b=kMOx4e0DsjpkdeOOMrLuYH6M49REWXdRL+yJ2N6APZdBJq/XhGaPlIuCfZXZdgh0Q7 Sd76KOJTgym5Uuf2P+RgBc1H66346PAk3RsqmoDDsnJ5hW70Fazz1bOraKpe+G7OLpUX jx0q3UuoBYlNgY0ZSVR6nkpY2cyF3J2Zb0RuCi+ekLcS1k749nUKDCGDg4sRQQM4tHs4 3bjsc4LykzjiJT2xLem+W2yfxC39ulXJmGMUkEyEZvuqF0RMr7/f7FTx04esHHQetA1L rKgqkVH3fyy8FfIRZgQPVhYfvGeOQPbH5YDCRGe6n05tGpDwzrzuwarouDUleAUa9tMi itCw== X-Gm-Message-State: AOAM532PAANlgh0j9OpXkbCgZjIit32DgAu+AW/cRxZcvMfsVocBAccU XJRShOP6pr5J70BBKjjknmnnrhzmVsWEgA== X-Received: by 2002:a05:600c:a4c:: with SMTP id c12mr774280wmq.48.1644320414744; Tue, 08 Feb 2022 03:40:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r11sm4245199wrt.28.2022.02.08.03.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:40:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/39] hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI Date: Tue, 8 Feb 2022 11:39:46 +0000 Message-Id: <20220208113948.3217356-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208113948.3217356-1-peter.maydell@linaro.org> References: <20220208113948.3217356-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When handling MAPI/MAPTI, we allow the supplied interrupt ID to be either 1023 or something in the valid LPI range. This is a mistake: only a real valid LPI is allowed. (The general behaviour of the ITS is that most interrupt ID fields require a value in the LPI range; the exception is that fields specifying a doorbell value, which are all in GICv4 commands, allow also 1023 to mean "no doorbell".) Remove the condition that incorrectly allows 1023 here. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220201193207.2771604-13-peter.maydell@linaro.org --- hw/intc/arm_gicv3_its.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index 069991f7f36..8dade9440ac 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -406,8 +406,7 @@ static ItsCmdResult process_mapti(GICv3ITSState *s, const uint64_t *cmdpkt, if ((icid >= s->ct.num_entries) || !dte.valid || (eventid >= num_eventids) || - (((pIntid < GICV3_LPI_INTID_START) || (pIntid >= num_intids)) && - (pIntid != INTID_SPURIOUS))) { + (((pIntid < GICV3_LPI_INTID_START) || (pIntid >= num_intids)))) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid command attributes " "icid %d or eventid %d or pIntid %d or"