Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp111827lqp; Sat, 8 Jun 2024 08:13:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4g9/9l7CwWHLNurUFS1kGgWZPimnNyH/XdktYnJGnCYZ6BlrF8SqKsecLevL7XAzhMp4l5CuvDDFqZ6u/iklktMoBzwhLi87bCvptew== X-Google-Smtp-Source: AGHT+IGRrrg9Vd56GM5weqzUxvhPO2Y5XVz3FGSOcQzdS/QQhyHi4fmHVR2e3J1P6f6NkTdsD+C6 X-Received: by 2002:a50:d65a:0:b0:57c:600d:5875 with SMTP id 4fb4d7f45d1cf-57c600d58f7mr2071635a12.24.1717859579184; Sat, 08 Jun 2024 08:12:59 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c626fcf76si1121755a12.523.2024.06.08.08.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 08:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MAG9vALW; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-207086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B96B61F22AEB for ; Sat, 8 Jun 2024 15:12:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D021717966E; Sat, 8 Jun 2024 15:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MAG9vALW" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70BFA56446; Sat, 8 Jun 2024 15:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.16 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717859565; cv=fail; b=u4FbHhp+TEYO4uwQEKweWkg12bvivGyFXXQn6F50i6hQjWfh+NfUvrJQNC7Zx+WBQPMas/PdJOdgv6kKedKEq392ozu5lh4ovFqpLMn5IMYmjQJeAKGNjuY8PFeJIlNi1+cu1V4KcuJPL8TR26JD2Y/XuKcXkrIUN/SK+AP2pLs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717859565; c=relaxed/simple; bh=zMgAVw/ha/azcpj/WwpKlb7F+cQaicVpsa/rgBYnZZ8=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=ceWxe67jD7CqwWXdi0zbcTik/8eM0wacJV6WuQhyrSoTbHDeAmLKt8iFq61EsANIIOJggIbYReZVTqMoDp/l0EWLjbrdONX3xlt1B8jOsgh4mcBL/OmBIxeftM9ZHyrLIGyRChuDGt88xvZegQ7dlmHGkmw8KCzL9agWTE6pJBg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MAG9vALW; arc=fail smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717859563; x=1749395563; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=zMgAVw/ha/azcpj/WwpKlb7F+cQaicVpsa/rgBYnZZ8=; b=MAG9vALWWPV7GHjwzpjdrIq530QSrphBJ1SSP/DDQ2rYYyZjzW2/8W+i kB9l9ix6PCaMJgzLCWlK71X7CbGPYqVGG1PQLjDTqJNiAn4MxA822bUds FsAb6aYgTCMOPzYyum3uu9+SQljhBr5wveBWbUUCvNvRG0iiISkGw/P78 8Q9wE0/OxDIaq2HaRv9wtIGWuea0COO5+xldGIVaesXD5xvQJXnm/4zru XFoiSwoad5GXMdqNkGP7a4CcZWz0ofss+pSUMWczgV5Sl41EznhpP1juc leU4dy+GBBveKuXXfeILu/S8ukJ536vdBE1Ygv5EdcQHLsYaIYmCh6A10 A==; X-CSE-ConnectionGUID: O4L+nt08T7Kk+aPTEDoS9A== X-CSE-MsgGUID: LjNdeoNVTYuElHblHpoNnQ== X-IronPort-AV: E=McAfee;i="6600,9927,11097"; a="11976486" X-IronPort-AV: E=Sophos;i="6.08,223,1712646000"; d="scan'208";a="11976486" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2024 08:12:42 -0700 X-CSE-ConnectionGUID: W7s5sV9ARJCnhyp3kvT5sg== X-CSE-MsgGUID: Z6XNXCxoSP2+JxFGVJtsJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,223,1712646000"; d="scan'208";a="43739910" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Jun 2024 08:12:43 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 8 Jun 2024 08:12:42 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Sat, 8 Jun 2024 08:12:42 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Sat, 8 Jun 2024 08:12:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtrl228a2iGKfnRkqV1kfUln/zTJD4Zs26tBq/6yLQpb/9chgqzSCq9TH0264kBgd1389NWAP1GnpdzFHGZdI3m/xJsNl9iXDVahxz1d07aDzDV3ij3s4tDh+6oJkgEtMJNb+ZtIwdQsnyjsmfY8+ScNDUAFkIzfvoOAm0KUBOUb4nxt2euEzm14xmDuY8Yh+mG1oJvl6P47zf2RZ5a3nGuYnCYI5X1RBCbq74iEU4QkIeQW2iD7LWIZW+XFarO3+gfxBbkkfVCx2KCp7JT2bdFpj/98wCEtE4pkU7t+n3OeKQfeQMlFB2S+osNIAX/bN25Ep+gHGnronvJcfYIE/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zUjNxJpK9vbNhnOCAyHL3oHmBLJr9ypMVoo31GSyrK0=; b=JFEaw4Eeo6wBFfYW3HQEBG+9eByyBqnoQuVX9rqzlLZ+CVpDzQq+eDdZY0nmSi/Rkl4Mw1hZXOx6wmE2kwDy1bopszghz1oj0phWdLuVOlaSJ/Zo8+jM6xB0+y+evRnybrlLcZQWU46hZkwBpbGIFVttu7m3f0EWpCvLvH0N7qi/EQe908qQvEjmo27r8+6ZEhnlVlTA92WN+3C7n+cKXKiCBxDTmtXDAr5Eh9z7Qmq5dJY/zuVjFEEv3lOQ0Z8FQdUTMbr7klYPvwaMU8TLOVsoKjhB1VflAqkEC/jv/Ay1qzdDnyZozxWQMWfBMg3MZ3VxlLakAlFtR8DOG4TAmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by PH7PR11MB7052.namprd11.prod.outlook.com (2603:10b6:510:20f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 15:12:39 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7633.017; Sat, 8 Jun 2024 15:12:39 +0000 Message-ID: <87f4123a-d640-4283-ac3b-f3410aefa8f4@intel.com> Date: Sat, 8 Jun 2024 08:12:36 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V7 1/2] KVM: selftests: Add x86_64 guest udelay() utility To: , , , , , , , , , , , CC: , References: <6cd5b8bba5905813dacf71249865b316146dd1d2.1717695426.git.reinette.chatre@intel.com> From: Reinette Chatre Content-Language: en-US In-Reply-To: <6cd5b8bba5905813dacf71249865b316146dd1d2.1717695426.git.reinette.chatre@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR03CA0350.namprd03.prod.outlook.com (2603:10b6:303:dc::25) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|PH7PR11MB7052:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a0a67d5-a277-48fa-aef2-08dc87cd6fe8 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007|921011; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Ny9xbVVRZGpBaTBEREhGaG10anI3SUY5K2N2MjhFOTFEWnJxTlV0bC8wWm9I?= =?utf-8?B?UHZKbWQ5KytDQ0d1OUluSFBPYVdDLzR3RXMyNURCSHA5ZWhMUkl3ZzUycDdj?= =?utf-8?B?S091TmlTRW1pdytVT2FHd0sycUUzV0FOWWM2WFpIVmZQSUkzNk1KTTdzVUR3?= =?utf-8?B?cHliSVZUQWhKTXNZUTRzWTlUYm9BWjJRQmlLRngvNnFHdmRQSDhIM055ZGhh?= =?utf-8?B?NElPeXJBclVBc2lTVWZxYmRNVkZTQVByc0ppT1FaMllWUmQ5M3RaZGw5YWxo?= =?utf-8?B?ZWlpNnNXc2s3RXBLa0hvRjVwMnFKV0xJSlhvS3V6UEl5RThzemZ2OXNDMUNC?= =?utf-8?B?N1RDdW1PUDh1emJyMC9kZEhzWlBNc1ZvL1NyZG9KQn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BoMWpyUGxMcVhuTTAxZEVmYm9weitGTUg3?= =?utf-8?B?NHU1Zzd6YWFHd1k3NVVjRVJTYlJmaXhoaXREdmEzNCtJVUZsRDdDWTAwQUlP?= =?utf-8?B?U3hDaGM0U2dpQnlRZElIUllmYnRJTXgyRnZSakxEaUNCNzE3ZFlTVmlGdmg4?= =?utf-8?B?VEZMN0RmUnBRRXBSRFlrTlNPU2h2NjNOc2h1bUpIVDdkdnhUTXVYSWxDNUtJ?= =?utf-8?B?SDkzbzBxMWRVTnFEaXROUjFQcVhHWSt0UVYxRyt6Y2V2OXBhSjc1V2Z3c1By?= =?utf-8?B?VFJsVHlRMHNGSGpUT2VlRkZnNE11Vy9Ha1hid2MrbnNhSjBSNm42dHk4WUZ4?= =?utf-8?B?dEQ5d3BrSERoRFNVSlh4NkxhcTBDQ3haQ25abHoyWkw2am9wcHBldFFNTW1z?= =?utf-8?B?T2YvUUcxOUJyU0c5UUR2Q1Y5bDk0Nkl5TGNabHB5WHdvaXU4dlpPOGw1UjAv?= =?utf-8?B?ZlFPbCtYaklWRUlsNUNmemRiTnE3T3dRZFlENUJYNTN4eHZSTlBjWVN0VDky?= =?utf-8?Q?q0in/+1sZKBtBmWetGQU/AONpvWkTDg9rEQ1o=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MTczUlB3VURaZzVYWWMzZGN4UCs3ZW5hdlo1blc1L3NNRnpLZnVoSTV0cUJS?= =?utf-8?B?Rmc4em92TjFTYjBJZjFudWxZeWhJTk1YQVZpVUFrVUtOeWRUeG5NNXdValBs?= =?utf-8?B?NWY4SFowMGlmeGVzc2s2YlZUVmI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jR0V050UUlJQTVPWGpCUmNZYUhkb1hQWjI4ekV3OEVjSUYrcVdhT3c4K1Uy?= =?utf-8?B?eFAybisvUCtCaGNrM0h4ZlFpbEZ6NGNrLzdhUmVSOVB5eTd6SnNNK3ZFbVpE?= =?utf-8?B?QUgyR05Za2cvK2VyYW9hQXo1cXBKVVlZVndqWG9nbjJ4S0Y1Wlc4SjRHTmh6?= =?utf-8?B?UXVCSkRPUTN1TklZcUZyTTNtcy84cmZwclhKZWpEZitHOERlMjJDenRIZTY1?= =?utf-8?B?d2c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5a0a67d5-a277-48fa-aef2-08dc87cd6fe8 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 15:12:39.7010 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hApcvT9SxxNv1+ezxvh65+r/bundsMF4QM4qhh4/YhHO0deibSjeAR82dptsyUev5DGLRC0NKgcgr2tI/lP4R+hRxngVpZ7KC1JEDsMxKy8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7052 X-OriginatorOrg: intel.com On 6/6/24 10:42 AM, Reinette Chatre wrote: > Create udelay() utility for x86_64 tests to match > udelay() available to ARM and RISC-V tests. > > Calibrate guest frequency using the KVM_GET_TSC_KHZ ioctl() > and share it between host and guest with the new > tsc_khz global variable. > > Signed-off-by: Reinette Chatre > --- > .../selftests/kvm/include/x86_64/processor.h | 15 +++++++++++++++ > .../testing/selftests/kvm/lib/x86_64/processor.c | 8 ++++++++ > 2 files changed, 23 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h > index 8eb57de0b587..f3a5881dd821 100644 > --- a/tools/testing/selftests/kvm/include/x86_64/processor.h > +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h > @@ -23,6 +23,7 @@ > > extern bool host_cpu_is_intel; > extern bool host_cpu_is_amd; > +extern unsigned long tsc_khz; > > /* Forced emulation prefix, used to invoke the emulator unconditionally. */ > #define KVM_FEP "ud2; .byte 'k', 'v', 'm';" > @@ -815,6 +816,20 @@ static inline void cpu_relax(void) > asm volatile("rep; nop" ::: "memory"); > } > > +static inline void udelay(unsigned long usec) > +{ > + unsigned long cycles = tsc_khz / 1000 * usec; > + uint64_t start, now; > + > + start = rdtsc(); > + for (;;) { > + now = rdtsc(); > + if (now - start >= cycles) > + break; > + cpu_relax(); > + } > +} > + > #define ud2() \ > __asm__ __volatile__( \ > "ud2\n" \ > diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c > index c664e446136b..6558fece8a36 100644 > --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c > +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c > @@ -25,6 +25,7 @@ vm_vaddr_t exception_handlers; > bool host_cpu_is_amd; > bool host_cpu_is_intel; > bool is_forced_emulation_enabled; > +unsigned long tsc_khz; > > static void regs_dump(FILE *stream, struct kvm_regs *regs, uint8_t indent) > { > @@ -628,6 +629,13 @@ void kvm_arch_vm_post_create(struct kvm_vm *vm) > > vm_sev_ioctl(vm, KVM_SEV_INIT2, &init); > } > + > + if (kvm_has_cap(KVM_CAP_GET_TSC_KHZ)) { > + tsc_khz = __vm_ioctl(vm, KVM_GET_TSC_KHZ, NULL); > + if (tsc_khz < 0) This incorrect type usage will be fixed in next version that I plan to send on Monday. > + tsc_khz = 0; > + sync_global_to_guest(vm, tsc_khz); > + } > } > > void vcpu_arch_set_entry_point(struct kvm_vcpu *vcpu, void *guest_code) Reinette