From patchwork Mon Aug 21 14:47:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Karasulli X-Patchwork-Id: 13359553 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 DE882EE49AB for ; Mon, 21 Aug 2023 14:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236130AbjHUOsF (ORCPT ); Mon, 21 Aug 2023 10:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236131AbjHUOsE (ORCPT ); Mon, 21 Aug 2023 10:48:04 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36CBDEC for ; Mon, 21 Aug 2023 07:48:03 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E90DB206BC; Mon, 21 Aug 2023 14:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692629281; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eYxmnEwKIUV+qqJzCKTSp2IvkXdFRNILdGWPtaDLrbU=; b=gZNc2O3hkXQABECEFKo+mOWX+2CIVNMEYMy1YkvPGspcbIZ6IdRDW94FM7prFLBuFNt1F8 x6Pb4zH4nQR1FQIB2mthPL4/eoTSGXv+60NfCmcLSTYmDq/AFCdce+NsSNue5Gplyl1Pbc sBYPOBHLaXXD3N1u4ZIgL2soXG2TKcg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692629281; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eYxmnEwKIUV+qqJzCKTSp2IvkXdFRNILdGWPtaDLrbU=; b=RD1Hs57GHQOmSiJjzhLJoyefTm69ivs3N/jdAZcFAGd/jkS93frTpPZ/y2twi16yYTvA9G mCIyjnjsK/I9+NCg== Received: from vasant-suse.fritz.box (vkarasulli.udp.ovpn1.nue.suse.de [10.163.24.134]) by relay2.suse.de (Postfix) with ESMTP id 7A68C2C143; Mon, 21 Aug 2023 14:48:01 +0000 (UTC) From: Vasant Karasulli To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, seanjc@google.com, jroedel@suse.de, drjones@redhat.com, erdemaktas@google.com, marcorr@google.com, papaluri@amd.com, rientjes@google.com, zxwang42@gmail.com, Vasant Karasulli , Varad Gautam Subject: [kvm-unit-tests PATCH v5 03/11] lib: Define unlikely()/likely() macros in libcflat.h Date: Mon, 21 Aug 2023 16:47:43 +0200 Message-Id: <20230821144751.22557-4-vkarasulli@suse.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821144751.22557-1-vkarasulli@suse.de> References: <20230821144751.22557-1-vkarasulli@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org So that they can be shared across testcases and lib/. Linux's x86 instruction decoder refrences them. Signed-off-by: Varad Gautam Signed-off-by: Vasant Karasulli --- lib/libcflat.h | 3 +++ x86/kvmclock.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) -- 2.34.1 diff --git a/lib/libcflat.h b/lib/libcflat.h index 700f435..283da08 100644 --- a/lib/libcflat.h +++ b/lib/libcflat.h @@ -167,4 +167,7 @@ extern void setup_vm(void); #define SZ_1G (1 << 30) #define SZ_2G (1ul << 31) +#define unlikely(x) __builtin_expect(!!(x), 0) +#define likely(x) __builtin_expect(!!(x), 1) + #endif diff --git a/x86/kvmclock.c b/x86/kvmclock.c index f9f2103..487c12a 100644 --- a/x86/kvmclock.c +++ b/x86/kvmclock.c @@ -5,10 +5,6 @@ #include "kvmclock.h" #include "asm/barrier.h" -#define unlikely(x) __builtin_expect(!!(x), 0) -#define likely(x) __builtin_expect(!!(x), 1) - - struct pvclock_vcpu_time_info __attribute__((aligned(4))) hv_clock[MAX_CPU]; struct pvclock_wall_clock wall_clock; static unsigned char valid_flags = 0;