Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4442087rdb; Fri, 15 Sep 2023 02:13:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/6vdvkcWVNYZWZQHsNXe894rpVhe0moEpb19EElKNXAUKBJXn1BLhjGxNVgT6ZqlOVwxW X-Received: by 2002:a05:6808:20a7:b0:3a4:ccf:6a63 with SMTP id s39-20020a05680820a700b003a40ccf6a63mr1520669oiw.55.1694769196616; Fri, 15 Sep 2023 02:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694769196; cv=none; d=google.com; s=arc-20160816; b=QDIgGyWtYAE81a4YBHQhrQbEHZnLILJ9Q11EEEKqp2evhKg/97g/ThN3GLzBJXd0Ok 0dJO1ckuQgLk3jX6t5VamEacSqU69zJoVjXnZ5IKQFnbMdNtGLiTxlM/qbVcupVUhPwG FpDK/+Pog9cYANESSmjCwp2Ph1wEMNpw/yhNQo7izaiE5De25TSnBEWIZB3pwl86sxj4 yXPALnt3l4znKH8v3xLfrLAF9qZ6dMOIGw9/SlBtAmhMxVu5LWQ1BmHTTj+wOAW6inpM 6vrpsZv+nzjCYzemymR2hGF+J7DHSme41KoyvY5GfTpD4eStuwQC08sdliEIK//E3wzz M8mg== 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=KrUex7tZYzG80r+HRntdlogt24bgAFnmLNhpPfiHTo4=; fh=gnTlXEhos692EhR81csmtZ75tauGWqGiM69Hvw+K//4=; b=PdGOw2S/5sLCuQpd873EjwXq2CzUSfKkuikT41iyexuRN7AhTXB6wUcQgGBexK5F5J lZRwb8i3rslVoXZWvTKyoM9DJMwBVB8xCxGE5WHOrxbzSGI3qOIzLbm9B4cz9qtu8kH+ c6rpN+ZL/Ikvv7ROXqEsdHaUixhUEC0yPhK5t0vmckOCtBiDXh7Nif+5KUYylxf/UFo8 oxea9ajevqmPZF9tGzh9jhOiGqys5wIdyiQXvMvQ/hDrc0rLmN5Mog97dd5FBGmCH3n8 6dsVpwJfrQlFTM2q+X8fFnRT0ytD6ZsWeebRrksRslIJmHYRB9gYTQKSN1Fn5NbMn5N5 nftw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Unyzodh+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h19-20020a056a001a5300b0064f78c32b89si3155567pfv.95.2023.09.15.02.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Unyzodh+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id EE7B982CED1D; Thu, 14 Sep 2023 23:09:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbjIOGJB (ORCPT + 99 others); Fri, 15 Sep 2023 02:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjIOGI7 (ORCPT ); Fri, 15 Sep 2023 02:08:59 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D72F91BC7; Thu, 14 Sep 2023 23:08:54 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50078eba7afso2936234e87.0; Thu, 14 Sep 2023 23:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694758133; x=1695362933; 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=KrUex7tZYzG80r+HRntdlogt24bgAFnmLNhpPfiHTo4=; b=Unyzodh+Pw35y6mdd0t9yAD4XH1/g7WqElhS945/VaFAWZH1gCSyyOg1U9m7soCC+a MfkbezDrVEiVT+iZ2ygB7vdgM0qFqCvN6qkkisdeX2XIaC7Uf/NLm2eAQBsc6HLdNLg0 O7WZCx2bAUpQJhX+hZjCEjEiBmSAL+EmIGQ58CGuTgMHdX2Ys7Q41I53TVYpLxQyP4vy 1+FsVAiYR5HJYOnIq1cGBI3VZEJsZ+dPBqahuGUWPZDPeesyMfNd5X7IPWUGGU1/6emH sMLdap/msG/QuOgpJBsQQtzc/jTZlgNhF/XKU6EhylvboIkkpsq0Yl1tME9T4/1LiaK/ VmlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694758133; x=1695362933; 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=KrUex7tZYzG80r+HRntdlogt24bgAFnmLNhpPfiHTo4=; b=Q3KzqFxdo68FeudCFEN9vl79Y1IdQCCxVQTSgNROMffBSm7SiZq1knOOo+lEa1NgdZ S4j3ofLRCU4ght+XegGWOHH4Amjm+NEG77m/hlVYG58vFKamityT1neNbL1JzcF8RnVS GFgmtRNg2C0XgEKSjsqAQewmUySARlgy7xZdTMOnz2eyJTfNDWed4U602+ZMCxvSpMYe yg7wg+omwC7VFFHIPjv0+XN8c1MBFe/Oy/Hsy0U65wirsZIXvwplQGKjpVGVnRRJnfT2 nca0ESlp/mU/GijcMIlfXHvi9CvjsTx0R6SrtvEDJnjgji1jYigY0D6hiCJp9hstfqV0 taaw== X-Gm-Message-State: AOJu0YySNUBXGjQvYs+Cox9necwdAQ+OWAfAS8JP+rYjbp8liSKqpuHh 9jMHiVOFl6yRBL30Hotk9vsdM36ujbUmiR0n+0E= X-Received: by 2002:a05:6512:3096:b0:500:9969:60bf with SMTP id z22-20020a056512309600b00500996960bfmr655736lfd.68.1694758132725; Thu, 14 Sep 2023 23:08:52 -0700 (PDT) MIME-Version: 1.0 References: <119c9d06d64b7e4932c5f74a05af1e769cbe7da6.1694421911.git.haibo1.xu@intel.com> <20230914-90a562a03985a9a97afd953a@orel> In-Reply-To: <20230914-90a562a03985a9a97afd953a@orel> From: Haibo Xu Date: Fri, 15 Sep 2023 14:08:41 +0800 Message-ID: Subject: Re: [PATCH v3 4/9] tools: riscv: Add header file csr.h 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 , Vipin Sharma , David Matlack , Thomas Huth , Aaron Lewis , Colton Lewis , 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 14 Sep 2023 23:09:12 -0700 (PDT) On Thu, Sep 14, 2023 at 4:14=E2=80=AFPM Andrew Jones wrote: > > On Thu, Sep 14, 2023 at 09:36:58AM +0800, Haibo Xu wrote: > > Borrow the csr definitions and operations from kernel's > > arch/riscv/include/asm/csr.h to tools/ for riscv. Since > > only 64bit was supported for RISC-V KVM selftests, add > > CONFIG_64BIT definition in kvm/Makefile to ensure only > > 64bit registers were available in csr.h. > > > > Suggested-by: Andrew Jones > > Signed-off-by: Haibo Xu > > Reviewed-by: Andrew Jones > > --- > > tools/arch/riscv/include/asm/csr.h | 521 +++++++++++++++++++++++++++ > > tools/testing/selftests/kvm/Makefile | 3 + > > 2 files changed, 524 insertions(+) > > create mode 100644 tools/arch/riscv/include/asm/csr.h > > > > diff --git a/tools/arch/riscv/include/asm/csr.h b/tools/arch/riscv/incl= ude/asm/csr.h > > new file mode 100644 > > index 000000000000..4e86c82aacbd > > --- /dev/null > > +++ b/tools/arch/riscv/include/asm/csr.h > ... > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selft= ests/kvm/Makefile > > index 0102a0297b84..89ecee2fdb73 100644 > > --- a/tools/testing/selftests/kvm/Makefile > > +++ b/tools/testing/selftests/kvm/Makefile > > @@ -222,6 +222,9 @@ CFLAGS +=3D -Wall -Wstrict-prototypes -Wuninitializ= ed -O2 -g -std=3Dgnu99 \ > > ifeq ($(ARCH),s390) > > CFLAGS +=3D -march=3Dz10 > > endif > > +ifeq ($(ARCH),riscv) > > + CFLAGS +=3D -DCONFIG_64BIT > > +endif > > This should be a separate patch, since the "import csr.h to tools" should > be completely separate from anything else. Also, all architectures that > KVM selftests supports are 64-bit, so, as another completely separate > patch, I think we should just add CONFIG_64BIT to CFLAGS for all builds, > especially since there's a chance some of the includes the other > architectures are using may need it. Of course we'll need sign-off and > testing from the other arch maintainers. > Sure. Will fix it in V4. Thanks, Haibo > Thanks, > drew