From patchwork Tue Mar 26 15:44: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: 782620 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753989wrt; Tue, 26 Mar 2024 08:47:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWJPD9HLvwfhDO8qGsCBJgDRmxvPRAxoAquoRC7StbtTlMKqJBwyBsMrEiGlnTwzL9ZRPFK2EfBDNqS84Bsffrh X-Google-Smtp-Source: AGHT+IGy4kdLwa3Gcpng1VhP+2m8+Gt+RacHX/PmjhspcXpjocjfsNde1+Hk7KYEzzxNr4nDHTZl X-Received: by 2002:a05:600c:1386:b0:414:7ddd:b92e with SMTP id u6-20020a05600c138600b004147dddb92emr7626669wmf.39.1711468060942; Tue, 26 Mar 2024 08:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468060; cv=none; d=google.com; s=arc-20160816; b=vV8VhAxxbTaoskNEPqI1PfpPAet8g05wSg3JGWsexnTZHQK+nETeKmlxNsatHsapqc TtwR5G3WpDbXFH+kfi4o/Xfa4t43bwYzLXX0/AewUbf+dhgoj14+hMrGyUIRI+Litv/k KQNvEqZDjpqTeuYCR+KezK/5lOj4P8YLt72nYy8wvJaQwjdju5SCljAll3a6lLX/FAZq jPOPlYP1L0G+5hzq9yEgYvmHBpj28BkPaaLgY++Cqn9JrneXItZdkyR6zFZ+BYNuLIc5 3DTAhni430xBNCsP+0LHYn8pRs6drpnZzPnlOCv/aNsRhs8n/DfRhgslFFR8b5Cq+rqK Y2sA== 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=JkAwTx0OkQeZQvYLzrNAV/RC6xNW2lAxLycOTzYaqpI=; fh=o+ins5HYUut2DgJhJRyjCJqW0m8UKZfchDj5L1Myjzw=; b=QuNUiV9onoy8YzMUMVpUG7JuAniqqKgWw44mk/HSLf6lE3YUuwk8rfS2w6EjWcT4Bj GmPVIH6tmwRLfVIGvM43359GQwOhP/dllLYEjf/i5iS9Az2MvHm3nbgi4U1ZSCJQOO86 h0UiH6gc5ZyYBBtiRmGwoJ5YMUSF7EGD1qNvFCddFfZ5g7F+Rl5ccBN0Ox0LQ2weuSbE HEBYav6Pm63e0JyZJDcx16J0Jp9KiPi+7hF7knBvhF3u/V2bSflf3ZtDAtCar7BLIsSE mEpTsqCmW4QVDr56YnD71s1wHPpVAHYtkoD8r72qAtTg2/dOadh6JpRnURojj8/GBki/ 2zBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EYGbRIwF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e38-20020a05600c4ba600b00412dcf507b5si4296631wmp.223.2024.03.26.08.47.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:47:40 -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=EYGbRIwF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zR-0003dt-Tm; Tue, 26 Mar 2024 11:45:29 -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 1rp8zI-0003b8-LF for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:26 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp8zE-00016J-On for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:19 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4148c6af2d3so9881685e9.1 for ; Tue, 26 Mar 2024 08:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467915; x=1712072715; 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=JkAwTx0OkQeZQvYLzrNAV/RC6xNW2lAxLycOTzYaqpI=; b=EYGbRIwFhOMph4BeoqqsSXXfTOYU7nb4l9JMMeH+BSJsDb2o81ha1ptGWJ+M82qQXo jlN6MgyCLe2cOLhE4WEicl8IEU7SotYBuz9nl1rUD1bE/sBk4okPTND89qpbZATi0CN9 7sgGAL7Dng686oBZr/QGaAn5w7QNbht68nDd8MDouinTWTrccvZmnq/DZXCIybPMGztp TvJTRfq8843IHTV92MUhaQ433IVYgJyZ0N2bwOqrW+G77+Q3u949aTo7vzLvO3LuSjcH oIjkcjEaNXsez6b2biUVEnrpCXegIY5MqvZTkJqmJGhgz6xrfMGkWx1AZQ7Y+z9MUYX/ iE0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467915; x=1712072715; 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=JkAwTx0OkQeZQvYLzrNAV/RC6xNW2lAxLycOTzYaqpI=; b=w8KwMDkOkeTGBQly5N3VgFyxjpYGTTB1zPANIrrjyQltF/5rbpg1FqItx1h28kLIxz ge53m6qBD8a7N3UhncViPvZGrKhqJtXTAR91iK9WVTzVCqkxaoYe4G8IO49UywupKcZG 94kU+wTd5oY9dMbdIjDMyzrWfnSWmQktA2xNH+y1dL4IFo5wtR+8q+5zmrgLyTWeqHqO enazgeA9J8Ra4TNA1NmkAXps8aYcLd2PLfwKJieXvSTf2O2E7bNjV2VdsxT2Yck6m1Bk 9yQmPAoEpFYoKWqgdCYipIQDQT/JpJJ6a0+ub3CXleZlUpYGJbLBOYZMVeHbr/pxaSS+ aWpg== X-Gm-Message-State: AOJu0Yx3AKqQfDalXph7X6Vdnt9BtGQRAyRFu9dHIIKwAkXZ+bpFngFK yT59tH3fVjc2tVmURISBgvuLWnCGz3aCM7y/rpHo10ZvECEv8IkYItzuOY/hlpNLzU5rA0UvVpu / X-Received: by 2002:a05:600c:4f01:b0:414:8948:621c with SMTP id l1-20020a05600c4f0100b004148948621cmr4736654wmq.8.1711467914751; Tue, 26 Mar 2024 08:45:14 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id p3-20020a05600c204300b004148090cf86sm1760810wmg.0.2024.03.26.08.45.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gregory Price , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Peter Maydell , Jonathan Cameron , Paolo Bonzini , Eduardo Habkost Subject: [PULL 01/13] target/i386/tcg: Enable page walking from MMIO memory Date: Tue, 26 Mar 2024 16:44:52 +0100 Message-ID: <20240326154505.8300-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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, WEIRD_PORT=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: Gregory Price CXL emulation of interleave requires read and write hooks due to requirement for subpage granularity. The Linux kernel stack now enables using this memory as conventional memory in a separate NUMA node. If a process is deliberately forced to run from that node $ numactl --membind=1 ls the page table walk on i386 fails. Useful part of backtrace: (cpu=cpu@entry=0x555556fd9000, fmt=fmt@entry=0x555555fe3378 "cpu_io_recompile: could not find TB for pc=%p") at ../../cpu-target.c:359 (retaddr=0, addr=19595792376, attrs=..., xlat=, cpu=0x555556fd9000, out_offset=) at ../../accel/tcg/cputlb.c:1339 (cpu=0x555556fd9000, full=0x7fffee0d96e0, ret_be=ret_be@entry=0, addr=19595792376, size=size@entry=8, mmu_idx=4, type=MMU_DATA_LOAD, ra=0) at ../../accel/tcg/cputlb.c:2030 (cpu=cpu@entry=0x555556fd9000, p=p@entry=0x7ffff56fddc0, mmu_idx=, type=type@entry=MMU_DATA_LOAD, memop=, ra=ra@entry=0) at ../../accel/tcg/cputlb.c:2356 (cpu=cpu@entry=0x555556fd9000, addr=addr@entry=19595792376, oi=oi@entry=52, ra=ra@entry=0, access_type=access_type@entry=MMU_DATA_LOAD) at ../../accel/tcg/cputlb.c:2439 at ../../accel/tcg/ldst_common.c.inc:301 at ../../target/i386/tcg/sysemu/excp_helper.c:173 (err=0x7ffff56fdf80, out=0x7ffff56fdf70, mmu_idx=0, access_type=MMU_INST_FETCH, addr=18446744072116178925, env=0x555556fdb7c0) at ../../target/i386/tcg/sysemu/excp_helper.c:578 (cs=0x555556fd9000, addr=18446744072116178925, size=, access_type=MMU_INST_FETCH, mmu_idx=0, probe=, retaddr=0) at ../../target/i386/tcg/sysemu/excp_helper.c:604 Avoid this by plumbing the address all the way down from x86_cpu_tlb_fill() where is available as retaddr to the actual accessors which provide it to probe_access_full() which already handles MMIO accesses. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2180 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2220 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Suggested-by: Peter Maydell Signed-off-by: Gregory Price Signed-off-by: Jonathan Cameron Message-ID: <20240307155304.31241-2-Jonathan.Cameron@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/excp_helper.c | 57 +++++++++++++++------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 8f7011d966..7a57b7dd10 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -59,14 +59,14 @@ typedef struct PTETranslate { hwaddr gaddr; } PTETranslate; -static bool ptw_translate(PTETranslate *inout, hwaddr addr) +static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra) { CPUTLBEntryFull *full; int flags; inout->gaddr = addr; flags = probe_access_full(inout->env, addr, 0, MMU_DATA_STORE, - inout->ptw_idx, true, &inout->haddr, &full, 0); + inout->ptw_idx, true, &inout->haddr, &full, ra); if (unlikely(flags & TLB_INVALID_MASK)) { TranslateFault *err = inout->err; @@ -82,20 +82,20 @@ static bool ptw_translate(PTETranslate *inout, hwaddr addr) return true; } -static inline uint32_t ptw_ldl(const PTETranslate *in) +static inline uint32_t ptw_ldl(const PTETranslate *in, uint64_t ra) { if (likely(in->haddr)) { return ldl_p(in->haddr); } - return cpu_ldl_mmuidx_ra(in->env, in->gaddr, in->ptw_idx, 0); + return cpu_ldl_mmuidx_ra(in->env, in->gaddr, in->ptw_idx, ra); } -static inline uint64_t ptw_ldq(const PTETranslate *in) +static inline uint64_t ptw_ldq(const PTETranslate *in, uint64_t ra) { if (likely(in->haddr)) { return ldq_p(in->haddr); } - return cpu_ldq_mmuidx_ra(in->env, in->gaddr, in->ptw_idx, 0); + return cpu_ldq_mmuidx_ra(in->env, in->gaddr, in->ptw_idx, ra); } /* @@ -132,7 +132,8 @@ static inline bool ptw_setl(const PTETranslate *in, uint32_t old, uint32_t set) } static bool mmu_translate(CPUX86State *env, const TranslateParams *in, - TranslateResult *out, TranslateFault *err) + TranslateResult *out, TranslateFault *err, + uint64_t ra) { const target_ulong addr = in->addr; const int pg_mode = in->pg_mode; @@ -164,11 +165,11 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 5 */ pte_addr = (in->cr3 & ~0xfff) + (((addr >> 48) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } restart_5: - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -188,11 +189,11 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 4 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 39) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } restart_4: - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -208,11 +209,11 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 3 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 30) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } restart_3_lma: - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -235,12 +236,12 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 3 */ pte_addr = (in->cr3 & 0xffffffe0ULL) + ((addr >> 27) & 0x18); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } rsvd_mask |= PG_HI_USER_MASK; restart_3_nolma: - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -257,11 +258,11 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 2 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } restart_2_pae: - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -283,10 +284,10 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 1 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } - pte = ptw_ldq(&pte_trans); + pte = ptw_ldq(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -301,11 +302,11 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 2 */ pte_addr = (in->cr3 & 0xfffff000ULL) + ((addr >> 20) & 0xffc); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } restart_2_nopae: - pte = ptw_ldl(&pte_trans); + pte = ptw_ldl(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -330,10 +331,10 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 1 */ pte_addr = (pte & ~0xfffu) + ((addr >> 10) & 0xffc); - if (!ptw_translate(&pte_trans, pte_addr)) { + if (!ptw_translate(&pte_trans, pte_addr, ra)) { return false; } - pte = ptw_ldl(&pte_trans); + pte = ptw_ldl(&pte_trans, ra); if (!(pte & PG_PRESENT_MASK)) { goto do_fault; } @@ -526,7 +527,8 @@ static G_NORETURN void raise_stage2(CPUX86State *env, TranslateFault *err, static bool get_physical_address(CPUX86State *env, vaddr addr, MMUAccessType access_type, int mmu_idx, - TranslateResult *out, TranslateFault *err) + TranslateResult *out, TranslateFault *err, + uint64_t ra) { TranslateParams in; bool use_stage2 = env->hflags2 & HF2_NPT_MASK; @@ -546,7 +548,7 @@ static bool get_physical_address(CPUX86State *env, vaddr addr, env->nested_pg_mode & PG_MODE_LMA ? MMU_USER64_IDX : MMU_USER32_IDX; in.ptw_idx = MMU_PHYS_IDX; - if (!mmu_translate(env, &in, out, err)) { + if (!mmu_translate(env, &in, out, err, ra)) { err->stage2 = S2_GPA; return false; } @@ -577,7 +579,7 @@ static bool get_physical_address(CPUX86State *env, vaddr addr, return false; } } - return mmu_translate(env, &in, out, err); + return mmu_translate(env, &in, out, err, ra); } break; } @@ -597,7 +599,8 @@ bool x86_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, TranslateResult out; TranslateFault err; - if (get_physical_address(env, addr, access_type, mmu_idx, &out, &err)) { + if (get_physical_address(env, addr, access_type, mmu_idx, &out, &err, + retaddr)) { /* * Even if 4MB pages, we map only one 4KB page in the cache to * avoid filling it too fast. From patchwork Tue Mar 26 15:44: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: 782612 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753508wrt; Tue, 26 Mar 2024 08:46:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVhOdJb484z5DIX2GQOjS241zNqfrN10bDpcoIFnpUm0nMml2YYHYowBa551nGT3uWhNCIeplXhJgJIEsIFVDgS X-Google-Smtp-Source: AGHT+IFwBvC8bTyuWD+6u4loWNAJdNgtdnoaefVrBhBUw3Q2CGA9DL8Bc+sLb/TjgK/l8xYiKaCO X-Received: by 2002:ac8:5f0f:0:b0:431:5b18:5ca6 with SMTP id x15-20020ac85f0f000000b004315b185ca6mr1868447qta.47.1711468002954; Tue, 26 Mar 2024 08:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468002; cv=none; d=google.com; s=arc-20160816; b=VDAjT+eFbsI7SmKFw5xtExUv2nvug4H6bR39wQXl0eJEfBXppwXQ1dnsiKr22nX8je 1QnI82oQB+KlVZKAVzXLomgwwZmsa8cVOTYB1fC1nvvCIEDVH7D5kRL/N0I0hw3KIcGV gXR5OP+9ZaI/9mc4+Yi4GObwQl64ITUrDRtnjbR2EpgdMTmJU2MlLDYdLWT/AmmlWIon LHs2cgppO6XGXU2u8d3vx65CSjre8vCV1qlVjeY/F8UQjwr0rQo65JQ4NRAolai4nd4R 21SYZ/EdgfqqsXXUAYjzrGMpAX/oTpbsy/46aGPNvJ8I1IDGIa1Yf/0sZnlWfThyVbvz MvMA== 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=D+2sufPZV1jZbwqSWcGkqalb0YdlIEBcm3JneTAQYPE=; fh=kcT4CFeFNmTl7CfmdUfPz3V21rykPh+OrQD/iN5LZRE=; b=Ojr9nExu7nrkbqAiD+tKL4h22c6+tfQwdhxJ1F0RSnQtkZOa6+QL/+hYOHnfG6WQYr Q+17/449pl0la9MLcrrAsQAryflt8FsauniSDbvObl9t8qhBotEPuq99dAToNoII9tHm i5tvzqxM3By04Awtgm7b+kK2AyMdQbJuFi7t0RVhr32sM5ujulIAEf8DCND1Gqo+/9bl uPdhSKSy6E98kqYPJE9fKj+SePFZq4WYHafPqPQ76++CCz8G0iNOyaZWaBujVblPKOUB CwNfunDKK1OpvEk7sSG39vmSI7bMcsHVBkpXwo/j+ebIPjRRNcpHqQ/fZryhnTv4NewV 7CgA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wzwyak/7"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u14-20020a05622a17ce00b0042ec25908fcsi7807620qtk.645.2024.03.26.08.46.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46: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="Wzwyak/7"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zQ-0003cl-6q; Tue, 26 Mar 2024 11:45:28 -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 1rp8zN-0003bL-M7 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:26 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp8zL-00017R-05 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:25 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33ed4d8e9edso4188059f8f.2 for ; Tue, 26 Mar 2024 08:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467920; x=1712072720; 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=D+2sufPZV1jZbwqSWcGkqalb0YdlIEBcm3JneTAQYPE=; b=Wzwyak/7ZiMG+4lNbfNNccr5MkvX3BZdxFaaFdBknzcK/lMETq1KL0b1TzUFScDCOv NguG4ApTN7Zpq63mC1hdyC870eWV1XeaAWQ5BqNQxXxGbIGnfdg8J8ikvhBDs/krsitV RfHuilSd7d6JCs1NLTziC7tsKf0S9/jQK0qCrOEwn0VKdzv5PJhdRjqeIdkYul8AB0wC pSzUGVZ5jve+KThFj0UE5NSnsXdJyhF5sCQNLfybTHbJXI9GiXxhysSm6z1UQHaNRxcq LJnPeTyzQKPAWLD3mUw0OopzhfG1UoUU+kB2on+7iwIK7+Ndli/6eA/Ha2uVkoaEHWiZ /F2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467920; x=1712072720; 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=D+2sufPZV1jZbwqSWcGkqalb0YdlIEBcm3JneTAQYPE=; b=PLlvyynr2cAxgidaB7mfB9wkrc9B4kbVaNPq97W9cPxbLCWNXmFLu2bHKua9usKvki Em6wctJnmtAVQZIibMiwrS6W3jw7aVqXk5Wz0TsuZYpJG68zJnJXdk4rGZwl2w9wFA8i OUmZum4MLeUwB1tyjU2DNaLU81gPe6VDegwsleXpLsvtNnV0/vEyG2p189sAftHfzmw+ Dksyvk8VDa/rjOSVpxoWdlI/l+iaUPn28Q0i0pJCDaOe/KR0UYTQkKNMGQhaVR835ZPa xr1++pGIKEvE6MOgvjF65J8yscNPQDRZd/U+8fKbNJ/kkiJcllpZf1T6Tsjk8t7KDoHx oTjg== X-Gm-Message-State: AOJu0YwvzGZ9v0ZICM82yckiPyhZYnUTqMYYU7+XtnBCB+OR7mS5+Jf/ 47gRGPRljuawQDkoUtdy44Lh6Z6V3Z6PNzzumr41PgI3xIb81Wj1TD/7BGJfTNkT1c+HrS5/VmX 1 X-Received: by 2002:a5d:63d1:0:b0:33e:bb5c:f60a with SMTP id c17-20020a5d63d1000000b0033ebb5cf60amr2406678wrw.66.1711467920447; Tue, 26 Mar 2024 08:45:20 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id ay26-20020a5d6f1a000000b00341dc343e21sm573910wrb.65.2024.03.26.08.45.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Lorenz Brun , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Paolo Bonzini , Fam Zheng Subject: [PULL 02/13] hw/scsi/scsi-generic: Fix io_timeout property not applying Date: Tue, 26 Mar 2024 16:44:53 +0100 Message-ID: <20240326154505.8300-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: Lorenz Brun The io_timeout property, introduced in c9b6609 (part of 6.0) is silently overwritten by the hardcoded default value of 30 seconds (DEFAULT_IO_TIMEOUT) in scsi_generic_realize because that function is being called after the properties have already been applied. The property definition already has a default value which is applied correctly when no value is explicitly set, so we can just remove the code which overrides the io_timeout completely. This has been tested by stracing SG_IO operations with the io_timeout property set and unset and now sets the timeout field in the ioctl request to the proper value. Fixes: c9b6609b69facad ("scsi: make io_timeout configurable") Signed-off-by: Lorenz Brun Message-ID: <20240315145831.2531695-1-lorenz@brun.one> Reviewed-by: Alex Bennée Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-generic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index b7b04e1d63..ee945f87e3 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -752,7 +752,6 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp) /* Only used by scsi-block, but initialize it nevertheless to be clean. */ s->default_scsi_version = -1; - s->io_timeout = DEFAULT_IO_TIMEOUT; scsi_generic_read_device_inquiry(s); } From patchwork Tue Mar 26 15:44: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: 782613 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753516wrt; Tue, 26 Mar 2024 08:46:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUsilnQq8ztaGL5GUylLIwNptnzNMu9t5Cs0ThrUivjqoZY7XFH3Tk+qG/BgAznxVhV9hMOyPD+elBvrq49yKQ/ X-Google-Smtp-Source: AGHT+IHsrty+lp2AHMNNZJ22dRKKz73dpf96Q6coI+5Mt1AYqdnGmmncNm++apD59EVeB6EQ7NBf X-Received: by 2002:a05:620a:461e:b0:78a:3b3c:3192 with SMTP id br30-20020a05620a461e00b0078a3b3c3192mr2418127qkb.21.1711468003643; Tue, 26 Mar 2024 08:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468003; cv=none; d=google.com; s=arc-20160816; b=GUi7/0GfCIvmba7Oc7pa79Mm0aQgm5rZ9EwZovmh7ejdy+u1VJOJZdi3WndjsWADva Kehql9rzeBtxaCTomTDFt3zuq9OEPYDff3BSodThYcsZn0KsCtYu/SXrvInnxLM5UxOY bTn5gpUE2ecj6pQ+7e4jnDmCWaX3pN42xlDZVZJnBfT/CEZXwq4bleGD1GOVrKISZRFF A7gzzMu62mL0df6KBCpBa88nRJMXC5cLBjmmCeSdiFh9fF31UoKuaRG71YPU8VzeOuKn /dCVTk30dK/s0rZPPzJP/jPS1VUl+aI0yy5ySJoktnWBnVc/KBYMbjc2aAqc84W5dkht 9xCw== 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=rDRJxqQMAhWnh+G5jpK8UG7ljcyYHl8RJLjLiMQKlpg=; fh=dI5/5p7GkHqaiHw7ZKEky76Na7b7zIsnpsLisNT2Y/0=; b=bfPtC8uBUnc6WYrLPLV98CoflQ9yGk/cRjxMxLkpPCt6QJqtnraoEncR9Fhqpvh6t/ 9woFXOdEdbLP934/v5TT2pQ6rnvQ3p5rKmFMqHoRz4PJtnqspfCi8rSh0LncitTGA69D KseOGSkPLNuOlMaUkkVN0eS2eJnU8eV7curYhjoQpAI7xDAHbfmhazSrpjK+arOxZ1p6 0zjAnxYcsy7fK+D68o+1JXOWGFRXnu3xzBL15e1zS6D73zdlochnpT9JqMSt4ZuLlCO4 HLsOFkgS8Xr7922ObLbkwe9I0Lvyl6Dx/01keGdnwp2jiS1YquOWuvtyaUQnXyX4TMq1 R4Og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NGt7zk7N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t10-20020a05622a180a00b00431508e27eesi5334081qtc.682.2024.03.26.08.46.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46:43 -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=NGt7zk7N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zT-0003fA-Hk; Tue, 26 Mar 2024 11:45:31 -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 1rp8zS-0003e5-8w for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:30 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp8zQ-00018g-R5 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:30 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d6dda3adb9so21223081fa.1 for ; Tue, 26 Mar 2024 08:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467926; x=1712072726; 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=rDRJxqQMAhWnh+G5jpK8UG7ljcyYHl8RJLjLiMQKlpg=; b=NGt7zk7NnvkLiO+rmxYS7RMgb414csV3Ce7YRpBUytr4vqQ6harrMRHoCRHpYzgSnP ve4OqizHNcnjwLv/LNyIcvteT4qwfM8Lzn/lzNoD3oWMVBLiA9QrdyoxzTcJDxX5jgDV 5G9ILGB8IsJDu0rjmGu+De/91OHsaN+pQ45vHPsvRiIDgimbtzbuP8I7wy5aleErE266 QnjP+F5RBoNv7J714TDXZxQbqp88Gu+30ffj/33LxptrLWJrMKlfkZS9IRd3K2Z9r2YX 0Bo/tBlmt3ouLtslQcBNfTg2R9XSl3p38MoiD4UVKm7MQ1YLTAefEa0tri7gjrJOWcmC jwnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467926; x=1712072726; 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=rDRJxqQMAhWnh+G5jpK8UG7ljcyYHl8RJLjLiMQKlpg=; b=s/nUc19k7sbNIWVfGbYIEVYMbX1Gs6Ba+06DqEYsQHHi1R1V6b7subeszsm98sRBkY qZwlTCveZETRN71ChUPVij9GdhIkfD2URO/zQKTZywYkokxK5CFAAm0ljix0wJcjYjU2 syGxM3zSPXjJMoo9aABUMz5EQW2NRGok9LvPcy7yQxptDCEHw6gPw448BeLOkp2u+Y7k xTIYF1g/nTvj5bSSwjV4pxayg2mrH9m/dsMutJP20+LcR5r1goHNulfdminyPFSm30oa b+ssxar+e7UtFCjFu4MaaZr+5kdURkergzWDdw6fbH/X/N0zn2c/lYS3ciENBuU8wmVm 7t2g== X-Gm-Message-State: AOJu0YxGbi/60nkU7nv5h7Zv02BGEhPqX3e4UqZd6bkLrO24V/fL7wBB 8zuWtheBGq12rfG7sx+DN9Ewxfpq+Tv0oMn3zltZp/19jqqQAiOb0eQgxBUs2vGtXSFAyBpvs5K b X-Received: by 2002:a05:651c:b0f:b0:2d6:a2cd:bb8c with SMTP id b15-20020a05651c0b0f00b002d6a2cdbb8cmr2493212ljr.10.1711467926018; Tue, 26 Mar 2024 08:45:26 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id hg9-20020a05600c538900b004101f27737asm11836235wmb.29.2024.03.26.08.45.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Yao Xingtao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Subject: [PULL 03/13] monitor/hmp-cmds-target: Append a space in error message in gpa2hva() Date: Tue, 26 Mar 2024 16:44:54 +0100 Message-ID: <20240326154505.8300-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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: Yao Xingtao In qemu monitor mode, when we use gpa2hva command to print the host virtual address corresponding to a guest physical address, if the gpa is not in RAM, the error message is below: (qemu) gpa2hva 0x750000000 Memory at address 0x750000000is not RAM A space is missed between '0x750000000' and 'is'. Signed-off-by: Yao Xingtao Fixes: e9628441df ("hmp: gpa2hva and gpa2hpa hostaddr command") Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Message-ID: <20240319021610.2423844-1-ruansy.fnst@fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- monitor/hmp-cmds-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c index 9338ae8440..ff01cf9d8d 100644 --- a/monitor/hmp-cmds-target.c +++ b/monitor/hmp-cmds-target.c @@ -261,7 +261,7 @@ void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, uint64_t size, Error **errp) } if (!memory_region_is_ram(mrs.mr) && !memory_region_is_romd(mrs.mr)) { - error_setg(errp, "Memory at address 0x%" HWADDR_PRIx "is not RAM", addr); + error_setg(errp, "Memory at address 0x%" HWADDR_PRIx " is not RAM", addr); memory_region_unref(mrs.mr); return NULL; } From patchwork Tue Mar 26 15:44: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: 782623 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1754226wrt; Tue, 26 Mar 2024 08:48:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCURg/WVZJ44EjPgWLhVOXu+KQaozhuw1Ap1vcuKTI+GJJsoNkWOTn1Z4WouLcerA16ShyOjQuBBDlv9OPTj2ZnU X-Google-Smtp-Source: AGHT+IEQPLb9l4HmrPbno2CUs0VJyn4qqFqX+cdpdcvRLPcxk/xCj5fUC5oj0DFGmEboRXU+fmU1 X-Received: by 2002:a2e:b17a:0:b0:2d4:37eb:21ad with SMTP id a26-20020a2eb17a000000b002d437eb21admr19249ljm.40.1711468094615; Tue, 26 Mar 2024 08:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468094; cv=none; d=google.com; s=arc-20160816; b=TDiqsf9EmASeDFz+Zlg6KeKr5z9pviuoVXsEo3IFGuOkO7Syme4w/dwvJqBAsKLYQV no1opg3lVNlVpf0uD7EPAYvB8k22RBW54ctoth9IVmKcdIXT8eSy9l/p+abld//z+7DA BmgPeOxhRe1ryn86Nk/b1ECWxR9OgFuB4M/IYW5cQzChq2T9olXxSisy2jNVH0ZeTkS2 iJ1+t05CbQBarPgveyVXwaSD2NXXd6OHuwwEa7L/TEeNDPmYHohq/ShZ2Bzpi7lGEUTC W/WDen/3x75PRLiMjMZPFALGeDrXENLmw6QoALyVvOX4brVm1haJAA/4BuN0GkfthNZw GIoA== 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=IDGvrX1ZbW/accSdyb5WOkWj9+BF/HkrY2XWDQDRR/o=; fh=ABR3BqPaI++zUxctK5qPRzzsP8di6cGksqHT7WaT0VI=; b=I++KE2OrMSa2dE9YFiBt1uZgyvBG4QKSp12JXhz2LhCnP8x3IGyFZ7JUyRtTr5JFyO Rm0nzVfxQEW/whbaJsbDClItuwzaX8aOOKPSdsqTNy6NK5//peyJhmneNFV3kiHO3xT7 qKkcpxPtJxktcqP74xuQChJc0OnBlgxjFRxbs1QdmmU7gWlGROi54ujYOb0AWU5WkbH/ WU3PBtD5WICZikmiBxU2BBfyiFhinuNWl+mbiKHque+nLPjwQZgCOIw8cJCpFHKfFh1B Oqd2FKiFxySF/QA6vEpLSChJBRzY6qx22jD1239RbKRyAHUfbBrMCNhpH4tBQP6YDIHF iIyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CrKUvdeH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k1-20020a05600c1c8100b00414065102cdsi4279788wms.157.2024.03.26.08.48.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:48:14 -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=CrKUvdeH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8za-0003hc-Ix; Tue, 26 Mar 2024 11:45: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 1rp8zZ-0003hQ-6O for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:37 -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 1rp8zX-0001AK-NZ for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:36 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-341c7c8adf3so2024958f8f.0 for ; Tue, 26 Mar 2024 08:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467931; x=1712072731; 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=IDGvrX1ZbW/accSdyb5WOkWj9+BF/HkrY2XWDQDRR/o=; b=CrKUvdeHFUIn/1DnLxGPmmixXaab6TmnvtqQbb2v0FB3q0WBtRyWJqUDO6rnR/u/jA DUnHO4XfvAckIOmygLFv1bqwDwnY3zTFvHbz47o+UoqnrX4rtXeJQ+zkIPp5sQr3Mj+H Ra1gsq2hkB6v8YHv+rGKlXADiZzdGuGHSzIv6ksgCynriOa4+2uYP6d1x60SSFW+V3HS x1v43Tbi5CRej0jpmdadwJvILvzUjoWV5l88i80iob3Hgjtg7BZuA4FPxxpiwO0Ow4K6 wvQ3aZio4/CmgkufCmTG31VG2k+yCD2bDXV0T/9/s7V+638p82/PsONUEzwyFpZ6yvWe GaXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467931; x=1712072731; 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=IDGvrX1ZbW/accSdyb5WOkWj9+BF/HkrY2XWDQDRR/o=; b=C88VWTVGtvH/b+TzrzVs2TG390coQS954b0Y8GkZuJvVxzNASg4yAcKqdq31Xak6CC M52rROC0sY23li6PYaWzVumy13lwaV0+t3dmJNee7pLv3/eg4NaiYHRq9E/lsO2voV18 c7sz0QuIwH24XXiMccVZokS/Ga7etoEZNu42XZnCEy831fR4rKUxT1/5HDr/Rtjfx32I QvwJF7xe8U+11A6Li3g74NkMRfNDmkO/kZSVG0pazZCkiUEOJkgFS8TpmfJyaO++fWP0 bo9jRcbv687mMyuKbdlSjPe/s8s8QaFHA1LYx/H5SfKt2UK1TgOGjzWRKYlbWP4M/hTt xrbw== X-Gm-Message-State: AOJu0YzJJiq4IJFBHKYmkbHyzR0RjtBEvV8VeTr8NyL2r2NTobOM/O0M t+rJbIktJzKLwrWluGyAZheBa0Ke7Bz8O6A2CzHGN7FI+5oHNnhs64l4I3FwBka7kUKLeTnqc+p c X-Received: by 2002:a5d:67cd:0:b0:341:c000:5f02 with SMTP id n13-20020a5d67cd000000b00341c0005f02mr31090wrw.7.1711467931613; Tue, 26 Mar 2024 08:45:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id h8-20020adffd48000000b0033e9d9f891csm12447332wrs.58.2024.03.26.08.45.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , Bastian Koppelmann Subject: [PULL 04/13] target/tricore/helper: Use correct string format in cpu_tlb_fill() Date: Tue, 26 Mar 2024 16:44:55 +0100 Message-ID: <20240326154505.8300-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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 'address' got converted from target_ulong to vaddr in commit 68d6eee73c ("target/tricore: Convert to CPUClass::tlb_fill"). Use the corresponding format string to avoid casting. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240319051413.6956-1-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Bastian Koppelmann --- target/tricore/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 6d9e80cc0c..76bd226370 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -76,9 +76,9 @@ bool tricore_cpu_tlb_fill(CPUState *cs, vaddr address, int size, ret = get_physical_address(env, &physical, &prot, address, rw, mmu_idx); - qemu_log_mask(CPU_LOG_MMU, "%s address=" TARGET_FMT_lx " ret %d physical " + qemu_log_mask(CPU_LOG_MMU, "%s address=0x%" VADDR_PRIx " ret %d physical " HWADDR_FMT_plx " prot %d\n", - __func__, (target_ulong)address, ret, physical, prot); + __func__, address, ret, physical, prot); if (ret == TLBRET_MATCH) { tlb_set_page(cs, address & TARGET_PAGE_MASK, From patchwork Tue Mar 26 15:44:56 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: 782614 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753528wrt; Tue, 26 Mar 2024 08:46:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqtQnStWK6uWvvnRrbkE4qzFjemLYB313ASIIPrcR6KpX9nMSuYLrIZ3yO4qlteqQJbj1QW5vnQkiEoBmLNE9m X-Google-Smtp-Source: AGHT+IHGAxFoxG+h36pDiJ9CoY+DiemTVGtVNnyEJZnYIcmo3+6JU4YuZMvKa3e7Wlt65caeTzzv X-Received: by 2002:a05:6808:9a:b0:3c3:d623:b5c9 with SMTP id s26-20020a056808009a00b003c3d623b5c9mr1459755oic.13.1711468004834; Tue, 26 Mar 2024 08:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468004; cv=none; d=google.com; s=arc-20160816; b=rzPaj7AkhaJ6zrNDCi/2tDNzOgjjzw8bJAFKrlDeqIsPVN/IWkIbsQP6ymUETbXJOE MstGP1Uyr37zl+yQKcyJmwFvxACKOSYvGIFh5qERkTw1Iuvc6t+U5Fz8C5VO5q81f+9Q hjBY3D8WF6e9n2mb9LJT0CMbOVAmtFBLtbZX3PUT4aC7MeIzXaVhZ8AdkOLRMcAbT4b6 GWn4y97hnijN7UQw1Q64F2DTgtrJPjTVRgEYBg2JnhbIR66DqbJB5ZerYkU+MsEVkxlu tW2r+PFk1cF2ryZo2JV3PmLtvCaEr0aZEBeOMkijbRer5NGKG8OuIb9TcmhCZw9UEz64 K9bg== 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=cEpSqRrZid1z1e37NHudEuzz5YNqDapUwXxK6rE0oII=; fh=OYWJvq3POC1xXXbfoy/DvX2LA6tMGzC3T+rFxYxe9+c=; b=IcGicvamQhdOqPjyd+G9Efh4UckQ3s8GfKxsdhGJjX4qTUTZIJruB/AU9Y2SpmkarM ap6IsZj/VXAKLBQIVLvVeh0TSRjoaVeZ12gditjWN2sEoHtb53nXpcpVnOFPFZo6Fs/y 3Ehq0OXZo0RMMKRfDhmaajoyd2HoJC7KSs1gVek/naM1+W49x8dlouk6B8RhqtdZQ4fx t2Bp7CUZuuvg25cs07+x1pCyTZixOA0/dF6XyZg2xPofaeQ2D7S3Ll68j9e9aXKTxStW XINvop9yboJqugvhjSrMSvRcHjwovH7TiXnV5InBD2yjR6xu0Kg6SmiasPbORH6diqP2 spAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SHsd5c8T; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f10-20020ac859ca000000b004315aed85e9si4082001qtf.124.2024.03.26.08.46.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46: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=SHsd5c8T; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zh-0003mi-8r; Tue, 26 Mar 2024 11:45:45 -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 1rp8zd-0003ie-LF for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:43 -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 1rp8zb-0001BP-3Y for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:41 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4148f00fa66so7143855e9.0 for ; Tue, 26 Mar 2024 08:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467937; x=1712072737; 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=cEpSqRrZid1z1e37NHudEuzz5YNqDapUwXxK6rE0oII=; b=SHsd5c8TYX8qJFueCgo0EsI22nDG1ks16kPkbO9T1/B9g1N2Mj8ArG/aW0NnY4wZJa udLXqCVPf6a3NpD5a3fu6qMRAwIRnTYXc/GxcQEBDZ4W2IdLiO5HomnW5tlFp51Gsqti nuYGliiTC4hg22cU14OdEtbVI/LK8yQiUoWN4tceHRpODRGVblabWhDRldm1si+XoIZA 67hUU8/Ic3NV96epOcfXrxq8vnYPuI+uF3t6TQNZOp27kfg21K0RybyMEUPj6CQ/SXkE ywf2RMbXcUPlXHSgZhMCSETynvmuvxU4KDjo8BtwUUOJTf7XgGEa8kOVoelYPmU/yhLb tkpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467937; x=1712072737; 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=cEpSqRrZid1z1e37NHudEuzz5YNqDapUwXxK6rE0oII=; b=uQX0c3fzLn25dWPPLMMMFPi8ehWWn/2gkTTbZr70CQx430tVmQIUrrzws90wR4L+6v jEnGLpbBp1irK5qmsKOQm75Gb9yQq8EiEEW724Tlqu5PEFHvBQHclzh9FI0kA4sbOP42 LkGrmtzJxzj2fDw9hJvrxuJJYzfLbxDgPtzPdxYM7QCO7SC2jU1lWYB9LXYwPfopqja8 9JwG2ygpXLuLvDshUdTubNXkYjnI+nZV/05o8Gmzpx43hoqvIG4rsEHJnDgPHK1mLstH kpuqrgPf5RB1qvTxJBEEgvs+jQ2vy1AiAh6ibRxpJg3lZGuEFOHZW6P8dq3mhVsEL30U jAgg== X-Gm-Message-State: AOJu0Yxzz0yFKYNNyekaeMh12JxqI/zDIWjgZqsefmQNcxYHq2mnQU55 1TR8nZNcwiwxBwOp6Muvk7iMlx/kzHfYLo4g6AfQYLyahUfhHDG8LUTqWAZaEjr1AKVrX+gGOmI W X-Received: by 2002:a05:600c:3113:b0:413:ee55:8bba with SMTP id g19-20020a05600c311300b00413ee558bbamr9797996wmo.4.1711467937217; Tue, 26 Mar 2024 08:45:37 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id g14-20020a05600c310e00b004147ec48845sm11842490wmo.26.2024.03.26.08.45.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Luc Michel , Alistair Francis , Damien Hedde Subject: [PULL 05/13] hw/clock: Let clock_set_mul_div() return a boolean value Date: Tue, 26 Mar 2024 16:44:56 +0100 Message-ID: <20240326154505.8300-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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 Let clock_set_mul_div() return a boolean value whether the clock has been updated or not, similarly to clock_set(). Return early when clock_set_mul_div() is called with same mul/div values the clock has. Acked-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20240325152827.73817-2-philmd@linaro.org> --- docs/devel/clocks.rst | 4 ++++ include/hw/clock.h | 4 +++- hw/core/clock.c | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/devel/clocks.rst b/docs/devel/clocks.rst index c4d14bde04..b2d1148cdb 100644 --- a/docs/devel/clocks.rst +++ b/docs/devel/clocks.rst @@ -279,6 +279,10 @@ You can change the multiplier and divider of a clock at runtime, so you can use this to model clock controller devices which have guest-programmable frequency multipliers or dividers. +Similary to ``clock_set()``, ``clock_set_mul_div()`` returns ``true`` if +the clock state was modified; that is, if the multiplier or the diviser +or both were changed by the call. + Note that ``clock_set_mul_div()`` does not automatically call ``clock_propagate()``. If you make a runtime change to the multiplier or divider you must call clock_propagate() yourself. diff --git a/include/hw/clock.h b/include/hw/clock.h index bb12117f67..eb58599131 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -357,6 +357,8 @@ char *clock_display_freq(Clock *clk); * @multiplier: multiplier value * @divider: divider value * + * @return: true if the clock is changed. + * * By default, a Clock's children will all run with the same period * as their parent. This function allows you to adjust the multiplier * and divider used to derive the child clock frequency. @@ -374,6 +376,6 @@ char *clock_display_freq(Clock *clk); * Note that this function does not call clock_propagate(); the * caller should do that if necessary. */ -void clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider); +bool clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider); #endif /* QEMU_HW_CLOCK_H */ diff --git a/hw/core/clock.c b/hw/core/clock.c index d82e44cd1a..a19c7db7df 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -143,14 +143,20 @@ char *clock_display_freq(Clock *clk) return freq_to_str(clock_get_hz(clk)); } -void clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider) +bool clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider) { assert(divider != 0); + if (clk->multiplier == multiplier && clk->divider == divider) { + return false; + } + trace_clock_set_mul_div(CLOCK_PATH(clk), clk->multiplier, multiplier, clk->divider, divider); clk->multiplier = multiplier; clk->divider = divider; + + return true; } static void clock_initfn(Object *obj) From patchwork Tue Mar 26 15:44:57 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: 782619 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753923wrt; Tue, 26 Mar 2024 08:47:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXsOviYDM4EW9gaJaATeDVMSUtRQpvNc7ZHT6NOs1XTy4F/jAiomKHRvTMpLI6f+6xIZhys6HVXrKMxuKxOJ4mi X-Google-Smtp-Source: AGHT+IFvKNoZ78EuAg0zW/Gjs6hG/1wqwbwu1d4MegyFC11IFM9xS2/99sANK2ncsRrhDyVvwSPc X-Received: by 2002:a05:600c:1d14:b0:414:7431:6983 with SMTP id l20-20020a05600c1d1400b0041474316983mr1069103wms.25.1711468052677; Tue, 26 Mar 2024 08:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468052; cv=none; d=google.com; s=arc-20160816; b=aq0rD5fqWGy0PCuuVBVJX0zP9oTdqHG6VRK2lNFKjPW4EM6uaMkaPGehVaxgmXbCu5 zdJ0DzjFMZhEbb6KdhEXq2Q3EBeshxAmTxhIfNuCbmVI1bBklzwOUZJluj42P/gTSnju Ulr6enA4ccUnP+2jfQUmf7I0SsAqB+ygvUG9aoa3fjNvilrWz68ssQvznS2amYV5U2IS hmdzsucin0gpxv0wHK+vrrcxyG1XQwieDCiE+t86qX1J7QJfobsb4nbm7kMrSH/kGfxE EgmJb84Q3hdF81EdcWbWF6qEMkEP4exUwTKQ+FIp8q2/ocuE9GnjPk3V227DqyNe4a1H Dz8g== 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=nd+vMuVqiQfFDX5tDq7mwgsep0f8/HZ19ER+KJLjK2g=; fh=Ct4hQfFcIb7hmG/H697AYDBgL2fIgZZokB/k4Sw3gpE=; b=aIZMdA40KNeF5hygkZdmWBZmw7xr+g1bVJa8Cu2wzCSBjaYyoZDhVyXtvf0KcFjfaz U+u+z9SjVFl6FFELOOTEX5PmtGiOJQqtkTebkjhCdI3D5EMg/yT+5GHWD+mLH2AMwt/w 2K6CHHT5iwKxfEugrKPd8uMYjBW7IUi58l0qhmzprwjabPqHx2uEQgEvvqVvPR3Ygynt d9o+v+XZJ0+1NdFBv35PhF9zepu+y858HI/YcBHl8E83RP0oXqW3efDjfD3DP4A8VA9/ kesf/Ri2TP1wXUPCVJQG44ouDBsjsO09Tqjh8aKEkBgqqE6r7Ps21L4O3NrJotfg4y2W l67w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nYUTXbzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e1-20020adfe381000000b0033d14c4928fsi5325154wrm.308.2024.03.26.08.47.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:47:32 -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=nYUTXbzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zk-0003q0-Ae; Tue, 26 Mar 2024 11:45:48 -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 1rp8zj-0003nN-1q for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:47 -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 1rp8zg-0001CO-SS for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:46 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33e285a33bdso3367640f8f.2 for ; Tue, 26 Mar 2024 08:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467943; x=1712072743; 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=nd+vMuVqiQfFDX5tDq7mwgsep0f8/HZ19ER+KJLjK2g=; b=nYUTXbzftBbnz39vmhFeITOPBmZR3OBT8VW3eTXivuz31s4KXPXsKqf0tGrNzbeE7u xqZSCpoIuml6KAW2Qe9z5jNezhSwzAflLYtqv53IRMb4nyJRjyyrD4IoCnvI6PHe8GFP JSv9u9gefjLYkEeOBkViKGzmdCYxRPBO3SrtyGkaYJuAzs2pM2xps0edXOom9/sZVlmk AyO+boVKBYkcsBixmc9x3UR5BAidimx7AZnRGyG/zDe0yzYWdAqX3ckFnx04bjXEGNEo w819Sy7tnuJHhuoBZAX6WqHzIIi/qTXu2LXz+uoxRa7j0p/11/FPKrQefonOPUSxWq/r ZT/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467943; x=1712072743; 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=nd+vMuVqiQfFDX5tDq7mwgsep0f8/HZ19ER+KJLjK2g=; b=hTmdvz0pHfXvPR6JekIiQQonW97QrkqJrxKROFN52bWCeLzegZY0YM4gkVDGTSmE67 jkGkm2OPwuStE1Ob5VgF1ned07EIFRb/7fVp/9Oe89TwqTrWobkKL40AZ4oaYbdFtKKw uFbR9n7cVne5ln1Fy0+pQ2hu5kwqEYKEcXEm0fpioVGtBYK9qkwp8BRfaX3CC13/Pbpt 5CXcuoBwZEX8IgFnyq8F8MuC1LlSqWp7KNOewR/L0cEkdJd/1pJgRlgM35O1Gii33jmM zkl5bA/0rp2d5DRIBnY67ysw76PKK2jyESFYIkaoaGeRhkVQfvywPUogsv09qaDllcJA XhUA== X-Gm-Message-State: AOJu0YzJhMr6BLXh6iMsxidPqEj72VES3OEbhan8eCIN3mGiNUSNaFgc eQTl61zTeVo92A8DtG1d6UzGQwOt+vv9lZly4t5hdpHeOepSjjPqE0T8fJV+I8+xUR3fOftQfnu 7 X-Received: by 2002:a5d:4c4f:0:b0:341:8efd:e206 with SMTP id n15-20020a5d4c4f000000b003418efde206mr1223655wrt.38.1711467942916; Tue, 26 Mar 2024 08:45:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id i5-20020a5d5585000000b0033ed7181fd1sm12471970wrv.62.2024.03.26.08.45.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Alistair Francis , Arnaud Minier , =?utf-8?q?In=C3=A8s_Varhol?= Subject: [PULL 06/13] hw/misc/stm32l4x5_rcc: Inline clock_update() in clock_mux_update() Date: Tue, 26 Mar 2024 16:44:57 +0100 Message-ID: <20240326154505.8300-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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 Trivial inlining in preliminary patch to make the next one easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20240325152827.73817-3-philmd@linaro.org> --- hw/misc/stm32l4x5_rcc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index bc2d63528b..49b90afdf0 100644 --- a/hw/misc/stm32l4x5_rcc.c +++ b/hw/misc/stm32l4x5_rcc.c @@ -48,6 +48,8 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) uint64_t src_freq; Clock *current_source = mux->srcs[mux->src]; uint32_t freq_multiplier = 0; + bool clk_changed = false; + /* * To avoid rounding errors, we use the clock period instead of the * frequency. @@ -60,7 +62,10 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) } clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier); - clock_update(mux->out, clock_get(current_source)); + clk_changed |= clock_set(mux->out, clock_get(current_source)); + if (clk_changed) { + clock_propagate(mux->out); + } src_freq = clock_get_hz(current_source); /* TODO: can we simply detect if the config changed so that we reduce log spam ? */ From patchwork Tue Mar 26 15:44:58 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: 782611 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753505wrt; Tue, 26 Mar 2024 08:46:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWvDgp0ewKov/++UleMO7M7jkSRj5zhQhLnAb4KO7vzrxgmjjSCYARf41rxBqQNjfwytZoXr6ZT60NblfKqmIHM X-Google-Smtp-Source: AGHT+IGKj+LRm2tgnbhkSn2NkMbWO3lEQ6I+fybozddStyCrcg1CANihf87vlxSgudUUpSgX/tVD X-Received: by 2002:a05:620a:910:b0:78a:517d:9178 with SMTP id v16-20020a05620a091000b0078a517d9178mr81023qkv.57.1711468002886; Tue, 26 Mar 2024 08:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468002; cv=none; d=google.com; s=arc-20160816; b=eINKt701HIJUKhNtfTF51SyFi37+VJpI0c0cJbxilu/lKJ8xFUAqjk385i8Bl0AYMo kH1YGxqQQYsKuYjDhqNllJqrwGM/CjKSuD3tR4hSZUOsBc9L9uKhwzqtrXnRuqan09iL tmX5l+d8Wdg2jo/PhAU4/nRkYxm1qlqXVNPvp8wTATYM2P4VvtBlV8ilcGWt1ihrmFfS YlyuD6Vwf3K28+roRwxE0sH361o1rHxW7V9X4uiDXGUfeKvnaE9RW7ojSUEzJqiSG65I /CRwbckLG9ENg5eWyZkJlImHzUA+/eiu03v8aH4d2WWXZjJw6JHHZwPrK8e6c9mR6VyC zLQA== 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=fauC/yH9kU0VZHj4feO8NJiXVYDlYdxvHhdtor8Edys=; fh=bt3B3Nx0RfbGf/wn/tgZqFegguczg+dHbvyQOx1eEVg=; b=v+Vq34ggKER0ntpOU7yddlj7l/9dLqAmOH51jQ7vE2GdV5X+DN6qh4bbEebd3pTXfI bOeWCBc3K7XHEo/Afd//QLpPbh8QjRmXAIFDAUpdonlHts8GIcGXeejwjXIWJWSVpJgZ U53Stv1hxL38x3TWlL1O5+cFcKs9YvHEuvsfwCKgisAPsxJCva7TJO2k9yEZZ4mnzHv7 GQishTxjmd5jOIyhj/tMwHKQx3FO03GUnNjPtQRwfIc+eLlJxjI6lo8sy1faB9GMkA/4 kMH+J9m2nR/N6CJh98IVkqSHQ5x1DS1jLSCUt09V2fWgFL1geLh0h8J+WUiZZsQ2wDYE ueuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mlPpDUJ9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dt2-20020a05620a478200b007882e101535si8107327qkb.779.2024.03.26.08.46.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46: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=mlPpDUJ9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp901-0003zz-2T; Tue, 26 Mar 2024 11:46:05 -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 1rp8zo-0003ue-G8 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:56 -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 1rp8zm-0001DS-7k for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:51 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-341d730bdfcso923843f8f.1 for ; Tue, 26 Mar 2024 08:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467948; x=1712072748; 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=fauC/yH9kU0VZHj4feO8NJiXVYDlYdxvHhdtor8Edys=; b=mlPpDUJ9MirdFE1yMXxP/N6UEO+gBont64n1BYfZvxhVvR032GOUQkZIC6Ph7U5KQK TLyIqb3vdlGRmliGSjpPIVbLbWKJG5mMyQtWYTsoec6XS8unx4A3AspQA0gOEyRzzCP8 lZ6TYppKqIqfLkOEQDxcjv9EwIei91KNxMQBFkn+nanZqdysQoly1HLA1HtY88y89suT dlYdnMU2SBpgNOyuBKO2D2WJQ6pf6zObORJ6W+MJ5Fhtq47iCk52ATMw9Ljy/Fzy7fGA 0NrP5qZ0eUdNhN7gm0FKeZc4CMB2bOcwQE1PP4Z5Zs2HeHRixiOZAwexrBxwh1vVb7qt K96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467948; x=1712072748; 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=fauC/yH9kU0VZHj4feO8NJiXVYDlYdxvHhdtor8Edys=; b=wzIRs6ZMRQ44sWyHpY+PF31csw4j2vYojvsH8km0r0gtLDE2GIHRc8Do9nBL3rPh/g hQclzuFQ579dbbeRYPqCxsbPKpRgxJUCzCYoxOWVroiN5POCHFj2VuHlqkZiM+H7zS/x SwMoRNysx5iO92ZwQ3Sl6/2cUQ7MgPhQv+W6kiWMzHxU0YjAgTNB+tmVhI867bWu+Xvb 42nimTD6UPR7lO/fGEVhPWB3srv07iDgosOxFbThP4OTtVwjrZsl36uAkPHey8Cj0FZG PoPgJzx9f0/F5hgShxd3PjYoCJjQTw6fQ/oOJW3maW9Tmm1BeSn8G2D3LEyfb8BThoEa pRgQ== X-Gm-Message-State: AOJu0YxlhKEMyAXbxifUDXitbrub0OoDMMgrJY/BI+aK02VGHJyftyHi txgSlvyZypE59gDLj4g8YP8j3KL9Ed3jH5qXSASXTbFeI4z28eLOINk6Q3auw57Q86bC/jDz8X0 F X-Received: by 2002:adf:cb12:0:b0:33e:9de3:9037 with SMTP id u18-20020adfcb12000000b0033e9de39037mr6604764wrh.59.1711467948446; Tue, 26 Mar 2024 08:45:48 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b003418016b04csm12472452wrt.76.2024.03.26.08.45.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Arnaud Minier , =?utf-8?q?In=C3=A8s_Varhol?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Alistair Francis Subject: [PULL 07/13] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock Date: Tue, 26 Mar 2024 16:44:58 +0100 Message-ID: <20240326154505.8300-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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: Arnaud Minier The "clock_set_mul_div" function doesn't propagate the clock period to the children if it is changed (e.g. by enabling/disabling a clock multiplexer). This was overlooked during the implementation due to late changes. This commit propagates the change if the multiplier or divider changes. Fixes: ec7d83acbd ("hw/misc/stm32l4x5_rcc: Add an internal clock multiplexer object") Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Message-ID: <20240317103918.44375-2-arnaud.minier@telecom-paris.fr> [PMD: Check clock_set_mul_div() return value] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20240325152827.73817-4-philmd@linaro.org> --- hw/misc/stm32l4x5_rcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index 49b90afdf0..ed2dbd9dc3 100644 --- a/hw/misc/stm32l4x5_rcc.c +++ b/hw/misc/stm32l4x5_rcc.c @@ -61,7 +61,7 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) freq_multiplier = mux->divider; } - clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier); + clk_changed |= clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier); clk_changed |= clock_set(mux->out, clock_get(current_source)); if (clk_changed) { clock_propagate(mux->out); From patchwork Tue Mar 26 15:44:59 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: 782618 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753781wrt; Tue, 26 Mar 2024 08:47:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUgdShXqcI1hSowbthIwRbKP6VMLvgwVm9HPENtKGsB91oT5CmKhY+SeSFZM4DG7PJ8sSHD5Lfd1csk3XBYL1J9 X-Google-Smtp-Source: AGHT+IEQ6aDIcekH9PdSuc9HR1P/ER+dmunQvkHEwNbRjhWD7baYvcEyowwliud3QTaiIfDxvq50 X-Received: by 2002:a2e:9549:0:b0:2d4:1fa4:9eb8 with SMTP id t9-20020a2e9549000000b002d41fa49eb8mr6368365ljh.40.1711468036625; Tue, 26 Mar 2024 08:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468036; cv=none; d=google.com; s=arc-20160816; b=dB6paTrW2ew16Zwak1tMfOMKhC7PFq3IbHxIRmskO2Vu6PeETCM7U1mzjY2iecwwWq 5dZ4l03KFfZDLOG6WNVe6DAOQvnYdO1ytSdZSWhqR+ni56P1gqz4ZFHpVjazwJF/VWeT wTX9/0E6By+o/acs+xae/rgKZeS2l3c0B78cEUCIgjyp9few3nOfqIb6Fc5ze4a5p0f3 eC5Mvmcrm6Wbkn8506Ou2e+2f6LBTWpdYAU8TBDanxp6E/TL3MGlD3ZLizXSfMzg3KH5 oHD+8Cm9bT9p//Ws6r3SgHAvQA4IcY+99k6DunDabiC48lB1dm9ex+gNPvR8vLh+mYkj PdUA== 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=pILgX4qmWPDEo+FllF7pXDQL2dWnRzBzAqVL780ebL0=; fh=E5042cbrlOhqCF/vSIKw3cvFjZyuvP8gnyNdH0I4TZk=; b=QUFST+MbzR+c9sFJtfxrNNcnDmj/zL+HkS0a/nyEHNGl2eZEt5PQsRnO13eJsn5KH6 wwIj/3rGkMQGEDrBydlZ49h0VcQ9wnBG2pGgk8iN0L6Djc46df6brAobk6Z3RZ8R59pj xcosmyhdaKs773qMoOIeR2Ezec5htj0+smIqyeSdlW9d2NuRJuX3bGnEFpr3W8OXjo5i ldR7tJv0su//bOd+iq3Ub6nWf9TjG947ahLxzgW1JNSlFoy/GqQRkPNpJ95ATLMa63RJ Q2o845dY8WhvsSfoRNG9KFwJNQcEgvoicBiidsTnX+AhFBsqnBht3oCuksXzkpjSCnj6 lrAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qd4XxyWr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bh17-20020a05600c3d1100b004148e1ac66fsi981302wmb.104.2024.03.26.08.47.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:47:16 -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=qd4XxyWr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90C-0004Pj-AW; Tue, 26 Mar 2024 11:46:16 -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 1rp8zx-0003zm-07 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:01 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp8zt-0001Ea-72 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:45:59 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d6ee81bcd4so6777701fa.2 for ; Tue, 26 Mar 2024 08:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467954; x=1712072754; 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=pILgX4qmWPDEo+FllF7pXDQL2dWnRzBzAqVL780ebL0=; b=qd4XxyWrCrUcGvRO7kuuWoY6Wi6laaGq6BfdtucybR0jNF6v6sjhh7ZlqxhjeOW7H+ YgmnW9WChgHOOopV7wChhrtTTxsHhCejBcFzvkYVMBAcX6ZNMlu7vSMAXMEps1btWy4e kfU6fWI74cJ0902WOrAMNaYUz/3B6TU/eDexDKbht7XaECU+o/ygRrHqdWrwN3KJ00PY i/cEDQwE6ss3mYFUd3stHUXatea3NuOzB0tRJoHp3i56Fbif/4/Nif4TEISbZfOAWA2U sOGfhuZ738k7ptayJT2HxhhkGUfxMJx1acsOayqLT/pajGASdQjL68SO18Z1CYCPT3cq 8PXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467954; x=1712072754; 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=pILgX4qmWPDEo+FllF7pXDQL2dWnRzBzAqVL780ebL0=; b=Ezfdcb1PljyqIW/0rAvFTc9fIxeecWkByZXjqIz4ZmEebxHV1i1BV3MQlG01G+99Rq /D/Vskwul6L62rRphIwX6A00tspcsaoz+Tvgz78HFprByAnK+1QRLrJPPRE/WDCUIg2z 1kBASWLjcejNWPeLnR/MK9gR3n6Ap4Yuyu6ztXptinTfBFNy4HzVzX1W7OYuXtgQx+DC 7/OVKVRJGWSduTqhd1nKaDksGLO9b0yKPaHMCDghhtoz//d3BKAb5ZyAu373J/V88Yzn dGrbIevHredU5yDa9UrNCH2I/knHA9NuOl4sTfbmrpGfpGq/i06dE9mWhdwvUmJPvMIH +7Iw== X-Gm-Message-State: AOJu0YwPqVN5fZMyOJrVfar4RUTfm7MOKtjF3Kj2MPQ7kt+6+4kHWS10 2cgkTwyMLEWr1hNLKrrUY/cZxYt1fAcKuoUmIWJNLgjt5NdKY1pP1pl0lFEqZmkpP7Dwi7gDG0B i X-Received: by 2002:a2e:914b:0:b0:2d6:f100:6e6b with SMTP id q11-20020a2e914b000000b002d6f1006e6bmr888577ljg.18.1711467953968; Tue, 26 Mar 2024 08:45:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id b2-20020a05600003c200b00341ddb65b07sm112154wrg.63.2024.03.26.08.45.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, BALATON Zoltan , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 08/13] docs/system/ppc/amigang.rst: Fix formatting Date: Tue, 26 Mar 2024 16:44:59 +0100 Message-ID: <20240326154505.8300-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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: BALATON Zoltan Add missing space to fix character formatting where it was missed in two places. Fixes: 623d9065b6 (docs/system/ppc: Document running Linux on AmigaNG machines) Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell Message-ID: <20240324161148.4650D4E601F@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- docs/system/ppc/amigang.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/ppc/amigang.rst b/docs/system/ppc/amigang.rst index ba1a3d80b9..e2c9cb74b7 100644 --- a/docs/system/ppc/amigang.rst +++ b/docs/system/ppc/amigang.rst @@ -16,7 +16,7 @@ firmware to support AmigaOS 4. Emulated devices ---------------- - * PowerPC 7457 CPU (can also use``-cpu g3, 750cxe, 750fx`` or ``750gx``) + * PowerPC 7457 CPU (can also use ``-cpu g3, 750cxe, 750fx`` or ``750gx``) * Articia S north bridge * VIA VT82C686B south bridge * PCI VGA compatible card (guests may need other card instead) @@ -73,7 +73,7 @@ https://www.powerdeveloper.org/platforms/pegasos/schematics. Emulated devices ---------------- - * PowerPC 7457 CPU (can also use``-cpu g3`` or ``750cxe``) + * PowerPC 7457 CPU (can also use ``-cpu g3`` or ``750cxe``) * Marvell MV64361 Discovery II north bridge * VIA VT8231 south bridge * PCI VGA compatible card (guests may need other card instead) From patchwork Tue Mar 26 15:45:00 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: 782621 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1754103wrt; Tue, 26 Mar 2024 08:47:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV3elO2AGGIxIrQLZBRlJuINu/2P5Ir5WgrChoa+MyGF34TXgsFlzdNduJkGCXCciywhuEx08bjKjq9JvFc1iPx X-Google-Smtp-Source: AGHT+IGIbdOrLk7fpNI3mcEsHrkJ9m53hSL7qpoNGeOVOJ0g1vGSv75yAPKR5j+lTBs1fSSjyocr X-Received: by 2002:adf:ed06:0:b0:33d:eb13:9e27 with SMTP id a6-20020adfed06000000b0033deb139e27mr1839133wro.23.1711468077445; Tue, 26 Mar 2024 08:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468077; cv=none; d=google.com; s=arc-20160816; b=scgJCUoKILpjATi/iy0PxuPeQvR4sH9O7ddYKXi/1LQGcXa0rwB1puTilyJVh1xLlv OohJ5npxQoIWwWBemGMxMyCp/0RjSCtj38p8Bp2qCRlla/4YJ1iHZcvxGgU1+/n0MxkH iJkpd4ubkOyb5dvz4tPTOTKOUlrMrNT/lvqx2amXVQemid21SEpguib9EB8kEegE3nol FegJoCUgqIStbF/RfkolLU9JCGrVTXT3ltoRsBMwzwvInduNCnyq4AOkFQm+5y2Mhi23 Q43weImKJZhDYTgBKrZAIoL7yO0pZ97CQ9DulGThb3id571Jlpyhf6ABaxWwelcEB7o8 VNig== 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=PZoPdLMWukYfNxcXkCat/bL6sGsc7qqjORe7Wmplu6s=; fh=/bEQrMR3Ia1huQRtKohszVZj0HSXkEFEIG3ssxANOyc=; b=in/MEv/+FeFcJlevGbE8n9cUkTvlRq9t9kImBtTkiHTQqotQZKjxJwGHjTQYccgS60 Tzz6KCl6jJ8KPuFPGg+duDyLbw3Jz60Rum8XcxdbXg9PE3fAJG5ErX6a9YOSH0WLBwoJ d9Hm76o2a3uoZdYTof8jPaEpxSzFhYRXbrk7JU6tLwdWUM6VGZ947RP9kKxTMQwxc+GU 4pMbWHAw64sn1Wxi2FgwXmeK4rbxXnf7kYskkaTRSpD4HN4UkymBszRPF+6QHm0gJLzD cND8mr/8zisaClZhLrtnt+HIrRND4c/VctywHFPlzEsM/bAfhTmpD2xe/tIgfwR+RE1Q H57g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZhKSc65n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b1-20020a5d4d81000000b0033eb79ed627si5315778wru.552.2024.03.26.08.47.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:47:57 -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=ZhKSc65n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90C-0004Sj-UX; Tue, 26 Mar 2024 11:46:16 -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 1rp901-000436-Cr for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:12 -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 1rp8zx-0001FW-CI for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:04 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33ed6078884so3745304f8f.1 for ; Tue, 26 Mar 2024 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467960; x=1712072760; 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=PZoPdLMWukYfNxcXkCat/bL6sGsc7qqjORe7Wmplu6s=; b=ZhKSc65n6aSSgjvZCIGZUYBuQTJzohbnxNhKAwvMA3eUDpaP4g8GJMX/qfzP0nRfNF kt/nXs3kCQmTcGFyWIRqoSljunIvDVY8GxP6fNXgFx6QYastUV5U85shDd0+t8//0H4y lFqEnAQMZ62hQaA3uHkXKeFlreoMNMjQcuuIE8/32JwyoOju+5s7lBe9fp/gze6VgPpf iL9B9DYDCPoCq5DgGZqEzmEtYK0NvEhYEf42JGJ8iLslKRzb8r3jVtiDAZn2frGL7t9V lUbpySQ++PRTbCyJOpi2gv86GdyZ0Y1kE907bozMH0X839rLA354SASPmgHZNwEWIUvX bHSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467960; x=1712072760; 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=PZoPdLMWukYfNxcXkCat/bL6sGsc7qqjORe7Wmplu6s=; b=jXwhNXkU/oZXPGsWh7KTmfKlvKN3jEz+lMkJaZvXIMr5tlQ4vHprGbY2ZKS4+5u3dJ f2lee3T4cwSRAQR95rpiggSvcuJkALMXx4h7vtkHLnmar7r/OUeMaUP5v9FaauavA6Zv ouojo/taGrlDB/7dIeiTS0Z0VJ105Ojmj1HBqPh2yRyJ+oYN7pDGTvDpxmTGRtvk2prX sxXn646N+h5lEuF+Xk5OLaorfbyw69XYcBtO6n2AVM67lUOSGeBHUxpKjc+sB3fHqI0Y FlIRlKAiQDVBM5gj4UjCGou8TZi/FBTxalsj2iVuIdIA7DIj6/sI7+3WPDCOXjP7H4xI 3hgA== X-Gm-Message-State: AOJu0YwOx3o/fafe8A2b1UH1tWw38+XQI3JKaytibJYujE8zvdnwcBJX rDf+u4sY9sByDUppqYFPNrOcxftgFSmhdj4jhTgTa0bHApFUy1rH2DyiIKO/0n0lnysNSS5fy0w 4 X-Received: by 2002:adf:e6cc:0:b0:33e:ce08:79b5 with SMTP id y12-20020adfe6cc000000b0033ece0879b5mr1645151wrm.9.1711467959787; Tue, 26 Mar 2024 08:45:59 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id s17-20020adfa291000000b00341b7388dafsm11861938wra.77.2024.03.26.08.45.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Yao Xingtao , Pierrick Bouvier , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 09/13] contrib/plugins/execlog: Fix compiler warning Date: Tue, 26 Mar 2024 16:45:00 +0100 Message-ID: <20240326154505.8300-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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: Yao Xingtao 1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70. Use g_pattern_spec_match_string() instead to avoid this problem. 2. The type of second parameter in g_ptr_array_add() is 'gpointer' {aka 'void *'}, but the type of reg->name is 'const char*'. Cast the type of reg->name to 'gpointer' to avoid this problem. compiler warning message: contrib/plugins/execlog.c:330:17: warning: ‘g_pattern_match_string’ is deprecated: Use 'g_pattern_spec_match_string' instead [-Wdeprecated-declarations] 330 | if (g_pattern_match_string(pat, rd->name) || | ^~ In file included from /usr/include/glib-2.0/glib.h:67, from contrib/plugins/execlog.c:9: /usr/include/glib-2.0/glib/gpattern.h:57:15: note: declared here 57 | gboolean g_pattern_match_string (GPatternSpec *pspec, | ^~~~~~~~~~~~~~~~~~~~~~ contrib/plugins/execlog.c:331:21: warning: ‘g_pattern_match_string’ is deprecated: Use 'g_pattern_spec_match_string' instead [-Wdeprecated-declarations] 331 | g_pattern_match_string(pat, rd_lower)) { | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gpattern.h:57:15: note: declared here 57 | gboolean g_pattern_match_string (GPatternSpec *pspec, | ^~~~~~~~~~~~~~~~~~~~~~ contrib/plugins/execlog.c:339:63: warning: passing argument 2 of ‘g_ptr_array_add’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 339 | g_ptr_array_add(all_reg_names, reg->name); | ~~~^~~~~~ In file included from /usr/include/glib-2.0/glib.h:33: /usr/include/glib-2.0/glib/garray.h:198:62: note: expected ‘gpointer’ {aka ‘void *’} but argument is of type ‘const char *’ 198 | gpointer data); | ~~~~~~~~~~~~~~~~~~^~~~ Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2210 Signed-off-by: Yao Xingtao Message-ID: <20240326015257.21516-1-yaoxt.fnst@fujitsu.com> Reviewed-by: Pierrick Bouvier Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- contrib/plugins/execlog.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index a1dfd59ab7..fab18113d4 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -311,6 +311,24 @@ static Register *init_vcpu_register(qemu_plugin_reg_descriptor *desc) return reg; } +/* + * g_pattern_match_string has been deprecated in Glib since 2.70 and + * will complain about it if you try to use it. Fortunately the + * signature of both functions is the same making it easy to work + * around. + */ +static inline +gboolean g_pattern_spec_match_string_qemu(GPatternSpec *pspec, + const gchar *string) +{ +#if GLIB_CHECK_VERSION(2, 70, 0) + return g_pattern_spec_match_string(pspec, string); +#else + return g_pattern_match_string(pspec, string); +#endif +}; +#define g_pattern_spec_match_string(p, s) g_pattern_spec_match_string_qemu(p, s) + static GPtrArray *registers_init(int vcpu_index) { g_autoptr(GPtrArray) registers = g_ptr_array_new(); @@ -327,8 +345,8 @@ static GPtrArray *registers_init(int vcpu_index) for (int p = 0; p < rmatches->len; p++) { g_autoptr(GPatternSpec) pat = g_pattern_spec_new(rmatches->pdata[p]); g_autofree gchar *rd_lower = g_utf8_strdown(rd->name, -1); - if (g_pattern_match_string(pat, rd->name) || - g_pattern_match_string(pat, rd_lower)) { + if (g_pattern_spec_match_string(pat, rd->name) || + g_pattern_spec_match_string(pat, rd_lower)) { Register *reg = init_vcpu_register(rd); g_ptr_array_add(registers, reg); @@ -336,7 +354,7 @@ static GPtrArray *registers_init(int vcpu_index) if (disas_assist) { g_mutex_lock(&add_reg_name_lock); if (!g_ptr_array_find(all_reg_names, reg->name, NULL)) { - g_ptr_array_add(all_reg_names, reg->name); + g_ptr_array_add(all_reg_names, (gpointer)reg->name); } g_mutex_unlock(&add_reg_name_lock); } From patchwork Tue Mar 26 15:45:01 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: 782622 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1754185wrt; Tue, 26 Mar 2024 08:48:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+JB5NU3Jdwb7on9dw7WJEgM5g+nXgvDKGV/AzCIthoKXxsU5LCaxxIj+RDbVFBXY6qyKi/btReD/0S7VL/Pa/ X-Google-Smtp-Source: AGHT+IF9Vwb973cazpRWmBHUz9Bxwqm2wXhrAgBAfF+8R/TR2cKhFLKOmU+VrM0tmGXVg/6Y6xr+ X-Received: by 2002:a05:6000:906:b0:33e:77b5:746d with SMTP id cw6-20020a056000090600b0033e77b5746dmr2040662wrb.18.1711468090702; Tue, 26 Mar 2024 08:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468090; cv=none; d=google.com; s=arc-20160816; b=QQeNtLqxLTAxjy1IVy68ZxZZ6jNtn1Qd64SnDuspREkV/6Z8w7b+5iED5pw9ktUI6P wI1oNGx8WZq+3P+h+sfnmFer7+13je23E04sb+gj77uw41X6lf82SR5gPUSozqzlWKVE 3Xqv2zamGf1xQlz7Vi+Ox20BlyeBBPEByZo6BN9zX1MD/nt4Qij0a7+tu5vgv7M2HH3z sXuggk9tAiYBlZeshw440MqenloqkrzbceYmyXJLHznDbPYbJJVsAKxIhn0WIcsuvFzy F5aS2OCBMei1vA1P77CwT11BiEIgesgYB7Izb4z9HuEdvlrQsKnsRLtkQGS2N66BxI0p ZXnQ== 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=a9aAigC2kGTbid56AicgylDWHcJDSIM2k5pIIBM/YvQ=; fh=pAGJJoxeRb3mkCbKvnNYuAbiZvOjq7h9qEZVLWQJHmc=; b=Ad7WTglfvVAz4jlABOqqZLVziwql2rvODNMMxinKjnnsccclevxUStTxRYxvsgjZPA wmIdrYyCDjVBx/HYyIxKAA5R7Cn1CgqQMEYLyyfIBx5ZHSth+Lf/dhIQGJ6fqXKuaZl7 ZLww4JFODSeSsjlpmYRT6rw2Sex4CkCkKJeft6nnIbZFpyj1H2gOAjhPjyUvfG0dTuba 34o1YwPtMD6sYYSCDPCz39mL6GNcKO8o6sE/s4akOBy0Ky+PF/vdKYMKQuFsH9ElaiNx gcDzP4EDgx9SqDqiX9rgMKzrt83GwRjZHPz9HDnVcNDN4De20RTUga0YP2iraVsD10C8 aK9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FmYpNi7Q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g14-20020a5d64ee000000b00341c567eba2si3517699wri.110.2024.03.26.08.48.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:48: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=FmYpNi7Q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90D-0004V7-GD; Tue, 26 Mar 2024 11:46:17 -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 1rp907-0004Ah-IQ for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:14 -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 1rp905-0001Gk-RF for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:11 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-414925ba716so554715e9.2 for ; Tue, 26 Mar 2024 08:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467965; x=1712072765; 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=a9aAigC2kGTbid56AicgylDWHcJDSIM2k5pIIBM/YvQ=; b=FmYpNi7QecEHtkQhubQskR+WXcoThxDv0g+BLSCZ2xir1KJr/NjBTcI8DUOxqD5LHi gvBxstumxYsTnRScTg+PhX0iskLMP4R57PqFdmRVhShgbKhKHs8iCDqUUcc0HEkefY10 eoQdB4t2laCXVHMmOWjCXU2RvBqN+HZVDI2sCU7+8nP48msST/Y3m2E8YSc9y8lzZ5c4 Y2dDYml9KYOE466Yl8JBtDlSg3pMfjiNjEBWJUtC9cLx/JvrGQgVJipZeF1gYegRBdQc NIGvBqAOpz2nD19Mul1Wtf6zZQdv/0rsDmd9+3zy2q72n3R9fq4hbKQ0wZiG6owfaJmF 7c9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467965; x=1712072765; 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=a9aAigC2kGTbid56AicgylDWHcJDSIM2k5pIIBM/YvQ=; b=GhNhDvNDZxBcJWK3R55FKIXtXwp6bsOStjEXDHcwzFfMTYiu3wp6apZR95i3+jUVVO kSy6vUnIXt8JKLX6MqlqdwFomSQKFtU9L2/SUhNPWOwt584IP6m+LwReVxS37GDA/0hC jsabyNIX/R4md9RQGmOIhuvibqIlGKgJjiQRx9odWYUlAi3wwRuvrZy8tLxvGgpT28H3 ioc6kf2p7AJkeSA+UcwdrEGW/7ZnUQo8FMGE3As8ZtaZn5kUBZ56FreWaTDjXkPehJNq togUwtbIrC3PIjuRWW3dQgtxaQcdE1XzO6dPWW2MYME2TkoTnokD8m6KRcnAnba2jhBW PHLA== X-Gm-Message-State: AOJu0Yzu6e3hYYL0A0cpaFCCg4WrSLZPzetQ61PThBx0VYwcU+iVi0HV E9kY0p9rssz3pwRE9AeVbxqa2CI/+Hzzna0o0hOScqXrmf6CMvbEXsiYp7SWjG1VJiwssq1DHfR P X-Received: by 2002:a5d:464c:0:b0:33b:87fb:7106 with SMTP id j12-20020a5d464c000000b0033b87fb7106mr1879099wrs.55.1711467965635; Tue, 26 Mar 2024 08:46:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id bx12-20020a5d5b0c000000b0033e45930f35sm2895844wrb.6.2024.03.26.08.46.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:46:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , Michael Tokarev , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Ani Sinha Subject: [PULL 10/13] hw/smbios: add stub for smbios_get_table_legacy() Date: Tue, 26 Mar 2024 16:45:01 +0100 Message-ID: <20240326154505.8300-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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: Igor Mammedov QEMU build fails with hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' when it's built with only 'microvm' enabled i.e. with config patch +++ b/configs/devices/i386-softmmu/default.mak @@ -26,7 +26,7 @@ # Boards: # -CONFIG_ISAPC=y -CONFIG_I440FX=y -CONFIG_Q35=y +CONFIG_ISAPC=n +CONFIG_I440FX=n +CONFIG_Q35=n It happens because I've fogotten/lost smbios_get_table_legacy() stub. Fix it by adding missing stub as Philippe suggested. Fixes: b42b0e4daaa5 "smbios: build legacy mode code only for 'pc' machine" Reported-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Igor Mammedov Message-ID: <20240326122630.85989-1-imammedo@redhat.com> Tested-by: Philippe Mathieu-Daudé --- hw/smbios/smbios_legacy_stub.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/smbios/smbios_legacy_stub.c b/hw/smbios/smbios_legacy_stub.c index f29b15316c..7d593dca98 100644 --- a/hw/smbios/smbios_legacy_stub.c +++ b/hw/smbios/smbios_legacy_stub.c @@ -13,3 +13,8 @@ void smbios_add_usr_blob_size(size_t size) { } + +uint8_t *smbios_get_table_legacy(size_t *length, Error **errp) +{ + g_assert_not_reached(); +} From patchwork Tue Mar 26 15:45:02 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: 782624 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1754500wrt; Tue, 26 Mar 2024 08:48:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNpmfPV6YYKzc4KBw+GHN/yLeifJW3LdIr8Ks4yFPSUTThBODhfVELRP+NAT6EolQ8R3fYNhwPcVRea55DXEyq X-Google-Smtp-Source: AGHT+IERYXc6oObjIJQP5ZdBhV3qacEoJ9Yi7jHELVLTqHp39tpovxqHxOR/EVkQjU23JKGEIF2K X-Received: by 2002:a05:6000:2c1:b0:341:b836:6318 with SMTP id o1-20020a05600002c100b00341b8366318mr52725wry.11.1711468130901; Tue, 26 Mar 2024 08:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468130; cv=none; d=google.com; s=arc-20160816; b=PnGE0qCJQZYu3tzT7XFgk7v2UEaY7XaY0YVtFDtf+Q1XLjlzn6qD0htGfg8N5GdDAO I6AOTgk6TsvT/+zR4+PHcbeIxmNWISMPalKn8enhnuS7iOO+m7noIHoFwFZQOVg0BobQ ESX5YgTqGsjcOYtJuS661xyrFwZ2hUCb2hkCsHzJBX/x7g7bR/9/yLQ00VYhrepwsnq8 ZEYPf4IRzuwzwLxrHw3/eSE85gaueSRv/WLM7z7yfOCWWskVSsuhtPmIpb+PSHFEg1TL e/Y00p4MK6B4Lz4mfGVlVd+TWJQWKE+dawSVIFp+VFHZaumyJ71RYmjdevH30BVvx2ox /n3w== 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=pTnsklKw4fWTCEXstwwApylL5b79xPCluS5bdtq/AP4=; fh=8fwwG4jf5s+vp2LxKfvGZcFOYvMbRyHUPH92VDUPV1M=; b=hIhIIXy3bO/qciYkJFU8h2jWII53Xd7hi0IFpIMHS06FOQTNzZigufZkiQl3X7dIA/ uist4ozipzfqRLxafFG+2aB0OYpR1R5v5MAaQxPodim+0qbsYTi7Cdil/6uYl8xwuXc8 faUW4Px/q4qYs0DBXrqQcyFJF8dFM6/brmhNTxsBqvFL4xN5whr9wTntr53Rm9StidRc q0BCG0t4p14k3mVdCRpNG2yjrYIM2tabobtMbJffCKggnaO7QbTOpLS0Bb0iMdkrNOXo l2CA3xPptBGtIimT/MLk133hHo4Gl5MXKnXzX0VuG5hXYEQcF2wiOoA9vtabV2uMYMpa 9PXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9kypSWj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k14-20020a5d66ce000000b0033e818ed06csi5549447wrw.220.2024.03.26.08.48.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:48:50 -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=K9kypSWj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90E-0004YF-Hm; Tue, 26 Mar 2024 11:46:18 -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 1rp90A-0004Du-Sd for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:14 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp909-0001JS-1c for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:14 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-341c7c8adf3so2025402f8f.0 for ; Tue, 26 Mar 2024 08:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467971; x=1712072771; 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=pTnsklKw4fWTCEXstwwApylL5b79xPCluS5bdtq/AP4=; b=K9kypSWjrfL9N49/W0NFOIIlz2Dnk9rtYgHDD6A1UPo93CPorPUdqVmjm6kgb6pr2O ZuDtGSzklFVjwXlOvepNxv0tv7EHRW9ndWLYhbvZBKNEJKw3G3sqh/NjSeLkNEqY3810 lC/FZkOjdhaCgmmaGXaR0yLvPtpXg37ndUompjvycbESn9AEB3SfLm3FEeUVU8i9a1UC FL/if81txP+DD12rEucTkPTogqMX0JCVVr4lUnZc4f+qhgv9kWP0UtxgbS7YcTUioGqI 8aHdJtGGmg9YCTjK7Udiyf5IkzFCclroIJUHFaunEgDmUZuQS2O0Gx9apk5FQYDC5pU6 tDkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467971; x=1712072771; 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=pTnsklKw4fWTCEXstwwApylL5b79xPCluS5bdtq/AP4=; b=QOn0wjYMRy8wymQWLFp1CHha2K0NGFyxXjt7Q16nOtY3Zj3+2wkyZZJ9a4kvKPfrNr I8FVqn9c5vtj50Sm68z+j8kGg6+IUXsLl0W/+Ur5Y2V6g3RSIqA7B8u7VTtgpgAtN7F3 WsjxbF7VzhAq+sc8u1WDQgD4/au34yYl0B97GyBmO1O+0NS/RqseJoV9uiF6+mXKrAp6 vxQBBXbhervPKgzMTJGBMeA2e4KpKzKISAoHC5XR7mpB/DoP1v28dfCDrLe8TtWpZ3RP pOPMuEss3gp8UAsxuFW91sI39TEpDW6Yys7qpg3+GvkHn4vTJ27qPZbRMLtLxiFLQYtQ ONww== X-Gm-Message-State: AOJu0YyIENf6BsRhQfUCrMm+0cxYWKCFMcUJI8r6+Vv7Ky04AxX+G6y2 m5PtbZNtLlIrEiclrTP2T7FHRQKziMC/Y6blWj85QY7RFcotFEuaSKj0g6cTMlehkXBGUtdNDGp r X-Received: by 2002:a5d:5b88:0:b0:33e:c0a9:79c with SMTP id df8-20020a5d5b88000000b0033ec0a9079cmr24223wrb.23.1711467971342; Tue, 26 Mar 2024 08:46:11 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id dv13-20020a0560000d8d00b0033e25c39ac3sm12463085wrb.80.2024.03.26.08.46.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:46:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PULL 11/13] ui/cocoa: Fix aspect ratio Date: Tue, 26 Mar 2024 16:45:02 +0100 Message-ID: <20240326154505.8300-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: Akihiko Odaki [NSWindow setContentAspectRatio:] does not trigger window resize itself, so the wrong aspect ratio will persist if nothing resizes the window. Call [NSWindow setContentSize:] in such a case. Fixes: 91aa508d0274 ("ui/cocoa: Let the platform toggle fullscreen") Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Message-ID: <20240323-fixes-v2-1-18651a2b0394@daynix.com> Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 810751cf26..17e125d66d 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -519,6 +519,43 @@ - (void) drawRect:(NSRect) rect } } +- (NSSize)fixAspectRatio:(NSSize)max +{ + NSSize scaled; + NSSize fixed; + + scaled.width = screen.width * max.height; + scaled.height = screen.height * max.width; + + /* + * Here screen is our guest's output size, and max is the size of the + * largest possible area of the screen we can display on. + * We want to scale up (screen.width x screen.height) by either: + * 1) max.height / screen.height + * 2) max.width / screen.width + * With the first scale factor the scale will result in an output height of + * max.height (i.e. we will fill the whole height of the available screen + * space and have black bars left and right) and with the second scale + * factor the scaling will result in an output width of max.width (i.e. we + * fill the whole width of the available screen space and have black bars + * top and bottom). We need to pick whichever keeps the whole of the guest + * output on the screen, which is to say the smaller of the two scale + * factors. + * To avoid doing more division than strictly necessary, instead of directly + * comparing scale factors 1 and 2 we instead calculate and compare those + * two scale factors multiplied by (screen.height * screen.width). + */ + if (scaled.width < scaled.height) { + fixed.width = scaled.width / screen.height; + fixed.height = max.height; + } else { + fixed.width = max.width; + fixed.height = scaled.height / screen.width; + } + + return fixed; +} + - (NSSize) screenSafeAreaSize { NSSize size = [[[self window] screen] frame].size; @@ -536,8 +573,10 @@ - (void) resizeWindow [[self window] setContentSize:NSMakeSize(screen.width, screen.height)]; [[self window] center]; } else if ([[self window] styleMask] & NSWindowStyleMaskFullScreen) { - [[self window] setContentSize:[self screenSafeAreaSize]]; + [[self window] setContentSize:[self fixAspectRatio:[self screenSafeAreaSize]]]; [[self window] center]; + } else { + [[self window] setContentSize:[self fixAspectRatio:[self frame].size]]; } } From patchwork Tue Mar 26 15:45:03 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: 782616 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753612wrt; Tue, 26 Mar 2024 08:46:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUKvxCiJTFWCA8CgDgzL7Y3FQXreXusYOwF7rS7iZD2JkmjtMqXdumXOTapz/hgVGsLhXFpMwpsoDwCc17O4Ztr X-Google-Smtp-Source: AGHT+IFPa9Rd5hZd44JN9T5hgdcoUBYejC2g1LW7AmB+hKZyZG5Q6Z+CeUuvswKPyVHXSnLU0ZBF X-Received: by 2002:a05:6871:29d:b0:22a:4f02:c0e8 with SMTP id i29-20020a056871029d00b0022a4f02c0e8mr3391341oae.45.1711468014230; Tue, 26 Mar 2024 08:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468014; cv=none; d=google.com; s=arc-20160816; b=WQseYNVkEU/i0h8RKWmjj2YwtN+Fi3fMXLOiVIGne5sC3pAf2zsreAqY9VQK0c398j MKRh1aZ3X+rlIRKtUs49jGdljLtO7+mxRxKCnDw8OniIbh3yyP6RQfqDF5HkxiwOcaiA dX9PGYrvxcV57SFFwDw+DRGw2Fz66Cc73LvTcDZ/bl0rTqIKJyF+bJMjpEwlEysyIiAH 6GlPVtQXehKBqaPYy/MRg09Dkgefxkr+IdSyUeGHt/zIDfMQbSotfLevJee+zww+9/1R ow3FOdbd8NAXrOUudV501GfS773FGYGFep5q8q6D/LZyP8h3vXN6mIE85/N5P8NdUJDV olnQ== 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=PKAyA2esITL8SITZAGwcUVQdYshhyjFMl3HKToYcoDk=; fh=8fwwG4jf5s+vp2LxKfvGZcFOYvMbRyHUPH92VDUPV1M=; b=aU/DaNdsG8qivId0dpcs1hKipSrQTSx+JxeV1ipyzx9YFc0B3/il+T7SixbYI9+CN5 JpjKhMfAdM4Cny34vPjcz13/GXdabj5j5oPfOfoFHWFF1F3OPWHKUfoqKPpvHvfGAFpT F1t9uGQ7zB3gT+GHCUyq0TNnJ+Jyl2LJzlNT7yNNt92SeqVgHmkM5OOSoLQKs1fB6pz2 406ZoHWWK87HD4TL6zBpKiagbF7nb+s1fIgeB0qFuZB9ssuRfByLZ6BHqa60NDMTZQnD pHHj/xRUeIqG25g0n7eLxV6agTnfSo5ac88dUjOn06Vprj7l/ySL/LM5c61PVNEHdlg/ lHTw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i4zmYjjG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w19-20020a05622a191300b004311546ccc5si7623956qtc.176.2024.03.26.08.46.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46:54 -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=i4zmYjjG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90J-0004hc-2a; Tue, 26 Mar 2024 11:46: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 1rp90H-0004aT-9A for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:21 -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 1rp90E-0001Kn-V4 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:21 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33ed6078884so3745541f8f.1 for ; Tue, 26 Mar 2024 08:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467977; x=1712072777; 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=PKAyA2esITL8SITZAGwcUVQdYshhyjFMl3HKToYcoDk=; b=i4zmYjjG1xzs3zNKPUYNQtTU1BmRmnUMbSv+JeR0bH3YUiy8jKIl8tnzxHHcNQpM/i PNj55eiQpmjt69RIxk27TbIZKSH+tC5YfBB8MJotm0/heCuytKJB72S31gaRyfj51NpY h5Zpxo40GhCZfC7GJvrTQ4svDi26YeSzwBKjT5glJgfDCGsP7efU/UzmdrufJtH7CrH6 cgec837rsHSIKPmJ5VJYEvThfJ59Ya+6o6mjS0OqYwbw9guvy+KyuxHEgigxoqA5rdl0 AnP6sc6ObVRM5cXRFOAoFx1JZUlpCckgIic0ytMFedEen1O9Fh7Il32RzC6zfIwCuqs0 UXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467977; x=1712072777; 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=PKAyA2esITL8SITZAGwcUVQdYshhyjFMl3HKToYcoDk=; b=nitbiOv1yT/5pif/3Y2vHcp1Arm6Ow0fM01FOrfNKI0qx+kjAeRiEC0vbhdrKtdVyx 8aI+OdnenPjHyuHnBntVWiTeCeo3DkGp/e3VUgOGJPmyvTixbOCIYSrCmcSfFbgvIFiF ONQ0RW+lpuPJDqCrF5CjqoMap7RxHK5x+2FCe5CTLUgEX7bwIi+RaRu6cHeiXdjv9KAK y+wQNVxZqJCUAYTTWlvRmOdTId0XOhYDk/pMW1e81KZ2OfUDxXfd2qXYqHqCg+23SVPm RKH+nAuhNLLw1OffZR7s4I5Y/IB2tgE8mgh1O6Mi/1r+oUw9yOTw6RmvKZB3sNSVhQTa 5K2A== X-Gm-Message-State: AOJu0YyS++cf/drzHQiUNy6Rpg1QCkdpNFW9fWv6xAyrbUjVw+YbeRim /ycftD8S8SDZ6pHRquHe1EcHWwvV97AWB5E+DCJ/zUjlGudmIpQiaogENpSbO5bPb1Zhu3rFaZJ q X-Received: by 2002:a5d:5505:0:b0:341:b5ca:9e9c with SMTP id b5-20020a5d5505000000b00341b5ca9e9cmr1642466wrv.25.1711467977141; Tue, 26 Mar 2024 08:46:17 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id az7-20020adfe187000000b00341ce80ea66sm5309912wrb.82.2024.03.26.08.46.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:46:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PULL 12/13] ui/cocoa: Resize window after toggling zoom-to-fit Date: Tue, 26 Mar 2024 16:45:03 +0100 Message-ID: <20240326154505.8300-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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: Akihiko Odaki Resize the window so that the content will fit without zooming. Fixes: 91aa508d0274 ("ui/cocoa: Let the platform toggle fullscreen") Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Message-ID: <20240323-fixes-v2-2-18651a2b0394@daynix.com> Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 17e125d66d..3efa8ac1a9 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1408,6 +1408,7 @@ - (void)zoomToFit:(id) sender [[cocoaView window] setStyleMask:styleMask]; [sender setState:styleMask & NSWindowStyleMaskResizable ? NSControlStateValueOn : NSControlStateValueOff]; + [cocoaView resizeWindow]; } - (void)toggleZoomInterpolation:(id) sender From patchwork Tue Mar 26 15:45:04 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: 782617 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1753611wrt; Tue, 26 Mar 2024 08:46:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEjpXpp+xCdfgrJqbh5cc6YY9GMbfwvFpNyTVh372hSlcMKxgQ6vWsyYNaI8aZDlDJ1D8DVxBLyf4nOwkB3eDO X-Google-Smtp-Source: AGHT+IHwqcim1gIu6r1/0wmbm4pZQZgO9iSpepY8BHmH7pCYQf7itDpHinOZIhMVJHzFL1qw1B+D X-Received: by 2002:a05:620a:102a:b0:78a:24f7:418e with SMTP id a10-20020a05620a102a00b0078a24f7418emr10921989qkk.43.1711468014223; Tue, 26 Mar 2024 08:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711468014; cv=none; d=google.com; s=arc-20160816; b=KhHV5zvoKUiCjqbxNazUJCq2uiXLMW9trd5FItbad+2fRVhlYEcxmpdhUpE8QaieAr UEsdXSDCiphIWiT67+h+7/b79WretE6KNiK8RO0LNQhgXw4kvEeinrqAZC19O0EXDLld zx+7z9Bmeuf0a6OB7UpoJhNYYkbF0BRjvceJjeuAIURQvJf8NGwQ39Fi7pz1uLfdzmIO 1nTMsn8fgjvyAgqTasisoGmT3RPlDUMPELSaKD8Yn8JReQ/hgRtTHAPCS1MY7ZmiLQbb q7lJ+k9P9dQA3S7UfVuC+XlaAgyaBzw1oRfrk1m2rOVf/tnsGPHFhYNNT0CVYlGeMhSf zThw== 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=usUN06CXz0bBKoHDMc3RGiloPrjkbc783kJkw+v3z/k=; fh=8fwwG4jf5s+vp2LxKfvGZcFOYvMbRyHUPH92VDUPV1M=; b=FaeYKny8mobbHyTRIG9fqp0V++XVu5fHU07LhypZg5wG0iL/ifAPNmz1Z+l24aXaMy AmLllpCpwC23bg/jPWWqflBzhQEBeiwprBWiuTFuWa6KWLZ4an3Kza+jIQzoItmLTk3C ELyPQKykgV6ngnB54vHBwh/1J2/FNRNK5qiIIQIdgYej9uDxs9MTlWjxPC1sLgstIsge asW9b135TZucEtSPwMzs/7p5DEhnUlbQkPa4JCogXFlfCQDz850Qxx31pWwh+oVr0U9e 9ogWmM9jRPRNLeFcLDTgKzE2e+VWe5NfL3iczOsVAdGuQ2xnqOqHegNGEgdqSXxewzh1 4QfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zL+i41wI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b13-20020a05620a04ed00b00789e887c788si7514241qkh.772.2024.03.26.08.46.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2024 08:46:54 -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=zL+i41wI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp90O-00050Q-Qq; Tue, 26 Mar 2024 11:46:28 -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 1rp90M-0004tu-GK for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:26 -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 1rp90K-0001Lj-O9 for qemu-devel@nongnu.org; Tue, 26 Mar 2024 11:46:26 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-341c7c8adf3so2025540f8f.0 for ; Tue, 26 Mar 2024 08:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467983; x=1712072783; 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=usUN06CXz0bBKoHDMc3RGiloPrjkbc783kJkw+v3z/k=; b=zL+i41wI2OQLyaW+F97VcEN78Tgz7Y7XJyWGQzfbgsZ9BBWGOSpDMH2++dJiFt+9Pq 533oQhTszL7C8hHLwZhaEUprwHJVHabudjQ/0vgJY6le3GfPnEygtVvoWCf3Lp4EOmKI JbXPEYGmUk+gom7bFL4f5L/lgASqYu0DwQwyvR5UdCx6KffsYr7MNky+qsXNNd3+5kDH py305Y3F4zJBgKg3HjxZeqBREQzpJQqNefSUjoWGqDE1/vjNaEKmTq1a2j9qEECBNQ+D jjyFUZpRg/cHJjf8v/BGPiIbI0+8EmYpn4+biajxt1YCzUyjMzBe8TDiB9PXcwIUBoI5 zMAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467983; x=1712072783; 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=usUN06CXz0bBKoHDMc3RGiloPrjkbc783kJkw+v3z/k=; b=QYgGkYNVB56+kwX6UYrRZuUUbzV/dyzVjvoNyNEKWzTnkGSyFlGfIBRxVdpq6jo3KX 4Ke6LTu59Z/44VmvFpBZKV171DYWN15ZMYMn3caPxEOioWE7m4iyXsrIFfn3QgZTp8+S n49ifKqYJjbB7/Zhh2jeVsRH6JR8qoa54Z/cv/z2/ImTkzgwTno56L9XwRN/jqGIYf+4 YKuC6oMbm5d8sQpcXwL8oCy+T4ZKHBuRxz/lqDo4BMsDfcMprEOu/8R1yrAxoDBNEEEs WQl1Cvaa7net5n5V+tck/Mjr5bSui2qLIuBWahLqpi8PO/rrN84nBhCwEfZX+g4vgsaB C2UQ== X-Gm-Message-State: AOJu0YwBf6H0yVA5cdEMZApFhkuqd8bdHSsHrH6OMKm8q+FAMjVwVPx7 8/zQ9yYIg3qohDxtM6s65UqHzDeoY8rfBjLiN7eC68D8uoJiN1TNf+KbGQ+TuGRMLwXLZfHZ736 r X-Received: by 2002:a05:6000:2c1:b0:341:b836:6318 with SMTP id o1-20020a05600002c100b00341b8366318mr45533wry.11.1711467982753; Tue, 26 Mar 2024 08:46:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id dk9-20020a0560000b4900b00341cb3489b7sm6710357wrb.71.2024.03.26.08.46.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:46:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PULL 13/13] ui/cocoa: Use NSTrackingInVisibleRect Date: Tue, 26 Mar 2024 16:45:04 +0100 Message-ID: <20240326154505.8300-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-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=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: Akihiko Odaki I observed [NSTrackingArea rect] becomes de-synchronized with the view frame with some unknown condition, and fails to track mouse movement on some area of the view. Specify NSTrackingInVisibleRect option to let Cocoa automatically update NSTrackingArea, which also saves code for synchronization. Fixes: 91aa508d0274 ("ui/cocoa: Let the platform toggle fullscreen") Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Message-ID: <20240323-fixes-v2-3-18651a2b0394@daynix.com> Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 3efa8ac1a9..25e0db9dd0 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -307,7 +307,6 @@ static void handleAnyDeviceErrors(Error * err) */ @interface QemuCocoaView : NSView { - NSTrackingArea *trackingArea; QEMUScreen screen; pixman_image_t *pixman_image; BOOL isMouseGrabbed; @@ -359,6 +358,19 @@ - (id)initWithFrame:(NSRect)frameRect self = [super initWithFrame:frameRect]; if (self) { + NSTrackingAreaOptions options = NSTrackingActiveInKeyWindow | + NSTrackingMouseEnteredAndExited | + NSTrackingMouseMoved | + NSTrackingInVisibleRect; + + NSTrackingArea *trackingArea = + [[NSTrackingArea alloc] initWithRect:CGRectZero + options:options + owner:self + userInfo:nil]; + + [self addTrackingArea:trackingArea]; + [trackingArea release]; screen.width = frameRect.size.width; screen.height = frameRect.size.height; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0 @@ -389,41 +401,9 @@ - (BOOL) isOpaque return YES; } -- (void) removeTrackingRect -{ - if (trackingArea) { - [self removeTrackingArea:trackingArea]; - [trackingArea release]; - trackingArea = nil; - } -} - -- (void) frameUpdated -{ - [self removeTrackingRect]; - - if ([self window]) { - NSTrackingAreaOptions options = NSTrackingActiveInKeyWindow | - NSTrackingMouseEnteredAndExited | - NSTrackingMouseMoved; - trackingArea = [[NSTrackingArea alloc] initWithRect:[self frame] - options:options - owner:self - userInfo:nil]; - [self addTrackingArea:trackingArea]; - [self updateUIInfo]; - } -} - - (void) viewDidMoveToWindow { [self resizeWindow]; - [self frameUpdated]; -} - -- (void) viewWillMoveToWindow:(NSWindow *)newWindow -{ - [self removeTrackingRect]; } - (void) selectConsoleLocked:(unsigned int)index @@ -1314,7 +1294,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification - (void)windowDidResize:(NSNotification *)notification { [cocoaView updateBounds]; - [cocoaView frameUpdated]; + [cocoaView updateUIInfo]; } /* Called when the user clicks on a window's close button */