From patchwork Tue Dec 12 09:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 177195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7603084vqy; Tue, 12 Dec 2023 01:21:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHl6SRT2c1gjg7UhFituZB5m4A2Z2Ms3bnSfdkvVVZh8sDI60KTTLBO9LTAvud4aIDinDTL X-Received: by 2002:a17:90b:1904:b0:286:6cc0:b91e with SMTP id mp4-20020a17090b190400b002866cc0b91emr2154351pjb.85.1702372875860; Tue, 12 Dec 2023 01:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702372875; cv=none; d=google.com; s=arc-20160816; b=B4JEy5VVr0AyYnUhoCIOBEjaYIs6XdUAJJeX+QKSAOZoS5JgSDZd4ieZNAalETQBeZ WWtubxb5VF20MnNtyRqZlAnPvf3yMKSbFL0Tk157gnY4PP2cOlg7gwu6jjw963xq6VI2 X5Q4ECntPIEColHn8dMKUD2rqkyDnZjGYCt3d8whARHp1V+/b8/IAlXTkxEGd8X46bu+ Ua2nP/FAytvj9otSvSNVsiLepOXhmUKEHvYAZT2RpD77h5WGgmQma1k6emxCIUki7ynI E7QVJVwFxd+mgTsDxTWtoUQjnCHq+MQ4sEob47ChjlYE5wMit47TPVd7aJvtNcrexlC/ 7ofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=vmZYbwnuKJy16bN5rjgdQm9l4q3HJb51gCUJLQRDvWI=; fh=Fw2SD0YFzpPQvMy0BhRwE5KtkQNZKe76WZgAOeqC42Y=; b=Xq4AZxvBl+4dF2D0D9fFZAGOKmoy6WubcKgF7vkXu8sqa7pYj1+kqMihYt8b6iS0pb v9NteDuYFfBNDdIVpAvEXmMGCJYybX3lcWUZlSJAU/+/N8ApQml2eZKtWfwkKBo5eShp XyEe7eI4Hce0blKV1OV4a+NrLi9FwLwwX5pYkZw69pAjJm/ntrJihVTiTw6ukkBRfMej uKLl7sU15ghC/n/lO3CEqePJ53rNASm5cf5MIjG5C8OuvzHy/NTUnUfPNFi67VbyvSiO KjbG6JkR6n+x3Sxfiz4c66f0MQc9DRXzT01AFtvPx+sKPKMls3FwE9nyJUkZVTLURNOZ LzBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=O0O4Qvy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n7-20020a17090a73c700b00278eb61c0ebsi8810126pjk.118.2023.12.12.01.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 01:21:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=O0O4Qvy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9BCBE80ABB3E; Tue, 12 Dec 2023 01:21:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346300AbjLLJUw (ORCPT + 99 others); Tue, 12 Dec 2023 04:20:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346399AbjLLJUk (ORCPT ); Tue, 12 Dec 2023 04:20:40 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EFB11F; Tue, 12 Dec 2023 01:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702372844; x=1733908844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bCbMxYqsNc6ysevtODH1LdEzA9cmGSP1KVajSHQPjJU=; b=O0O4Qvy55ltuH81dmJRHwdGmihtcQp/Ng3l++Uawa1rpksLfyYAkXxj9 EgAb9RoJnl5GVu+84A7tA0p3BmdamG6b4Hs+JOO5ANjRXU5AUNjygSTVh UzT9GNB02HEnNYCl42R2IEfWrKoofeCSnklq9WXhO/bfBz2IGPmBieF0x aclSL7wtjxGhXC+bW1s8+IEI/Jb1hOaUembStnIVomlkQv19byO8FV6JU H6YpW32UcFwzWa88kjmZT+EptnYxtJ3+kp/YLHxG8X3zz94Azh2uRUAms z/2EkubTxYr/1grp1Ijzw33I528wht2+OUcfN3xN/X7Xi4/wNTxVjvJiB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="480974352" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="480974352" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 01:20:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="917213171" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="917213171" Received: from haibo-optiplex-7090.sh.intel.com ([10.239.159.132]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 01:20:36 -0800 From: Haibo Xu Cc: xiaobo55x@gmail.com, haibo1.xu@intel.com, ajones@ventanamicro.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 , Guo Ren , Mayuresh Chitale , Daniel Henrique Barboza , wchen , Conor Dooley , Minda Chen , Heiko Stuebner , Jisheng Zhang , Samuel Holland , Sean Christopherson , Like Xu , Peter Xu , Vipin Sharma , Aaron Lewis , Maciej Wieczor-Retman , 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 Subject: [PATCH v4 06/11] KVM: riscv: selftests: Switch to use macro from csr.h Date: Tue, 12 Dec 2023 17:31:15 +0800 Message-Id: <5f5f837cd052587f1d49f81a2c4dc58a5330fe47.1702371136.git.haibo1.xu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 lipwig.vger.email To: unlisted-recipients:; (no To-header on input) 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 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 01:21:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785067341070004134 X-GMAIL-MSGID: 1785067341070004134 Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/include/riscv/processor.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/kvm/include/riscv/processor.h b/tools/testing/selftests/kvm/include/riscv/processor.h index 5b62a3d2aa9b..6f9e1e5e466d 100644 --- a/tools/testing/selftests/kvm/include/riscv/processor.h +++ b/tools/testing/selftests/kvm/include/riscv/processor.h @@ -7,8 +7,9 @@ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H -#include "kvm_util.h" #include +#include +#include "kvm_util.h" static inline uint64_t __kvm_reg_id(uint64_t type, uint64_t idx, uint64_t size) @@ -95,13 +96,6 @@ static inline uint64_t __kvm_reg_id(uint64_t type, uint64_t idx, #define PGTBL_PAGE_SIZE PGTBL_L0_BLOCK_SIZE #define PGTBL_PAGE_SIZE_SHIFT PGTBL_L0_BLOCK_SHIFT -#define SATP_PPN _AC(0x00000FFFFFFFFFFF, UL) -#define SATP_MODE_39 _AC(0x8000000000000000, UL) -#define SATP_MODE_48 _AC(0x9000000000000000, UL) -#define SATP_ASID_BITS 16 -#define SATP_ASID_SHIFT 44 -#define SATP_ASID_MASK _AC(0xFFFF, UL) - #define SBI_EXT_EXPERIMENTAL_START 0x08000000 #define SBI_EXT_EXPERIMENTAL_END 0x08FFFFFF