From patchwork Mon Aug 23 16:41:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12453237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AE54C4338F for ; Mon, 23 Aug 2021 16:54:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9FF4613B1 for ; Mon, 23 Aug 2021 16:54:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B9FF4613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIDDt-0008Nm-UM for qemu-devel@archiver.kernel.org; Mon, 23 Aug 2021 12:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mID1a-0008RZ-BS for qemu-devel@nongnu.org; Mon, 23 Aug 2021 12:42:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mID1X-0007Ka-S7 for qemu-devel@nongnu.org; Mon, 23 Aug 2021 12:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629736930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9ahhZw7UhNiaeiQddaQJNPmtavRWVitOR1ZCYyKxXHQ=; b=ZUWIeaTtn8ApgMFoddsw0I5m1AE9gP1Kr4sJZzebkOc96wwexZs3HA59MPrjm1OINnC7Vj ZlhHDFCxVpDraZyWyB/uOd5IoHWJCruKiSVyXQRNi2K+ufLcn/OrADiR7P5cIooPGeAdPG nNEYbX0lCtdAgGBtqPVQ5YWrvfZUt8U= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-YGrN9VRyOSKCRNy98qriIw-1; Mon, 23 Aug 2021 12:42:09 -0400 X-MC-Unique: YGrN9VRyOSKCRNy98qriIw-1 Received: by mail-wm1-f70.google.com with SMTP id n20-20020a05600c4f9400b002e6dc6a99b9so195244wmq.1 for ; Mon, 23 Aug 2021 09:42:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ahhZw7UhNiaeiQddaQJNPmtavRWVitOR1ZCYyKxXHQ=; b=E4wSGhOKbbJkD+I962x6Fw+86xZ1wVdtko+LAhUCks23EKGwtCLqWRaCHt0J2qZ8Cl 9MGGmuljvxuMB2af42XrxYj6DfEMV8eZ6GXVYuEkgsU1aqaUOMckt2HCcs8pcJDoAEbf VnvESwc50mmmwE1pXXwahloqLqU/Tqg3wXzw6RH/FAIDUAmeum4R9DZ+v5M+QIGuUYoo d9++bhS0Wvzc6NKHJMwhOYdk6TAsNcLJdetnlSdJFMDJXIP9p8K78hX/hgdFjc0h7zq9 HOmCJG/THHrdMsHtaPjGj7Rt0vUK9bPgOJcQeNjlaMwMljlZet5jI7vWN4ALik/84fVN VkhQ== X-Gm-Message-State: AOAM530M3k2CTarTfr87Ge/h72dLuPkIjzEbvrP+Ug2tL2AoWSOvbpzr OF4l7gZTplUCGxf/rkesoMzpA1wBMD7nT14ASpOKLsNBAaTQO2wHHeifSSzG590V7cY0X4Ob6dv Uow8tJ/w4AQ2PjXYHqNJUS9dATVrhxnaYPRxpw1F2abfj6AVHFEx92FENOvNzKCZZ X-Received: by 2002:a1c:a5c2:: with SMTP id o185mr1825630wme.34.1629736928411; Mon, 23 Aug 2021 09:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5RC9IdJb8SJs6rfbcQqD7kcDryEb9HPPXiTquTariJ+esiuJJexDY4DS5jsKdOf/nbNpmuQ== X-Received: by 2002:a1c:a5c2:: with SMTP id o185mr1825597wme.34.1629736928186; Mon, 23 Aug 2021 09:42:08 -0700 (PDT) Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id p9sm10502547wmq.40.2021.08.23.09.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 09:42:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 2/5] hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR Date: Mon, 23 Aug 2021 18:41:54 +0200 Message-Id: <20210823164157.751807-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210823164157.751807-1-philmd@redhat.com> References: <20210823164157.751807-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) DKIMWL_WL_HIGH=-0.743, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: Peter Maydell , David Hildenbrand , Jason Wang , Li Qiang , Qiuhao Li , Peter Xu , Alexander Bulekov , qemu-arm@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , "Edgar E . Iglesias" , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We are going to introduce more MemTxResult bits, so it is safer to check for !MEMTX_OK rather than MEMTX_ERROR. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand Reviewed-by: Peter Maydell Reviewed-by: Stefan Hajnoczi --- hw/intc/arm_gicv3_dist.c | 4 ++-- hw/intc/arm_gicv3_redist.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gicv3_dist.c b/hw/intc/arm_gicv3_dist.c index b65f56f9035..e62a9cdfa8d 100644 --- a/hw/intc/arm_gicv3_dist.c +++ b/hw/intc/arm_gicv3_dist.c @@ -819,7 +819,7 @@ MemTxResult gicv3_dist_read(void *opaque, hwaddr offset, uint64_t *data, break; } - if (r == MEMTX_ERROR) { + if (r != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest read at offset " TARGET_FMT_plx "size %u\n", __func__, offset, size); @@ -861,7 +861,7 @@ MemTxResult gicv3_dist_write(void *opaque, hwaddr offset, uint64_t data, break; } - if (r == MEMTX_ERROR) { + if (r != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest write at offset " TARGET_FMT_plx "size %u\n", __func__, offset, size); diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index 53da703ed84..547281a8961 100644 --- a/hw/intc/arm_gicv3_redist.c +++ b/hw/intc/arm_gicv3_redist.c @@ -450,7 +450,7 @@ MemTxResult gicv3_redist_read(void *opaque, hwaddr offset, uint64_t *data, break; } - if (r == MEMTX_ERROR) { + if (r != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest read at offset " TARGET_FMT_plx " size %u\n", __func__, offset, size); @@ -507,7 +507,7 @@ MemTxResult gicv3_redist_write(void *opaque, hwaddr offset, uint64_t data, break; } - if (r == MEMTX_ERROR) { + if (r != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest write at offset " TARGET_FMT_plx " size %u\n", __func__, offset, size);