Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4481252rdb; Fri, 15 Sep 2023 03:46:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOvrONyQA/MHLVwTE+CvcDW/Hl+ge4v1179q73BF7GK3RVQBstacXJw5YkFBkHJKZhkYQs X-Received: by 2002:a05:6808:2a81:b0:3a7:ae8:79d9 with SMTP id fc1-20020a0568082a8100b003a70ae879d9mr1186769oib.43.1694774814261; Fri, 15 Sep 2023 03:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694774814; cv=none; d=google.com; s=arc-20160816; b=Tb5FpqP/2AAFD5AvE7ZRm9RBob/nj93sFC8vxrURYOro2StQfLsbqn3HYIFGK90ngr 9sd1A2kBL+7DXdRpMTffcj+ogDxN9m2G8HTTh44Y084RvNd6xQPSOey1sCAbbM3K3+aa mCcPvot2v0MbaqUm4qRSPtGTBNAszDp1MEo5E+I9/vPGfHDWFi8GkTaDPO7zrn4lALjF t9jekJrjg0GoJ3Z4+Rf+henHV2Id+gtokDdQpCn32RzyxrVH5CizM650uaN8CoZprkMG RmdmYb5Y3wJiNpmm6qMTpfsHTZsc8W7sWrM1seJeow/kHKdgjB0oGjP86Xb9r2vBvA2v bevQ== 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=g1zuvJ7RRCqy9MSyULz3DiU3qO3y4/pQtJW6GP4mEKM=; fh=pwW/kBpWPTpFGx0XLXXHZT8LdkVOwoXBrHL4vdFYTgE=; b=uopwgf/QN6c2TYrbc8elsb2iqvwuECRJQ2/MCDzC0hqi5vwOoTqmHqTvjgRT96rAhA pXjgxksVTWFqGa0Uw8tYEd4urwtsAytRmXBc2z44gdsweDGbSza128MJTxQWVisoNF49 sQHIWcJ0qCZQ0hAUQHuMa/zeT9OaWXX63NieiYd44mOw5Zaowv8dwVDUHAcVI7eVEbTv YojdggOiADMJEXluGBGykfi6ht3rzhNNgEivZnmZkIvD585ugx6yuUKxF9UME0yzgB4a PFgAmBndtU+NTseCjbfBcz/jIyqqZd0+Zd0LFvJUZGp/tIzyCzwn2kq+Nv5LWm6bFWUl sdDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hNEqoUQO; 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 cr10-20020a056a000f0a00b0068fb75d68dcsi3117399pfb.206.2023.09.15.03.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:46:54 -0700 (PDT) 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=hNEqoUQO; 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 22FDC8381EF0; Thu, 14 Sep 2023 23:24:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbjIOGX5 (ORCPT + 99 others); Fri, 15 Sep 2023 02:23:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjIOGXz (ORCPT ); Fri, 15 Sep 2023 02:23:55 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C4B6270B; Thu, 14 Sep 2023 23:23:50 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-500bbe3ef0eso2141635e87.1; Thu, 14 Sep 2023 23:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694759029; x=1695363829; 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=g1zuvJ7RRCqy9MSyULz3DiU3qO3y4/pQtJW6GP4mEKM=; b=hNEqoUQO/cTfVnBAqJ435MWPucNekQCo7hLibOtNN6t3uywMByiX0hlg093awL6lv7 d0fZH7aZxzNMWL0j3hb2Tcaoex8P1GhymqJ3BSbjvQCDmazK0NtbsZG52W7fHnpeqZ+g hCJPraPNGxRkYqiXkqklDg0MGvIWdVKR/2THGlSJBK6F/RmrPNRWTpc6lJXtJ/lcRxN0 4x+f1Uheh3cY5/ASavdQz89nrKpR6owZ6WZNfU3l+jv+yvnaxs9jilDNLWTbqPFwy3Gk pcIwuOWDLbDufm2D8JYDN/z3xC1nYOoFkcLcbFjMKqj48PmIJ+AKtWhW4SPQarNDZGUg 8qPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694759029; x=1695363829; 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=g1zuvJ7RRCqy9MSyULz3DiU3qO3y4/pQtJW6GP4mEKM=; b=v1ZFMLuhljvYHmsC8zO80hcCwa/xgb84uYwI1CeFZaAxaFIC/W0XkDOEzE440yuC4K 3UpySiW9s56EBq3BoRAk6dSVQq4WjNC+tOhXRPrY+IR7GtfMpp8Q4jC3MID+01XLp8KI K5+NWURitc6WgeIukpK5t2CQS+TPMm1WjDB9pe0Bq+k6nAaT+Cskk/cTxxTUZMC37rdi GNN0Uvle2YJuVXKYub2tUWLJsqWUz61QnqdpumP/cXa99Kv8fD8e5ISBHUO3F5WdDfhY x5PuKXeDPTlBDUsRucjk4XyiafuE98y6tMV1mF45f8rKR8YBJ2IYU6mCzjzQ4LkLPMIi 4+/w== X-Gm-Message-State: AOJu0YzLkqgyT8uzZFsmYSoxbjGEwNpus88nwnRn93dZ7x++IwYt0x16 5fFOcqDMjZaaQ6FJB1VHrFypynnRcIqGblAuNJs= X-Received: by 2002:a05:6512:1095:b0:502:d973:3206 with SMTP id j21-20020a056512109500b00502d9733206mr1476766lfg.6.1694759028702; Thu, 14 Sep 2023 23:23:48 -0700 (PDT) MIME-Version: 1.0 References: <64e0637cd6f22dd7557ed44bd2242001e7830d1c.1694421911.git.haibo1.xu@intel.com> <20230914-ee133dd5e804282ce28833d6@orel> <20230914-reflector-preshow-786425ad7ae2@wendy> <20230914-2232dea1c6d03fb5985755e6@orel> In-Reply-To: <20230914-2232dea1c6d03fb5985755e6@orel> From: Haibo Xu Date: Fri, 15 Sep 2023 14:23:37 +0800 Message-ID: Subject: Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test To: Andrew Jones Cc: Conor Dooley , 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 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]); Thu, 14 Sep 2023 23:24:08 -0700 (PDT) On Thu, Sep 14, 2023 at 6:15=E2=80=AFPM Andrew Jones wrote: > > On Thu, Sep 14, 2023 at 10:52:15AM +0100, Conor Dooley wrote: > > On Thu, Sep 14, 2023 at 11:36:01AM +0200, Andrew Jones wrote: > > > > +static inline void cpu_relax(void) > > > > +{ > > > > +#ifdef __riscv_zihintpause > > > > + asm volatile("pause" ::: "memory"); > > > > +#else > > > > + /* Encoding of the pause instruction */ > > > > + asm volatile(".4byte 0x100000F" ::: "memory"); > > > > +#endif > > > > +} > > > > > > cpu_relax() should go to include/riscv/processor.h > > > > Can the one from asm/vdso/processor.h be reused, or are there special > > considerations preventing that? > > We'd need to copy it into tools/arch/riscv/include/asm, but it could be > done. Hmm, now that I look at it, I see we're missing the barrier() call > in this kvm selftests version. > Will reuse the one from asm/vdso/processor.h and copy it to tools/arch/riscv/include/asm. > Thanks, > drew