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: 813976 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489221wro; Tue, 23 Jul 2024 13:41:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUOg55+YsnwiO1wfTYPXJtOQYNTNatYmnt0+mjU0JtGb5eyLol7EN0tatE2nnsViSXiglfN35toPD6VreMongiK X-Google-Smtp-Source: AGHT+IFx8YNStGB4TCyQ/jespg24psCfiAgKfMLLh/BTRxmWrSqQtbRNoSsTrBDTwLMR8IjF8er7 X-Received: by 2002:a05:6214:40e:b0:6b7:9b14:626e with SMTP id 6a1803df08f44-6b9907feb96mr362686d6.57.1721767270922; Tue, 23 Jul 2024 13:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767270; cv=none; d=google.com; s=arc-20160816; b=XqfsFxPbTAB0hKmHJ64fKIlVGGzno9OWlHdgKBEo/5N3x7cYaUGxHbWYRnzmJyzEtE 5JCvYk7nW0ERPul0Mk5njPjUVMtRLpOSFBikRGoptyCVnCubKvP0Ba4m+COsEFOK1dy9 PwTprSR2IO+f1v5vnpivr4GtUKBvZtHic54KKF+s2QCARr1HD4qJy5cMZH3vWoNbpO8k Yajs4Hg8ELVlhm+1P3VfjbQw/gcpP6MkwEPdStCqdVqDn1VFhXQ04+SrXjX8o1S8GJKt Rw6J9IX5owL7k5+4+aSuuEppiZbhhePuawMnWitQfaY/xg+PX8V45fxiP71bMTVRY3V9 NIew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sVpySpyrjhMtcWBGxVtjyNF2MUS6wyprjn1PN1O1F+w=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=vsLuFFPJAh58cOAP5217OEqA1aH2IbnAvgAUpw8NALnxItzVINSRoj8aQ3ejHyhm8R 6yq0douZi2FsfAa+nsKOnNMLRNURRneERSizfg9ori3XpKUkT66OUUsi5y+9PTtMfuQ9 D5MpzQSTXPzKyjXXvXp3LEBsx6xUCVtkgy6D98AVG3adFb7VSYu1jsyK9eh889nMUPhG mNpxIAum78sAcV5ivElqn9tfiA7E+Ha3aLbIuHPFZsz6Km6uwda27vzLe64UA4pzcxOV +uyAc4JvmnES5KApQX7yZldRC2TdT50MSDvqQ4KyPlB29JUO9wvdXhRnGQSKWXuBtE3P uxHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aT+LAzlu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7ac7a2f66si112000126d6.23.2024.07.23.13.41.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aT+LAzlu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813968 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2488797wro; Tue, 23 Jul 2024 13:39:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW3kC/4klW6RDXmFkAOWeYIoEGF1qKAvfh29Z+tPhieWWs2igblDwHKP/m0Fm+8TAuB3/k04X7RhuESOXWhFHpA X-Google-Smtp-Source: AGHT+IGAIMBdGsVpcvUoH3Nbdaer8qN77s5n2UyzXUdUeqKVpKpymgcJrg8i4zqxr7zTnR0VhpvF X-Received: by 2002:a05:6808:2028:b0:3da:a4f7:74bb with SMTP id 5614622812f47-3db08f78e34mr127373b6e.41.1721767184283; Tue, 23 Jul 2024 13:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767184; cv=none; d=google.com; s=arc-20160816; b=bXWi0NoZB4wlZ7zYQAc2uW2RUuQPTkPFxiuU+p46wti6grFZTHucOw71kzdf59yn9v KAXhLdkz0ZpDmghTmlO+2139Cp0KL0DouKwbbCFTiwoPrd07D0EAEIdi320ZxzXRKWS6 VrrS0SwC6gsCNnqSn3quRwswG5jOdaWLW5NquSgvNBKOgDO1Rd1YjkT2doa+eLIDlYXj 8FXX3rvTquuYboY95sgwNRAwTecriHZWajFCjCgPp1LYPhfS5ZEI912XA5I8Wh6R0v0h M8U6qfSMG3Xz7VrwQIavI0CRLBxJX3Iog1v+iUVhMRt3JXZ7nn6anMv6kYTq+igbABWI jbaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=07s3gAboUiyqxdzn5K8IrlmeguSj0H4h3EuvIHEUowk=; fh=P5Uuv03EGnSUdvHiKODzE1tmjpKkES0C3Jo663h3TmI=; b=pTDalBz3rDU1pn+AbJOmJHkJY3UY2DtRF1/Q2kwfYSGpByJAWVKQJXhlAKbvMPy1Gh sEuJPYajXT3JizwMzyHua0li5GfCLuhYRYKzneSU0u9ig5a+2vb2LaxCtUkZqlNJNEL/ hv7jzvGhPFCwLMZtftGLc55lnoovskikZao9up/kBmQ8lLYBNs2olGkfI3H8ZWmTDfbQ F6zPMqP5mlpCsQ7IJvUes64u3amc9N/aHbyiU7LE1GgPZJlJosDAQ7HH7saaj88Loqdx LY/O19JsDL2arQXbtICrf1Aw6AFshClHFNUKKiTaHRf9iZaPNJ92RLmZ7au0cKH45tch B1KA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u6t+O6Sz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cd29a4csi108582711cf.203.2024.07.23.13.39.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u6t+O6Sz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813979 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489353wro; Tue, 23 Jul 2024 13:41:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbxLYcuisArq0j2A3vUQ+Nsd1KoVKV+C7TSeOJuhcxoNlfT6TLs1PnoW+zR3njx5wAAK8eie4EC/loFdweK4tL X-Google-Smtp-Source: AGHT+IGO2TMvQZoAn08mvKcR5cjpXAhpqbFPS8v/RpcqgBhW3YCMc8V6lAFet5PMWWat/eQzOhvU X-Received: by 2002:a9d:7ad5:0:b0:703:787b:13c4 with SMTP id 46e09a7af769-7092536c3a5mr44406a34.23.1721767293875; Tue, 23 Jul 2024 13:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767293; cv=none; d=google.com; s=arc-20160816; b=lJNN3JwbYwmfkVcRKwYpZdu05We01d6HvriRr34//t1wYor8B88zL3umzfCVxWmJnC 0b3rgNmA6EliVGQRNAlmLQ0TkFBpp1R54xSSi0rEy+h4M3e//O0BH7k6U1TMHRxJQyf6 5Nfmx5yjiKhU3tnRGIBwl6oHB+/PY85LYzh56UuGj9jVzRNlZG5UZmSemxMUAKcNPpx6 /sKeCV6LKXZWgWbREM3w3GoYh0UhV3O0VoIFbUv3xGgBRIyTD0Ctp12ciWFm6yNxWgVE 2rDTodIwRH1qe3WgU5mwsJcIMqb1UCazsG0vOLErjucOf60x15Bymz+fgFvLTKkf3THN KJ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rrr8U9MJkVqXeBeQIRhzeP4hlOkJzQZ2EPAVbiwALWY=; fh=FbCFlkQD0x3F8EE/s/6ezkzcWLQ3n+Y8v76cEtpNQUU=; b=TsyLNg41tIoVr7+OBqSDpkHSJBkGKhIlFlQ+saIzX0OvUP5rbUtHBayf0JGpZ6OH/v Xvh+RDaiiy9LLbhVlnPy69Uow89hmDnH4STup4OilNSgCO9eisUw2cznRmvnE1ZoD53T St9Op0f6hwr+csaN+djQqyX7j9ZEh2+V4wbVuwC/lOHeGZKIeCh+Z/F7m52+ip3W5WwK iO5JwAfPq8Df6Pgpuy8B2LWiSJ2CE1/GUY0Wd2TJNeH7QKVT2SYm//PCuQiAY97nR0RW 4Syt2YOVGumWSARhJgFzqrfDmLbpNhT5Lu+PXHElURH+i9WBNJOVisU2akZ/CMwxoQ2T YvAQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uu+kCSWU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdb87d1si110697061cf.340.2024.07.23.13.41.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uu+kCSWU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813975 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489198wro; Tue, 23 Jul 2024 13:41:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVDz27543RKFqAq6ryjA1wFOluWob3hMsw8RKVNr4rRtg/QayVCTJPkrcBL0nDezbL0DMeopH/J/t1C+ghmUfW X-Google-Smtp-Source: AGHT+IGpV3hXdZowKNwRDqllKKAJySwEIO+7AzWeCpffO7XeY5KxSznqH4CfDsEbNMDPUwAQn2Vd X-Received: by 2002:a05:620a:171e:b0:79f:1985:b602 with SMTP id af79cd13be357-7a1a133dc89mr1614718285a.39.1721767266875; Tue, 23 Jul 2024 13:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767266; cv=none; d=google.com; s=arc-20160816; b=e/nDlg499TsYO7/FcdI0doLf0N5lGimOmPIxLQjvrc2KCqcDq1sS/f5V3yXWBF6Sx6 uvb/aUK42Ym8XLVN6wwemV5tRgC6UYNz/kTJogagggC5Y7gi+5tyoOW0HJQbPBVxZK5u W0i3FLZ2fEaIBHu529V8Lt8YXRVPxlDIam/odq361lUR3AXo413IDtsLorYdOzDp4HB/ X6Z6KYA4dn93tGHitUPBBj9X/ryX5RXm7d/cZEuz5KMtXFcQNM5OE74LtRF0EIYG1fEW nlYqJVNFOlZ+ocCcQsrOSKI+XKD+9lsxP1QROkfXNfpP81W+qZSS7fNyo1fHgQXvuf17 p/IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SEw2US0MusaevsyReo4Qy9oebugC1Q09g9E1j6NjCoM=; fh=d63FR0c3ETih8ywwL708/MYK/WmikiRunAdgFdVU+Zw=; b=zPlYCAN3Vr3afFdm2OBPeSiavHiZhfRWdkQSC6DMRmyiT1Sx0oswxwrvziL8UNi8M7 NPLVPKKSDmSk23730v3j41b/PfBRhX+IKDzg3RqOQPmtmJFZfskacUqs2gkWpjHZW0XJ RIS9tbHFdOo6Lokcaxpwnl6IWi73HW6NwLUbd724fvyY8fjGaujw8hAYL1OxnnTmCA9e G/N3iUu3pICfJuKcpLAVZaCQQFuP94VTxwu5iUNdPH672IHj1Ee+XUrHBJhvuLGIOrtd 1VpkEVn/6XW5XPL/CaufBCuJ+h9W7A9+NVTJKNuqjmGDAhG34IZ21PRdCsq2DHj41/E8 Gpyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YkfBe30e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a19906d76fsi1107224885a.521.2024.07.23.13.41.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YkfBe30e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813972 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489035wro; Tue, 23 Jul 2024 13:40:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXgP5AOziQd4AwKZ6OqrDkoaWGRJFHLA1vmcgWqaGSD8HApLIroeuuunK6Y+FzF44pqsm/7uRzhmNgUJaDLPbkK X-Google-Smtp-Source: AGHT+IGIIHsBhMKKAOSYeYN7HBAy8Ek2VslMhlb6s1sM3xaTALGZXpLkaEaFTqwZIQui7ksEGTEQ X-Received: by 2002:a05:6102:1484:b0:493:b4cc:93ac with SMTP id ada2fe7eead31-493b4cc9478mr4778260137.21.1721767234781; Tue, 23 Jul 2024 13:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767234; cv=none; d=google.com; s=arc-20160816; b=fDbrqa3kRdX/fobhV419fbNBBuAbayax0TCLMm0xvUmUJVmN3krkHLV2msLyUSJ63P gujZ4ExkgUBaZy6NCyzrdmCBNv2jKXh7X938e7plWFJ5UZeQheonGi7+SIM6M+4JxdJG rsUsg50bqc68RQ6hmtXN7Bs8SN72xxftswl5NAzgBFbp2num1Gab6Zqipa8BBpybl8PW lKeglb9vd9JIlDmEiU/2Tk6kQjHWgxHyCA7dFk1MknyD154e1ajBGeTg8HCYbRsZUONh eHmWp9ClP11QWCQjbW7qr0sldmIzMA4jHiECZRfCvo5DkoUKHmFueJaZ4glJ2d53IhgQ Plgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; fh=g6QfngWxyI9+6PUvfGrxmghjEe6uF3GkeHNILwG6GDU=; b=ay2Uy1ssoTc2gUSNbQUuClhPa1S2dIs4jkqpqrUAylhlqaqgub4ju9KvOvsAr4LM8s eGgNlvnVX7u10YgEFALcpNHhHMoffxxuZTm1OZAu74JPNG21AwkUHsA3///kHtFtoRcZ o3Fh6HEtm8sYtEk31z/ERXLC5FOkEKBoSjywEi2Mq4WahgD2B3ZVg+BUFaCcemk73mBB TxUfuLUdPQLK3fN1gDIkcii2NLtsnU13xqLzSpPflpaE2R0j/x44MgXV3sA0ue3x9AGe njTiT03fFx9AcrB6mAVmyMgPfAPLu+tviaRW/oYgO9YKr9Vr2QW7hmm7tRAjkgcPIItw G6ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vLYljU6K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1990732c6si1099627985a.529.2024.07.23.13.40.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:40:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vLYljU6K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813987 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489862wro; Tue, 23 Jul 2024 13:43:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXNysvl8YUm7YaFNfwvokMkzUUQv/tJuQ/252j3AWC3qIXbXooHaualjARGuV+5wKnpPYd3Hez9Sz4XJlPaiXlh X-Google-Smtp-Source: AGHT+IFASqgULs7BTVDwTD2jS2zO1Q87Qnw0Dx2sh3J+LoCBgh1+9W4Kzq+tb7c31SyyTlI/ztHr X-Received: by 2002:a05:620a:25c8:b0:797:84f9:cb38 with SMTP id af79cd13be357-7a1c2eed9cfmr531089985a.11.1721767392225; Tue, 23 Jul 2024 13:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767392; cv=none; d=google.com; s=arc-20160816; b=Wz2D+10HHoQG7PUPlRiuRBg8r0wHqXikE1cyx+lh2ZD5dsAYOrzy+QVAsBtVjYxjVE b4QSf2C43awfZ8Xx+CtR0HLNCP/DQZ8k+VQmv49VJ/vg6vA5E0gYKZlZzcEvwAewIBqO BtYXOdc0VoNKSkTKc2sp0Ei3ygIXQffHmkFzdOTfyA2AERs2n2k3c2nx6VDxkenTtqyh v3EKXmtb77teksh9tMKarC3kYMQL384GVYK69YUzbbEdbrz79Z8QC5KOVGpiuST7ta68 NCUXgXJjy78xNblYNnM83vWgu4CTvytYX0Hax5LiGky5fmvWFPDJvIWljoisxyMH1q34 sidQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mAWB86PPkrxBCeTbR27TWMyKaulXnrAS2NRotSYIsdM=; fh=BEPGsnE8RziNoCBYK93sEvoshUmPMpi1sZJTP5DzDWM=; b=wpu5iSuVRemmsovohCEv1CYZPdR0FDBQAhDrMRbJn5C/4OR/5pm1z23oGSvJWD5FwU Bz7/TN0hxirQVt1eUpnBoPLt43Her03FJGf+hp95p4ucrMyYBCK3CVfT+XZHXisfEkZe B//e9+slebk8guQxXS2qVzHradvoyAJ99KSMW4zkefUbgHfPRV0JyCeF7HiEECyRo+nb Jg7vdOfHMTpEOESDScKN2n/teC4er/L0SOZieTApBZd4RRv3wx5ok9rXfIBRQ1pzSX6d kdHjKSEHzObVxPnAxyT2Ao/yChtx1swrA+3fNTt68lqTnloDni96cWbWtuvmgBgRPgyr cs9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GrDVkwtL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a198fb13d7si1116803985a.205.2024.07.23.13.43.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GrDVkwtL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813970 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2488966wro; Tue, 23 Jul 2024 13:40:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXscg7rL3xOKwkrk2/loJlClB0gySXc452fb0uCOIuSZLsW6t2uQ5mon2gTBXGdzLy96z/jIfX3ztv2amFU/Z93 X-Google-Smtp-Source: AGHT+IGEoS4Rydrl9xrj6cfsw+7T8E3K9CsCu39kZbtieQufILsZ8dfor6M8nnP9Z+/JLwdXmIco X-Received: by 2002:a05:6214:3019:b0:6b4:fbec:952f with SMTP id 6a1803df08f44-6b990744ec0mr587916d6.25.1721767218276; Tue, 23 Jul 2024 13:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767218; cv=none; d=google.com; s=arc-20160816; b=MFn+FeTomzWRsq9T2dnTC4QR793gfdHb3NIQofxkMlXajlif/nmYJNWOZ6CYfXSu76 gBdrnM/tarqWNZ1qR0/A2qXneOsxHkvdbY4UZIRQP3bxwzC3gMyPUKLm9x8GdqeedTWC yjmyEqnXoBFYeHmrnFW3SDLEQlvX7qSPoRKqhfWk1yIb1bC/IMu0me8Pebkp1OKey6zG vMp84eQ1iilAWbLjhJRWUDa/PYxD8j4UJ58a46wDTHRZbUb5oWaw590mIFOdUzmpHqat gY+ePRwzp8CdF8wd9FDAv58718IvP+93yTNgP4W9mo6q2jB9PqG1zC/zF5I4fr40Vrni nK4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PVW3Gx4VWf1FcJPawzcx0DDSK91Xb6uFhCXhyBk+SmU=; fh=My8FCjwgGr9Kbdql5KahR2+ZkzFVqZuChAI9lVM2YGU=; b=aMgvWOgTLHLCP1OQFVlyB9svDdIFt7txw3yKfMKjJSOeMFrBi9j+aJryUGDJiD1F7l DK5q8c/TnqUDaixwwJ0ZkRcSDAvgC4FxRy9ZOLK/vAATc1dPPMV306Jfgbq3hcoH7WOw eoKabGNoAClWUkoyTlKcT07vX9/ST769qVoiVHTkvBLygdbCP3iTqJye7o6v1JorI0hF vuBvbFWv9nC85SyMBqjMyRz8NCj6oaYg/Sw7wCLAg2phexGHolDr0vBPv0AkgqM5zsgS d5uAZHi1b1dpyUDwLWrKTML59IXZ8STTtYPjACgV1AMOpZGmS/ixCI4nksHohEmwyuPd hAlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xEZFmD0D; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7ac7c54f1si112231756d6.177.2024.07.23.13.40.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xEZFmD0D; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813971 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2488972wro; Tue, 23 Jul 2024 13:40:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWl6qCm2RKYK77cemD1Yop4t2aIF431q8YtO5Veag9Lk7SPkLADpGva2VNOF6jEr17AqSjaqQvFrovl3xPHUjKx X-Google-Smtp-Source: AGHT+IHJesNSwhFqC+JoG0dhLCnMB7BfkrVRqYXuI3gpE+Q2xIECOvkxxH2TmYp3PlEDPKRkAIfH X-Received: by 2002:a05:6214:21ae:b0:6b7:9554:7f20 with SMTP id 6a1803df08f44-6b984332bb7mr58688526d6.15.1721767219308; Tue, 23 Jul 2024 13:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767219; cv=none; d=google.com; s=arc-20160816; b=jprENtG6CCyb73j8V3E3qEv1gWLxhM58Ju7GHwy+8yWMb5TXdtn/dp0eXQ0aya5Bao Dq3TrSVk+JgQUihM2yl82eyUu6XZset0PdKdoGW7F5Bz7g2NA95bbecRCO5skimoiM1J cfo88LjR9aLO55ddflMW6vofY7ktYMvkLvyvbhzkrLANPTDh4V+BHepozL1yhQbURUdv adSwtF7dkqOwiUrg+dUXBabC+Hd0qqyumq3IH8kW70NnnoITHLw9NiZH2PEYk2+XzJSj Qy2/4/CF9Mrh6JPPd8TbzHkuX4F2/F1VPloB++xlWUAHh2u9ewLfbf0X0kOuptLR1aXr x57Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o3ABXJMZuK4B1pMDKEQUPr16WMzhgKew8s6daG0+jWs=; fh=My8FCjwgGr9Kbdql5KahR2+ZkzFVqZuChAI9lVM2YGU=; b=GDrtOUL+A0Fg98rXbx7hU4MwS0RUOZamQ05TLGpHdmzeW9LGLb4qvbXo4XAL4omyNA nKIoWXTRytZneXYOyJ0kVT0tajqvajvvZISl74Oa4fpLowtHQcb2HIGFzRnYORGAZu6M e2Ay9CFG7ojpk5Q+sdGAE12g1dHGcMjmkS8qhB2AEQgR/rA2hTfMdFpA59ccjHar4QM9 PJJm4YKm+nsZVS+TlxkmPsYCZLTaUVMk4MaPtADfqFid67OLI4FQNRGrMLhwT5gMYM/s KeBYi7yHVb0WrV76SPDuuUuCAd7kAigOS8nEUnRa3mXQfuwoagpoDYVVqLbPq4GQ2e/3 QDNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kh7kmD0u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7ac99c74dsi106886976d6.274.2024.07.23.13.40.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:40:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kh7kmD0u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813996 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490096wro; Tue, 23 Jul 2024 13:43:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX5rj5ctDHusyATUfeWtomdyZAsQWqlgSzkUXxBH6/UFb0oc4d+Cy3ADCfBvSFQDWPPxfGWeg1JfLGpfxGj8lgr X-Google-Smtp-Source: AGHT+IHek/hjHrBp5SCbJoi/aDFMRBQ412gy5yefq29+20VMscLCccVbp/Mq7ksMWUuC7EnCZA8Q X-Received: by 2002:a05:620a:410b:b0:795:5995:fc89 with SMTP id af79cd13be357-7a1cbcd90famr24362085a.18.1721767438511; Tue, 23 Jul 2024 13:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767438; cv=none; d=google.com; s=arc-20160816; b=r5w+c+eVgOmYB6nSntVJZ44/gAA/9O+sw9HBR4W8nLX/I+4EJdUEtTHvD/GVqlJyTp /62ltZ9QPCitBMdViP8wpyIOFJbQhmKMwkhcl2C6/6JU227xSjoKdRqtn2axhMpQAni1 ddiALLQO4lQv3Ta5IWfXaF+Z+D0AdIIvd1UMSLu+2r2F46mKfJrV+hh3ZiCWI3w86C0P 0fxNlUXhypX0ou5VSMdPtUmmNoaKdzAO4wuE7zBIZDSTDl1rB0yBae/h+mdldjZvNh4c WThWX5Wv4dBZ4NlNQTkQZ3OxrF0l6+2wwoeMnd0mb2LpY3zNWbNHKyfd1sbfYLSFBmy0 iqHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3JNSLq3T/DO8Fim2AW30tyDDzF8z85BC5OXkOQl9TDE=; fh=cUnmHIKs+vG8TZozagqp1D3iRwAr69O7nXf0Pg6JTFM=; b=BvZ4zAncblS2UDZyyZ0RePkP7m8R8ct+Zv/EiGGrb9e1kurLFggK9o+e/fibSBwTde ynuoZEbBzOzqSlQgPrtnsgee5MoeBQvdkj2I1gYG6IHc988A1YwXsk25ms8VWwr2A6OT UHyg7DBZx2bEGpC12556h4BSLhprWs4cAZ1K60UL/7a3eOYvSDupZ+B/C5KyTrZrIlQC oUKAkz6HXh2h3iNrQR2vCFg71M/SQCXN2Iz+VmIexv/oMMecGDpofsHan4zJT+uZpA1+ Hz593ABBQ453j/zOfscRJo4DBONkiskDBL+rnV/IvHImtciLenAJWIY9N3DauqiGHgeK fMKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=faTz0xwK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a198f9817csi1053993185a.72.2024.07.23.13.43.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=faTz0xwK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813974 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489185wro; Tue, 23 Jul 2024 13:41:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+xRVjxUzDS6VgcdxfUHke2Cm/xJzZkOh6Z/oXD1E480eCkcc7XtF/yXeku7Tco0I36Helb3j9jNy9t/7/syW1 X-Google-Smtp-Source: AGHT+IEBmw7nnwZlKUEJxDNBFX2ibit1kq2qm5NHgk8AJg0Iq6xLQ22+GrrzD79DyvM5r9Wbupq0 X-Received: by 2002:a05:620a:1a93:b0:79d:60c2:59f with SMTP id af79cd13be357-7a1a133dc6fmr1360301285a.32.1721767262760; Tue, 23 Jul 2024 13:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767262; cv=none; d=google.com; s=arc-20160816; b=fE8xpndp963S2kpSNrJfBXzpMkwJvC4YaU2hJzKw2zdsSupdHKBy3/cPqPZzCleGaS GNmfeAx5KE67UZ02EEKjX9SlK+sr4Mft3mneZtNBz/0WhT/G8akTNA0/86ByXa69AAbw 3UBXUz3aSp8+M4G9QUgpXsdEkviOXKGEi+8dknbVxJsR1oz/25yAE7C/9lP97mpKpXjw YLAp2Sx/NnlRnbFgpqJwAkXgJqyJiu7ojrQcwDU4UvSNueFLlQdXBuNeC/sl8IKBPmTH sdQlcPOTQVPk/3EDZIAvF6zpji7JoAGa/zE9xhaYqozhLwo8BimWoXtrgjl3U4vKIhMz Ye2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+hMaqq/BTdi6PrKr3cYrZxRyWg7HqfkCm9irnu5mKRU=; fh=5KYNaH84KuhJkbNfHAKkJotxTHueTtQQGeWlMENxW3A=; b=uudUkhVlq5nH9Hr3+DGLdN4TRcMoXziHQaCMAkjaxv+jnbQJmS7xCMoFqnmQixl6r8 dPrG8b27Ij1JYjLUWp1/75an0bjZRIH06uo2hZSwOBFfDCsibvvJyPqRsynJ/ERQVXbm 70ZTrq9Ba3rvJW0F6jZ7UZj4kT/JcoqXS9BQBVkDcIzwR/GtjkA4dPhClzVMR1THksH4 4y5WAuPgYd2yORk5Q5saZg5VlY0FfOKK8mo0BN2hgnfRVk+5LfZ2siAW9oJEriDZDnUG D87ewQHHfb5cSjluZ0kJkqD7qDooqhKoKJZ8dwGF99fLnqpPJE6KByaDNpn+MYqXZTr1 AEIQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e8dv81d4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1c86ec5a0si132595185a.287.2024.07.23.13.41.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e8dv81d4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813978 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489278wro; Tue, 23 Jul 2024 13:41:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUuasLdTPlGeA4Z7RcAgh22o9M5wsWDt+ERusVdlTDtm0vyZ3TvslVW1/wJYSOxk46SinQqtlsJe3fCOW1ODCZS X-Google-Smtp-Source: AGHT+IGoCdZsg51UUmOOKGSRhjLSMqAE2jEyk9Z93zAOilZbwuhUH1KpdxMLLnsLBqo7fh8q/J6J X-Received: by 2002:a05:6102:1525:b0:492:9e3a:9f48 with SMTP id ada2fe7eead31-493c190b2a8mr1286562137.2.1721767282550; Tue, 23 Jul 2024 13:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767282; cv=none; d=google.com; s=arc-20160816; b=UhSif9cumOU5QKirYaCIQPodNqss9P4V7X5mdQ+D6O1pjvDndETZMNutyDOE4HTG+g db3Ah97y8PF9nYNQZ1YPHF8eUlzSqp89KrZ2ULQpHwxVNxUwEXKE0f8C9pt9lI2yt6PY 45rdb1lLfnelQbYiCertKCZwjNjmqWC/arXLks7l6XAHcLxScdfXT+aXNI2S8lbqXTcY fA0U0OjJAoDe5oAoVXf5QdnKvjsT7BPaAXtLYthxDv4D88vNbo84+wXOxJCDakaorcNs QwNUtpCAFTqR+ouuu1NgxkiIiTgx1LA+Xu0WHXleYN9DvroltYbO2ytUB0R55aDGLK57 OizA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vEOkd3+zxom1XlmbkPPQvUDNjv9xP8TI/j35/QIU7mo=; fh=6kkQHg3LKqV7+iDll0gwTlEigYyWKHehcxsQcQJfzRQ=; b=VvZPyKTKTrfgfoKRML5A6e6Q3cBERiRmNFZ67nv8NI9pko73r1axPdAUdTv67p+QGD hRjm1vmMtMDUUFa28TWK0VOAReUTTn/Xqieo0GHKmnpYV9tdH8wUtj9LG03GE/W7L6IS VfLRFHk6hgViUteH5w5BYui3EpKBeL+oPcMtmp71Zk5pNhm2vKGZvmApOPPczcWs1o/7 abbqv2ka8N+7lses7iB0YDUXRrMSV4K+uHJ7XS+TszNCzO00ZjfEt3yw4zyTzO29P6aO wojM+WyPykQm4rUDtiQzNU6tZuBv5QqvLx8ys8itqilM2bAfbyOYn7t/4jsu/zPkWiYs Q2+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gnP0B4Ur; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1990b334dsi1187978685a.749.2024.07.23.13.41.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gnP0B4Ur; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813994 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490037wro; Tue, 23 Jul 2024 13:43:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7MqBA6FSadmO85/BcFFSDaOePljtUvZxFt+x9pvFO3RioDOmpxA6HXNmLXV590fH0oYkbEPfPJlBPmqkF7eRk X-Google-Smtp-Source: AGHT+IECXSZUQO7oaH9f1WQawsOzVgF5du5p+zaFBqdUlfU3Hh6u7mFJ0CsRuAPlInnFXtRu+BB0 X-Received: by 2002:a05:622a:40b:b0:445:229:3879 with SMTP id d75a77b69052e-44fa52a4303mr147545071cf.29.1721767425671; Tue, 23 Jul 2024 13:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767425; cv=none; d=google.com; s=arc-20160816; b=HyovSR0SIeyyYKkCXWLa1DH3o13+fdl6liqkmnJWG/Ag2Jrq3mccSqcbRDoMTYwnei H0QiwdbBK7RtYq4Y8qYk01sKooCB9An+HT6jqSPVBoaXBBbATbTIzD2ImctqMjZwYnOM h3oKiFPltUCIw/1jsyowfStmoOkWLQ2uWAv1FlkVGn73D+zx42sEZlX/rYp+VxhnIEhO UljKtjVnbO238Vlo3VWk3NRBZmYj+NYTBxb2AVvWqUMIoQZtI6GEUqCDtZD+RsXZ75qM lzR4aSorSF7c1TQZ2w5ArYe3Gv42D6t1zJrVrz4sWaoxI6yp+FjjVy8kiKGhc0/k3XLJ UuLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rcNZQQ0nKhi9U2udqnFLIBFior9dBlBIvCxC4fyrbfU=; fh=2T+KfhuSLAapjLkuIGm4M/wQO1FbRA2dukK4EuTVnoI=; b=NmERwTEEhnClJUpbqi4T6Drg7Ko18W4OUJUYbvT7Go3fuULbHZrb55VzSvPDFWfdWE QXcjMpxrYfbWTdMzsyRiMVeFvNq8DgbbQXtGLgNLiHbmxarFCRSz8hVM9KLKGs88zGpu YvhtEthh4TnNB3FIKYe3AzfPsCJWf6K7IVUX3ULTmblIZd4VN4NNi4cGvSM/dHgblPKl j+oTBL2fOdP+a8wR21rhMSTUPcDbLsRMzC82Uz0VP7zrPFWbar/LEgdGTrJpsjWHk0CC Q464vOGmnxzi1cHY4oWJCKWzOsV7ZzHbV4SjKLuGhhbWVGd1fOACAf+yPtB24w5SmGLn O+jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MQZBDdsh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9ce00262si119700381cf.582.2024.07.23.13.43.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MQZBDdsh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813991 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490003wro; Tue, 23 Jul 2024 13:43:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVS0Cr47XBJ8Ud3aoLcyKNSRn8N98ODUxa+5uXRkxKekybjeNwnRGmkxqZRiSiLPaLSkXDUrx/RglaIjHmlsHMN X-Google-Smtp-Source: AGHT+IEkQzgP1wuvqrRAK251KbOhtF33ZmxRj5pNtG0Adr8pfgvjSVheWH+o7O50XWALlWir5WEc X-Received: by 2002:a05:622a:190b:b0:447:e046:8482 with SMTP id d75a77b69052e-44fa5281649mr116336301cf.23.1721767417505; Tue, 23 Jul 2024 13:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767417; cv=none; d=google.com; s=arc-20160816; b=qkhpqQ2hx/Y5O0bBoEh/yGowNpDCbruMtrWtXlj8K8Sr351ux6/fFGZpjbSW3HWbXN CoE4ahb43jFG2DLldL5yTGQtLF2qM3oXNvoCl/55KetjwP/cgh3SYPPKS1Dv9iX1IvVS PeHcdtrK8U2LG6oxpU1E7CQcApBiX6VJKWzb1gOsSycXEjx6EVGUDSG56TbjC7MtA2yZ JmWQTvR+1+6pgYeP01pbpQFbeAuOcljhdfBh137f5PlRJAOvoKWt8KFctcQC7Mdv7QwF elkXGMvHmrzWcWl6P0WIVNKKBcNLDSswTOOq1mhP2rFQN3KFq6OLHJEJMO4HW4akfNlF YnAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=efl2J6FZMNBybvIOohahy/rqbvmAN7ozlP6FIF0OQ4s=; fh=2T+KfhuSLAapjLkuIGm4M/wQO1FbRA2dukK4EuTVnoI=; b=xJzRIQOVNFjDSPunBkvohguiX/gd+uCCV+YVJ97JLl/L7HUKC0K5eLrYugCPznh/89 oFH66dRF3KBs9+soJ7w0JXM86mkYbhUBPb+ODNY22jPucrxJb4lxaRXfLw4QcneV9ZA5 Q96oIWL+czh2A1EwyiNCeAuSzAcm6ceitc/ElB2Jl8v1yXTxtwvwi3R4DcrZzQ9luSo9 nQNHL7lw4ewaOwtymk9RoYiCN0Eu5XjR2DwaZ8sS7ciUu4n0OApBxASSzFNBhoMOKqkT S3a8ElD3zj7l1u3u/zZGClckIFuLWl928jQ+3e5xfmBUZIu36KGJTh0IM8xuzC65CQ1/ 178w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QfZaLrxW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9ccfb398si106007271cf.33.2024.07.23.13.43.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QfZaLrxW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813985 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489809wro; Tue, 23 Jul 2024 13:43:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVADsJXu0a16GEmyyW0nChB9OwegmrTnwEiFiShzi9yII60o7P/veYWP6Wqm3CTryQRAc4YUwNInkDS0dJkZTiC X-Google-Smtp-Source: AGHT+IGfOZvhPgPqQotOnkKiuizDDU/X16hK3J4rHDm+l/hJYSk9jvp/FF6N8tm8AuaFxtkZRyzx X-Received: by 2002:a05:6214:d0d:b0:6b7:9a8a:2feb with SMTP id 6a1803df08f44-6b990778f81mr556096d6.26.1721767385055; Tue, 23 Jul 2024 13:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767385; cv=none; d=google.com; s=arc-20160816; b=RHjuj1VF2EtIQPuo69g7ARCCMH2IvXc3Ej/+MYtKwu1jiCUoho7cXDd+GSJWbR1DO/ QgDKmDTHIj3DrhRrhu/OLi4wIYGYXHPR83dZciqEVCqOlZaywJL9lYDw2CTY81uDXhkp n/h6YKRkGzqGnQhaVTCJG310D8foCuT2f/JPv2swQ7gKN/28DKXhPEj6ONCKulV7YXN3 nRNb+/e++9zKNJiZU59dIHglIL3Ro+9E2YhYsvQmB3hcdu9QDLtX/dDDhwf4H8I7YNtr u0KqdFjEfkiPK/DvDoqwvqyyN8wT3pC6AFr94GxjqPIlCxjVnJYslIuY/I9q7HeJBURo TsKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pqhDz9jkzJVJQG2tzSqklstnX2oao7JbXMBXUDlT2s0=; fh=2T+KfhuSLAapjLkuIGm4M/wQO1FbRA2dukK4EuTVnoI=; b=LGqmmH9qqkxfyTLlBL2IRMymTFPM6JaFAZPtqVW8Tbiz/jKIsbVzpZ14pXdz7f/OvL ggE3Wddtz58GPFxG6qV+8Obu/pDZA5Ed+eZkclzidjREfTfMH+SSzCUEeLOGbGab1WsO t4BPN+HhXe8EZEFef0UpqI3vP29r0A6qHoCXICf7/HRuHk/zRUb/0p4LeEn+Hd/K3QZw eLLf5Bbavo27YKmg+xpCKyH7naX17WREepAdmo2/UKY7j7IF/wV3MXDizpZbNMWpnRtD SlpJKHhr9YLpPi1oWC/kO6XanPnAh9Eu+HvI5rJgmS/mG9wNgnkFJC0cT+4w7dmCw0MD qLUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lhQpAjNp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7acae19d8si105172086d6.409.2024.07.23.13.43.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lhQpAjNp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813973 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489179wro; Tue, 23 Jul 2024 13:41:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU3SLUdcfOxGu4gCcEJyQgYO6mq7gcJBxyNh8sveKh2zzSK3U+M3akl/219mYBpkjv/evK2pXznJ5YLzfkn77Ay X-Google-Smtp-Source: AGHT+IEJBGHCToJII79TZ3YmmSgWC/GBLi/uBtacIH27ja6/+9LHTZBdE/J9r/bXyTEXz0uJymqn X-Received: by 2002:a05:620a:4144:b0:79f:85e:e3fa with SMTP id af79cd13be357-7a1a13a8224mr1207054785a.45.1721767262258; Tue, 23 Jul 2024 13:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767262; cv=none; d=google.com; s=arc-20160816; b=OJa3QPBVDm6x8b9ImVWQ4VHKpxsXQiTJ/F37VcJ53IlD8tZIttaGDra49YSlQdh2ef SMccQYRZ8SYbuUy1jwgXR1igQVstRM0gu/5Z9OYdVAdVUVtUUwBzKLCMAI43TSVQ6Nil s3RLpTlBSptqO0dT5yvztjf47EECy0gjdFqMoolwfZ9KTQdlpQtV7TRsERQa0MQvyZ44 jCS8TNp7j6PyTcgnwsLTvCtlfm1ZuG9ymJNz/r8oJXQOGILa+s49QLql4MsqQdgl1hU8 pCsv9xhAFmLAqETcZReFdOHgXfT8dGvJlpXoosKCVB6oEfkkVGH/qF/6qyFwr9c4HbRH /jiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QlBR/BeAgLJfmHQZz0VW3T3k1ZaI6aRPlMOhtzIdfss=; fh=prBTqj2Lpe26INKtnaCAbESuyi6ae4Ne02Vo6k/InwU=; b=zLLdBhERJ0ZUdANF3wKJzNiRVStHn5eprqhmYNd0APd3fm13u0HNozqbOe3sv9JeD8 rrGIMHIn+XfHV8mXYcKHgIIZ8V9GLHJWsEe5ikMUywidSgxbgOYyJ37FpSi3TsUL/ddU u6/oQJmXn9pJ76dJmSZ69A6Ix31JapvRq6GU/Q9X4a1DFN1DK/CP47SoCaQGz7GXgCrn WIGBDQW35s2itnRAQe8YpFweDHAfrE35162NoRj0wuUax9ssVcMztJWF7yXb5aJ8LKXA BH/Ai9Zpq6rPur7U3/TNleioBUtgZHp7Aieq7TcNvhmrOBcJ3QqK+aXbzuXJY2VTqcRT eNug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3J4jLz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a19904a804si1132561285a.309.2024.07.23.13.41.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3J4jLz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813980 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489401wro; Tue, 23 Jul 2024 13:41:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVl18q4WGVd2itl2oi0BLqUWRsCcJSu61R7GziJnS4rB+Cl4ghE+J0GVXDH08T8j9d0F1IJ9zf4Uyj6/ddKxgz6 X-Google-Smtp-Source: AGHT+IHY8YVBSraeGkT4FlXhTwY9SL6Q9lObkBYTRMq4Eb7zOK1PO+nCsrH5x/ExPAJ2bis5L9rg X-Received: by 2002:a05:6214:f0f:b0:6b5:4aa9:9687 with SMTP id 6a1803df08f44-6b961116423mr146696466d6.50.1721767305239; Tue, 23 Jul 2024 13:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767305; cv=none; d=google.com; s=arc-20160816; b=IGv4IWzfTfPA7w2hsm4hA0Cjen1nZfgIceRvD5Tmznc3FI7dPA4pziD+TAP39RJlBr Sfz69QfVVnch2xnQyS5AKE3dizIlcJCidzgm+DYAksHcKueaxNpzB8VxChq7HTwzNvhn vGyA+Y/fT7ZUGjlr+NWmam5E2Hlu7LULIhunXfnyiIWaerAgNyGmOzVuRfIk6nfWOIvK O29Guju5cJh8gRNvz0d1cr+frXDRb+85RrUTOpYcyF+wzKaArn1iBkmhSvYPUPXJx8LR kfBmypQUPYvS3UIYVw9rSGM6BBP/zYOP5nlOAWKnrR1Efe7E8Rph+KVzn6OoZLR8fBhX WiUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bELfHk4oMv9ib41OJIdVRWkzH2ywz3o3d2vSZHxMu3U=; fh=s2ggtbMcJ8IF7v/es+PJyDYG6fs/fHVgIEhHgmNbwWY=; b=C/lBQnq3nyN+cNX4KlUrdvmgHlDkuklqLCf5GTkxHi56aCoUUlNIqBzTwtkDwhsqz2 KZsiOzmYKkO4uYiEZji0SelVhU9pv5r8YTGCyKiz5DnCCV6eLgASsizaOMBEpRkyOA8+ 6suGhr/W8G2142eunYCQfnwOgoQDgeboTWAy1A94m4B+IJE8OflAAOIUuE0yc2cmZTJg 0rzwisAX7o9i/iC24KO6MRb6ygbegtC2Lq2TUuK3vt/RquGgq6pNchKhwLG9WFYg/6Tg QgWBmgtiHrPwpiZtp0ehidJg5EeIqE12IDDU0c9zuYgwLXwkmGlLo7YRvDmIvPMllher pSgA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RK+UIhVt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7ac9e8747si112303726d6.397.2024.07.23.13.41.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RK+UIhVt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813981 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489502wro; Tue, 23 Jul 2024 13:42:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbfdw1ScMVN8/d5vZlaQxgRwT0AhqAegcdOBBpP0fxYgWd6XFt4lcUXN3V2WTMbRrop7gQN3pVyR92o/gNi35L X-Google-Smtp-Source: AGHT+IHm72/jF1yqkzKYkZB/kdll6YBEtDTcRYn/YnDMcW7oEs+DLHsxI5FpES5VsNOy03MZy0PU X-Received: by 2002:a05:6102:5713:b0:493:b484:ac06 with SMTP id ada2fe7eead31-493c19ee819mr695203137.21.1721767321874; Tue, 23 Jul 2024 13:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767321; cv=none; d=google.com; s=arc-20160816; b=Z25VAiDllrjnTFL2KQ4k5DWj5jiNwgqq3lCoowYezGa/jtnDW67VOztwIl9nxvietA ijySfHLGoB2Jp95kqybaWy6wAwjv76hXaALdH8ZcUhh2/+/T+bS4tEwDVlz+lKqWyKRD LHV3xfPrkOKrReTE5hhFHzeDWNP3dvwRlovou5YDJ3bH5/U6fZ1JXn6Y4lUSim822hip MVx4aRqHvlEYWTHQ58QuGk/xQ3BXspKsrlbl3+1zboklLULtnyWxMTOg0OpwH2xIl2id M0vqOAeHUGnC9LWWd+LpYc9aikRPLQKA4dlU8V9ns6PS/Roh0EKvClIQWsxonnq7tX3P IFBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2N8bD0EiQwQSfnPzHE5ISzd574iE9UTxrUPygv1PgWk=; fh=/qvncaaVouBG2u7u0xelaaO0gOBYgzka2KHwazWJUws=; b=srSeMDdSN+1Em9FaOwJIpydQeDN28Gf009oHPPkvNYAGeL1gybzUEB2fogOVTZbSn/ Ey+qiTeX5lV+4ABAiRSsXJiKv/s6/rXxuiRUc5nWQMbCGrnSFsclfoSm415fx3DuAY0S mIFp8+8jmnFDuV+Qf1eb9p0zxeBVGDMYJMF5I1nXf6GyB6+H+g1/8g6QPkfECARHhup7 IGG5eOJzpY8WN1tGt+8g3z7+u0b46ems1KXZuAusZQm5NjmM8vNBL5NTkvZf78Nup5qM xU3FWjiJbZn6lMyUBu9M5ZqRV3NDBIM99CrtN7eC+8rAJ1f+GaaEWeuVUsSZKDfljzdW WzpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X6CifGpN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdb8264si118340811cf.366.2024.07.23.13.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X6CifGpN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813984 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489661wro; Tue, 23 Jul 2024 13:42:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXE3/SxJXzLsRyMDfE6qWnX8PxllEqWax1n/GAD4jtVFUXAGy9q4Gqa2nWLC3sMARtyml9dV1lvls0xMzgNkPP X-Google-Smtp-Source: AGHT+IGyaqsOP/2PvEmi4mrmcff/saDI0FJ31RfTq2a60SihwtKkyAC2umoA2L1+VdqMSDt4XBEr X-Received: by 2002:a05:620a:2441:b0:7a1:9a00:9aaf with SMTP id af79cd13be357-7a1cbd26293mr17660785a.55.1721767354767; Tue, 23 Jul 2024 13:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767354; cv=none; d=google.com; s=arc-20160816; b=0rCRsgXwAjEuEmRZAAvZuJFFHsp0CHA/lctX8NSUPvrPTGhR+VDW5eI5t+H4869wW0 gp1SjH9GaxJhi+25GanNOpZWmYcccHeBtOBcNWHSiGW7QoLAAxohBjggQJS1wuWzKod8 Fk8EN2RpW66j2Q4OuEfV4b2RwyZEM59krs3fsXZQcwfFiztzEEiw3x+is5bTMAnnem0u owe8JoMu+9ADj0oQljgP0VhI+uoO/rOsMVTg1zvHHcfm4xAfMH57qN4f/NAa4KYMwrTn Du3ID5i+Wip2g20OLfu6TaIJBXAsFs3jaA0VVlUM55juQqCNkUNswA5aPcC+Z3A/65lN shPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=McKHquff5/qMRalcyN7OIwCMwCYYM5fhTICEYe9ToHg=; fh=+95r5kQR6IukR7ZYhJTgQlrK+EjvhO3YVAakLK9B5LI=; b=b80ZNpwp3Rin1VdMK4Y5jQlUMGFeLAtsBk4eDqiKIl2zJX3b5v7ctBC+uZpCst4SzX RIkYGxuUG7PumDxfKi04VwK5wHc3v9fPJFJ1V8gkA4C1uFbBhYJFvkCrrt+8Kmdt/P0e Jl0EkDT57KjPzOd0CqB3xHk/xUsMe8/gYDMQCA6XWVFjKso3AzDXwXgskrxOghEhnNqS zu8HIcy0l80me0rDZEApUJLuaeolD1xnH9kJTS+frRscwCoT11rJTtVzt4sYcVrmh7wQ 0Cqs2ymHD7UjthVcg5beTUV05EEHSnI5qSHoxfIuSpNQTv9RBKJgMyz6KT1oUmpci/hX 3ARg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fzo+aERd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdb9f3bsi109331701cf.363.2024.07.23.13.42.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fzo+aERd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813986 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489858wro; Tue, 23 Jul 2024 13:43:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW/Yzy/Wk+rRJxbe3abI58UGNC9lMwFJUDpIO8xK6vH19HAFoJfvylk38W4KMDYxyQj80DWfmxgW3xzA0ThVbpv X-Google-Smtp-Source: AGHT+IEty60X+wPRbbcq9Ikq00Ilr4WyJpZtLjS1r9/rVcdB7C0YXDiDn01Jpl+uleZnffNM9MbK X-Received: by 2002:a05:620a:4590:b0:79c:119e:2b44 with SMTP id af79cd13be357-7a1cbcc3795mr25124285a.3.1721767391856; Tue, 23 Jul 2024 13:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767391; cv=none; d=google.com; s=arc-20160816; b=gHNXSuU+GLjt77IeWtk3lA/oFltcG+yJ4OJk20g1a+1c3d2hiB62/0GXpI27Gp0xoi qvp93zTZ/XU/s+c12e3DiGo9FglGgkQ9HWDCiWweu9Rjx6iEgNJQK+bXqHmaMJEW9vhY VO7Dahfm1LSJE8y7Is1L49G5wN6EcBFY+G12w7UqmEPAcMo/5DIatRsQ0iuDwnlhu76p lKXkTcsns+XrhptgNz/hakEcSiTdyNw5vi34msLv8zKNZfMCY5e9wbJzSXi1jGs3SfEZ 7GmBdy9lC0DToH4fJPPnJZow74i9e/B9k5ZoJOm61y8ywsLI17LuZJbcRTXZMA/7RGgw W8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F/yrpwbL/sETCyin9I+oHUPZfHbu6njuZ4wq9Na1o4A=; fh=w4WchwrZ8PMYZk2q2uUvT8sAqIxtkrW8WgUBVAwjn/k=; b=cQy7V8qTC85OJfZU3fvY5zMmfqiPD6bM9NbdU1ngVf9Px1A9i6vmBL2WCm9XOsOqM+ RDHfY37RnLGy2mfakVRXhz0ISih0uc6JqrBdnUpTtP72Y5wYOgfuYZHtHZm1HfQOeUDS q/BBwEQnhnYfAk002igbCTYx9pbYW0lmXDx9DLW4fcFIp0bv6w6gM8ZH0OuEgqiQFpLf WJGLrQsYgQQ1Wc/34SkjF+d+Z8j9pGyumLNzTGzqxGvNr6dFHJS9rimG7r+MF5YmtUap 2xEvajejPqHYSiUUnnofRFvz5dNYZ4ddi+XMyf97mK6KdfLWiB/xYOLE+rYB0rB4qjMH SSzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LIw6LwRb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a198f9807fsi1122418085a.110.2024.07.23.13.43.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LIw6LwRb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813977 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489260wro; Tue, 23 Jul 2024 13:41:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWnLEfYOUxRwOaoLn8bCfDEglvB3pmG6iqLr5o9yepcs2XT1J1+8bLj7wLdpCNA0UhnjlwQoimzdUY3HTD+XDvc X-Google-Smtp-Source: AGHT+IFFGvrZuPsE1dfHLN7lX1jSPNmhseB7ZCXWgmPm26DjE586U9qUCcbPuct1QS8uQ/SRka21 X-Received: by 2002:a05:6830:3708:b0:704:4995:3733 with SMTP id 46e09a7af769-708fdbd6c6bmr15897290a34.31.1721767279479; Tue, 23 Jul 2024 13:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767279; cv=none; d=google.com; s=arc-20160816; b=XJdig8h5vWGR2gzunbsRMjfCMmRbb5tAb5FqF32bGHVTjLUMBIrgoKn9IHgu+OJR84 Z3iwMT1w/BjJFkEDEAG+6XkpkFUNg1iKtXQ80x/Qdd3JoxrhKeearyWwYjp38Z+HM07A /d+GTojiVuqpjMmqRaMT9J/K+BM5aU/iqzo2GyNPPWMAzzb0cGazFM87iUS0DBdSrhqX 37zKfBW5iKurcspw6jMz2nTInriy022YDIR6uJlc4KmD8abvrKMxZrcB6ra2//IAvd44 EHkjuDXeCePQhinCo6hTuuu+D1AvGq0DgbCARZ8j6nNl+MlzF0Re4rIW4+mHIy14bGVu RKJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EVi4ymf0JUdrFDuvhHPunTPbRwIlHUJLlhZi+FT5T80=; fh=kpPLvM4LppkMl/YKImZ3Ct1+jOKnps+13Iso3OkL16s=; b=qlzAPzSrbbAfnv3AsjL5YG8gvWOnSAOxhHVYb0eB1gpWeUjHsdDvDzIP08kLi+MB9N YDVW4nSrdHlvUeCzHvMlBmV1gbm2zc2fkVHpoqo4sUew9mKzfRV4tSekAggfU02TUpZO 8zwheknkI/mYVcx5Rt1elIyU2652BkwwiwqKehajsAW7j+cYlOJfvQUaro4vw3WVbOsq Y8HnJcMrDpdXE+CrKS3N7EWln2CsmRE3BNEJku/zGo6U018Tzf8ajLzPOQUEVIcMLKn6 T3azCYHZMUU7OYEVhFcc6QafdXOp1Ijb/LIpV5Vj7bZNu8g/+A3ZjNNI8xvWgpDNqtTH mmCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zdc+VbyX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdbb516si110758231cf.376.2024.07.23.13.41.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zdc+VbyX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813992 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490020wro; Tue, 23 Jul 2024 13:43:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUUQu5F+yq9S+5N+mTP4TCqdCDpsrJ1URxLiQQAEWuPP4MWDXz2SARckEjUAoiTAvzgXofOmbrVSQ00Zki+5mY2 X-Google-Smtp-Source: AGHT+IHHzhKgg2HmIu6s6AFH4cdidX8Yna6q8Rc3Lh7b1usmHZ+GleZ0mgAvAh9rCFCZ4nqZLB4/ X-Received: by 2002:a05:6214:407:b0:6b5:e74a:8ad0 with SMTP id 6a1803df08f44-6b9907219e0mr873476d6.6.1721767422749; Tue, 23 Jul 2024 13:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767422; cv=none; d=google.com; s=arc-20160816; b=zYpM5OMhCnJeKennsWRgJwTfGRKxnevN6hWKB4vjXj5uSX32SpWyjZxc4kTUHWFL6e 6x10qs4wU9dw6OGRWvKfVokIfMnJDYy26tGwwBaNyaofg749+nXM4xS4TCR9OtWk/AQU 9d0UG7YNFbuKBThkOCO+vBpS6Jl3qgxmwpN1KD4zCRzkGTAqz0sH4wz86lcOUKlULbcg AETjpkxhpdIP5kG+RVRpBcQnk/YPo0a2kYUoycQtWL2Yq7ttmPquClZ9JO6tnlI4WySj XXQTmheEB2SqYsj+Ff1ZC7aGQiPFQvTSeZz/dZNwprFTqGzPlQ+OFcQonjwRTHsz2fre FReA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TB/f/Th1FBB1dNgfWZKdme0n287GDsmesKr4d3trepo=; fh=2xHiZd0a2mpp4kaBwYvfP53LjG71w1oajHEDa7sJQT4=; b=vKi7PQWRaG0NnSU4AUK/JcVsIAJRti302rtEQRM8o1j4vGQvx1ml8VafTykFyN1gnR JKKIiVrPz9VL6qjTtH50pnqHhXmsFvJs+TT+BOpXQDK/NIpPaKeU4HlgM6siyzoIsr8+ F3WlY2KzOnjZ92UpgEOZDBZk8/S6ghZe5Zgh88qcVZ9FqENEfghbxPIej3Sf6LYlMn/W +UzJySa21O17CcEvC/rBtmSeQPUKc35mtFt/8wY9jwC08C3GA4U1+QGicYYRmICGdxSL Ky93LzuA4OxE7Une0+/8KTZkq6RZ/qCLlYq2f6numlesxs7bqDj3fLVMgKMg3BWeuiTQ mLoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c3cVSXDA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7acb0e58dsi110438646d6.525.2024.07.23.13.43.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c3cVSXDA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813989 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489958wro; Tue, 23 Jul 2024 13:43:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVrvS5O1xyiK3JQ1mXzOIVkXX0dQy/Lsj4cQ/2lzq/52Xnd4R+ZFkaRF6+NBR3ueK4wJIXT5RCaafxVIra7IRsf X-Google-Smtp-Source: AGHT+IGz7nmbJ/CSPM4ajLdj5zLN+e5TCSt1pHs+rkVkdamnbXY53dTIujT5YAYblBLH8eSAeHZ/ X-Received: by 2002:a05:6214:f03:b0:6b0:6400:3b6f with SMTP id 6a1803df08f44-6b94f00df9bmr210916386d6.8.1721767408623; Tue, 23 Jul 2024 13:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767408; cv=none; d=google.com; s=arc-20160816; b=WKyYH2Y75SnbolEiBG7jaU8ggMyaBLC5dFI78hlb0xHmOIJ4SK1BcRZ6/jGFpJL20Y CYzDsH6QwNze5YnowS3FM3AObL1EqDK+Bx5URx4OrnXBhRRpGp7u8BePn/g9CnhjlCb0 JVWnmPZIAqUrMJqviiEHlroCpndXySh+wUb1gbUebjw9IvtKtL5kcvxmZXRuZY/U/Nmn v/8X+OH+dlvdpy4ZN2XMyboa4p4VwKkkQAid9EdXRhF4qite1WBQiDLgNbeMJdM241Ix jGc07qpnysirU6XQ7Cxgrft+xj2+R1rS6Qa5J1L/gv/8/aK7EwM3VOaZD6a1npxWBz4g FDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O+mMJVnZoHb8TN0OKgay2wr/RPzQblLQjBQP+26HLiA=; fh=kpPLvM4LppkMl/YKImZ3Ct1+jOKnps+13Iso3OkL16s=; b=nadTB9BvSMWTPTyV4aaZCGstrn3FeakbrGLeVXEpGVSNcedxTw3WkSV4SG/ef/oOCP WeL2nuJgfeLzYAgXa1ZYjKjerhfAdstOIbwaBC50P7tl+Wz6eS+AxCciTjfaKyD01k8+ agWkBW/A5V4NVqd6vYWeoc6QA3oCbXTpf+yBnEa2IBAimPHMEwqIxQ5mNN3Lv/olr4qg aGbgNGemVs68f0O9F4+XX7+FKCDL6shzeIAwCPePxwXy4JZC5QgX7qwAiUqGgdmJ9wMp xrMUoZ5JFXbUMOey8Haa03o1wfR0VBHwY+jV0cqoTJRKC9Yi4EyYNHbFvjv7V/IGIm1D gz5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGyVCORb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7acafce6esi114004886d6.492.2024.07.23.13.43.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGyVCORb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813982 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489655wro; Tue, 23 Jul 2024 13:42:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCCsY+EbvLIC/PBWy4Vw4goCfB82Z7n/+o+JoXSnVPrUrD6UyJBpB3vQ1jKXoWGxqWgv/+mFZnXEqosGSN+jrB X-Google-Smtp-Source: AGHT+IF0h0m++eOuPuFZA4iNfhR5zpQdtG8QkBJrUb3QnURpEzaUYVAq8EGZUQz1A1gMp5AL0aoD X-Received: by 2002:a05:620a:44c9:b0:79d:751b:67b6 with SMTP id af79cd13be357-7a1a652d2b2mr1290018485a.16.1721767353642; Tue, 23 Jul 2024 13:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767353; cv=none; d=google.com; s=arc-20160816; b=RNnDfYwaQWBO5fHVREKBb4slu9tWUvcZBKlzzpPfYao9Da/5CkWdeFZNFuXQlMByK6 FkM/XZGU62fPk7f5rlwKnCTJ0xE8jVSm6vSByAela/jIdE4wRdFEA+nb1+x56u1XGN4k tWteEroKsL2KXeCtUXzforSawjv2ExPHPToFB+aUpm+zrkZJeYjKIr0ZgK1MTbPbV12J lHWbmuqB44U4lGkuh5uIVUhNiCGQidcigGX//mcbBAIwxSQQ/LCrpyLmOKqBn5l6It0y zaVvf+KQ63ZGOCtyKVQSDiY/5k6ywxhNtBmTDEPolYOsiNq3mxOwmD6OME+QvZiQ9mzO jNug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dSCWBLk+dTPyKUi346CpD+A3ideUlHg+vbcXd5eth70=; fh=2xHiZd0a2mpp4kaBwYvfP53LjG71w1oajHEDa7sJQT4=; b=eerSgsu5ayR7KDVsuwmIvQa1XtEj+2cydBo9rHDDBHPQ2Mg7PSeCdDQ4j/f66W5AvX dWElEJsAeHQ5qK7IxXdR+wjiDszDE0cDz0Ryt1yVjLRed2ndTQnn6KmfPJbEXmErtSse 8G9IHmFTA+BGHeFEiQKDg5zH1hnrG/h8rVkaOaCMYSM2VXjqlr36QgWbshRjcC34jZNx mPXAGqptJ/4asds2M4hivtEpJNCAp/OORS/HCzXerR717S4qMYf99z7ypJDjyCFMuuaM BqvCBUMwig5wmbEyrxKQbMuOvSz9cWUHAIvU+pgztw9sX1PjXf864z3LbH3kUlJ83q9i 6N5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qapZBxDW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a198f94152si1060624085a.149.2024.07.23.13.42.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:42:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qapZBxDW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813983 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489657wro; Tue, 23 Jul 2024 13:42:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWn4GfcrkrM9B/rVg4E4fBbhkU0S/nQy6S7RuUVU9+Symft6kxSYTU7UJrwSEpcvzYRkc5wZ2xR93EBmeVacEwX X-Google-Smtp-Source: AGHT+IErfcJsXLrScd1Ii+gdHshLttR0vxvTPuAbZXLV5hCXmWz5uqpffKdDD3tTQtbLh4hDnpxt X-Received: by 2002:a05:690c:1a:b0:617:c578:332c with SMTP id 00721157ae682-6727962c07bmr1912727b3.4.1721767353750; Tue, 23 Jul 2024 13:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767353; cv=none; d=google.com; s=arc-20160816; b=HsocyG3Xa32F8P+i3H0NvALSxbGqmvrlL6QS2o7CPJrRl0p7Ij2yNrlhKfZ9QPkftW u8q5LsALMY6h+h8yTI9A2vqAIa0ltv5cgXgqbMMEP7fyc3bvMyNqtW6B77JmeD1D9QOr LgIwaDKr/zaoyf5BkeYwDiUtgnNxWHtzbsvCObrqe1yk5nQ/hvRcc+535uzt6LEvYjP4 f+0e+05fhtWzHlYj/+UdbDnxQfhbW0DP0ouKnRbkICOPFKAMcu4y1SplvykO5IM9r0yK TFuLPDu3Mnn1yn1kp/eq3jHWKW2xol4qjZwdKt2QJmwf5FcJJhcH0coPk0AIvgo1iNkz lbbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GBM1IJL7GzUQtrseAlPnjePV8gHhhVpan+XyuPJ8YY8=; fh=2xHiZd0a2mpp4kaBwYvfP53LjG71w1oajHEDa7sJQT4=; b=dE6IEhg6gB+o+jde34inPuLA2SA0u/m1vrAvRwKsivGqNd8h6L0yrxY/My4sszmDGb pHQ/DMNl1lR6N5L1h7u3cCkyIQTpb31dYaUP03yGILxwGAppd8kg6M+NKGJrChYwXBL4 vyFMa21439tXMu2emcNCO6vQXwCnTRgKX6M/YMDH19yHRTZ+ccjLXrlqRKpOYGYKbUnV +lSFkIb5crhsYTNYAmmuxwdI92azIWeEcE2ZwyKyF6Zd5XjuuHA6TJwlMgPyjWKqX7vm Dv7LtvZbF0ik0aNeEf4MJsW60clq29PfYuJAuS4lz9PzH7fu28clPM01TP3JMJ4dpcej pvbA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BkgbqQKS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b7ac9993f7si111141386d6.250.2024.07.23.13.42.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:42:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BkgbqQKS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813993 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490021wro; Tue, 23 Jul 2024 13:43:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUhdtrfZ2oyUc6ENOAqeba4y1REMbAvhS8Dm0p2SpVsrKgKMKGhYAgi+RW4vmOLwNlesM5vwmLGrMeNPZFrX2nY X-Google-Smtp-Source: AGHT+IHfgqLD4HZyyYSiQXF9oHQ8680ZCuHXz8p4AfkH1OWuBC10A7cTxilg5fjNe/ADiNNlOUHv X-Received: by 2002:a05:620a:390c:b0:79f:11d7:8175 with SMTP id af79cd13be357-7a1cbcfcecbmr19501685a.32.1721767422773; Tue, 23 Jul 2024 13:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767422; cv=none; d=google.com; s=arc-20160816; b=CViVeODZpmuOc2jy1gXyRNTIeGfOjEgFQd9kSM3U8ed3imgd1MkKvwfuLMhxe8m6cK Q2m2h2mhCCcI4lsxN7Uh7tsHfuaRQpp6g6C72n+AOL04gNCqn3Q4mSGLU241thyHZany s3S+pzrnC8xkhxgNt4ZSPdX0gmJHNv/bx/8lGfGVlmPWjyzaFFFpOm8gTnvbkDHNOlPI tDA2QIg8crWbGFS7tzBsk/yDnpkfbsplPWH5+ummF0lKpQFDRz40PXsp3nEdMcbaQBE4 AvIiPnUqKmm+OhZSC/M0O8NDBenVpfbDvvtJEjCoF4ohkeBuOrPc1p7wRClzJ3hQSIt9 MZZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T1Rd8JLREenPY7uD+H493cwaNhRJxArDOSc9CQhnapI=; fh=kpPLvM4LppkMl/YKImZ3Ct1+jOKnps+13Iso3OkL16s=; b=jjDfk+0bGG5R8R5soaiCSgMJXWxuaUqRiN8+kXIJxFIK3eQq7POG945O82B8G1apSB BaByQNNhVkIsQeeUPR0Ckn0cgJAPxXOuoNWD/yoUEPoRnNbSBN4n4G5p8HvGtYEPU9pr 2a1JFPrtxtiTDe/okYkUNaKx4XZt4K+45R/95FRC4DcKxjhSngx1pCdHlJnyL3i0tLbi HmlAjMC+h5qYJrI84sKcVZZwm1gP0lv/F23VeMuzWB8bGZBh2bfhUtJjs9JvBPAzVvT7 AJnBSfc39KgUNbIEsyE25LFnV4lIzXGpViPsSRXlX9GlzeaLHL29YCFclyr1i3NHh1+1 KpGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wBRBmOHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a19906fdeasi1069019885a.485.2024.07.23.13.43.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wBRBmOHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813988 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489934wro; Tue, 23 Jul 2024 13:43:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGv0w2SYUA1Dm3sfQL9WoQXt+G95vVv7+kLakwWP462E848PlnXs52RwczpD8t07wnCb6jTptAPfu1Rs8GW6x0 X-Google-Smtp-Source: AGHT+IFRI6u1MtajhBk9YQQ1XygPxSTTzmA7LxHlK71l3YgsLuFpalxHC/fMgBg6+Z+8paNKj/Hf X-Received: by 2002:a05:622a:1791:b0:447:eaf0:af89 with SMTP id d75a77b69052e-44fd687c55fmr1304791cf.37.1721767405643; Tue, 23 Jul 2024 13:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767405; cv=none; d=google.com; s=arc-20160816; b=hF93luw6qjOSDPJzROFYOX05CTipy6nEEr/cx9B5ZBNFz0T3Mp3mDrhx6f1Np7nOWH Mfp2c4zIR5LcM5PnE8wMkAvihXuzYqbPd0bn+R6JrTEyUyqWFcMmp/dBBepM2WOTQTcy fuMlOFuviEl0zF0p3VbNATmcjgX6m63jaoXUbTqKM1HhiRHkU12WQ6QrFnptBBS4DcTL 3BGgWwSpzI3heydzjK0JQ/PJhrLtaoIrCxezw3/5iaEcuj9lH781ldMPQLlbAzsSEQLk D7HAyNnGC2rEyAf66d1XYlsw4y21bIWkN3wz54Th+QQK6tWRHJk4w6GRS737voT6NP6u 72Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=edehD0KtGJ7psWAUTWuwqxCMF33mNrSx960MdEztH2M=; fh=2xHiZd0a2mpp4kaBwYvfP53LjG71w1oajHEDa7sJQT4=; b=uclGzRk+dzJkXFyBT86WMIOadv2YwjNPY2+UDXqjpCxbUSdLdtdmiUmH5y8qYTiq/X tfvF2ihXVhaG0GxMXjgku8C0+1jLBmkS1Kx71PWRh/74A+9KXW56bqgmm0ltecLefZ/s +fALHIZu8iNklVduLZ8ZeXhsgPfiPtVjgXkNK9g/3wrcS/g3zwrbGjf6O66OpD4ZFh/0 cVWj7w4Crw4OGBuzDRzn3n52LpLh8lBNqPdBAYE9AeALnkBG4WNr11raE1bS2tPTuofa IhFhaB3vK5KkS7egSUr6uSJ0g+ZPDiJJVGY/43RzrE9Down0iBWrruKYjswCx7+tF0hk 8HFA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vag+/qlO"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdd567fsi113939131cf.504.2024.07.23.13.43.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vag+/qlO"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813990 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489988wro; Tue, 23 Jul 2024 13:43:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXCzwy27IE4eC/7pRJ1U2v4mBjXlP/7zNORNd98fZ8tfejdvnXX8JAC+fDxhkq/xdN2gM4o+O/2ziscrRVRA+kp X-Google-Smtp-Source: AGHT+IHD00TsvVpYnmVZ0TEN62n3pGxeoa0oQkMNKVUkH/TC5F878wqQ6xzQjgen/TO2bozFsvy6 X-Received: by 2002:a05:620a:294c:b0:79d:569a:699f with SMTP id af79cd13be357-7a1cbcec817mr18069885a.39.1721767414562; Tue, 23 Jul 2024 13:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767414; cv=none; d=google.com; s=arc-20160816; b=j2VFltOMqNMkDaW/tGSYN8BOvMaQ7jOzUBl9Ud5Ks6rZ8hiMIIgQDg6YYWGnTUuXSx oQnOCUQFqwJqQMCR1TmAnR/wPl2GPBwO9DZQIeSlzkt7AWW4ezVA/XRGw1dlNyuShCEn eUhpCrpGUiPioWGV9yL5ti3HR5IxA2SNSSgaR8d6bmeoclxRv/zMNt75yJwgs8fApuTO eqQsH8aghjn7Ozw4nnv932FfYwEc1/u/feKrzFtCyGMwz7kB6M4TVAyZYnSmYUxX86Qy XDRxN4vyIAm9KNUTd2QzTws8BdvGULUZiqXoyG7CYRx4GCIPl1Q8ehApBtxLeBcL7Yjo mHyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gprouXpFTSkljW0fNmBZHXNIbVMVrEajPZ/PMlUZpW4=; fh=VQcHOxnJp4I3wo/cDAzUyaIlplmz4sXu30nXH/spc2c=; b=jiE2Ak9Xe05GnoWrv4FIUISXFK+J999GVz3K+YeUCiQ2M9nEcACntm8E41BNpF2fvz lGAOOccEW2hygS4fyEEYDA8yuZvYoC/6MHXOe/pmjSBKnPAtSHu4fBgWvLS6ftKX86HI N8+vAoKmELCmhfFDLblw4ohc6EQwxtChDnVUu9XhDGU38YXMYc/epzL2evhSXVxLkIUC g7LDYZF5YEZHgYeKgJjVqlrWDLeGQZLUxYslq8AXFaJ/T3wzuroEttJm6wNdVHB52Vld F0b6ek7FQd4NxdBDdnBqJPwII+PSJ9bTaiCno/GdFHwHK3lxkTBfViBnRexEfQTKNpS5 Vn0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DCgCY4lF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1990b520csi1106148685a.778.2024.07.23.13.43.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DCgCY4lF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 813995 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2490053wro; Tue, 23 Jul 2024 13:43:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU9EZn+O+QJoSsUiYW3zHVPAK8bc/tUbEX/MUAtpIiVSsLURj557r9GDu108dNZ1yWNOETU7rrcxdBntm2YYzyz X-Google-Smtp-Source: AGHT+IHP+ZkUYCrcsIxOy1c0YTGpMPHOHnKWqAEN85tPHQXz8Junu6M9rtS6KhC/+/eFk2IX9Sjs X-Received: by 2002:a05:622a:607:b0:442:1bdc:2a6 with SMTP id d75a77b69052e-44fc80dcab1mr50576671cf.30.1721767427776; Tue, 23 Jul 2024 13:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767427; cv=none; d=google.com; s=arc-20160816; b=BxtCZN2qvGCXzeYvAMlDDVVsUAwaYB/6wNOTE3KPjcpMUW7Z3/dTR8ohFGqj2sa5UO /m0gPHoGTRrEmfEsdipKtGMhmnH1JJ1iU0wtc3quQ7V8pyglZEJW8G/VErDv3CbRTmGG B7xJrdF9FQbwlLlee0NtSC/2KmwWoUb++5PWCln/h7YkFjSZKotQEydbG76t0bWvZq5l vccOXNH7A4H/jbvZIW8bbCXOZDZhbrunZVQjFVKoM7ADm5p/AuB3sBEvOXe6EN6sPvQK UidxlsehiLxcwuORf6REbjDTndszPoyFjzdHkVcczGQiY765hETiktAKmNuUAtADJ4ni MX+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9AGqT/HuIbzxdWkOMa17Gjd1RtMZJ6gzAqRn/Fh0hIA=; fh=L98wPpKcHCrFLCpI2ivSFZgergKUUJWtaYkxJ0Dccrs=; b=oMHlFU8jtlo055j/1pZwDet714iOuKkdq26bsru7UBiANcEPd9gVbcWw69n74aOz+p zHAD3I992EdGS1/bCFDgYIEpvyK4iaug+JCiPZa6fwaU7f9GMBgnNF9lES1XuZsAdagn m5hASKflotNv67QTRzajd4zOQO9yaRDN+vGWNnTWFyFotty9NS1gjhin6KwE/Oi7dtz7 FxbA+YIE7X0ChKTFslDsy4zcICLUm5BmTma3vypXpAgkcmL9XvAleasD2rUSuFKuaomQ R0x4x9xTaS/iM+KmOcB7v5+gdjHTa/8bggc+MTB8SUr/Ipqvz29VJSmS53G2t72+bUcM Ay4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJ7DzPGY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cf182ddsi114760961cf.763.2024.07.23.13.43.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:43:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJ7DzPGY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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