From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=90.155.92.199 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793893804; b=jER8LLU4IjAdIFjicYILDo7Jw9zKleJwrmBeG0RfPqA/R5f7YdQSezEPipOPE+UWGqT2 4HXLAzr4WEsgQe/fpk20WtMeDceTcXCamo+q+SQvAus7Me8vl95Xn7WybVexR/JUg+9YU ei3bHkrb6VdJHZWsUWzSRAUZLgYb35k6rzmV5P2jSnfzPe1mSRK93A0XOHW4Gc4C9Lnbw iw9kVs29MXZv/WwNEbgi476FC8vf+rUl2GnC3CN4qDLw0RGiMGpfmU/o6d0wPTvGj6bx1 qVYBiiT+B3cLBss9by0/KHOQ4SfwEmpoa4ElVQW3qHOYdvBj5mZMEv3t5WB/4mdfiwA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793893804; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Sender:X-SRS-Rewrite; bh=172rW2csVgIW8w3rofrqDqPbG51uDxT7XAZeT+28lqg=; b=q1bL+8tHXZ3saZJa7i0o6Ak0jEzdk1MAwIazZPTEvSD+z6gQNGldAJu2CtbvasGi73K9 WlRNN3fMuXPIBPNbJy6p+EdYvesID9Oa4KzJWnG2ON8s/mBcUdtwEXXC85Q/ksc/uSFSD vD6E9o/OwrUsulBfBrsgWrBMGi3PLeY+gnitwcaSRo41G82+I6nnSQLZEeUYywoyw4dZ3 ZUsXWK2YBTYgdMt1EuXsl50fzsS3QmYvxjTE5fX2oPLoGL6qFMa4m3gQrXLWPgQhhA3hg EyGHV1W+hiHwORfZAx0z9MJebF+kRl3gqY2zXoizXkk0f1FOhSoM0PFsh2ZibFH5DDw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=none smtp.mailfrom=desiato.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=HKDJZu1h; arc=none smtp.remote-ip=90.155.92.199 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B412E606D824; Thu, 5 Nov 2026 15:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B412E606D824 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=desiato.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=HKDJZu1h DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=172rW2csVgIW8w3rofrqDqPbG51uDxT7XAZeT+28lqg=; b=HKDJZu1hdZbYfVaBOCLlBavSnA V2TA2mcvmVf58eYsqLUFUe/O1HGkUqDYLxh7hKC0/beriyKNx406TAdR+fxUIJcCicJj7ZtRPdrtg v8U493D/1ozG5g5huFss99LV35zEJpMn6tuWI09mTXLpEQ5Tkei6UNAMShpEzmscf56d7cdvFq/p+ Ksz6ArXcuNDw5K5SZXmX7tFDttCVGoC5tVmwb7Ba6a9NZrikijNdZcNKb+evRsYgyACCcJmSPLv5W 0lu5QwNNyDOXiYQxOlYu0jqSLRPANM9R1+TZ2jL2lYB1L7JC3SFawOmzoOiCNQvXHWfoV9swqj02n vfbX3PwQ==; Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.100.1 #2 (Red Hat Linux)) id 1xOziw-00000003Bo2-28cD; Thu, 05 Nov 2026 15:49:58 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.5 #2 (Red Hat Linux)) id 1xOziu-0000000Aaza-0bAa; Thu, 05 Nov 2026 15:49:56 +0000 From: David Woodhouse To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, Paolo Bonzini , Sean Christopherson , Paul Durrant , Vitaly Kuznetsov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Jonathan Corbet , Shuah Khan , Juergen Gross , Boris Ostrovsky , Jonathan Cameron , Sascha Bischoff , Marc Zyngier , Joey Gouly , Jack Allister , Dongli Zhang , joe.jin@oracle.com, David Woodhouse Subject: [PATCH v11 13/23] KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test Date: Thu, 5 Nov 2026 07:49:44 -0800 Message-ID: <20261105154955.2525419-14-dwmw2@infradead.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261105154955.2525419-1-dwmw2@infradead.org> References: <20261105154955.2525419-1-dwmw2@infradead.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html From: David Woodhouse Now that pvclock-abi.h is a UAPI header, use it in xen_shinfo_test.c instead of locally duplicating the struct definitions. Sync the tools/ mirror of the header to the UAPI content: the KVM selftests include path puts tools/arch/x86/include ahead of the installed kernel headers, so the mirror is what actually gets used. That makes the struct fields __u64 (unsigned long long), so switch the verbose printfs away from PRIu64, which is "lu" on 64-bit. Signed-off-by: David Woodhouse --- tools/arch/x86/include/asm/pvclock-abi.h | 27 +++++++++------- .../selftests/kvm/x86/xen_shinfo_test.c | 31 ++++++------------- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/tools/arch/x86/include/asm/pvclock-abi.h b/tools/arch/x86/include/asm/pvclock-abi.h index b9fece5fc96d..6d70cf640362 100644 --- a/tools/arch/x86/include/asm/pvclock-abi.h +++ b/tools/arch/x86/include/asm/pvclock-abi.h @@ -1,6 +1,9 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_X86_PVCLOCK_ABI_H #define _ASM_X86_PVCLOCK_ABI_H + +#include + #ifndef __ASSEMBLER__ /* @@ -24,20 +27,20 @@ */ struct pvclock_vcpu_time_info { - u32 version; - u32 pad0; - u64 tsc_timestamp; - u64 system_time; - u32 tsc_to_system_mul; - s8 tsc_shift; - u8 flags; - u8 pad[2]; + __u32 version; + __u32 pad0; + __u64 tsc_timestamp; + __u64 system_time; + __u32 tsc_to_system_mul; + __s8 tsc_shift; + __u8 flags; + __u8 pad[2]; } __attribute__((__packed__)); /* 32 bytes */ struct pvclock_wall_clock { - u32 version; - u32 sec; - u32 nsec; + __u32 version; + __u32 sec; + __u32 nsec; } __attribute__((__packed__)); #define PVCLOCK_TSC_STABLE_BIT (1 << 0) diff --git a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c index aaa414c677ad..c48c0bf44257 100644 --- a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c +++ b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c @@ -98,22 +98,7 @@ struct sched_poll { u64 timeout; }; -struct pvclock_vcpu_time_info { - u32 version; - u32 pad0; - u64 tsc_timestamp; - u64 system_time; - u32 tsc_to_system_mul; - s8 tsc_shift; - u8 flags; - u8 pad[2]; -} __attribute__((__packed__)); /* 32 bytes */ - -struct pvclock_wall_clock { - u32 version; - u32 sec; - u32 nsec; -} __attribute__((__packed__)); +#include struct vcpu_runstate_info { u32 state; @@ -987,12 +972,14 @@ int main(int argc, char *argv[]) if (verbose) { printf("Wall clock (v %d) %d.%09d\n", wc->version, wc->sec, wc->nsec); - printf("Time info 1: v %u tsc %" PRIu64 " time %" PRIu64 " mul %u shift %u flags %x\n", - ti->version, ti->tsc_timestamp, ti->system_time, ti->tsc_to_system_mul, - ti->tsc_shift, ti->flags); - printf("Time info 2: v %u tsc %" PRIu64 " time %" PRIu64 " mul %u shift %u flags %x\n", - ti2->version, ti2->tsc_timestamp, ti2->system_time, ti2->tsc_to_system_mul, - ti2->tsc_shift, ti2->flags); + printf("Time info 1: v %u tsc %llu time %llu mul %u shift %u flags %x\n", + ti->version, (unsigned long long)ti->tsc_timestamp, + (unsigned long long)ti->system_time, + ti->tsc_to_system_mul, ti->tsc_shift, ti->flags); + printf("Time info 2: v %u tsc %llu time %llu mul %u shift %u flags %x\n", + ti2->version, (unsigned long long)ti2->tsc_timestamp, + (unsigned long long)ti2->system_time, + ti2->tsc_to_system_mul, ti2->tsc_shift, ti2->flags); } TEST_ASSERT(wc->version && !(wc->version & 1), -- 2.43.0