Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2457816rdb; Sun, 3 Dec 2023 18:42:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZxMotlWymNT2pnutGOa8KXgIs6dztCN9AmxotkZzQqJBUB1PAJxiwDTZMuRnjVnCe22pN X-Received: by 2002:a05:6a00:4193:b0:6ce:4055:511b with SMTP id ca19-20020a056a00419300b006ce4055511bmr3031060pfb.30.1701657768524; Sun, 03 Dec 2023 18:42:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701657768; cv=none; d=google.com; s=arc-20160816; b=OEO27SSRbmCsjoQWVnLIQXYAmTHJ7811ckU13mMtDgiNzp2SAJCnwRP/FogsE8frkl V2qNEONk+8Wlan1uFUY+jAx6GwJDlhAY3oKhMQwl6lk5ogVdLBNpD49DEo5+wnShlen+ 5sp2LtFcsB4rSAUUMQV+ON+xhmVm1SvA+yZYhSKga4sPPP/MHJCEW7DB9B0x62iMz4Go I038hkQD65CyGaO474WMAodb8pAOm1IMZ510PgZW+alkHNQld3jaQaVQ76BxMhdOLGxN kJNXZKfjw3E5YeAaEsSUOItrUZewEvSAJyvnNjINYigS26J4p2jiSwC/LilPVWzJp4HS +KMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=SEUh6K5iutasnoMeRQbvniZJyhB8EqO9DGWeSRBdHG8=; fh=i9kO9nGU8XAXSktHUrF/mydeOqZ9IGD0urJtC1NEWH4=; b=HYuBqByhqcMxkQnF10hmEHCOYRx7mJOQ5svJLR/Fc0aU/bxcgrVDhLenACJbA5PJJp y4nlV5zBktvrOTqjIqUraPn3sl07xFMMsa5Mht7MqS6xIHweeTxa1c3KkNwQZ3UWilZp AJ4OqhD9S31UbCl0D0nZK46cW3KKYZsbvafRBr1OSQnPI5xjeZLXwRv5CVtWLOWOTAIk z1Xa+7O2mqcIAdACYxzi3+wYPS0aTV8+gezEjRHzeHJuxAd1DPwUXT2FriP2gh04quZE SjeyeL2nfmi0hw/Xy9ivNHzscju+HrZc3GYHHX1RZyQOm0An6bc/anRBMJB8EqlYTeqo Pa9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U2OuZqmu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y16-20020aa78550000000b006ce5732bd23si337454pfn.368.2023.12.03.18.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 18:42:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U2OuZqmu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0E9308078296; Sun, 3 Dec 2023 18:42:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234330AbjLDCmd (ORCPT + 99 others); Sun, 3 Dec 2023 21:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjLDCmc (ORCPT ); Sun, 3 Dec 2023 21:42:32 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A656D9; Sun, 3 Dec 2023 18:42:38 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ca03103155so4974391fa.0; Sun, 03 Dec 2023 18:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701657756; x=1702262556; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SEUh6K5iutasnoMeRQbvniZJyhB8EqO9DGWeSRBdHG8=; b=U2OuZqmucqFts8pAMt/wdD4lmr34uN6jJ/2bh2Hb8iYEpve6PK1jjBFcAMnW2jXsW0 s9qMLepYbliqh1PIAorSrtzuxrHMcl8wTU42TkZaBwZMKIKvZG6bUoX2Nsm4huEBBKal kOV79Z5gP7m8T3TSMukeasr+T49wCsxWnRFS7+T38XWk7vivD2NqeRluCPmPEOA/7XXl 8gs75xOLkFR3BA8umg/sUY5wQfANIOAZCgUwA01z6gKkcQh12fnV2NzpfacFv/a3bNmr 4Ofk9fi7NdyeLyYg5BM9J7qyIlDB6S863h0geH75v3xQxjJVYF0M4OarjUVYPio0nvOj g4mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701657756; x=1702262556; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SEUh6K5iutasnoMeRQbvniZJyhB8EqO9DGWeSRBdHG8=; b=WIUeDHzytcpf0c/oZdrX7GeB/I9tDhKNEBoS46Wz/Zwqgw4x1E5WA/So1Wr04JSEDi CNcG+HwMtydMbIfodpOfmBplpQPvBdncVDa08+MqTkR92TNtHnupWc525SytOhdEn74P yASIHfkd+aIh+uL7x8fCe5rlRBAQergP4LQmVhoOZIFPt02vdkJndLx98/5Vx6hUfEfi jWqVkDlGE9sYX7oiTGuzmvOf5mJu4bRnUWl85rbK+P1zRZ9tUqyX6cf/Am4afgV1EsxQ n+Zd4pha3Undmp5tv1yZlwu302tQH7pY7GlLqr306SiOTvqnPxKmL+M0SJ56LlRza4Rs mNHw== X-Gm-Message-State: AOJu0Yz8KemNXAHDqY4CmCvYkm1cpYqbyqyN2QzL+kcPLM5k2c4MGxgN iUcjLfPC6+TZUnClqo7X5k3pYPQ9oTRT7X3dDnY= X-Received: by 2002:a05:6512:ea1:b0:50b:f03c:1eaa with SMTP id bi33-20020a0565120ea100b0050bf03c1eaamr553100lfb.95.1701657756237; Sun, 03 Dec 2023 18:42:36 -0800 (PST) MIME-Version: 1.0 References: <64e0637cd6f22dd7557ed44bd2242001e7830d1c.1694421911.git.haibo1.xu@intel.com> <20230914-d2e594e7d84503ad14036e2d@orel> In-Reply-To: From: Haibo Xu Date: Mon, 4 Dec 2023 10:42:24 +0800 Message-ID: Subject: Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test To: Andrew Jones Cc: Haibo Xu , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Shuah Khan , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Anup Patel , Atish Patra , Sean Christopherson , Ricardo Koller , Vishal Annapurve , Vitaly Kuznetsov , Vipin Sharma , David Matlack , Colton Lewis , Aaron Lewis , Thomas Huth , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 03 Dec 2023 18:42:46 -0800 (PST) On Fri, Sep 15, 2023 at 2:21=E2=80=AFPM Haibo Xu wrot= e: > > On Thu, Sep 14, 2023 at 5:52=E2=80=AFPM Andrew Jones wrote: > > > > On Thu, Sep 14, 2023 at 09:37:03AM +0800, Haibo Xu wrote: > > > Add a KVM selftests to validate the Sstc timer functionality. > > > The test was ported from arm64 arch timer test. > > > > I just tried this test out. Running it over and over again on QEMU I se= e > > it works sometimes, but it frequently fails with the > > GUEST_ASSERT_EQ(config_iter + 1, irq_iter) assert and at least once I > > also saw the __GUEST_ASSERT(xcnt >=3D cmp) assert. > > > > Good catch! > > I can also reproduce this issue and it is a common problem for both > arm64 and riscv because it also happens in a arm64 Qemu VM. > > It seems like a synchronization issue between host and guest shared > variables. Will double check the test code. > > > Thanks, > > drew Hi Andrew, After several rounds of regression testing, some findings: 1. The intermittent failure also happened on ARM64 Qemu VM, and even in the initial arch_timer commit(4959d8650e9f4). 2. it didn't happen on a ARM64 HW(but a different failure occured during stress test) 3. The failure have a close relationship with TIMER_TEST_ERR_MARGIN_US(default 100), and after increasing the macro to 300, the failure couldn't reproduced in 1000 loops stress test in RISC-V Qemu VM So my suggestion is we can expose the TIMER_TEST_ERR_MARGIN_US parameter as an arch_timer test arg parameter and tune it based on a specific test environment. What's your opinion? Regards, Haibo