Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3838597rdb; Thu, 14 Sep 2023 04:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5zBuxg3PBARvdwpid4KfKDbDHqxEGg5ZnwKswJHccZ8Lds5PP+CSQVRNRw5odimdfjyoe X-Received: by 2002:a05:6a21:7988:b0:157:609f:6057 with SMTP id bh8-20020a056a21798800b00157609f6057mr4382199pzc.27.1694690960799; Thu, 14 Sep 2023 04:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694690960; cv=none; d=google.com; s=arc-20160816; b=RTJ75x6D/u1/GZLbDE9yAZOcoyThGkxhNiEbDSyILUfQ9W2k3W6XScMcSOQ96gd13r s6n8WXFsQpfazytZPJ/cOSxBLZa4K2AX+8lyVn06pSC10T39YeRMLpMqAn3ihwHZN1k1 NvZPMZ24jKD7wVGdTcvNsbiaEFfDTrzC5I1hlIZpvJsgbb+HZSuVHBz6J07zlTYWv0q1 JG3nOBJVFUSfPM60ediFXNH1wvrTI9rpodyd4JT2oCvcFWnOC71jalTHOD1r20bwJg45 LNgHibK2YkQdalUC0rU1GxRHRyVAcdpEv5zZhpHmewF2ciDjOqEGeZ9bV7EJBIp8lG3P 3ghw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FRr1rkGuTrUN4Y1UZo1LPGic4r7SXTmbnAZytMBynRY=; fh=JFzBABtNOBO5URvP+kolz/kiMUfXBvmP+E5E/hbjSXw=; b=IRbZz/gQPn0ZStaDFs1AoGuhQ+aADFUO56Wiyx9FztCDOhqHAy7sPKsS4l1l3fbvQf D7Za3BCBPvOXqLC4AC3tx2XnS4jYZ2K/j3LDskZvs8EH842EErrnw6qz+aRVHpchhbfE zT4kCH0JjAcCkaBuOVHJ+/jdqSceul2I2R6Y6XMLkpjtk9jOeWydSfkZxbei8UJYHVEL MjkZmlyVjt9ojCB3Y6GpRGGGzX7FQoid4CWnUJ6AATWKjT3T8XIPAgKwrVmFyNy+OrcO AdKLxZdalZ7zXnSyQ1AeQpjK58zlxrG7tDojyCbQbpeOaQ2Tz0Sc6kKXzi+l8UmSR7p/ h+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="R0P/bDFG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l19-20020a656813000000b0056b0b30d05csi1359390pgt.245.2023.09.14.04.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 04:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="R0P/bDFG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EC90C82E6C22; Thu, 14 Sep 2023 01:14:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236253AbjINIOO (ORCPT + 99 others); Thu, 14 Sep 2023 04:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235969AbjINION (ORCPT ); Thu, 14 Sep 2023 04:14:13 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDFA41BE6 for ; Thu, 14 Sep 2023 01:14:08 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-404573e6c8fso3589115e9.1 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=sZI/xq/Xo89H80DiuNA11PM4kP6aCSF81LO6jW2ZiKhykdNO7nWFjzYjLTgh27FNWi WcJQCXoLtHVsKpXCULsSSHLyUk+KOpB9teNgtUVOQFwnaPbLERiPYHbxciue1PI8H0/H EJybs0noEQqmm4ScwtBsoWpdYslp2NQ2g+YqHPOTYrugbik4EPjhKj5/8xJvF/418v9n 4XqgZW6GqdJkMpAByLMD+2KqAawMkcruScBo6G/mpESASvH0oMhk49jvwB9Q1+xMlEw1 JmtojsaYA5LLrITBk4zdWJw4ZiK7ju9oXZ2pqHvgJ7RDKADLEkEDc+kapuhBRCYBmZwW cfsw== X-Gm-Message-State: AOJu0YwLa+CSJd0P08DJIet2Zm+hg95BUlCOArlqcyOz6my75Jp5Gnz7 ycr5qcD+x0EhqGGg9pZBxMarXw== 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: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 01:14:17 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 pete.vger.email 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