From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F0B2EDE98F for ; Thu, 14 Sep 2023 08:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236241AbjINIOO (ORCPT ); Thu, 14 Sep 2023 04:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235932AbjINION (ORCPT ); Thu, 14 Sep 2023 04:14:13 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB281CD8 for ; Thu, 14 Sep 2023 01:14:08 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3ff1c397405so7108685e9.3 for ; Thu, 14 Sep 2023 01:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1694679247; x=1695284047; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FRr1rkGuTrUN4Y1UZo1LPGic4r7SXTmbnAZytMBynRY=; b=R0P/bDFGGU00HRZZch80NPWNzldugmJJtHADPZkt7XB6/3lvoFKveuUIKJXhR3rLCg /MQ5amxjdeElvJQZgXZxdC6QmumIWEUvic5xQAGQJ2O/Njy8bche5sAFin8M03KQ5q3f SJcVXj4sOooBoqj1ebGKqdeKlw88EIwCZ5npkZOW3Dsu7QKVRQY0fdXELQABCn5X1jKp W9ONx5zCpO1ZuzCykDkZPxbywZI9MEgvy/utEK4uwGDNNW41JlvK+ghIQelw8Wul9et9 YVRjrmj0Neqz5baQMuoiIe4kgUO+/iezAjR8kYwrvQe4lrjLBiIqgIg/OfFlfUNHuOUZ d8iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694679247; x=1695284047; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FRr1rkGuTrUN4Y1UZo1LPGic4r7SXTmbnAZytMBynRY=; b=aoXF96V7zB+94nZepeoRP0Yo7n1QXKkiozTUoWeGOMsjr2eT6vqc674GXO7kt09Qr9 ohQZz8F3Rdw2Djx0ZlOBq/AeGidniFKzZ0Nn+7RP+TSyQsn0a5RfJOViamkVqssonkJb abDK/TG24WyVO4uC2Diu7VtZOoqesmUhQsms/YEKzXrahN//crf+DRBNRXTYG7x0K4rB qvU8Pv2ngh3RF5V/lJdUIqyyXdGSHEkSiGqN18FPqTGEt43QZfFyKT2Vtot1iaCAVy3v N69z9pVBST6QFY1LSu2kvsIrWrHOwW/5k1o/q2wcDMwP5r/lBOQ+30lSvLuwu4XDXrU+ YgjQ== X-Gm-Message-State: AOJu0Yzcf+ptE/40DafbjJBG6uVKtFioThDFEVClUk/CbfsMf74rkhqm E9K61i1t7Yl97FNEuFko2I8kCg== X-Google-Smtp-Source: AGHT+IGh6/pw8AhCYNH7FiOWterqGvoWGNUkgu/EnsrVKnj5h5ttR15SiMKATB3tNhotsC22ECVYdA== X-Received: by 2002:a05:600c:cc:b0:3fe:1db2:5179 with SMTP id u12-20020a05600c00cc00b003fe1db25179mr3955293wmm.19.1694679247084; Thu, 14 Sep 2023 01:14:07 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id p6-20020a7bcc86000000b003fbdbd0a7desm4074945wma.27.2023.09.14.01.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 01:14:06 -0700 (PDT) Date: Thu, 14 Sep 2023 10:14:05 +0200 From: Andrew Jones To: Haibo Xu Cc: xiaobo55x@gmail.com, 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 Subject: Re: [PATCH v3 4/9] tools: riscv: Add header file csr.h Message-ID: <20230914-90a562a03985a9a97afd953a@orel> References: <119c9d06d64b7e4932c5f74a05af1e769cbe7da6.1694421911.git.haibo1.xu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <119c9d06d64b7e4932c5f74a05af1e769cbe7da6.1694421911.git.haibo1.xu@intel.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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/include/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/selftests/kvm/Makefile > index 0102a0297b84..89ecee2fdb73 100644 > --- a/tools/testing/selftests/kvm/Makefile > +++ b/tools/testing/selftests/kvm/Makefile > @@ -222,6 +222,9 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ > ifeq ($(ARCH),s390) > CFLAGS += -march=z10 > endif > +ifeq ($(ARCH),riscv) > + CFLAGS += -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. Thanks, drew