From patchwork Tue Jul 23 20:38:28 2024 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: 13740354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 17F6AC3DA63 for ; Tue, 23 Jul 2024 20:41:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMHv-0003IU-3A; Tue, 23 Jul 2024 16:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMHr-0003HS-V6 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:08 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMHq-0003un-9s for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:07 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4277a5ed48bso44882085e9.2 for ; Tue, 23 Jul 2024 13:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767144; x=1722371944; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sVpySpyrjhMtcWBGxVtjyNF2MUS6wyprjn1PN1O1F+w=; b=aT+LAzluqB7+nCIMVw4o7j9fOk36aFCuzlxdVIbf+DA+y11sEAl8/7GFQrgSNj6eDF 8I6vUEHxE2v3YpzIo5xD9vu56ernbBJ93AkA0UU9qNwe3cTYVyLhxY+OdGb/66Ar+3vj pasLf1iK8fVUsIZj9WOHNRKrfbkEyYECzO0y3AaFPslLzgX6MVvr1goPrg9iOuG2tRpp kJk3zS9gY9GGIYOzpBYOc2RSJriJzpc2BwUKhXzHwRYbaVwxUrJRVUjy/ERTlXxBADCz qOWcI1LjRFwKtLSJzV64zeVnXfUaqNLYFLqJ5kYPEcq5Q/Th3jR5IFKiCeJ/9qAbNSf4 Y3RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767144; x=1722371944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sVpySpyrjhMtcWBGxVtjyNF2MUS6wyprjn1PN1O1F+w=; b=lI5e8sRHtgWEPOx9lfndxRm42GsSAsauatGN1opavkJQlquFTmL8EoZ9AgS9d9R3tQ g0umCQLwzbJPtHnAfPYYK4wCVYF37HCnVt3oGtEpofhop+TY4xMm7cr+MrHPVOgJMcGb t4xCNboE6R91VA/ksxFmXVwGBxeChmEIMDqP3yWUAjTGQLkgRqzukCY37Z/c/tWsaSO+ RqSt1nPDmaaKJ1FgOzC+bhPdUsmphLY8xcNOv3o2WJcbNzNhJ+sGIgHJY88+jFTVVdHL SOltvnCfgO2Hyr6U33PdKPdQN1y9cPIMEEdBK8uZ7KiKQ7A3i+fy1ySkpe0hBC4IIed+ 6Qdg== X-Gm-Message-State: AOJu0Yyc9+73fXocfIgw7mq9WRgNcKu/LczNbxbkCDLXwCZhXwg+5TrB leiZx20ut28gv2g/FiRoFAKeH/qx8ftUaWOiEEXFrMqL7FewwM3MkcosE5099+S43+/MobO67gs mjhs= X-Google-Smtp-Source: AGHT+IGI0VXaOZnQDIADJZ/nJrjJPvXOn4YNqkpnolIPyChdlEgfLD/HF4jqqe7/7SeagPdHLOVkFg== X-Received: by 2002:a05:600c:4ecc:b0:426:6921:e3e5 with SMTP id 5b1f17b1804b1-427f95af393mr5855e9.24.1721767144522; Tue, 23 Jul 2024 13:39:04 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9399b13sm458445e9.27.2024.07.23.13.39.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 01/28] accel: Restrict probe_access*() functions to TCG Date: Tue, 23 Jul 2024 22:38:28 +0200 Message-ID: <20240723203855.65033-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This API is specific to TCG (already handled by hardware accelerators), so restrict it with #ifdef'ry. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240529155918.6221-1-philmd@linaro.org> --- include/exec/exec-all.h | 7 ++++++- accel/stubs/tcg-stub.c | 14 -------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index b6b46ad13c7..72240ef4263 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -301,6 +301,9 @@ static inline void tlb_flush_range_by_mmuidx_all_cpus_synced(CPUState *cpu, { } #endif + +#if defined(CONFIG_TCG) + /** * probe_access: * @env: CPUArchState @@ -357,6 +360,7 @@ int probe_access_flags(CPUArchState *env, vaddr addr, int size, bool nonfault, void **phost, uintptr_t retaddr); #ifndef CONFIG_USER_ONLY + /** * probe_access_full: * Like probe_access_flags, except also return into @pfull. @@ -392,7 +396,8 @@ int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, void **phost, CPUTLBEntryFull **pfull); -#endif +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_TCG */ static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb) { diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index dd890d6cf69..7f4208fddf2 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -18,20 +18,6 @@ void tb_flush(CPUState *cpu) { } -int probe_access_flags(CPUArchState *env, vaddr addr, int size, - MMUAccessType access_type, int mmu_idx, - bool nonfault, void **phost, uintptr_t retaddr) -{ - g_assert_not_reached(); -} - -void *probe_access(CPUArchState *env, vaddr addr, int size, - MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) -{ - /* Handled by hardware accelerator. */ - g_assert_not_reached(); -} - G_NORETURN void cpu_loop_exit(CPUState *cpu) { g_assert_not_reached(); From patchwork Tue Jul 23 20:38:29 2024 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: 13740347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A4362C3DA63 for ; Tue, 23 Jul 2024 20:39:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMHz-0003V5-Bt; Tue, 23 Jul 2024 16:39:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMHx-0003RK-Ae for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:13 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMHv-0003v1-KZ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:13 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4266fcb311cso44609795e9.1 for ; Tue, 23 Jul 2024 13:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767150; x=1722371950; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=07s3gAboUiyqxdzn5K8IrlmeguSj0H4h3EuvIHEUowk=; b=u6t+O6SzM9ytBu9h2IU95IyQzBh77auCijdrLJ7tIhgAkzohTWLY0VVpI4GItdeeDz WruGSSkzoKz7g3g9Xe25jVzbSoyoDQhmMmmYcblgK6Q6vFKeHOfYfYXcEwReZxyEhI3k fqsvkTr1Ufkhhnaej9uJtWUpg7xq1K8V+bvzJcUgg0yca3K0zvV1aseSBggIANWuEkI0 uVZ7A+vnL8ziWfOosQHi7S/g3avW6HXDX4HEaqTsBM4EBqf12t/e4U6TE60DANAyn1DV dNlrVO39gL4zfkqPVAiD06xho5klxFq1nIcgqrws5YSWokoFBwNicbZxoCoFdj2SejjH ahsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767150; x=1722371950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=07s3gAboUiyqxdzn5K8IrlmeguSj0H4h3EuvIHEUowk=; b=NqPLN85TdIprcZcUEbQ3A5X+20eepi8Qp3YyE7adyUD/KYxTgl6kl63n/9pKi1fBU+ pKdqAkWoF0LF/ETqi+MeNUNwpsP8Iut7NAG3iSGLB7dlpag010Eh09Y7m4qYQwiqKzMc 3OPU160Saw0PGCKobUKIzoBvCVLT3ReJSSkuFJecGonc5jg7S+1mNwAXPvVCAL8nVF17 pefQrkMZgAdfn4qrx8HKVblLmOsAcYGE5/I60PWJ7eTURYI6Bkcqp30pNVyNa2BU9RsH 5ZTkswk4zKj0K02ZOHlhzHYwA0sk4CRs8GFKNbG0bHWg16N2MVdVpbr5kXr4nqWX8tKL 69wg== X-Gm-Message-State: AOJu0YwjrPfpppaosh38Ooao/RW8IF2XExPl2VJ5QHN+TG7kKte+ZutK O7nWqX+dCMcfP6VrGQX7ltoAjSovWq5shg31FXMfEp7toFztD5oB2N8GGXuRdt6ZADrkKO8YKIg ztx4= X-Google-Smtp-Source: AGHT+IFVSL1Q0OK4Dz55H4GJs+er0z4SuHBsokaUuHWhGAV32blMH2Wcsd/QmMpixMUi4s8rwkAL9A== X-Received: by 2002:a05:6000:1108:b0:368:667a:3dec with SMTP id ffacd0b85a97d-369f5b30273mr22511f8f.18.1721767149874; Tue, 23 Jul 2024 13:39:09 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787ebab0sm12538751f8f.92.2024.07.23.13.39.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhenzhong Duan Subject: [PULL 02/28] hw/i386/intel_iommu: Extract device IOTLB invalidation logic Date: Tue, 23 Jul 2024 22:38:29 +0200 Message-ID: <20240723203855.65033-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clément Mathieu--Drif This piece of code can be shared by both IOTLB invalidation and PASID-based IOTLB invalidation No functional changes intended. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Clément Mathieu--Drif Signed-off-by: Zhenzhong Duan Message-ID: <20240718081636.879544-12-zhenzhong.duan@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/intel_iommu.c | 57 +++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 37c21a0aec6..536994c3107 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2666,13 +2666,43 @@ static bool vtd_process_inv_iec_desc(IntelIOMMUState *s, return true; } +static void do_invalidate_device_tlb(VTDAddressSpace *vtd_dev_as, + bool size, hwaddr addr) +{ + /* + * According to ATS spec table 2.4: + * S = 0, bits 15:12 = xxxx range size: 4K + * S = 1, bits 15:12 = xxx0 range size: 8K + * S = 1, bits 15:12 = xx01 range size: 16K + * S = 1, bits 15:12 = x011 range size: 32K + * S = 1, bits 15:12 = 0111 range size: 64K + * ... + */ + + IOMMUTLBEvent event; + uint64_t sz; + + if (size) { + sz = (VTD_PAGE_SIZE * 2) << cto64(addr >> VTD_PAGE_SHIFT); + addr &= ~(sz - 1); + } else { + sz = VTD_PAGE_SIZE; + } + + event.type = IOMMU_NOTIFIER_DEVIOTLB_UNMAP; + event.entry.target_as = &vtd_dev_as->as; + event.entry.addr_mask = sz - 1; + event.entry.iova = addr; + event.entry.perm = IOMMU_NONE; + event.entry.translated_addr = 0; + memory_region_notify_iommu(&vtd_dev_as->iommu, 0, event); +} + static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc) { VTDAddressSpace *vtd_dev_as; - IOMMUTLBEvent event; hwaddr addr; - uint64_t sz; uint16_t sid; bool size; @@ -2697,28 +2727,7 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, goto done; } - /* According to ATS spec table 2.4: - * S = 0, bits 15:12 = xxxx range size: 4K - * S = 1, bits 15:12 = xxx0 range size: 8K - * S = 1, bits 15:12 = xx01 range size: 16K - * S = 1, bits 15:12 = x011 range size: 32K - * S = 1, bits 15:12 = 0111 range size: 64K - * ... - */ - if (size) { - sz = (VTD_PAGE_SIZE * 2) << cto64(addr >> VTD_PAGE_SHIFT); - addr &= ~(sz - 1); - } else { - sz = VTD_PAGE_SIZE; - } - - event.type = IOMMU_NOTIFIER_DEVIOTLB_UNMAP; - event.entry.target_as = &vtd_dev_as->as; - event.entry.addr_mask = sz - 1; - event.entry.iova = addr; - event.entry.perm = IOMMU_NONE; - event.entry.translated_addr = 0; - memory_region_notify_iommu(&vtd_dev_as->iommu, 0, event); + do_invalidate_device_tlb(vtd_dev_as, size, addr); done: return true; From patchwork Tue Jul 23 20:38:30 2024 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: 13740357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F04ACC3DA49 for ; Tue, 23 Jul 2024 20:41:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMI5-0003ke-6o; Tue, 23 Jul 2024 16:39:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMI3-0003hh-CT for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:19 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMI1-0003va-OF for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:19 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4266ea6a412so43216515e9.1 for ; Tue, 23 Jul 2024 13:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767156; x=1722371956; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rrr8U9MJkVqXeBeQIRhzeP4hlOkJzQZ2EPAVbiwALWY=; b=uu+kCSWUxkbHbQCPsXA1lfKP0oaO/kWX5NBaK4t5h3qxK5XqYbV0KvXi2SoR5wAlG0 tU6iTKRZeNC4HdTLCkds88CF9Aev6OxN6Qu5zRCMEJ33K9hliY8PkaJLfPMk1iSMwOz/ 5GotqIT3JcU2ENIs4HhlIPLgEZlUMol8LwwgUlRkkVQCoH+FNbf15Ri4vL1smJE7SDsM wWTy7wCc8XymaqGNHs5dqh2xRSLpnTF+jpF/P5zW4nWWWLvc5ZzPeej6vK0w/Pml+BfP lrBpYURkZV2QC6wvlkGsS7U4xW2KAFDEWTqU/zkhe6+OpCaRlf+g2FcDi/sce59Su/4B tRXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767156; x=1722371956; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rrr8U9MJkVqXeBeQIRhzeP4hlOkJzQZ2EPAVbiwALWY=; b=fElR0E9HbxKL9ViheK5aS/NCs+yvs6S9WkNGYLYKhWxDVYqqFJNWc9bsJiu5DwjEwr roiNMmMVTFR2hZ1Ls0h399NQmsJIwwbqRDOO/TPY8Rc4gRG4GFWFUmoXeBrC3BifrlL1 WXYzzbEfkz6a+qC0QeTOJVeLd3tCtYGRaI823wB8ap40L3KNL3OqMQ5i1z5ix2Q+i042 zvBNBuZogDsdW0jaoSbk5dBb0lY44r0qQIbKrlFfBd5K8hflOD3Y/9EhPJ9vCNTar12k b1eU0aOL8MkSAKbEvqAaNPDEMwLaI5rDONYVvw0U76tTNBbHqbtE9O7oU/zryX4w2+Fy PvRQ== X-Gm-Message-State: AOJu0YxN8dGKSxVI/WRZOg+zi1sTynADwd3HRXqjCEnlCMAdqb6MMeIf SP2ntgCfBpOSZsCJBZv8VMC2K/2rEUUBLhswFNI5ukTTBw97cNYXTB9+jYiuJIYglAFNZOzdsAQ r7k0= X-Google-Smtp-Source: AGHT+IF38NEHrloe4WJCVqJkOGfytDDebvQOmzI0hSvr9MRxWG5qQfuMtnfYADvRMUbtZ9RkSj2V9w== X-Received: by 2002:a05:600c:a42:b0:426:54c9:dfe5 with SMTP id 5b1f17b1804b1-427eab7c129mr43548945e9.10.1721767155936; Tue, 23 Jul 2024 13:39:15 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f937e274sm512615e9.14.2024.07.23.13.39.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , qemu-stable@nongnu.org, =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 03/28] hw/intc/loongson_ipi: Access memory in little endian Date: Tue, 23 Jul 2024 22:38:30 +0200 Message-ID: <20240723203855.65033-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Bibo Mao Loongson IPI is only available in little-endian, so use that to access the guest memory (in case we run on a big-endian host). Cc: qemu-stable@nongnu.org Signed-off-by: Bibo Mao Fixes: f6783e3438 ("hw/loongarch: Add LoongArch ipi interrupt support") [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240718133312.10324-3-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index e6a7142480c..e7979dbdd8b 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -14,6 +14,7 @@ #include "qapi/error.h" #include "qemu/log.h" #include "exec/address-spaces.h" +#include "exec/memory.h" #include "migration/vmstate.h" #ifdef TARGET_LOONGARCH64 #include "target/loongarch/cpu.h" @@ -102,7 +103,7 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_t val, hwaddr addr, * if the mask is 0, we need not to do anything. */ if ((val >> 27) & 0xf) { - data = address_space_ldl(iocsr_as, addr, attrs, NULL); + data = address_space_ldl_le(iocsr_as, addr, attrs, NULL); for (i = 0; i < 4; i++) { /* get mask for byte writing */ if (val & (0x1 << (27 + i))) { @@ -113,7 +114,7 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_t val, hwaddr addr, data &= mask; data |= (val >> 32) & ~mask; - address_space_stl(iocsr_as, addr, data, attrs, NULL); + address_space_stl_le(iocsr_as, addr, data, attrs, NULL); return MEMTX_OK; } From patchwork Tue Jul 23 20:38:31 2024 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: 13740353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EB0F8C3DA63 for ; Tue, 23 Jul 2024 20:41:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIA-0003zM-PB; Tue, 23 Jul 2024 16:39:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMI9-0003wc-2O for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:25 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMI7-0003w8-GS for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:24 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4277a5ed48bso44883335e9.2 for ; Tue, 23 Jul 2024 13:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767162; x=1722371962; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SEw2US0MusaevsyReo4Qy9oebugC1Q09g9E1j6NjCoM=; b=YkfBe30eIKZlLqI1KrdgrBb36cSgtV1XZNT0ah+gTUvYC84wCgkVRjcRictcqO6eUM CIPqcv1F8Nq1BEChvhXu9MWdx9BTAL7TtZXBLeyHUeF5i5OB3QMzQ3oRe/BxnCXZx7vQ /MAoN+pVQli1Ns9v/7DfoGKaFVLgPyE7MPQ/8aCxj06fjUJtF5703PLr51lxHzUigsrL FWxy7LnUgFnnGN71ovlawJtXYvP4mUGNAXCPC8g9IQEhKS22Y8aTebWH/iMaOBydUZZc OqdQfrgQ3YzCLSznQAxyjaKosZtoT+RlwpfTRy71vhvcnHxwz1r9j1hj4zyA6p7crBe+ Vlcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767162; x=1722371962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SEw2US0MusaevsyReo4Qy9oebugC1Q09g9E1j6NjCoM=; b=S9fJqyawedkOAr8e4yJEzzDiwqRn1TzeUYWfLZgQ6KXZaqJkS2Ztclla4xpHbzEhcV Ywz1xrBUjrarEydKd++RecRp3FbtpfwXC75As/n1Swm10vo0HoZ1PvLidff7zlSAur56 IhFcQTdOYbZZjB7098iA4FCIqNld0AQ5j3KRbDxq8oG7MXsymzoUKQxfIAzxWx3v1NTq pr+2k+cPi5Fm7/88DJVAMrvyMxXFvLshfyaHGFbwKGkkvYa60HgCQx5Yz5ot10Czf5dB V/lsm41tEaOOP/WB/uweBZkMVJu3nL5XS550jT/qRNSneJ3yEZao58bc3sMJvoukY9x8 PcDw== X-Gm-Message-State: AOJu0YyQrYQ8MCdEWmlgbFoW9tuh4lJ3K9BrgRBC0yCvXbZ/Ol0Eo77n kqa3bhB/14IhTxbWV6OcQKl+fGhmfOO/Xqq/6uyIwO/vR2MaHm1jjUn9tKVevwPfv9itomx1Fbk rz5I= X-Google-Smtp-Source: AGHT+IHxcOkhf0+BkIPgdu2V5qPDwcP/E8xsbMKL5oTz99VsZvIHXCMmfubEBbbB6nZr/VrTr4wGMg== X-Received: by 2002:adf:ee48:0:b0:367:8383:6305 with SMTP id ffacd0b85a97d-369f5b14530mr35690f8f.55.1721767161794; Tue, 23 Jul 2024 13:39:21 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f93e65a7sm319175e9.33.2024.07.23.13.39.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Song Gao Subject: [PULL 04/28] hw/intc/loongson_ipi: Fix resource leak Date: Tue, 23 Jul 2024 22:38:31 +0200 Message-ID: <20240723203855.65033-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Once initialised, QOM objects can be realized and unrealized multiple times before being finalized. Resources allocated in REALIZE must be deallocated in an equivalent UNREALIZE handler. Free the CPU array in loongson_ipi_unrealize() instead of loongson_ipi_finalize(). Cc: qemu-stable@nongnu.org Fixes: 5e90b8db382 ("hw/loongarch: Set iocsr address space per-board rather than percpu") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao Message-Id: <20240723111405.14208-3-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index e7979dbdd8b..4013f81745e 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -318,6 +318,13 @@ static void loongson_ipi_realize(DeviceState *dev, Error **errp) } } +static void loongson_ipi_unrealize(DeviceState *dev) +{ + LoongsonIPI *s = LOONGSON_IPI(dev); + + g_free(s->cpu); +} + static const VMStateDescription vmstate_ipi_core = { .name = "ipi-single", .version_id = 2, @@ -353,23 +360,16 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = loongson_ipi_realize; + dc->unrealize = loongson_ipi_unrealize; device_class_set_props(dc, ipi_properties); dc->vmsd = &vmstate_loongson_ipi; } -static void loongson_ipi_finalize(Object *obj) -{ - LoongsonIPI *s = LOONGSON_IPI(obj); - - g_free(s->cpu); -} - static const TypeInfo loongson_ipi_info = { .name = TYPE_LOONGSON_IPI, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(LoongsonIPI), .class_init = loongson_ipi_class_init, - .instance_finalize = loongson_ipi_finalize, }; static void loongson_ipi_register_types(void) From patchwork Tue Jul 23 20:38:32 2024 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: 13740350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1702DC3DA49 for ; Tue, 23 Jul 2024 20:40:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIG-0004HS-Q9; Tue, 23 Jul 2024 16:39:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIE-0004Fp-S7 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:30 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMID-0003wT-69 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:30 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-368313809a4so137311f8f.0 for ; Tue, 23 Jul 2024 13:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767167; x=1722371967; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; b=vLYljU6KXnrrpDDMlpW/4g+AYy5/98gQ71OxWS2nmuk54PrgBezm2gdZjwHTDmQe3P SmXNg5ZPHRWvBs6anlEsM0PKwFK2kFcHj5mvw7MplDR3+ksQBsxl7QCfIDbkMryDYinr gk5fEMjBhhZYgDV01q7X/WZ4JE0C7jIUjF5Qrj18wC1unxIxI3ssafxFioGb004RzbjD vHgfWBuUuMw4ya2rrDrYKG605noriaUpUuFLK0e75pvYO6GJjbXK0n59r8ikOHm0ReUu zDjAlg5zjNmj29XTYOf0Un39jQM3QEJeKkmsMEtwfD6bCTNKOGGUY365ShFg+kuOpTBI Fdfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767167; x=1722371967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; b=LSZaTyTPBkWIDyOe7cvkY9gkqxZoMa9hcqeCGxKFsa7QgcRzIXVllkT0w5d2xQlG9Z x6gMrD0qt+QO2iDrJgkyA8HiJSqHx4sTsoNfRWSG2356ZJqNghaf3flNW/A3rd2dzggB 1w51y2nIC0kh8hyMmOWuKAP7wuLV8+E/gs728U42S+cNtfHpckZnDMvetOACF/GxGnBG lBuS9OY9qeSL9ziFbtDz8sTn4ltQnbZM98nO/zoQd5UEJx8822tm0+xEK+iLYBsi/1LC m+XGg+5oTGDV4aO0KMAmjDlggLOQM8Ro5sM5ZMOLMhM20/E7CgQA2E2MxmAFcaaftoku D0ug== X-Gm-Message-State: AOJu0YzDYntqyi3frD7ceH66g4JUbpSJt7UpWaoYTKWZ9E0lIs9ecLJ6 rwQGVBNRN3V8zgr/kBC+37BYta9Kho2lbfs8iWSeeaM7FuR7JYwM/RdkMt4TdI2Y0URMw8Mks5Z kI4U= X-Google-Smtp-Source: AGHT+IGKwhkPIdxGthdNPxuX+0AC0etCyXz6PwIb7/LLquNRD1O1VG/iY5spYqt/ymVVTuHgRXmXbg== X-Received: by 2002:a5d:6484:0:b0:368:37aa:50b3 with SMTP id ffacd0b85a97d-369e3f01536mr2976124f8f.24.1721767167398; Tue, 23 Jul 2024 13:39:27 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f937f58dsm520255e9.18.2024.07.23.13.39.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro Date: Tue, 23 Jul 2024 22:38:32 +0200 Message-ID: <20240723203855.65033-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. Replace the type_init() / type_register_static() combination. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240718133312.10324-2-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 4013f81745e..682cec96f3f 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -365,16 +365,13 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_loongson_ipi; } -static const TypeInfo loongson_ipi_info = { - .name = TYPE_LOONGSON_IPI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(LoongsonIPI), - .class_init = loongson_ipi_class_init, +static const TypeInfo loongson_ipi_types[] = { + { + .name = TYPE_LOONGSON_IPI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(LoongsonIPI), + .class_init = loongson_ipi_class_init, + } }; -static void loongson_ipi_register_types(void) -{ - type_register_static(&loongson_ipi_info); -} - -type_init(loongson_ipi_register_types) +DEFINE_TYPES(loongson_ipi_types) From patchwork Tue Jul 23 20:38:33 2024 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: 13740365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 45FB5C3DA7E for ; Tue, 23 Jul 2024 20:43:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIL-0004XQ-Ex; Tue, 23 Jul 2024 16:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIK-0004Uy-4j for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:36 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMII-0003xK-Hy for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:35 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3686b554cfcso2898473f8f.1 for ; Tue, 23 Jul 2024 13:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767172; x=1722371972; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mAWB86PPkrxBCeTbR27TWMyKaulXnrAS2NRotSYIsdM=; b=GrDVkwtL1XQYfkDs7gWiFxfboUJl0stRVHNg+1Er2v6VoUzGBJQK+smVLwPU0Ae3x6 lo1pESbNo/SIowKNvfEe7Jvk1KjkWbps5yx4Q9KKGOhDeC9Uf9bQxx8rXqFTERXkECw0 kaBnV4F0aeDKfpqYdbssvnjaYTelnv9hIU7SQXPkzueVzAeJxB/sVhTloMxrQrU21maP jwy7l90lVrPaqdExIWPplnv5kH24VT2W7sQx5gCIEb33eNKgDC5pbOtmo4LOlDatYnix PLejprUUA38MhrJNLQeAFqJXMAjJQfdAKYLAMM+UKDLhIQ4g/tvukZwh7REbRZ2Fanlt 7rRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767172; x=1722371972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mAWB86PPkrxBCeTbR27TWMyKaulXnrAS2NRotSYIsdM=; b=h/Az2F2cTEfLY1nH1u1czAHGsVEk1Kym4FmXI3lqUSPQJN/qcRhc+xAlD6W2LCTpt+ Pcd//zegpVFveHNiDpUdptwwLgVAd7G8OwXLdhUIgP0o3HyCiUd5JQ0Bc0toOOK/hE2U b2mzDFz5uYGBA+h19lnEG7m+g9mvWWmVLObC2QRHRxqhSnpyMsZpB5zTXM5+Uh+97d4F IqekJ0ptsE8Tml+ioQ3oUz344+dk6/Ci9eSL60uCNapvqVE0X3yA8terfXkIjFrBWmMN 9CmuAVp0zGCbZNFzJ8nV3Y0Kt7GbXHTFhlvGfbjpA8P1fqY2/jgv4JuIqrRsPpXCt78D hn1Q== X-Gm-Message-State: AOJu0Yw/A3Vba8YgtOj3Nj9TOTGGj5OU7+PwzpqXkbknIfNyZhilsRC5 pkrjLclQG+UtTFv8EVXCI2ZR3yBhX/+AvtUoDM15qWTC6IArbfDC5Isa7mBweAU5mueYEwmChVy URi8= X-Google-Smtp-Source: AGHT+IHw/i222pDAcGyYQI8uppF0fFUZwINVRbOj8+ub+D7NNjE+u6ksBQZ2RPTYluT9BDgGr9VL4g== X-Received: by 2002:a5d:4d01:0:b0:367:923b:656b with SMTP id ffacd0b85a97d-369f5b0b8c5mr36823f8f.54.1721767172756; Tue, 23 Jul 2024 13:39:32 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f93bc977sm373015e9.42.2024.07.23.13.39.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Jiaxun Yang Subject: [PULL 06/28] docs: Correct Loongarch -> LoongArch Date: Tue, 23 Jul 2024 22:38:33 +0200 Message-ID: <20240723203855.65033-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240718133312.10324-20-philmd@linaro.org> --- docs/about/emulation.rst | 2 +- hw/rtc/ls7a_rtc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index b5ff9c5f696..3bfe8cc14a2 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -42,7 +42,7 @@ depending on the guest architecture. - :ref:`Yes` - Yes - The ubiquitous desktop PC CPU architecture, 32 and 64 bit. - * - Loongarch + * - LoongArch - Yes - Yes - A MIPS-like 64bit RISC architecture developed in China diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c index 052201c2cd5..3226b6105e8 100644 --- a/hw/rtc/ls7a_rtc.c +++ b/hw/rtc/ls7a_rtc.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * Loongarch LS7A Real Time Clock emulation + * LoongArch LS7A Real Time Clock emulation * * Copyright (C) 2021 Loongson Technology Corporation Limited */ From patchwork Tue Jul 23 20:38:34 2024 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: 13740348 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4E841C3DA49 for ; Tue, 23 Jul 2024 20:40:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIT-000578-W3; Tue, 23 Jul 2024 16:39:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIQ-0004su-Tc for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:42 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIP-0003yB-7w for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:42 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-427d8f1f363so34183875e9.2 for ; Tue, 23 Jul 2024 13:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767178; x=1722371978; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PVW3Gx4VWf1FcJPawzcx0DDSK91Xb6uFhCXhyBk+SmU=; b=xEZFmD0DTPUjTsBSWySthtoHcR2rj1cTmeg7RaOyDAjWEccmOXcSo8msHOJg9fuB9S n4godjE7L8/OIK27BGwWsW0ZQgQW6L6CZUEZtAxs5g4mh6bwaJOu4Z3n3jpy43NsXs3i s0kD7SOb9La/Di3I/EBHD5Z2dZNjI5PWjSRsR6GHfftNqsQ4xki6ISleAIO2H2q+OpfV fXIPnUtoEk2Q7q3Xp0BF5C0DaFQHe89KoKfjsN4x5OQcM2UntT3MlgKO6149LHjLvox4 geCVTfRUiN8nE4q9vqMHI+pbW3TVZQq4UMm+TDKNPdadkHokbkJvSx6p/0TMzohmePhd 4Ong== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767178; x=1722371978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PVW3Gx4VWf1FcJPawzcx0DDSK91Xb6uFhCXhyBk+SmU=; b=MX44lc2e0y2ZD7i5v4/mxSdQ5nNlbkIXVp9SODVK3BO8bUbItR4dRI+X17vm+m7YU0 OyBN0Qi9/j5yjjjmQJsU5zyVNcCQYTkOItXJqb5gDtz/X7reYdda0vKxkWRQK6VdtHos gklm6CeW+SIcf5xvhZI7PUouOn21WZFZmfS6QWijFJlGzjxkg/po49sMCTPx8tlqQCaY O5jY3GEojtHGPYoCiwddF5T/vZ3ytg5l4eZ05GGK/a3VqlL/aKG0vTK102pZw+0CtOjO o8VR37zKE7I/tMMZfvcjUnEr7QZPob9zgoSY0jos9W5V/OzTkTtYu8HjzRMjn59f9CvF um/A== X-Gm-Message-State: AOJu0Yxrt+yWpwLGd6roEbl8IFu4J9ce8LkM9Q4/Qw4CJQIoAdgwya1i JSmcp3mB/LrfpAgS62e8J1+ve9Sb2jksp/bsNd2tqj9ghnzXaxnadJynWAhRoI6eSQlEmXBaaBA fCOA= X-Google-Smtp-Source: AGHT+IGPnUCRIxKQjeJQhzrmQRtve4PC+GVadf60BN//tmj6GLFOC2kNB8foVk/9XRalUt8dBgUAGA== X-Received: by 2002:a05:600c:3ba9:b0:426:647b:1bfc with SMTP id 5b1f17b1804b1-427dc5584d8mr66747675e9.30.1721767178238; Tue, 23 Jul 2024 13:39:38 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f935954fsm575655e9.9.2024.07.23.13.39.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 07/28] docs/interop/firmware.json: add new enum FirmwareFormat Date: Tue, 23 Jul 2024 22:38:34 +0200 Message-ID: <20240723203855.65033-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Thomas Weißschuh Only a small subset of all blockdev drivers make sense for firmware images. Introduce and use a new enum to represent this. This also reduces the dependency on firmware.json from the global qapi definitions. Claim "Since: 3.0" for the new enum, because that's correct for its members, and the members are what matters in the interface. Suggested-by: Daniel P. Berrangé Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Weißschuh Reviewed-by: Markus Armbruster Message-ID: <20240719-qapi-firmware-json-v6-1-c2e3de390b58@linutronix.de> Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index 54a1fc6c104..d5d4c17f230 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -15,7 +15,6 @@ ## { 'include' : 'machine.json' } -{ 'include' : 'block-core.json' } ## # @FirmwareOSInterface: @@ -200,6 +199,20 @@ 'enrolled-keys', 'requires-smm', 'secure-boot', 'verbose-dynamic', 'verbose-static' ] } +## +# @FirmwareFormat: +# +# Formats that are supported for firmware images. +# +# @raw: Raw disk image format. +# +# @qcow2: The QCOW2 image format. +# +# Since: 3.0 +## +{ 'enum': 'FirmwareFormat', + 'data': [ 'raw', 'qcow2' ] } + ## # @FirmwareFlashFile: # @@ -219,7 +232,7 @@ ## { 'struct' : 'FirmwareFlashFile', 'data' : { 'filename' : 'str', - 'format' : 'BlockdevDriver' } } + 'format' : 'FirmwareFormat' } } ## From patchwork Tue Jul 23 20:38:35 2024 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: 13740349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 74FDCC3DA63 for ; Tue, 23 Jul 2024 20:40:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIZ-0005Vf-Fb; Tue, 23 Jul 2024 16:39:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIV-0005HW-CO for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:47 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIT-000402-Jj for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:47 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4266fd39527so44948115e9.1 for ; Tue, 23 Jul 2024 13:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767184; x=1722371984; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o3ABXJMZuK4B1pMDKEQUPr16WMzhgKew8s6daG0+jWs=; b=kh7kmD0ubn5EzesGqCO9IllbKBVncUaGtCr5swW8oUW+n7PAmckkKZ6AFsCKRD3JE6 eLRENYq2gbyu0ig2ftmOSo/iB0EpKh62xsRt7vWRVtV6pWo8pxPqfzZT9l+mr3Wwh0Kc OojoAaf9T2KRgtfg5GjUuams65H7rwnH+n13F1/qACvw4vN7dB97uMCpKqkossFcpz5N 4RDEdq9QNCRJJdvLAagmIJJEOhqi5BvDEDqJ0ql6gERAqm7Jjdq253Fi6T6ykeZ0PHYX 0CGR9MO9y/EFT8liibPdL9cj+z9gtv2Vd1+qHF7fbepaPR9K7mBdkvSBcdHpykxATxTL m6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767184; x=1722371984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o3ABXJMZuK4B1pMDKEQUPr16WMzhgKew8s6daG0+jWs=; b=PAMXx5gSthZ/hx9rNBsuMohmHPbUgAyCeNXxON2FrALrx2W51rokyZQC/D8IbkYtCM hJa1Ino+yHL7R+6p/zFlL0K6c7Pw04SR/UAaMl00fOasL4Fdi/393QWpQwPEYILx2IEJ 6/ZZf8lOsvMShNsAcxKx0BVuXznJgaVl4jpcf1i+QcRQktc3qtW96QRxbxtQ1HTQE6jc KbfMi1XMJUF6MJvzJVXu2a0T2O1flngfmFRh7JCYSdyo0Z+2jDrBfwUQ7yHI8QUBc4NZ mhsATysS8JXkuiXfaCxgVKAPJuw6onBxu940QKC9gT0cPq18+7At/urw222K6vev02UQ UxjQ== X-Gm-Message-State: AOJu0YwxXjnByrls0Qa8y8a44FI+BQr88Jgq/khTJmITgkEVtnw/C+vN h4oR9uiSLmHrVJfYdHj28XafkTbTld0JRFFJYRDES59ww3EjWFs/tI+/3VqGf4ZkC3skec+UmRW w3g8= X-Google-Smtp-Source: AGHT+IFgC5CyAp4R2oa08g2Qnx/boScJWTKQWrhU/93BBIPnaF9e6TvsFZ+o2eCV9XDLs/kQdvEzrw== X-Received: by 2002:a05:600c:3514:b0:426:4f47:6037 with SMTP id 5b1f17b1804b1-427f956075dmr59895e9.19.1721767183733; Tue, 23 Jul 2024 13:39:43 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9397337sm483385e9.23.2024.07.23.13.39.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 08/28] docs/interop/firmware.json: add new enum FirmwareArchitecture Date: Tue, 23 Jul 2024 22:38:35 +0200 Message-ID: <20240723203855.65033-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Thomas Weißschuh Only a small subset of all architectures supported by qemu make use of firmware files. Introduce and use a new enum to represent this. This also removes the dependency to machine.json from the global qapi definitions. Claim "Since: 3.0" for the new enum, because that's correct for most of its members, and the members are what matters in the interface. Suggested-by: Daniel P. Berrangé Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Weißschuh Reviewed-by: Markus Armbruster Message-ID: <20240719-qapi-firmware-json-v6-2-c2e3de390b58@linutronix.de> Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index d5d4c17f230..ae417999447 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -14,7 +14,10 @@ # = Firmware ## -{ 'include' : 'machine.json' } +{ 'pragma': { + 'member-name-exceptions': [ + 'FirmwareArchitecture' # x86_64 + ] } } ## # @FirmwareOSInterface: @@ -59,6 +62,27 @@ { 'enum' : 'FirmwareDevice', 'data' : [ 'flash', 'kernel', 'memory' ] } +## +# @FirmwareArchitecture: +# +# Enumeration of architectures for which Qemu uses additional +# firmware files. +# +# @aarch64: 64-bit Arm. +# +# @arm: 32-bit Arm. +# +# @i386: 32-bit x86. +# +# @loongarch64: 64-bit LoongArch. (since: 7.1) +# +# @x86_64: 64-bit x86. +# +# Since: 3.0 +## +{ 'enum' : 'FirmwareArchitecture', + 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] } + ## # @FirmwareTarget: # @@ -80,7 +104,7 @@ # Since: 3.0 ## { 'struct' : 'FirmwareTarget', - 'data' : { 'architecture' : 'SysEmuTarget', + 'data' : { 'architecture' : 'FirmwareArchitecture', 'machines' : [ 'str' ] } } ## From patchwork Tue Jul 23 20:38:36 2024 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: 13740374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9EC5C3DA49 for ; Tue, 23 Jul 2024 20:43:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIr-0006XG-JE; Tue, 23 Jul 2024 16:40:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIb-0005fK-38 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:56 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIZ-00040d-H2 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:52 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4277a5ed48bso44885285e9.2 for ; Tue, 23 Jul 2024 13:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767189; x=1722371989; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3JNSLq3T/DO8Fim2AW30tyDDzF8z85BC5OXkOQl9TDE=; b=faTz0xwKPZfA3940EgucNLTQArqTbQKKfytHgThB0DMssfffqkCFTnWNUXy9fb00Py 5V138fA35RmcNBCN1PKJvRfzgQ5OoxcV6E2/oF15mFyrJqZXjRO0Yj8YCOnl4lR4ijWJ yHb7EYXWvEJXhajlqM1L/eQ1Lp4rMTrHk4rCsDiR932e135/FRjxaOCu/9knpu+5Ld2R zvC49vPSdV6gcnkVALb+/aXJVyKMOeg1mMU2aXFQwH+zrM8r2GWb59jfxZTjq0HsJplH 3YK181nfdldFJ1c21YttbsuC7A4dhst/ScO4BZft1HHpRbeLCAfsLqxxiMH7XvDjYm5F CBPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767189; x=1722371989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3JNSLq3T/DO8Fim2AW30tyDDzF8z85BC5OXkOQl9TDE=; b=J3dLtmc0CVlWmf+MDHGOrOpUQ4BII8ShNdD+aQyAXWm/XBtBN9TE/KUr2GnrQktQMW 5QjwwWHbyF1dR0cq2smeCuJik23IgeFcRI1whulwUNK2I/Pt3ooNQqB02BxjwkGpKPOT tvwoAemSKykfDupLie8Tj5vfkORD3pv/bllqJuFe1KzinLtAwYw209IjOSm3w2T6hgx+ PKvdOnOYiM4I7y8DVIryenqR4c0GuHyFBBJy1DrNmTh7dxA0q3MA3HiyFXGpvTfsdFtc Jhb46vHiCFvlf763YAHGRrXx1XyIW4X/or1liDT8PMUYwoTiKSz7fAUboZMY/gnu9TB5 nBzA== X-Gm-Message-State: AOJu0Yyp0rMccwG+bb7Brr2ZB++OGlQorFHdE+j/QWODV900jCPtfFpk cLgCqpZIQDR//gIgwHC6ZqMAHUY4IP9YjNYIsHH43FOWhkni3H2ikRv3qF0Ztvby6EmFfh3Cw17 GP+4= X-Google-Smtp-Source: AGHT+IGAGzFqxFEqdjKwZQoZWYOrGqX7dkGdleVM4L1x2Szly4d1pLFg84uaAhDyyrl70ORwMSTX0Q== X-Received: by 2002:adf:f250:0:b0:368:6633:c547 with SMTP id ffacd0b85a97d-369f5ac3e00mr32939f8f.37.1721767189140; Tue, 23 Jul 2024 13:39:49 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9398497sm483755e9.25.2024.07.23.13.39.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 09/28] docs/interop/firmware.json: convert "Example" section Date: Tue, 23 Jul 2024 22:38:36 +0200 Message-ID: <20240723203855.65033-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Thomas Weißschuh Since commit 3c5f6114d9ff ("qapi: remove "Example" doc section") the "Example" section is not valid anymore. It has been replaced by the "qmp-example" directive. This was not detected earlier as firmware.json was not validated. As this validation is about to be added, adapt firmware.json. Reviewed-by: Markus Armbruster Signed-off-by: Thomas Weißschuh Message-ID: <20240719-qapi-firmware-json-v6-3-c2e3de390b58@linutronix.de> Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index ae417999447..57f55f6c545 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -470,7 +470,7 @@ # # Since: 3.0 # -# Examples: +# .. qmp-example:: # # { # "description": "SeaBIOS", From patchwork Tue Jul 23 20:38:37 2024 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: 13740352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07CD2C3DA49 for ; Tue, 23 Jul 2024 20:41:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIu-0006q8-7R; Tue, 23 Jul 2024 16:40:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIf-00063G-Tg for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:59 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIe-00041A-Ad for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:57 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-368663d7f80so3241745f8f.3 for ; Tue, 23 Jul 2024 13:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767194; x=1722371994; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+hMaqq/BTdi6PrKr3cYrZxRyWg7HqfkCm9irnu5mKRU=; b=e8dv81d4GETIhKjz02U2Qj/VXej0lWG70HkJKws/gKIh0vBvftL2e5b09BHrbbXUES ZFzDakkLq0gHU06/zRYtTh18StG8M+2fEe9KUPnfXEom2USB+is5iTmXVyh16tKT8UG1 OHuU5JA1DUV083gWW+wYUwK7MwBQknVWU2QY8aYYdvc50aoh5MFgwXEDoy/xnZHDTKTJ I0hshvtRiZTOGSF05wzUffeH94si7mOfBfSnyCxj7ldy7Zdr6DwyMBzIa5GnOBhHtu2P QFxy/aOgxeRZawzCr9fFfp2+p/7CGMwmj4vcJEVBAUmFk+BVFaOpHPQ5DUk2T86eeiGm ihjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767194; x=1722371994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+hMaqq/BTdi6PrKr3cYrZxRyWg7HqfkCm9irnu5mKRU=; b=kpnZQaBcGTiFIjahmsbi5Y/Sjr/hB2ycjy+8IEGTPtAonJeB3RJNa7J2KBIvVchnJC jS1COoo7v0P2QlTiGtt9sSp/jimnIvxV8IdfjvMoIBlwd6rdSHKm3TGVf00kO1kpWNSf 5hHdGYTsteXAKvfsc6osgOwWc5W/yrhK3NXuf2l2Ip0mDqp3jIvNBq1RgfDpTZgB+FCP i6NXRiXvJK0WeKicC2nFuh9mbncmCh9PO8pV5cBFtoQ20zZel/HqbcZsHOTu0IIW0nPa H7hTG7xDJQl4J/UbUwCRxfZsUVZ/vDcxuSxm+TTWdCjTMxlG9qSd98r9bhlSm0X1US7B 435Q== X-Gm-Message-State: AOJu0YzqjkX2xv/QUYLoEnvV4Bnl2vtaidbHIgr9PFl7aGNpSdS2k2Zb 5pDABIcF9xvij++9heuRxWJfCIXP6HWnPyIurqNPqeR+opNsuzCnLqO49FkdT5JYjdmnBms5Zgi DZMs= X-Google-Smtp-Source: AGHT+IG57LI5YWyZHVY+kl90wAv5lE9l7oJ9B0qwyRPR4wxUqd35iJDfJuVsGFBnhz88AsrCOTWPBg== X-Received: by 2002:a05:6000:d85:b0:368:66b7:621d with SMTP id ffacd0b85a97d-369f5b2c80fmr38100f8f.18.1721767194455; Tue, 23 Jul 2024 13:39:54 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36878694833sm12408147f8f.55.2024.07.23.13.39.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 10/28] hw/i2c/mpc_i2c: Fix mmio region size Date: Tue, 23 Jul 2024 22:38:37 +0200 Message-ID: <20240723203855.65033-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: BALATON Zoltan The last register of this device is at offset 0x14 occupying 8 bits so to cover it the mmio region needs to be 0x15 bytes long. Also correct the name of the field storing this register value to match the register name. Signed-off-by: BALATON Zoltan Fixes: 7abb479c7a ("PPC: E500: Add FSL I2C controller") Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240721225506.B32704E6039@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/mpc_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index cb051a520f7..06d4ce7d68d 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -82,7 +82,7 @@ struct MPCI2CState { uint8_t cr; uint8_t sr; uint8_t dr; - uint8_t dfssr; + uint8_t dfsrr; }; static bool mpc_i2c_is_enabled(MPCI2CState *s) @@ -293,7 +293,7 @@ static void mpc_i2c_write(void *opaque, hwaddr addr, } break; case MPC_I2C_DFSRR: - s->dfssr = value; + s->dfsrr = value; break; default: DPRINTF("ERROR: Bad write addr 0x%x\n", (unsigned int)addr); @@ -319,7 +319,7 @@ static const VMStateDescription mpc_i2c_vmstate = { VMSTATE_UINT8(cr, MPCI2CState), VMSTATE_UINT8(sr, MPCI2CState), VMSTATE_UINT8(dr, MPCI2CState), - VMSTATE_UINT8(dfssr, MPCI2CState), + VMSTATE_UINT8(dfsrr, MPCI2CState), VMSTATE_END_OF_LIST() } }; @@ -329,7 +329,7 @@ static void mpc_i2c_realize(DeviceState *dev, Error **errp) MPCI2CState *i2c = MPC_I2C(dev); sysbus_init_irq(SYS_BUS_DEVICE(dev), &i2c->irq); memory_region_init_io(&i2c->iomem, OBJECT(i2c), &i2c_ops, i2c, - "mpc-i2c", 0x14); + "mpc-i2c", 0x15); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &i2c->iomem); i2c->bus = i2c_init_bus(dev, "i2c"); } From patchwork Tue Jul 23 20:38:38 2024 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: 13740356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4EDC7C3DA63 for ; Tue, 23 Jul 2024 20:41:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJ6-000856-Oe; Tue, 23 Jul 2024 16:40:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIo-0006fF-4Z for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:09 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIl-00041o-CQ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-427edcc207cso10657395e9.3 for ; Tue, 23 Jul 2024 13:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767200; x=1722372000; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vEOkd3+zxom1XlmbkPPQvUDNjv9xP8TI/j35/QIU7mo=; b=gnP0B4UrGUazyktAluHhqjQUScuI1L/OmURPCarBu/6UJWaWxRzxuxY9blIllaVcAP i8Db/T2cy6Ye1a+VE8VQTlv7lRfxI4KzTPf9xFKOsZAms8GJt3Thqmpxn5YqCevpmE0P kp63ywRojTRSBnl2krCNGmilDjaC46clZoAYmT7FHI8c8mcTxNQXyEah7WfyYAuUKRbn ACOaa4SZhBBNgN5JGyAGxX+/jhPjqZDKvsKkw/z4oqXi7pZthOowUAeyQlNmJpw/Ea2+ W+/Xfxs5GYJp7SAE7sl6DJ+gKnoOJjfwKiWs02AWljAbakTeWDkHtzGpfQcam3leElrq 5lsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767200; x=1722372000; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vEOkd3+zxom1XlmbkPPQvUDNjv9xP8TI/j35/QIU7mo=; b=EII9ANAlmTz+ms6lPcVxf6WlqYwPzWUvoYdI9HGXDJa3aL+gVX1WNTI5x/VDA/c/Fu wvBA1JzQezjwkOW+y1AGz01+vDWSV//lYCV7VCGXW46UKN69ogfts4I2lcwl3GrBmY4c HgfTjEeP8rRvMluo5wxVJ6FJ85WONPwZQYw5YvgJYqQ5VoOIFaRgx5EKQRz7m+mVokiC AaPzbVBn3mBzh1FjMDUgKGQiMKPyelK0U1ijsyluwaueFDpELpoJUK42b55aR2K+vufv DfvyBPHcEt1ngOYt6ZyB9guqK1mQFFQ2riV5JVMGsq0GQAlrNIhwSVbySU9+56MNyJ3h Xuzg== X-Gm-Message-State: AOJu0YwAOfjzbNZr/KAHUERpPbahTZMpheA+n42pzsxB5cl1Qd5rqEQq gPH0L5MB7Z3gKi8iXerZq9XkQD42FHCNOQhryBH+W9xPZ4WQm3vJf34//hWwjhRuWOiAtn4mrea 2u+g= X-Google-Smtp-Source: AGHT+IG/JD7on6qkNkS7D2ufluexNdsnztjMRqzUsh2dMGW4owb5snE1Lf3MQRkUkNQ0dBB5hG9Fgg== X-Received: by 2002:a05:600c:19cb:b0:426:622d:9e6b with SMTP id 5b1f17b1804b1-427f95b0f94mr12795e9.23.1721767200235; Tue, 23 Jul 2024 13:40:00 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9372e99sm532325e9.16.2024.07.23.13.39.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 11/28] hw/mips/loongson3_virt: remove useless type cast Date: Tue, 23 Jul 2024 22:38:38 +0200 Message-ID: <20240723203855.65033-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast the pointer of this type to uint64_t* is useless. Signed-off-by: Yao Xingtao Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240722091728.4334-2-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 4ad36f0c5b6..408e3d7054c 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -355,8 +355,8 @@ static uint64_t load_kernel(CPUMIPSState *env) kernel_size = load_elf(loaderparams.kernel_filename, NULL, cpu_mips_kseg0_to_phys, NULL, - (uint64_t *)&kernel_entry, - (uint64_t *)&kernel_low, (uint64_t *)&kernel_high, + &kernel_entry, + &kernel_low, &kernel_high, NULL, 0, EM_MIPS, 1, 0); if (kernel_size < 0) { error_report("could not load kernel '%s': %s", From patchwork Tue Jul 23 20:38:39 2024 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: 13740372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B7C4CC3DA7F for ; Tue, 23 Jul 2024 20:43:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJ8-0008Jn-4p; Tue, 23 Jul 2024 16:40:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIs-0006s0-AQ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:10 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIp-0004EA-K6 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:10 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-427b4c621b9so40018475e9.1 for ; Tue, 23 Jul 2024 13:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767205; x=1722372005; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rcNZQQ0nKhi9U2udqnFLIBFior9dBlBIvCxC4fyrbfU=; b=MQZBDdsh+8KfLeZJK2ROecLVJs+FsUan2KWdDAwamQ0iryU4J/0x74sYbU5aMLfKPg ljwiqJHpYSpC71cRUgBzCSHGsPnxmaure0A/oRAMXeJN93oAwE2Ew3vrzVXhqJixoYdE K9atdKa6UAXmMKF/01eOP/ZXlG/A9XROSRBEfCLB2zf3E9YjRdusHxq2lO00VgqmNcyY wz/hrW5SnBjkLfPetYl965rHFT4J1S816cVoiPrkZbXn+UlAE88mk5BNy8cdAKUfTTQx SJSQB8/xA81zqIR0PBjtQJrXxze8F56un9f97Gd6sO/C92VREJgUx0Kyk8tBusF73bcU rCfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767205; x=1722372005; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rcNZQQ0nKhi9U2udqnFLIBFior9dBlBIvCxC4fyrbfU=; b=vET8tUIwUC/GQTpaNrhGq7bxHvWA7T4C/WA2r/9y0zA1boYhppLr8zi4y/wvKoeO93 I9EFXz28QjrQxUim+kCIl9dtH3VtMJoJiKMS5LA2lu7DwUtaAs91G0MAiKKYore4PIpI Y3yASJor4F/t5EKtZaRx20rU2BXaYXwr6qWLptFMrFGn2wJK8cs1t5xGgy8LYtqPDnAi Ka0sqLn/SgZ27WI+8DMsw1Aaqfd4mZsEVtlRb1XE3ZajYAEhF3qMkNxfMOYIieF52YjD HaBWEKDP2qQGbp6a9O868hs+Sjq7GzyEmlt4XipUnRbBXQpm1ieG70I1DVRZ72rdyhZD GwGA== X-Gm-Message-State: AOJu0Yz2o2gUZUerRJJNx+y5YNp0Upq8xkYW3JUevd4H12PGxmoCss7p bmCBs4Z8glu3b2cPQhsJsMzc1JRYa/1V7xqOwxMe+okcfo7xKvPGWY+ZRulVpMATiMRr0JoUpGc 86Ok= X-Google-Smtp-Source: AGHT+IEr4xLEs0e1uDun0tR1343R6BLZLmCVbrCA4Yj3SaEJBFe+ubjjHSa3GykRhK+rSwdHwZIY3Q== X-Received: by 2002:a05:600c:4ecd:b0:426:6ee7:c05a with SMTP id 5b1f17b1804b1-427f95562b9mr114755e9.15.1721767205614; Tue, 23 Jul 2024 13:40:05 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f93abff8sm442335e9.38.2024.07.23.13.40.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 12/28] util/range: Make ranges_overlap() return bool Date: Tue, 23 Jul 2024 22:38:39 +0200 Message-ID: <20240723203855.65033-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao Just like range_overlaps_range(), use the returned bool value to check whether 2 given ranges overlap. Signed-off-by: Yao Xingtao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240722040742.11513-2-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/range.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/range.h b/include/qemu/range.h index 4ce694a3983..d446ad885d2 100644 --- a/include/qemu/range.h +++ b/include/qemu/range.h @@ -210,8 +210,8 @@ static inline int range_covers_byte(uint64_t offset, uint64_t len, /* Check whether 2 given ranges overlap. * Undefined if ranges that wrap around 0. */ -static inline int ranges_overlap(uint64_t first1, uint64_t len1, - uint64_t first2, uint64_t len2) +static inline bool ranges_overlap(uint64_t first1, uint64_t len1, + uint64_t first2, uint64_t len2) { uint64_t last1 = range_get_last(first1, len1); uint64_t last2 = range_get_last(first2, len2); From patchwork Tue Jul 23 20:38:40 2024 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: 13740369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CBFF3C3DA49 for ; Tue, 23 Jul 2024 20:43:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJI-0000uu-12; Tue, 23 Jul 2024 16:40:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMIy-0007Y6-Fi for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:18 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMIw-0004Fh-GE for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:15 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-426526d30aaso44701285e9.0 for ; Tue, 23 Jul 2024 13:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767211; x=1722372011; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=efl2J6FZMNBybvIOohahy/rqbvmAN7ozlP6FIF0OQ4s=; b=QfZaLrxWWJ40W9K54k+09t0exDCPNjKY9S2tOAT4/qLaLQTvZDWLLgKUjttgmw2L+L PktN9OnMXGvhKfjhHgJ7azSYBfv9ikbZ1gZhVFoL9kGbFGaNbXU4PXmFWoqSR3U2d9gS UizxYFtFvRQcVGo42YHFidEjOi3+vpT7k80YPLP3yNkRqIjiD4B24DS1FNMxQo/gPFIf DaT8IU6W9xLo1dyeCN1MyMjI51U1iSmjjCxjUMeZDvb4UH9u2752bNU5GmsuLq1cM90k 2bB/dOgncAEV5cmsTrLNH96zazlZ62wSTa5dPx6yyhvtO6YjmVlzNjkkQbtr3wTyjx41 ASoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767211; x=1722372011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=efl2J6FZMNBybvIOohahy/rqbvmAN7ozlP6FIF0OQ4s=; b=ua8OGrB7gzbdv/VwYdXQp0bEg4kdMdW1YzvALbWQvKi8DRPEef6fdGZTjbkN8eP8ZL gast4moUEogPyzq5kR5oIf5yUn1XCAqV8AnVdj1J8dzCjL6Woch55LljhAYSICRL2v3D HXMxvtrloEAGxHvejj1v1Udsj/cmITgWtj6Na3VuDxnZurs/Lq4lsuUlh18ht7CHlvf0 ZQyHMBVxpQoqg7z5D7KnHh9jPY09Fx3FKcmocmoVQBNG6IEA5r3eztyLP2KSifJQTJwy iIfC6l/fogpjTTS4RcwD7BHP2qxOTivqb8LRK/xBvGfOfe5lDUhwDZvHgAivgEfgca8t e3QA== X-Gm-Message-State: AOJu0YzV9Nsf1zAssu18yuXlJ1wEsyMFHmCweO9B0iRMk8AwrhUUVU2+ 0Bx4qJ03SVtk0q+4c0BJ0Eqr6pph7DaLHiweqvUxRVFijwgoWe50IrgBKBOShsqKt6tU1B8dx1p E7js= X-Google-Smtp-Source: AGHT+IHj6RYFqo7w48bpHyWmP4T+IUyN9ddN93a5N5am/uV5A6O9Qbklt4EqwRGAuu/LiRgiYmLbtA== X-Received: by 2002:a05:600c:4586:b0:426:6f0e:a60 with SMTP id 5b1f17b1804b1-427f955c2d4mr81865e9.17.1721767211490; Tue, 23 Jul 2024 13:40:11 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9413663sm316075e9.45.2024.07.23.13.40.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 13/28] cxl/mailbox: make range overlap check more readable Date: Tue, 23 Jul 2024 22:38:40 +0200 Message-ID: <20240723203855.65033-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-ID: <20240722040742.11513-5-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/cxl/cxl-mailbox-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 74eeb6fde73..507690c0dd1 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -1086,8 +1086,8 @@ static CXLRetCode cmd_media_get_poison_list(const struct cxl_cmd *cmd, QLIST_FOREACH(ent, poison_list, node) { /* Check for no overlap */ - if (ent->start >= query_start + query_length || - ent->start + ent->length <= query_start) { + if (!ranges_overlap(ent->start, ent->length, + query_start, query_length)) { continue; } record_count++; @@ -1100,8 +1100,8 @@ static CXLRetCode cmd_media_get_poison_list(const struct cxl_cmd *cmd, uint64_t start, stop; /* Check for no overlap */ - if (ent->start >= query_start + query_length || - ent->start + ent->length <= query_start) { + if (!ranges_overlap(ent->start, ent->length, + query_start, query_length)) { continue; } From patchwork Tue Jul 23 20:38:41 2024 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: 13740363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0F300C3DA49 for ; Tue, 23 Jul 2024 20:43:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJG-0000fE-4c; Tue, 23 Jul 2024 16:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJ2-00080B-Vl for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:21 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJ0-0004GF-QC for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:20 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-369cb9f086aso2071619f8f.0 for ; Tue, 23 Jul 2024 13:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767217; x=1722372017; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pqhDz9jkzJVJQG2tzSqklstnX2oao7JbXMBXUDlT2s0=; b=lhQpAjNpUj2d8fkr0XCwzjRhteDtmS3dEbYCxXIodEx/hN3cTer2VzlJKVr5ySllq8 LD5Vr+Kfy508M0YQ5UurQV7s7dAVcHEgQcNbjxz0VVpU405GWXm2/ORNpGx1ul7VBJJX +zUCAUZxaxI5sS09jdC/xWIDwly+7j16orA2GBDO4H4+FNjQnr6bx7rrjecUDpvN6F5e MIK+Ju0HP+wfL79k5yaSg6FpWuX7cITKTAJ8Fxg2Lp7TEaJJnJjsQPf7uURcIYLdXQwQ F+JUqJAmhAZT94+oKRp+lhdICq3VQSLdZmuPAFK4E1tATlnHDGYHrb94Yv+700cl4oJq Bbaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767217; x=1722372017; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pqhDz9jkzJVJQG2tzSqklstnX2oao7JbXMBXUDlT2s0=; b=vwzMc1p+s4p8wqeRPRXE38hZ/XS5XbTBhxDapumK/BSm6StvvltAHEcEX19BuuMUCa DQm9oL8tUuq3WKhTNqnrUdjPema1sGd12D6wptKL+6JCJUWGdGp/RNqm84fv3xcYmRWv psfgI0WWX8iv2gm/nim7bHy5mHIJbSxYDU4Xskn1DkfSFQ57K3HKFUp7i+2BlEen0m27 jSP55iDfjtrqoxgo+1jbdizxLnN9PNehCxMd41lUmIsog1tdrPs+FMcSzrTDOXLTa+A9 FZO4uqe7vEmlacCzJGjjf1+q6OzGdafVTtx5QN9X6AGF8xroQVifdQqEL2f8DM/5AgXT TYPA== X-Gm-Message-State: AOJu0YyxBDyy/UtRtfY0Fpm6/NYkZ+WMApb8owV9IklYqeLctf2OF+rA 78BZXXNwdZSR8SR+Z4WlRIdXH7sVFRHHtN5O5gtVhgVoLtGicVMUvq5TtvGaHnkvN/ELSSInk5c pZKc= X-Google-Smtp-Source: AGHT+IElmPSE0293WEGARsdDyOGAzPplpJCqtDI/v2lMSEwrEPj48xacn2u84oW10zp7efsHROHLvA== X-Received: by 2002:adf:f38c:0:b0:367:402f:805b with SMTP id ffacd0b85a97d-369f5af631amr43652f8f.2.1721767217092; Tue, 23 Jul 2024 13:40:17 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427ef3f4665sm25877335e9.0.2024.07.23.13.40.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 14/28] sparc/ldst_helper: make range overlap check more readable Date: Tue, 23 Jul 2024 22:38:41 +0200 Message-ID: <20240723203855.65033-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240722040742.11513-9-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/ldst_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 2d48e98bf46..d92c9f15934 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/range.h" #include "cpu.h" #include "tcg/tcg.h" #include "exec/helper-proto.h" @@ -240,9 +241,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb, if (new_ctx == ctx) { uint64_t vaddr = tlb[i].tag & ~0x1fffULL; uint64_t size = 8192ULL << 3 * TTE_PGSIZE(tlb[i].tte); - if (new_vaddr == vaddr - || (new_vaddr < vaddr + size - && vaddr < new_vaddr + new_size)) { + if (ranges_overlap(new_vaddr, new_size, vaddr, size)) { DPRINTF_MMU("auto demap entry [%d] %lx->%lx\n", i, vaddr, new_vaddr); replace_tlb_entry(&tlb[i], tlb_tag, tlb_tte, env1); From patchwork Tue Jul 23 20:38:42 2024 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: 13740351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3AA75C3DA63 for ; Tue, 23 Jul 2024 20:41:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJH-0000tM-Eo; Tue, 23 Jul 2024 16:40:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJ8-0008Op-B3 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:30 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJ6-0004Iv-HN for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:25 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3684407b2deso3281156f8f.1 for ; Tue, 23 Jul 2024 13:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767223; x=1722372023; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QlBR/BeAgLJfmHQZz0VW3T3k1ZaI6aRPlMOhtzIdfss=; b=vz3J4jLz71NQbBchq1lHvyHCwrOAUm6OqB2vsCk8PSQjuj7afSttTTjLmvi8FQBHmO 4aITS38TiIBXSbnzEhreJXIoJgquKxAu5+AWaYBWei//AkIvI8ceT4ziVM7hqeJoxLJN X9D9EkpBmx2+x3snc7TjwXJ66L9o0xDvY/P5WBxWh4Z9m708Au+1PNw9qb4GNT+CUy3Q iRhfc2098THUHje5zDGN59HRs6AQfV/5oWpW0EWopKTQFLdDK/Su29ZLJnAKaD5hOTAw 4VupYByd9Qo3fqrPs45ExKLOAhD7vlUqe4ClyAYUoXCa2URGDmyYs3ngPOWk2bwQGchM r8Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767223; x=1722372023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QlBR/BeAgLJfmHQZz0VW3T3k1ZaI6aRPlMOhtzIdfss=; b=mWVuCYduALVGAiRFhqAYq1NcVLOc71SJHEFDj6DjWNWPHX8WCrqBapdCiBMISVFO7e 5s6ffwPnsAKYrHLnFFPxnB/eUWYupLvFF9fMM2xdCT3Tg+Ym0d97SssCBZdb/lAp4iD6 AEQF74dHBBdrOW67ihyI6FXchcMb2XM2j/I5kqvyHvw1R0h8FXzJIMTEHD4JD0/h0BRM A6cXW3BvxzQV1njOx2YZX0hyebOczxbko0k3GCwB08t/ADHDXPUFIxobG2bthxw9LhAf iuyix4DTYDj616Pa11LcL87JE2+tvcZnDPBGq3CQghf5qxc+h+WaU4vEYFLIBHJcgJ/y woVg== X-Gm-Message-State: AOJu0YyY4bPCGmOxW6c1OL1qE7cb5AMIaYI3WVYTSw73/ipjM7PZc0Fb lHJpb74L1FeER1AA4W+RA2x8/2TNk7pYcCJ2PZQxJLmgwz5RtdJBG/TXQybG572K6oykrNSGGP6 0auU= X-Google-Smtp-Source: AGHT+IEnz+rDcxL3ZYWG1WFGKucBEjEh8YbrVtMFT5aABbwvdCRis0lKzfVckOVdvUfnRvM5kPkkvA== X-Received: by 2002:adf:e605:0:b0:367:96d6:4c2d with SMTP id ffacd0b85a97d-369bae35a62mr7181631f8f.25.1721767222666; Tue, 23 Jul 2024 13:40:22 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3687868ac54sm12427512f8f.28.2024.07.23.13.40.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , David Hildenbrand Subject: [PULL 15/28] system/memory_mapping: make range overlap check more readable Date: Tue, 23 Jul 2024 22:38:42 +0200 Message-ID: <20240723203855.65033-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Message-ID: <20240722040742.11513-10-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- system/memory_mapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/memory_mapping.c b/system/memory_mapping.c index 6f884c5b90c..ca2390eb804 100644 --- a/system/memory_mapping.c +++ b/system/memory_mapping.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/range.h" #include "qapi/error.h" #include "sysemu/memory_mapping.h" @@ -353,8 +354,7 @@ void memory_mapping_filter(MemoryMappingList *list, int64_t begin, MemoryMapping *cur, *next; QTAILQ_FOREACH_SAFE(cur, &list->head, next, next) { - if (cur->phys_addr >= begin + length || - cur->phys_addr + cur->length <= begin) { + if (!ranges_overlap(cur->phys_addr, cur->length, begin, length)) { QTAILQ_REMOVE(&list->head, cur, next); g_free(cur); list->num--; From patchwork Tue Jul 23 20:38:43 2024 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: 13740358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EEB2FC3DA63 for ; Tue, 23 Jul 2024 20:41:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJJ-0001C9-Ph; Tue, 23 Jul 2024 16:40:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJE-0000be-TZ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:33 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJC-0004M5-EA for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:32 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4266eda81c5so52350225e9.0 for ; Tue, 23 Jul 2024 13:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767228; x=1722372028; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bELfHk4oMv9ib41OJIdVRWkzH2ywz3o3d2vSZHxMu3U=; b=RK+UIhVtK8hxHlkoBAmgJcTms9ifmyMR+w1i3VlRsCkDVAOB7vVQ9BPe8Q4wHxMBVE pmlHZk6MHoob8y21NL3t+bxkIEjXsXg03qn8RvXI5mh9Ih4PejDFJ1gtqYTu18dGsXE8 cBx5HDwyEm7NtCKPAZSWw3S7pcRM/jbn13xdlDfeBKiuPE7JNe1F+r0PyeXaILhZQ56X oRmfCsMyL0ZYVm27R0yTozYFxlwRO8bh33gSym+X/Z+yiiTfLkHdnXNGXZpHwX+OXATm biMpin/xjzsAD+2q3hD5fxx9BBXDvYmTV0e0l+MYPRWKbqGOIihB/xMyx17qAyNdKSWL zXag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767228; x=1722372028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bELfHk4oMv9ib41OJIdVRWkzH2ywz3o3d2vSZHxMu3U=; b=Wjr9tpxKa54/eJCVOdbqZ/EEhRxwoD+pokqZ8rYBu1hU9Yw1qCK+nyaVgXGJQ+vkPo 6TbHc1P2qZOAejQTSBVwMXXfXhJd48ldkzSnOmlDQK5mqavzRM7eSMBnvCkJuTBfQpeK jYIcQDQsA10WurXDGnQShu0OydH1+7hZ9fw6sSaI23bT57K8pRRCb33Jgl6Atm4ztTMH 1g6tAffrK7s/8floQrT8qZUXhABeETG72IANZJEgPt4EhPNaBceU6P6bRlFyFXs/RYwm bec9b8xzWJxsYbv1e74Ft6QKnIPsV58wx1D/u8IbFNdAtUCxVW0PIKDH+5bYKIUs4u4J jO/A== X-Gm-Message-State: AOJu0YyiTohyy98aeSGjhPAZ/LK4KyUWfmjhcQfQJA4t8cnFlHzTYmFr wLX4izZyRvD0IpsFk8X7W4EQZ13TMxEHIHF1c1+qkIv9BEB5BELtBCcKrDcecnid8WN3f3xAw0D h0yo= X-Google-Smtp-Source: AGHT+IEXQVGc+DMr9iNCRoC3AXhORrn+nS/1uuISM9fIH4K/vryx23FDxBGUNc+zAQMZWl+nrA1PLw== X-Received: by 2002:a05:600c:1d24:b0:426:6416:aa83 with SMTP id 5b1f17b1804b1-427f7ab6468mr4940655e9.6.1721767228163; Tue, 23 Jul 2024 13:40:28 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f93e5eeasm362685e9.38.2024.07.23.13.40.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PULL 16/28] crypto/block-luks: make range overlap check more readable Date: Tue, 23 Jul 2024 22:38:43 +0200 Message-ID: <20240723203855.65033-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Message-ID: <20240722040742.11513-12-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- crypto/block-luks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/block-luks.c b/crypto/block-luks.c index 5b777c15d3c..45347adeeb7 100644 --- a/crypto/block-luks.c +++ b/crypto/block-luks.c @@ -33,6 +33,7 @@ #include "qemu/uuid.h" #include "qemu/bitmap.h" +#include "qemu/range.h" /* * Reference for the LUKS format implemented here is @@ -572,7 +573,7 @@ qcrypto_block_luks_check_header(const QCryptoBlockLUKS *luks, header_sectors, slot2->stripes); - if (start1 + len1 > start2 && start2 + len2 > start1) { + if (ranges_overlap(start1, len1, start2, len2)) { error_setg(errp, "Keyslots %zu and %zu are overlapping in the header", i, j); From patchwork Tue Jul 23 20:38:44 2024 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: 13740359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1741DC3DA49 for ; Tue, 23 Jul 2024 20:42:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJb-00036i-Gi; Tue, 23 Jul 2024 16:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJK-0001I6-5u for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:42 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJI-0004Ne-25 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:37 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-367963ea053so4295768f8f.2 for ; Tue, 23 Jul 2024 13:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767234; x=1722372034; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2N8bD0EiQwQSfnPzHE5ISzd574iE9UTxrUPygv1PgWk=; b=X6CifGpN5f7R3sDxPih/4GB9XCUk2rV/FSV675VobXIQ3u+IGjRkO15SFAzgbivmmt IStqD4XS/KuuYvPamc60xPK9LXAz9oNHDa691sI1X+jEf/t235JtOK+CGatIJUsMFnQm GdaI6k4Fkr/D+UWEObuIBbYAvKry7sPvGBV4zO5pfI750p20MrbKWFs4J82MSGgRghLj meE1FVLgrUU0pSEKf4IJhfoiH0mKZDL8f0U9oQ3O4jQN3+5vJr5SXZO9adgdpZiBW3nN T9VRy6KgVrT1bHcz9c4CfuaE74tAG09bC/hsVg88I7sUPAjr78KLZ9IZXoCtNWJ60kNc ynwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767234; x=1722372034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2N8bD0EiQwQSfnPzHE5ISzd574iE9UTxrUPygv1PgWk=; b=sd0eD4pNQBKPrPfzC2XJMr+RR037nX5JTZY2gqTAdJt5D13jMSVVqedgMVBOR9bEwF hsGkMNuB626XgYoO3r1skcclbZYK/Ml1/0h6k3cpLf4B1xXP4gJo3e4LQSxSShesGTT8 rWE2BnFW3L2tg0upDYCDVslt4uEHUDh/s7uNp7LSoertISZp/cO/aZW0SDow7arxC8lf 77ohg9Q3LoAau+M5TN0fLu2Il9SZ6GC1IPSUhT0ixDYVT0SPK2DUxUHvK4JOFxSG/yrn hnibJ3MYgVDiLdNFNE4k2wxDraOCPNR9zlbOpQOX1gg2kvHLyEOowQQTgLnWzZ1zLYwT 52oA== X-Gm-Message-State: AOJu0Yxj4J2tX5KIbTAs855uiYII6J/rmPcy2+pk8TDavgBAtkWaUA2P sSTzNJdKSQ4XQlDaJY27FgQ7qENtEnDCxgHx1BI4/tiPVhUNQUaL9ygILSJa23JMc5/W+UpnrsX clCU= X-Google-Smtp-Source: AGHT+IFmvp7Mu6eu4KTV8dwUEh3RqzCxejJRvzau7t9u+3Y3aZp10BJ7wrGiVrFgKgctY2kCOoGpZQ== X-Received: by 2002:a5d:5751:0:b0:367:9d4e:8861 with SMTP id ffacd0b85a97d-369f0a994acmr632762f8f.57.1721767234014; Tue, 23 Jul 2024 13:40:34 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787cee03sm12462353f8f.76.2024.07.23.13.40.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yao Xingtao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/28] dump: make range overlap check more readable Date: Tue, 23 Jul 2024 22:38:44 +0200 Message-ID: <20240723203855.65033-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Yao Xingtao use ranges_overlap() instead of open-coding the overlap check to improve the readability of the code. Signed-off-by: Yao Xingtao Reviewed-by: Marc-André Lureau Message-ID: <20240722040742.11513-13-yaoxt.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- dump/dump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 84064d890d2..45e84428aea 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -30,6 +30,7 @@ #include "migration/blocker.h" #include "hw/core/cpu.h" #include "win_dump.h" +#include "qemu/range.h" #include #ifdef CONFIG_LZO @@ -574,8 +575,10 @@ static void get_offset_range(hwaddr phys_addr, QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) { if (dump_has_filter(s)) { - if (block->target_start >= s->filter_area_begin + s->filter_area_length || - block->target_end <= s->filter_area_begin) { + if (!ranges_overlap(block->target_start, + block->target_end - block->target_start, + s->filter_area_begin, + s->filter_area_length)) { /* This block is out of the range */ continue; } @@ -734,8 +737,9 @@ int64_t dump_filtered_memblock_start(GuestPhysBlock *block, { if (filter_area_length) { /* return -1 if the block is not within filter area */ - if (block->target_start >= filter_area_start + filter_area_length || - block->target_end <= filter_area_start) { + if (!ranges_overlap(block->target_start, + block->target_end - block->target_start, + filter_area_start, filter_area_length)) { return -1; } From patchwork Tue Jul 23 20:38:45 2024 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: 13740362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B7C11C3DA63 for ; Tue, 23 Jul 2024 20:42:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJY-0002Wn-Gz; Tue, 23 Jul 2024 16:40:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJP-0001ey-2H for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:45 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJN-0004QX-9B for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:42 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-36844375001so3393229f8f.0 for ; Tue, 23 Jul 2024 13:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767239; x=1722372039; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=McKHquff5/qMRalcyN7OIwCMwCYYM5fhTICEYe9ToHg=; b=Fzo+aERdpm7HcFj4Gd29zqVgcoYkCwGoOBa+Q0iGmgoC8mqWseAgeTaZU5NTdZg30o WPIIs7dXC39vFCKnJXoTcSoXaRdv2kuwnBzTzgw2swyUyKb55eIz1xN26na3VvPCIArV U56um/1BB76CISpzNuIRR+n5fYGacV1fAYxXDFDMCxul+2MF52cbm4l6Ytd2Trcn2ccS TYtKJUZPiKdI2tAQdzeeE5Q6n3E66dkUhhvldGPfNxs2+EVg1a/o9cKSrzu92f3bLZ5w V4v7rvvsg5jk5ub0r5mPJeIzR0kPX1ODOkcAF2dLgywd2hv+u8n9KPQt9eYu4kCPaYwN 2jzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767239; x=1722372039; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=McKHquff5/qMRalcyN7OIwCMwCYYM5fhTICEYe9ToHg=; b=vXehf20EcY3ejoV0Ei4GMMBfSKXF4AGLF/BHRFHMdOGPSzhZdRZmr3y39bs3lIwDGj Zk073w9VHDSjBdwKM8Zy3fNkz4B1tgv/S67z+roRBpewrR7jOtaaZh764bVBbWjh16Fu oxhVMqY5TXY/S8JrdvtiXT2Llm0CKfnFmKxGFykXwBJWlkBLkMinLYpUehbUOZDJqPEu L+vBqH+crm2BDQPHHr+JZHZexOVVQODQSmnopSmLz0I1R9Py6fYwSND93g0pmR8CZIVV sFuSKU1YJurTXEXt9NvGqpZanl6Gc1CFzfo/Vm6ZbzEy/2sZ6NgbuYW/GFiF7x6b4xZI QQwA== X-Gm-Message-State: AOJu0YwwcEiaHKq9TVeD+nmKo4nCfAolbbuiwyh2MgL2Ogztx/pSW+e3 FEq5NsxguG87AcIkPa+dMVr9QdmvkXhryAOtbt3sTyMAosS3h1+K3evjFroYXbmGZbhMohBneCJ vypE= X-Google-Smtp-Source: AGHT+IHnk625/khGNvD1ccVYa/EYeq0wZHtqPBlRu5r5aTdSfBJWafRkUQ1h+3UZLC4HuSFHRGpYYg== X-Received: by 2002:adf:9790:0:b0:367:909b:8281 with SMTP id ffacd0b85a97d-369f5b9ebdcmr19251f8f.59.1721767239488; Tue, 23 Jul 2024 13:40:39 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3687868482esm12386768f8f.16.2024.07.23.13.40.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 18/28] hw/nubus/virtio-mmio: Fix missing ERRP_GUARD() in realize handler Date: Tue, 23 Jul 2024 22:38:45 +0200 Message-ID: <20240723203855.65033-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Zhao Liu According to the comment in qapi/error.h, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. * * Using it when it's not needed is safe, but please avoid cluttering * the source with useless code. In nubus_virtio_mmio_realize(), @errp is dereferenced without ERRP_GUARD(). Although nubus_virtio_mmio_realize() - as a DeviceClass.realize() method - is never passed a null @errp argument, it should follow the rules on @errp usage. Add the ERRP_GUARD() there. Reviewed-by: Markus Armbruster Signed-off-by: Zhao Liu Message-ID: <20240723161802.1377985-1-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/nubus/nubus-virtio-mmio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/nubus/nubus-virtio-mmio.c b/hw/nubus/nubus-virtio-mmio.c index 58a63c84d0b..7a98731c451 100644 --- a/hw/nubus/nubus-virtio-mmio.c +++ b/hw/nubus/nubus-virtio-mmio.c @@ -7,6 +7,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/nubus/nubus-virtio-mmio.h" @@ -23,6 +24,7 @@ static void nubus_virtio_mmio_set_input_irq(void *opaque, int n, int level) static void nubus_virtio_mmio_realize(DeviceState *dev, Error **errp) { + ERRP_GUARD(); NubusVirtioMMIODeviceClass *nvmdc = NUBUS_VIRTIO_MMIO_GET_CLASS(dev); NubusVirtioMMIO *s = NUBUS_VIRTIO_MMIO(dev); NubusDevice *nd = NUBUS_DEVICE(dev); From patchwork Tue Jul 23 20:38:46 2024 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: 13740364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D2FF2C3DA49 for ; Tue, 23 Jul 2024 20:43:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJa-0002py-35; Tue, 23 Jul 2024 16:40:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJU-00025I-2g for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:48 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJS-0004RN-DZ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:47 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4266f535e82so43047005e9.1 for ; Tue, 23 Jul 2024 13:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767245; x=1722372045; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F/yrpwbL/sETCyin9I+oHUPZfHbu6njuZ4wq9Na1o4A=; b=LIw6LwRbIQXe9LEuMswlNW5CY8TJEiurSyHCthK3vo/g23MfgfNSQgxwj1VVY3vRg8 ZixBOWVgycTDuESiwgjnyz4X0Tl6dz/ptUeapRlN083+mdEo26OGGzuPza3lIlrO/qD4 t61DQEA3Xkh1sJ9yKJvoHZxqxbVHwZybVnZuuRYorgzoHd26E17TZhdEPM4ZmkVeVnu8 hLMiBFgnMw8k7t1E3VkwJg/hvkBye+5VPmHhFNXt5Y40FN6BD1It90FdAvcN8rv+nUbn 90v+i1SrAnnX7/9VmCR8uYzwJs+Wd3HnHsrVO5tAwG+szkbI9NTOJBN4z923dp2T/7l0 3npQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767245; x=1722372045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F/yrpwbL/sETCyin9I+oHUPZfHbu6njuZ4wq9Na1o4A=; b=Z/vhoqoYAWCZ2TEG08o48qJkN86Jtt5YMd0m4pKFwGisHY32TQtyFVhv8zW0MmcbIX 2rSPWjFDGjQQoy44hNMoVsxUJ/a+AJRGLe2yRt+2ZnrSqUvyCHHcja+q2urFytpLzC28 iViyaMVN6PCF8rXZGboea0s6S9H8OjMRkvw2vJsdvEtxf9C60iL2cRG42mF4rdMiQbWm 0GIhjvTZldPw7mAtNcXlzc9dvILJ0OhpOhP6ElSF3+Mkso4Khz24qLjMu7sKT9uLVYLV P82k9bWhe1S17ysF+lySu/0XbchwbNgfgF4SF9i8Dc/IsVgFnOixWfBQk64/4+vM7nGS 0YJg== X-Gm-Message-State: AOJu0Yxn7SXz7n7JQwBw6mlTgc90gs/Djsje+Fr+7WHhlPDH8kpLerse wR2BOaEsteWthbjPpWIn83gwXxQGzuMM/NoRXdLHeZvYzjU2Zi9aye69ZFmlDiSU126S7ePtwq8 9yzk= X-Google-Smtp-Source: AGHT+IFiBXhYHIAzVlWhXrp/TBqau1VQTshg1DAjiVcO1ZXCliV7JlF6jcOvFzaCAk5O011P7IqqCA== X-Received: by 2002:a05:600c:3542:b0:426:5c36:207c with SMTP id 5b1f17b1804b1-427dc569de8mr70546675e9.25.1721767244800; Tue, 23 Jul 2024 13:40:44 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787ed572sm12368044f8f.110.2024.07.23.13.40.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Pierrick Bouvier Subject: [PULL 19/28] hw/char/goldfish: Use DMA memory API Date: Tue, 23 Jul 2024 22:38:46 +0200 Message-ID: <20240723203855.65033-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Rather than using address_space_rw(..., 0 or 1), use the simpler DMA memory API which expand to the same code. This allows removing a cast on the 'buf' variable which is really const. Since 'buf' is only used in the CMD_READ_BUFFER case, we can reduce its scope. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Reviewed-by: Pierrick Bouvier Message-Id: <20240723181850.46000-1-philmd@linaro.org> --- hw/char/goldfish_tty.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/char/goldfish_tty.c b/hw/char/goldfish_tty.c index f8ff043c396..cdff46bc13b 100644 --- a/hw/char/goldfish_tty.c +++ b/hw/char/goldfish_tty.c @@ -16,6 +16,7 @@ #include "qemu/log.h" #include "trace.h" #include "exec/address-spaces.h" +#include "sysemu/dma.h" #include "hw/char/goldfish_tty.h" #define GOLDFISH_TTY_VERSION 1 @@ -69,7 +70,6 @@ static uint64_t goldfish_tty_read(void *opaque, hwaddr addr, static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd) { uint32_t to_copy; - uint8_t *buf; uint8_t data_out[GOLFISH_TTY_BUFFER_SIZE]; int len; uint64_t ptr; @@ -97,8 +97,8 @@ static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd) while (len) { to_copy = MIN(GOLFISH_TTY_BUFFER_SIZE, len); - address_space_rw(&address_space_memory, ptr, - MEMTXATTRS_UNSPECIFIED, data_out, to_copy, 0); + dma_memory_read_relaxed(&address_space_memory, ptr, + data_out, to_copy); qemu_chr_fe_write_all(&s->chr, data_out, to_copy); len -= to_copy; @@ -109,9 +109,9 @@ static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd) len = s->data_len; ptr = s->data_ptr; while (len && !fifo8_is_empty(&s->rx_fifo)) { - buf = (uint8_t *)fifo8_pop_buf(&s->rx_fifo, len, &to_copy); - address_space_rw(&address_space_memory, ptr, - MEMTXATTRS_UNSPECIFIED, buf, to_copy, 1); + const uint8_t *buf = fifo8_pop_buf(&s->rx_fifo, len, &to_copy); + + dma_memory_write_relaxed(&address_space_memory, ptr, buf, to_copy); len -= to_copy; ptr += to_copy; From patchwork Tue Jul 23 20:38:47 2024 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: 13740355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AE90EC3DA49 for ; Tue, 23 Jul 2024 20:41:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJc-0003Ga-Ca; Tue, 23 Jul 2024 16:40:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJa-0002u3-1r for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:54 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJY-0004Sr-39 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:53 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3686b285969so2782382f8f.0 for ; Tue, 23 Jul 2024 13:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767250; x=1722372050; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EVi4ymf0JUdrFDuvhHPunTPbRwIlHUJLlhZi+FT5T80=; b=zdc+VbyXDGJRJwBdwYlWWJKy7XoHXoBDDIprf6Hll5uLnmkG4osvo6naDOpCbSksp5 +c9iWwFdHdV6x0xD6R/AIlg+zEj9MusQyWtdUGqYAXLLNrOTu4AMGRg1RDSQn6QrXq95 bBRF46wO9u70W9bl1jbsmVgEF/wqKqMojFTPzAj0Euf60mOeEOw+SKLErMhKIdLxiCv1 sbtS5hy5Pno6dtUsd3Mzyekv4klk8YP0MBg0NybYZkvi50E7fz8dLdihGflE7zDYdfbb 6f+UTzJrHFGye2T0RigJc/oqeQlszWxo6RsTwLr+++PffhVhRIPZwVNdyb+PuRZxF9F6 Zt1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767250; x=1722372050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EVi4ymf0JUdrFDuvhHPunTPbRwIlHUJLlhZi+FT5T80=; b=uo84XhpgN+5EYKYvhivKmpObOUerQfT54YJ/OPgis+p2zh7iXSsUBHburJ6tqYhbdJ cyucPw12R/3U5pxmXc3K2qqKi9qbZfDMj6wBHWTiq6rF7PLycFEkBahR4/fYODrddTAo A1TClSAwPTZ8QZrLho4Ptxnnw80T6qb0PXt5maDtC9ftj2OjQRqrFcxiK1S4RmfskQX3 X8LXQomzsvEJPQ3blJc/6Fg6Df5djXcKkO18pIbsDPqCJv2cFQX0zvZVd5LgGDhNjdko qZrlxlabvTV0eRHZnM/BmT7mf7KP2RFMONrHP7km5mxOHBZkLsZsJpZIUAS3G87Z6H/p 7mwQ== X-Gm-Message-State: AOJu0YxlSeDpSvjLA8+9zf5XxOqZaBuvvm0gLS1/IS1Bf0yWwm4bUQUS wX6dUAFYz0Wypl+sJKHy/5LJPydPSueMSI46X4WwzZyP6xWicCuBHjNJOEa1C8hrycDc4+osIGh BKwk= X-Google-Smtp-Source: AGHT+IEJA35PdPkt4JsORHnb2C8/7l7/PbA++LorrZk8MT/FzrVx6WNAtSsHXFMnUqSEERdoDjx5QA== X-Received: by 2002:adf:ed8d:0:b0:368:664a:d4f9 with SMTP id ffacd0b85a97d-369bae3654fmr8624996f8f.28.1721767250112; Tue, 23 Jul 2024 13:40:50 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787ec979sm12392870f8f.94.2024.07.23.13.40.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Pierrick Bouvier Subject: [PULL 20/28] chardev/char-fe: Document returned value on error Date: Tue, 23 Jul 2024 22:38:47 +0200 Message-ID: <20240723203855.65033-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]() return -1 on error. Mention it in the documentation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: Pierrick Bouvier Message-Id: <20240722160745.67904-2-philmd@linaro.org> --- include/chardev/char-fe.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index ecef1828355..3310449eaf0 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -228,6 +228,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond, * is thread-safe. * * Returns: the number of bytes consumed (0 if no associated Chardev) + * or -1 on error. */ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len); @@ -242,6 +243,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len); * attempted to be written. This function is thread-safe. * * Returns: the number of bytes consumed (0 if no associated Chardev) + * or -1 on error. */ int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len); @@ -253,6 +255,7 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len); * Read data to a buffer from the back end. * * Returns: the number of bytes read (0 if no associated Chardev) + * or -1 on error. */ int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len); From patchwork Tue Jul 23 20:38:48 2024 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: 13740371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 80AFEC3DA7E for ; Tue, 23 Jul 2024 20:43:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJh-00047s-Fm; Tue, 23 Jul 2024 16:41:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJf-0003mr-Gd for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:59 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJd-0004V5-F6 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:40:59 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4266fcb311cso44621845e9.1 for ; Tue, 23 Jul 2024 13:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767256; x=1722372056; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TB/f/Th1FBB1dNgfWZKdme0n287GDsmesKr4d3trepo=; b=c3cVSXDAPweGChM6QtjXryqtaN3hOBKpRCgYCbX7r4snywe0psuWLfcJtLjvJTmPlY tsKjJdTUBjMmbyji3Mq9SoUk103kMtyIWmPze/bRhOzNblPJf9lYG77adSeHqOozgdLY gm8PWjUtBqpkE3nUrf1CkDY1PgqNr8hwANy10f/Rn8IIMoU94SvQiOPtUsyCQvQjzbAm cNx+TIgJmuNVhuKkAjL/FakB2CHDsxTu7MDiIutCkqO36gX93w/gDE+CqaoZ5lZkOI8N bsi1WK7tjUEhBR5GhsA2RvubiiT5Mj1szMaWovTgmpqKL39KDEv5Xf5DZqC7t1ZY57Mb dLHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767256; x=1722372056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TB/f/Th1FBB1dNgfWZKdme0n287GDsmesKr4d3trepo=; b=MO2UoWjMQR9KGCTWKesxTHUJDwQMSjo31b6TLh2ISw+rKUZE+wbm6P46JDepjDIYZx Clbgk1TqPmdU60CtjPZk8f6eZ9ZqDAL2oAinFx0oloyjj4/RkHxYUCSM+wUPp7RKZZDS vhjx6bCFEp7Tltr/MSF8gRxmhwGTg5J9FbQOQd7Df9CS6IT1MaSKOV/exm93GNb011gz P/D43zQFcyC90Yt4BJq0fYHVprlaGGjMw3Sx0L4Ibw+rXt7L76rZRIosyU+wic85Q+qr J8hogpQQagxdSrZi1YQydsI1WXcRZGgPsm5bC1yyA1wN0TA6U85KrXRfbUXNOdTSw4vL KQFA== X-Gm-Message-State: AOJu0YxIMx4wKG+3Mhhr/7raJkvcCB/X7tSHdZDjBP5xpE6cYIajAoFp O/UWG2CBz8FvwfEN2hIvUiEok72cgf5dvSa25or0lxzx7i9zoQ0WbvMEVwJnv0FR7S7HF9/DP6D 8tcA= X-Google-Smtp-Source: AGHT+IHWNE7nBjtTGWYiT80ToYlRD+1DGCLycdnABF1UWiajbMWWd6H3kBCwAN2Rm4VVjCxA8/xq7A== X-Received: by 2002:a05:6000:1f8d:b0:367:8aa2:d41f with SMTP id ffacd0b85a97d-369f5bb44cdmr34324f8f.51.1721767255622; Tue, 23 Jul 2024 13:40:55 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368785c58e7sm12582641f8f.0.2024.07.23.13.40.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:40:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Mark Cave-Ayland Subject: [PULL 21/28] util/fifo8: Fix style Date: Tue, 23 Jul 2024 22:38:48 +0200 Message-ID: <20240723203855.65033-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20240722160745.67904-3-philmd@linaro.org> --- include/qemu/fifo8.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index c6295c6ff0c..2692d6bfdaa 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -15,10 +15,9 @@ typedef struct { * @fifo: struct Fifo8 to initialise with new FIFO * @capacity: capacity of the newly created FIFO * - * Create a FIFO of the specified size. Clients should call fifo8_destroy() + * Create a FIFO of the specified capacity. Clients should call fifo8_destroy() * when finished using the fifo. The FIFO is initially empty. */ - void fifo8_create(Fifo8 *fifo, uint32_t capacity); /** @@ -26,9 +25,8 @@ void fifo8_create(Fifo8 *fifo, uint32_t capacity); * @fifo: FIFO to cleanup * * Cleanup a FIFO created with fifo8_create(). Frees memory created for FIFO - *storage. The FIFO is no longer usable after this has been called. + * storage. The FIFO is no longer usable after this has been called. */ - void fifo8_destroy(Fifo8 *fifo); /** @@ -39,7 +37,6 @@ void fifo8_destroy(Fifo8 *fifo); * Push a data byte to the FIFO. Behaviour is undefined if the FIFO is full. * Clients are responsible for checking for fullness using fifo8_is_full(). */ - void fifo8_push(Fifo8 *fifo, uint8_t data); /** @@ -52,7 +49,6 @@ void fifo8_push(Fifo8 *fifo, uint8_t data); * Clients are responsible for checking the space left in the FIFO using * fifo8_num_free(). */ - void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num); /** @@ -64,7 +60,6 @@ void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num); * * Returns: The popped data byte. */ - uint8_t fifo8_pop(Fifo8 *fifo); /** @@ -73,7 +68,7 @@ uint8_t fifo8_pop(Fifo8 *fifo); * @max: maximum number of bytes to pop * @numptr: pointer filled with number of bytes returned (can be NULL) * - * Pop a number of elements from the FIFO up to a maximum of max. The buffer + * Pop a number of elements from the FIFO up to a maximum of @max. The buffer * containing the popped data is returned. This buffer points directly into * the FIFO backing store and data is invalidated once any of the fifo8_* APIs * are called on the FIFO. @@ -82,7 +77,7 @@ uint8_t fifo8_pop(Fifo8 *fifo); * around in the ring buffer; in this case only a contiguous part of the data * is returned. * - * The number of valid bytes returned is populated in *numptr; will always + * The number of valid bytes returned is populated in *@numptr; will always * return at least 1 byte. max must not be 0 or greater than the number of * bytes in the FIFO. * @@ -99,7 +94,7 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * @max: maximum number of bytes to peek * @numptr: pointer filled with number of bytes returned (can be NULL) * - * Peek into a number of elements from the FIFO up to a maximum of max. + * Peek into a number of elements from the FIFO up to a maximum of @max. * The buffer containing the data peeked into is returned. This buffer points * directly into the FIFO backing store. Since data is invalidated once any * of the fifo8_* APIs are called on the FIFO, it is the caller responsibility @@ -109,7 +104,7 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * around in the ring buffer; in this case only a contiguous part of the data * is returned. * - * The number of valid bytes returned is populated in *numptr; will always + * The number of valid bytes returned is populated in *@numptr; will always * return at least 1 byte. max must not be 0 or greater than the number of * bytes in the FIFO. * @@ -126,7 +121,6 @@ const uint8_t *fifo8_peek_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * * Reset a FIFO. All data is discarded and the FIFO is emptied. */ - void fifo8_reset(Fifo8 *fifo); /** @@ -137,7 +131,6 @@ void fifo8_reset(Fifo8 *fifo); * * Returns: True if the fifo is empty, false otherwise. */ - bool fifo8_is_empty(Fifo8 *fifo); /** @@ -148,7 +141,6 @@ bool fifo8_is_empty(Fifo8 *fifo); * * Returns: True if the fifo is full, false otherwise. */ - bool fifo8_is_full(Fifo8 *fifo); /** @@ -159,7 +151,6 @@ bool fifo8_is_full(Fifo8 *fifo); * * Returns: Number of free bytes. */ - uint32_t fifo8_num_free(Fifo8 *fifo); /** @@ -170,7 +161,6 @@ uint32_t fifo8_num_free(Fifo8 *fifo); * * Returns: Number of used bytes. */ - uint32_t fifo8_num_used(Fifo8 *fifo); extern const VMStateDescription vmstate_fifo8; From patchwork Tue Jul 23 20:38:49 2024 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: 13740367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D17E6C3DA49 for ; Tue, 23 Jul 2024 20:43:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJn-0005QQ-JK; Tue, 23 Jul 2024 16:41:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJl-00058g-EB for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:05 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJj-0004Vb-4U for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:05 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4266182a9d7so40096685e9.0 for ; Tue, 23 Jul 2024 13:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767261; x=1722372061; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O+mMJVnZoHb8TN0OKgay2wr/RPzQblLQjBQP+26HLiA=; b=EGyVCORbD5+5m3pLGsrfX0NJkFSawwF99QsB1ohI4ksFqs2n0/4hlMLjASng0Jm1GW OQM7Sz9lnWc4w3f5cqduLVIQfn9oFqAXTUxhyuFCBEFWlDSypHRb1jXN13e/TbamOLpy JG8VoSdk8xl7XxhL/rop+OneIFlnpDDqkkdXuKV+qkaiX2tdjC9LI+c2xObz6Q3YUkka aWmMCtUiFd9ULd/NvxSELpguR5Qa+Ht/lcrRyTMPTf6NgHg/ozwzTjoTpODX0hrRFzuu Z3+ubmXJMhEZ8/uiRAPc7SV9Hl553cz9j7glaRBVeoxQxWvzYt2+oYvoJquryssNYUt9 uwgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767261; x=1722372061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O+mMJVnZoHb8TN0OKgay2wr/RPzQblLQjBQP+26HLiA=; b=LcBYWGbf/GS3fU2eQgXA6KT2kr926ixgsfN9sy82Yo6OZMXW3jEOB16rAHBtPo984G /tIqwYX0yARmq3EXDdfEzeoLX8vsr372KYb2D2COVStcA+UuLUctTOeharZCdu0kmBUB FJoufWBKPCbRFaoOuICBoYUiHdXafjX9Vdc8U0JSAv1U8HWuVZ1JVf4Px9G60IjpAYpr fIHUT8hLM2kuhfD9oOGa6VDU/+dOmUKghbVR1tardrbqWn+xq63Fbaw1WQ5ZfJ16flvs Y8+edQ66JScFCXCmXHaXuNFPonqlzMD608OlSbs9ma3SWWOzHSt3ILLI3HkWmCIlVpU5 HvzQ== X-Gm-Message-State: AOJu0YwyKDdPNvfcceSBPC31L0lBan4Vp10Yts/fg4yhit2RsrkVTGde xZe2ahT6bPdGzvinMxDXP84dvHeA5XIjNs47NtE6hPxrCIAxjEenHYLOC4nPpYKFKwOMQUTeWz8 3c+w= X-Google-Smtp-Source: AGHT+IEY7krJaQ0Pp+xSIpUsbMkpjUsopIY0G86nEQ7kjJKNGa3xvVh4Ch+UZdD4xDBsBt3kI1i7OA== X-Received: by 2002:a05:600c:314d:b0:426:55a3:71af with SMTP id 5b1f17b1804b1-427f95b714fmr15955e9.33.1721767261042; Tue, 23 Jul 2024 13:41:01 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9397204sm541795e9.21.2024.07.23.13.41.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Pierrick Bouvier Subject: [PULL 22/28] util/fifo8: Use fifo8_reset() in fifo8_create() Date: Tue, 23 Jul 2024 22:38:49 +0200 Message-ID: <20240723203855.65033-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Avoid open-coding fifo8_reset() in fifo8_create(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: Pierrick Bouvier Message-Id: <20240722160745.67904-4-philmd@linaro.org> --- util/fifo8.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/util/fifo8.c b/util/fifo8.c index 4e01b532d9d..2925fe56119 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -16,12 +16,17 @@ #include "migration/vmstate.h" #include "qemu/fifo8.h" +void fifo8_reset(Fifo8 *fifo) +{ + fifo->num = 0; + fifo->head = 0; +} + void fifo8_create(Fifo8 *fifo, uint32_t capacity) { fifo->data = g_new(uint8_t, capacity); fifo->capacity = capacity; - fifo->head = 0; - fifo->num = 0; + fifo8_reset(fifo); } void fifo8_destroy(Fifo8 *fifo) @@ -97,12 +102,6 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr) return fifo8_peekpop_buf(fifo, max, numptr, true); } -void fifo8_reset(Fifo8 *fifo) -{ - fifo->num = 0; - fifo->head = 0; -} - bool fifo8_is_empty(Fifo8 *fifo) { return (fifo->num == 0); From patchwork Tue Jul 23 20:38:50 2024 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: 13740360 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DC88CC3DA7E for ; Tue, 23 Jul 2024 20:42:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMJs-0006GB-Fc; Tue, 23 Jul 2024 16:41:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJq-00062Y-Qd for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:11 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJo-0004Vs-QJ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:10 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-367940c57ddso3144279f8f.3 for ; Tue, 23 Jul 2024 13:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767267; x=1722372067; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dSCWBLk+dTPyKUi346CpD+A3ideUlHg+vbcXd5eth70=; b=qapZBxDWb//CkAlAcCV2eDsSeTAadPyUoxa9ROkt43zyWWoX01SRKCXrb2QUdHTbI+ 0CFqoD6gGfw1U/eo8xPK0Z1kkYOk65BgGMLklrh+3dfvatyrlwK+4RarmDjBfArTCv2N FrlnemUB64CVzbXQE/fXca3R7/QeYCYtIKx/LvCcIQ96rBYgG5DvjjD6aWRmGgS/i5+2 4sdvcO0noNDvBpVMt61gjElJhUDpsXvO/LLM0sNOxAsbllFTIJajoEW3WW6MqL1mC0vE QY9TZ0+Tm763/NDOcWFunNwcPHz+JNjWkTXnHl+J+NF17Tt6ivF5PWIPFPdedeZbATUs MwXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767267; x=1722372067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dSCWBLk+dTPyKUi346CpD+A3ideUlHg+vbcXd5eth70=; b=nHFaDLATtcHeQLCCgp3SCJFx+n+x31cQNfBWGLssR1c1wJ2i8VRgN09oyAINCTaDNn o8B/p5nqKz3/D3BjyuyqnO9a0nS6dYHAPzSlqDlbR3sjqE7nxaz7UFsC6vHr0FDGdgiw 1frObyT87S7/hCTowGZ44hjXSyx1awi/x7egbEm+mOaT1yyFRZakQIMIRIBXVc/AWBoU kn/TCNd924LIfbilemgpSKMZsrcDZyYxTfI2DzRx39pdA4lmtKb/utPEPzAMuagQzNTg T2kS4AwXzkgJTlctE32sXYANG3bpmyemp5358O5ZkFW6dAcBrxl71n/dFnEPeaaKbIOU SWQw== X-Gm-Message-State: AOJu0YwRRltk07VaCcwUs6UeDg/DOTf/wuahKFaw7U8oelmEMHKugjqX HsujcO6O0g0dl+dF+CDVn/xgcpyx87eOW0Z60WRzBp4ugox4/jofuOwv92h9MVwnbSP4BWVlmfl +W7M= X-Google-Smtp-Source: AGHT+IFG2nm/lCT+8XjPxSNVK/q+eDv/M6vNHUpHyX6B6M8b0aVz9Nezc15d/G2ixdfU4CsbQQhhiA== X-Received: by 2002:a5d:6a47:0:b0:368:4ed7:2acb with SMTP id ffacd0b85a97d-369bae01e22mr5450473f8f.5.1721767266672; Tue, 23 Jul 2024 13:41:06 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787eced0sm12312095f8f.98.2024.07.23.13.41.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Mark Cave-Ayland Subject: [PULL 23/28] util/fifo8: Rename fifo8_peek_buf() -> fifo8_peek_bufptr() Date: Tue, 23 Jul 2024 22:38:50 +0200 Message-ID: <20240723203855.65033-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since fifo8_peek_buf() return a const buffer (which points directly into the FIFO backing store). Rename it using the 'bufptr' suffix to better reflect that it is a pointer to the internal buffer that is being returned. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20240722160745.67904-5-philmd@linaro.org> --- include/qemu/fifo8.h | 11 ++++++----- hw/scsi/esp.c | 2 +- util/fifo8.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index 2692d6bfdaa..e287e871190 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -89,16 +89,17 @@ uint8_t fifo8_pop(Fifo8 *fifo); const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); /** - * fifo8_peek_buf: read upto max bytes from the fifo + * fifo8_peek_bufptr: read upto max bytes from the fifo * @fifo: FIFO to read from * @max: maximum number of bytes to peek * @numptr: pointer filled with number of bytes returned (can be NULL) * * Peek into a number of elements from the FIFO up to a maximum of @max. * The buffer containing the data peeked into is returned. This buffer points - * directly into the FIFO backing store. Since data is invalidated once any - * of the fifo8_* APIs are called on the FIFO, it is the caller responsibility - * to access it before doing further API calls. + * directly into the internal FIFO backing store (without checking for + * overflow!). Since data is invalidated once any of the fifo8_* APIs are + * called on the FIFO, it is the caller responsibility to access it before + * doing further API calls. * * The function may return fewer bytes than requested when the data wraps * around in the ring buffer; in this case only a contiguous part of the data @@ -113,7 +114,7 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * * Returns: A pointer to peekable data. */ -const uint8_t *fifo8_peek_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); +const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr); /** * fifo8_reset: diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 8504dd30a0d..412c8cf2260 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -486,7 +486,7 @@ static bool esp_cdb_ready(ESPState *s) return false; } - pbuf = fifo8_peek_buf(&s->cmdfifo, len, &n); + pbuf = fifo8_peek_bufptr(&s->cmdfifo, len, &n); if (n < len) { /* * In normal use the cmdfifo should never wrap, but include this check diff --git a/util/fifo8.c b/util/fifo8.c index 2925fe56119..566b0893441 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -92,7 +92,7 @@ static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max, return ret; } -const uint8_t *fifo8_peek_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr) +const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr) { return fifo8_peekpop_buf(fifo, max, numptr, false); } From patchwork Tue Jul 23 20:38:51 2024 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: 13740361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C7EE2C3DA49 for ; Tue, 23 Jul 2024 20:42:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMK1-0007gS-Ce; Tue, 23 Jul 2024 16:41:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMJw-00075b-HV for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:16 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMJu-0004W9-9e for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:16 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-368663d7f80so3242250f8f.3 for ; Tue, 23 Jul 2024 13:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767272; x=1722372072; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GBM1IJL7GzUQtrseAlPnjePV8gHhhVpan+XyuPJ8YY8=; b=BkgbqQKSuPBUhSzEK0rFyCQXDODtII/i03+4iZE9fYDyVD2wpbUgqFYk7rdCezPyiB C0o7EQz5vPmsHgAiczbpKtRmzvhMcLE8Xb4ocT3U1VyGUOZW63Luw28yCqnZf+0bGwK+ a/ofyEWqq8Q6wdm16vIPLhyC1UEhjcHOL/2rlCoAlNo3rhemc1Grjak51i7aEsotsi/V WQOpNCW0qgUSmGjEwRN2ZYc25WqPVYS4EGxOPI6cGWtxjqYsHj8zcTEXPP7qqJQVC35i ddj+kgW7Z8u2YmYQ0gUcGctB0Ixi+5li4FIehw4JapQGpbDr5botYEAp14Frd/vtHoLj PTug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767272; x=1722372072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GBM1IJL7GzUQtrseAlPnjePV8gHhhVpan+XyuPJ8YY8=; b=NDkexa0Pm+cGvX17OGIDTXbpbuUeX2maJatykN+vAbA1ETsg1n7T5jL006rrKMf9Xq x3F+Rahhx65fa0vFhKWea683EsoQALHGlxOuzsVJC1ixn6ZxyBcn1FMgeMtsEJ4w7rWB /7fawUPy08iRoiw9pcLjJOAiWn7TFushWSzDbWk2EvKvwW2/MmZ6I1ziPP7AptxV4hVb SjeRXUSrbsj2dCfZXW8AGegIvvclCdKP1w83PTX0Q754+TXnFcUqtm+sH7R4Vljv6xse UdzFVoV5E6OsTgaAiOWDSZ0mHm0BhmfxMGeOHvMPucKL/AA4xzdjvOmD++nzgS4/CX78 BSTQ== X-Gm-Message-State: AOJu0YyBjySPuQRJbxo2KED9pshQ6VloO3BQCB9HHKndjIfUeoBqAzDA l1+xGYJl7qDfnYuzXP5GfwptB/DyM7DNDbT6GfhQrluwPa/lV6qdri5/BPC+oXoSdlHoZLLxjCG Ax+U= X-Google-Smtp-Source: AGHT+IHp7UXxXFmhUjJGk6XistfccSGrFw31mxt2y8SQLzX53RSGI/FHUAxQhfTgVGM/mcDUtvZg5A== X-Received: by 2002:adf:f24e:0:b0:369:b7e3:497c with SMTP id ffacd0b85a97d-369f5b0eb62mr37435f8f.1.1721767272069; Tue, 23 Jul 2024 13:41:12 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36878695a52sm12468356f8f.64.2024.07.23.13.41.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Mark Cave-Ayland Subject: [PULL 24/28] util/fifo8: Rename fifo8_pop_buf() -> fifo8_pop_bufptr() Date: Tue, 23 Jul 2024 22:38:51 +0200 Message-ID: <20240723203855.65033-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since fifo8_pop_buf() return a const buffer (which points directly into the FIFO backing store). Rename it using the 'bufptr' suffix to better reflect that it is a pointer to the internal buffer that is being returned. This will help differentiate with methods *copying* the FIFO data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20240722160745.67904-6-philmd@linaro.org> --- include/qemu/fifo8.h | 15 +++++++-------- chardev/msmouse.c | 2 +- hw/char/goldfish_tty.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/scsi/esp.c | 4 ++-- ui/console-vc.c | 2 +- ui/gtk.c | 2 +- util/fifo8.c | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index e287e871190..a30220c8e96 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -63,15 +63,15 @@ void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num); uint8_t fifo8_pop(Fifo8 *fifo); /** - * fifo8_pop_buf: + * fifo8_pop_bufptr: * @fifo: FIFO to pop from * @max: maximum number of bytes to pop * @numptr: pointer filled with number of bytes returned (can be NULL) * * Pop a number of elements from the FIFO up to a maximum of @max. The buffer * containing the popped data is returned. This buffer points directly into - * the FIFO backing store and data is invalidated once any of the fifo8_* APIs - * are called on the FIFO. + * the internal FIFO backing store and data (without checking for overflow!) + * and is invalidated once any of the fifo8_* APIs are called on the FIFO. * * The function may return fewer bytes than requested when the data wraps * around in the ring buffer; in this case only a contiguous part of the data @@ -86,7 +86,7 @@ uint8_t fifo8_pop(Fifo8 *fifo); * * Returns: A pointer to popped data. */ -const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); +const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr); /** * fifo8_peek_bufptr: read upto max bytes from the fifo @@ -96,10 +96,9 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr); * * Peek into a number of elements from the FIFO up to a maximum of @max. * The buffer containing the data peeked into is returned. This buffer points - * directly into the internal FIFO backing store (without checking for - * overflow!). Since data is invalidated once any of the fifo8_* APIs are - * called on the FIFO, it is the caller responsibility to access it before - * doing further API calls. + * directly into the FIFO backing store. Since data is invalidated once any + * of the fifo8_* APIs are called on the FIFO, it is the caller responsibility + * to access it before doing further API calls. * * The function may return fewer bytes than requested when the data wraps * around in the ring buffer; in this case only a contiguous part of the data diff --git a/chardev/msmouse.c b/chardev/msmouse.c index a774c397b45..2279694cfab 100644 --- a/chardev/msmouse.c +++ b/chardev/msmouse.c @@ -81,7 +81,7 @@ static void msmouse_chr_accept_input(Chardev *chr) const uint8_t *buf; uint32_t size; - buf = fifo8_pop_buf(&mouse->outbuf, MIN(len, avail), &size); + buf = fifo8_pop_bufptr(&mouse->outbuf, MIN(len, avail), &size); qemu_chr_be_write(chr, buf, size); len = qemu_chr_be_can_write(chr); avail -= size; diff --git a/hw/char/goldfish_tty.c b/hw/char/goldfish_tty.c index cdff46bc13b..c2e1f6537f7 100644 --- a/hw/char/goldfish_tty.c +++ b/hw/char/goldfish_tty.c @@ -109,7 +109,7 @@ static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd) len = s->data_len; ptr = s->data_ptr; while (len && !fifo8_is_empty(&s->rx_fifo)) { - const uint8_t *buf = fifo8_pop_buf(&s->rx_fifo, len, &to_copy); + const uint8_t *buf = fifo8_pop_bufptr(&s->rx_fifo, len, &to_copy); dma_memory_write_relaxed(&address_space_memory, ptr, buf, to_copy); diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c index 989839784a9..d40ff37e994 100644 --- a/hw/net/allwinner_emac.c +++ b/hw/net/allwinner_emac.c @@ -349,7 +349,7 @@ static void aw_emac_write(void *opaque, hwaddr offset, uint64_t value, "allwinner_emac: TX length > fifo data length\n"); } if (len > 0) { - data = fifo8_pop_buf(fifo, len, &ret); + data = fifo8_pop_bufptr(fifo, len, &ret); qemu_send_packet(nc, data, ret); aw_emac_tx_reset(s, chan); /* Raise TX interrupt */ diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 412c8cf2260..7e9657e9c30 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -208,7 +208,7 @@ static uint32_t esp_fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, int maxlen) } len = maxlen; - buf = fifo8_pop_buf(fifo, len, &n); + buf = fifo8_pop_bufptr(fifo, len, &n); if (dest) { memcpy(dest, buf, n); } @@ -217,7 +217,7 @@ static uint32_t esp_fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, int maxlen) len -= n; len = MIN(len, fifo8_num_used(fifo)); if (len) { - buf = fifo8_pop_buf(fifo, len, &n2); + buf = fifo8_pop_bufptr(fifo, len, &n2); if (dest) { memcpy(&dest[n], buf, n2); } diff --git a/ui/console-vc.c b/ui/console-vc.c index 899fa11c948..8393d532e7f 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -287,7 +287,7 @@ static void kbd_send_chars(QemuTextConsole *s) const uint8_t *buf; uint32_t size; - buf = fifo8_pop_buf(&s->out_fifo, MIN(len, avail), &size); + buf = fifo8_pop_bufptr(&s->out_fifo, MIN(len, avail), &size); qemu_chr_be_write(s->chr, buf, size); len = qemu_chr_be_can_write(s->chr); avail -= size; diff --git a/ui/gtk.c b/ui/gtk.c index bc29f7a1b4f..8e14c2ac81d 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1820,7 +1820,7 @@ static void gd_vc_send_chars(VirtualConsole *vc) const uint8_t *buf; uint32_t size; - buf = fifo8_pop_buf(&vc->vte.out_fifo, MIN(len, avail), &size); + buf = fifo8_pop_bufptr(&vc->vte.out_fifo, MIN(len, avail), &size); qemu_chr_be_write(vc->vte.chr, buf, size); len = qemu_chr_be_can_write(vc->vte.chr); avail -= size; diff --git a/util/fifo8.c b/util/fifo8.c index 566b0893441..5bbb6150b60 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -97,7 +97,7 @@ const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr) return fifo8_peekpop_buf(fifo, max, numptr, false); } -const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *numptr) +const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr) { return fifo8_peekpop_buf(fifo, max, numptr, true); } From patchwork Tue Jul 23 20:38:52 2024 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: 13740370 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2B9FAC3DA63 for ; Tue, 23 Jul 2024 20:43:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMKN-00013C-72; Tue, 23 Jul 2024 16:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMK3-00087D-Br for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:24 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMK0-0004WL-K9 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:22 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-427db004e36so29717495e9.3 for ; Tue, 23 Jul 2024 13:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767277; x=1722372077; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T1Rd8JLREenPY7uD+H493cwaNhRJxArDOSc9CQhnapI=; b=wBRBmOHiukq57BhbTTUKFtfQhk5rj3IlB9SBzreTSsHHLD34Fs2z2SZEupTFL8hjcO cuiuMaRHPOMyF1LFGdYjtLLstqxamaRYsbcVyeOlOtyvaK2mem1vwL7JJtbMzg3niEf1 DrAeAVirHjtGAnVrrDLElmT1trzEVW4yP4pDXxajPqaWtz90PvxPlKvAhwvEJ9HJr8GJ tzcA1rfyPPMfkmEhnnDBlBTKa4sNgXBj6c8z7TC1DlkmPB7BtmQhvbYYgEux5D/AXsCf YkGPtUuOp2GhymioSTZ6xiIKXJH08EHxvXPspgYbAka4QhQc3peP837cck7dCui+XvvN Q11g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767277; x=1722372077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T1Rd8JLREenPY7uD+H493cwaNhRJxArDOSc9CQhnapI=; b=S3d34h+g2p/O99EhO2sanr2YBUQ/p2x6GwOaEAJ7jXIx8bSofvKWbTrDiL2MlIxtgl YSefZb1EfjlwBv4phHxDG91PEBONBlEUhFINARhDD7wWUuz2GmNOCaU+r2ZiBI4/K2No JTqJ2ZFjslTyzuZDniiHAbZWqmmNSKpZq3jAR8E5PO7XpsKQBFV6nukYgvpCQRNqVYQJ dg1QnyF5asqJ5DwDJG3NEuiyMAnoXHWsq4HcyU/uwwaaZP4PjBllPjJbvtco5AZOom4S CoNThRMA+g97WeXIvufJX6Vbd/H7xQX9HgMxu/SjOvUDpYsRqRgJN4x6cUlIAkFiKoxx cUWA== X-Gm-Message-State: AOJu0Yzb/O8EVl965ZvNyIMgClpY5FDrOxoPgCIHR1tcxWNAGjUeRH2m Hd8X0tKJcPqtzf4ZML2eW75Mm6Vtbytg7faTlE7QB8eLqGDau2lsXiif5pF/lSGG8AZsV2fXp5P HwhY= X-Google-Smtp-Source: AGHT+IGfUznRA8pB8/zGnHSd8/r+tIrnoK4d3cJhfnvCstd1Qbxfv+wVIDqU6avUgxWYvf36TaHuAA== X-Received: by 2002:a05:600c:4694:b0:426:6688:2421 with SMTP id 5b1f17b1804b1-427f9554a96mr119885e9.11.1721767277493; Tue, 23 Jul 2024 13:41:17 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f9398602sm510395e9.26.2024.07.23.13.41.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Pierrick Bouvier Subject: [PULL 25/28] util/fifo8: Expose fifo8_pop_buf() Date: Tue, 23 Jul 2024 22:38:52 +0200 Message-ID: <20240723203855.65033-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Extract fifo8_pop_buf() from hw/scsi/esp.c and expose it as part of the API. This function takes care of non-contiguous (wrapped) FIFO buffer (which is an implementation detail). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20240722160745.67904-7-philmd@linaro.org> --- include/qemu/fifo8.h | 16 ++++++++++++++++ hw/scsi/esp.c | 36 +++--------------------------------- util/fifo8.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index a30220c8e96..bca6da306f7 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -62,12 +62,28 @@ void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num); */ uint8_t fifo8_pop(Fifo8 *fifo); +/** + * fifo8_pop_buf: + * @fifo: FIFO to pop from + * @dest: the buffer to write the data into (can be NULL) + * @destlen: size of @dest and maximum number of bytes to pop + * + * Pop a number of elements from the FIFO up to a maximum of @destlen. + * The popped data is copied into the @dest buffer. + * Care is taken when the data wraps around in the ring buffer. + * + * Returns: number of bytes popped. + */ +uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen); + /** * fifo8_pop_bufptr: * @fifo: FIFO to pop from * @max: maximum number of bytes to pop * @numptr: pointer filled with number of bytes returned (can be NULL) * + * New code should prefer to use fifo8_pop_buf() instead of fifo8_pop_bufptr(). + * * Pop a number of elements from the FIFO up to a maximum of @max. The buffer * containing the popped data is returned. This buffer points directly into * the internal FIFO backing store and data (without checking for overflow!) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 7e9657e9c30..04c9a557b69 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -197,39 +197,9 @@ static uint8_t esp_fifo_pop(ESPState *s) return val; } -static uint32_t esp_fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, int maxlen) -{ - const uint8_t *buf; - uint32_t n, n2; - int len; - - if (maxlen == 0) { - return 0; - } - - len = maxlen; - buf = fifo8_pop_bufptr(fifo, len, &n); - if (dest) { - memcpy(dest, buf, n); - } - - /* Add FIFO wraparound if needed */ - len -= n; - len = MIN(len, fifo8_num_used(fifo)); - if (len) { - buf = fifo8_pop_bufptr(fifo, len, &n2); - if (dest) { - memcpy(&dest[n], buf, n2); - } - n += n2; - } - - return n; -} - static uint32_t esp_fifo_pop_buf(ESPState *s, uint8_t *dest, int maxlen) { - uint32_t len = esp_fifo8_pop_buf(&s->fifo, dest, maxlen); + uint32_t len = fifo8_pop_buf(&s->fifo, dest, maxlen); esp_update_drq(s); return len; @@ -335,7 +305,7 @@ static void do_command_phase(ESPState *s) if (!cmdlen || !s->current_dev) { return; } - esp_fifo8_pop_buf(&s->cmdfifo, buf, cmdlen); + fifo8_pop_buf(&s->cmdfifo, buf, cmdlen); current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, s->lun); if (!current_lun) { @@ -381,7 +351,7 @@ static void do_message_phase(ESPState *s) /* Ignore extended messages for now */ if (s->cmdfifo_cdb_offset) { int len = MIN(s->cmdfifo_cdb_offset, fifo8_num_used(&s->cmdfifo)); - esp_fifo8_pop_buf(&s->cmdfifo, NULL, len); + fifo8_pop_buf(&s->cmdfifo, NULL, len); s->cmdfifo_cdb_offset = 0; } } diff --git a/util/fifo8.c b/util/fifo8.c index 5bbb6150b60..a250ea9f804 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -102,6 +102,35 @@ const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr) return fifo8_peekpop_buf(fifo, max, numptr, true); } +uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen) +{ + const uint8_t *buf; + uint32_t n1, n2 = 0; + uint32_t len; + + if (destlen == 0) { + return 0; + } + + len = destlen; + buf = fifo8_pop_bufptr(fifo, len, &n1); + if (dest) { + memcpy(dest, buf, n1); + } + + /* Add FIFO wraparound if needed */ + len -= n1; + len = MIN(len, fifo8_num_used(fifo)); + if (len) { + buf = fifo8_pop_bufptr(fifo, len, &n2); + if (dest) { + memcpy(&dest[n1], buf, n2); + } + } + + return n1 + n2; +} + bool fifo8_is_empty(Fifo8 *fifo) { return (fifo->num == 0); From patchwork Tue Jul 23 20:38:53 2024 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: 13740366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CB328C3DA63 for ; Tue, 23 Jul 2024 20:43:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMKp-0003Rw-Fg; Tue, 23 Jul 2024 16:42:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMK8-0008W3-VM for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMK4-0004Wa-Um for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:27 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4266ea6a488so52257015e9.1 for ; Tue, 23 Jul 2024 13:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767283; x=1722372083; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=edehD0KtGJ7psWAUTWuwqxCMF33mNrSx960MdEztH2M=; b=vag+/qlONDv73l2xtzfaO5MXyl9llE2JAgw8zhlFG7KtSPkSDHity8oDZlRijD1OS6 +pMg0KJ7H8ehLmei39ZDZ4DNfwAGmMAlECDXDNsVtm8wyHAgLcViLXQmf0TDkxoz6aH8 luufZOedVG0qtiR7aEdb8GQZHTHpbT4YyZeEUOGxBFYh8zE+NC0dPYKQ26qknst02Nya rIcUpnF/mbpJVJi3BD+BJ4Dq4UIrpcd5FntCvjUuMSN48F72f7G/w3MOp5j/D0QUC+15 pVztovDzg2k/idQ9F62pd9B1Vq3Vi/lGDsNa1crf9Z5KAnwno5xY8+LkZGMEcLx/ul9/ Z2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767283; x=1722372083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edehD0KtGJ7psWAUTWuwqxCMF33mNrSx960MdEztH2M=; b=Km7wOqiAykMRRvAiD/+8ud7qxxesTJt+kB8lqWcFraL5T1GDzYZQUGS3YqMJ7mJg9J qnGuD6BGLYodHhEVyF19YyynTokkjjindObaVlCVUc+QkxDfIiZdkrlBQETo1Ij6F/yu CBcktoReITRNmG97U5yf/ccG0Q8GTKVz/DIH5tqqbp296V4FQqAGAzr2/ufgzOyxeRY3 5p4FJXMn8vkWCS8G4WNrXyP5CpOcOaeBWkryZUfPsbCmOkC3jBZjg8bzYhMKVn6Ugk3a /mlo5E5sfRT0HLHjulAsGpX8IfwFnfL7hJkUek6PVtgI3REdaXBy1p5re92RSdgvvoa3 MqZg== X-Gm-Message-State: AOJu0YwzIgSvw9SnVUZsvfJBvEoq04G9Y5whGO7jKPDVCEVxui8O1waq 1KySttMvriyMBIFLddFr6PpS8BOGJtAqrfSZeUSv9qTyM7kYyZxzw1/LjSoTGpMjJo2QSVaXiGd YcYY= X-Google-Smtp-Source: AGHT+IHfiMIerRfkNnqj78mw4GHum7yCps2MykY5abNv3AQZOeoYzpsWQZ/RX8wkZoB8cfudZEMdOg== X-Received: by 2002:a05:600c:3ac5:b0:426:673a:2904 with SMTP id 5b1f17b1804b1-427f7adf206mr4570065e9.36.1721767282776; Tue, 23 Jul 2024 13:41:22 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f935dd83sm598555e9.5.2024.07.23.13.41.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Mark Cave-Ayland Subject: [PULL 26/28] util/fifo8: Introduce fifo8_drop() Date: Tue, 23 Jul 2024 22:38:53 +0200 Message-ID: <20240723203855.65033-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add the fifo8_drop() helper for clarity. It is a simple wrapper over fifo8_pop_buf(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20240722160745.67904-8-philmd@linaro.org> --- include/qemu/fifo8.h | 9 +++++++++ hw/scsi/esp.c | 2 +- util/fifo8.c | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h index bca6da306f7..d1d06754d84 100644 --- a/include/qemu/fifo8.h +++ b/include/qemu/fifo8.h @@ -131,6 +131,15 @@ const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr); */ const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr); +/** + * fifo8_drop: + * @fifo: FIFO to drop bytes + * @len: number of bytes to drop + * + * Drop (consume) bytes from a FIFO. + */ +void fifo8_drop(Fifo8 *fifo, uint32_t len); + /** * fifo8_reset: * @fifo: FIFO to reset diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 04c9a557b69..b7af8256232 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -351,7 +351,7 @@ static void do_message_phase(ESPState *s) /* Ignore extended messages for now */ if (s->cmdfifo_cdb_offset) { int len = MIN(s->cmdfifo_cdb_offset, fifo8_num_used(&s->cmdfifo)); - fifo8_pop_buf(&s->cmdfifo, NULL, len); + fifo8_drop(&s->cmdfifo, len); s->cmdfifo_cdb_offset = 0; } } diff --git a/util/fifo8.c b/util/fifo8.c index a250ea9f804..1ffa19d900e 100644 --- a/util/fifo8.c +++ b/util/fifo8.c @@ -131,6 +131,12 @@ uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen) return n1 + n2; } +void fifo8_drop(Fifo8 *fifo, uint32_t len) +{ + len -= fifo8_pop_buf(fifo, NULL, len); + assert(len == 0); +} + bool fifo8_is_empty(Fifo8 *fifo) { return (fifo->num == 0); From patchwork Tue Jul 23 20:38:54 2024 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: 13740368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9CE3FC3DA49 for ; Tue, 23 Jul 2024 20:43:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMKN-00013h-7Z; Tue, 23 Jul 2024 16:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMKC-0000Rs-QJ for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:33 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMK9-0004Wp-T0 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:32 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-426526d30aaso44709865e9.0 for ; Tue, 23 Jul 2024 13:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767288; x=1722372088; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gprouXpFTSkljW0fNmBZHXNIbVMVrEajPZ/PMlUZpW4=; b=DCgCY4lFJqyW2/j+2R4OUJBPWvR1NqqDVmNPwC1SKWeBMOnA5nGevD7f4GVpOS5V4K c6LQG9YDq/k4sw5rKSZuUTTNENresb8REaehnrYMsZTP06eYjxEuwRz5/4lajj1ru0ws EUm2P2e+KaSXMe9fgTp73Yid42qtvvTVG4fA8aCU7uuju5dkSTcod6mm7olXI2zkb8fv EqscqKVneYAqCCEujEawZpoVrPOJbP8Rb/nNJ7C6K5eHPdStkiYc0+7jWjxV1l72rlpH x+pZpuZFB2QQM0ixHZvHOMy9BybIQQ4SKZ3JXVXTneTCH4cKuYHTpwB7oxlBvkKh03FZ b0cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767288; x=1722372088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gprouXpFTSkljW0fNmBZHXNIbVMVrEajPZ/PMlUZpW4=; b=wvoq1NFBrPaxxcSaIHwQL49bNbcgHHTcNPY3KzPgbIENna/D00ggQluf52whSPdMTn r7mjyqnE6PeIWIHJ8rOdxxmCJehwcm1SjQ6YtenFJOTShaX0d0GUIRBaX2ZbsCFYzetL VnPKqg2aV5Lt++f/xxZoerZqssObUleL9cOlpgmBoK1v6G4l1QoG9RuAcW2lsnJnB/LQ N5ODEnZQ5dpYeYwmSovsYJaV+Le2FBZIKnEmUgC+9vR1zilHt4IPoDS5JEE+U8jrENIL mj0UnZrf1yJV0pgVby8m9AyKOYBQp0kyOc5jNCF8T3Z3nFznQCkWgvWRm9EBPG0rA7bT X+Qg== X-Gm-Message-State: AOJu0YwLYsFAe+q7A1/3oliN2oHIPN8nOOzau6O8OmMWqY1UzVJSNScw uQmYgB0W+3sNL5PCOCeWWrpHIYRMg5GQ9rGAM5gH33C46gkwMNjPXGExC7DeVuluSyqx9aticA6 MqGE= X-Google-Smtp-Source: AGHT+IGiDgdAWIg4VrTnbBjRYQpLqUvmrwzZjhT+ICZaYsC66LkIktXdT3qObDI0GSnwAUR167wqwQ== X-Received: by 2002:a05:600c:3acd:b0:426:6f1e:ce93 with SMTP id 5b1f17b1804b1-427f95b36e9mr22755e9.33.1721767288063; Tue, 23 Jul 2024 13:41:28 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f935dc1bsm601145e9.6.2024.07.23.13.41.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Konstantin Kostiuk Subject: [PULL 27/28] MAINTAINERS: Cover guest-agent in QAPI schema Date: Tue, 23 Jul 2024 22:38:54 +0200 Message-ID: <20240723203855.65033-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Reviewed-by: Markus Armbruster Reviewed-by: Konstantin Kostiuk Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240717140025.66397-1-philmd@linaro.org> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index d5ff6c2498e..8c048782a6d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3218,6 +3218,7 @@ M: Eric Blake M: Markus Armbruster S: Supported F: qapi/*.json +F: qga/qapi-schema.json T: git https://repo.or.cz/qemu/armbru.git qapi-next QObject From patchwork Tue Jul 23 20:38:55 2024 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: 13740373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 53851C3DA63 for ; Tue, 23 Jul 2024 20:43:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMKP-0001Ms-RE; Tue, 23 Jul 2024 16:41:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWMKJ-0000i8-6F for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:41 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMKF-0004XF-22 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:41:37 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-36868fcb919so2866360f8f.2 for ; Tue, 23 Jul 2024 13:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767293; x=1722372093; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9AGqT/HuIbzxdWkOMa17Gjd1RtMZJ6gzAqRn/Fh0hIA=; b=QJ7DzPGYx8lYZ7zWiSFofL/ij7iEymKpUQwaEls3qyK5rIP5NbOjsVII1nTkQ3kUdk W+SucUUzgg4hxi1CpsQZ/iLDTJgPlC2TcS8te7wBT4YP1tADfw1FZ1qqbJr762VpZOcN fdoCIvfyb7/SJD/E12ZV0x+H0NWXGVrsbI1h5SPAWn8rJdKCR929BjTeE5MTMc161Vl9 4BXqCftbNcMD2tABzAdrQHz1/mRRLca9JJXouKA0hP7BmUC5MI5rY/HbBY3fcsYlbTyN Mt5vG15Y0BcfYnUvg+30ubJhhP1+xtKh7ACVBvp6ytpQ/l/6d7eA4DtSlJjTwocssdUG 6jqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767293; x=1722372093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9AGqT/HuIbzxdWkOMa17Gjd1RtMZJ6gzAqRn/Fh0hIA=; b=MHE+PaG1xgv9gFveQ+hiPZP2rSLCw3e1BwUJ25iLn9lDFgULpjYSr1VedfsY3m9+NG uoLJl+CxYk7B/Pllf4gXfiG6P+B3X+D6qyp03OzrIzcWVdlTn9ZGsW6AsVOgmhLzwsht sqnDxF3+VnQXa/+DQVkoaM0GBggljxaQ9sPqKQbdV8c0Z5R8KRQYw7GoniDbkWm80XxJ th2RZtQR9Yl3JjC4uFp7Efq6xXzWWA5wXDsr9VisKdUXbRhUW3jPD6tveZTV/1SK8IF/ AvnGMJ2ud3RjoOMtoSnY26cOgLyF0Nu38I8M7J1FkikBoiNc4vZn8ERrxb71jQ7tbEhl zgkw== X-Gm-Message-State: AOJu0YyhdLY438ZD6l1VqIcPHQji40pvrZOA5oNIcskIIU3RKd6JxlnM VoGgyz9nk2IsPw/Qm2HySJVY8iZPb32TaaUztwC9IydcmU2DaR+5oaFRSOcwkFhLKpb00/uO1NZ Uagc= X-Google-Smtp-Source: AGHT+IHpO+edb2z/rqnljhNasjGftnMbopGoGS+FoHzexXbjYv+z1EGuHf7PET4boFUtrHppf1byMQ== X-Received: by 2002:a5d:4148:0:b0:368:3079:427f with SMTP id ffacd0b85a97d-369f5b2b9d1mr33585f8f.30.1721767293382; Tue, 23 Jul 2024 13:41:33 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f939aafdsm523495e9.28.2024.07.23.13.41.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:41:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 28/28] MAINTAINERS: Add myself as a reviewer of machine core Date: Tue, 23 Jul 2024 22:38:55 +0200 Message-ID: <20240723203855.65033-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Zhao Liu While working on a series of CPU/cache topology work, I became interested in the machine core component and would like to help to review more related patches. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240722164412.1163414-1-zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8c048782a6d..a8e9d1b0010 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1878,6 +1878,7 @@ M: Eduardo Habkost M: Marcel Apfelbaum R: Philippe Mathieu-Daudé R: Yanan Wang +R: Zhao Liu S: Supported F: hw/core/cpu-common.c F: hw/core/cpu-sysemu.c