Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp530553pxb; Wed, 13 Jan 2021 09:21:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMjXfvcqu6a0qHSIZNpqHR17iit7deMX+HeVWP81KKNc9haUoszLf9/Ovs1WRXJOtaaQzj X-Received: by 2002:a17:906:720e:: with SMTP id m14mr2285483ejk.161.1610558469328; Wed, 13 Jan 2021 09:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610558469; cv=none; d=google.com; s=arc-20160816; b=fegSgfrH2YDhZ8CcRGa3I80kwX9RGwcuyND5VRhsIfVOseJlME4cbmKmFzMAGR7/2P tfW0j6RnlgN0xT9Yb4aV7KT0K4nE+5/aLtaWOt4W9NAZ/8rZTw/e+jCDjEdKmBb5avZc 33PDUynZXoT8qyADFfgni/cCLFnXZWIEnqRdOJ4q72fFEVXgxeYo78PJPR9N8wMyGvYw S6ioiTfjp3fDYO/V5BQF7jOgpdXpVlivAwyF+mf5eKV4LpXhJvU6MsCnjdybRhFOVAZq 3vU/PKQm08q5TiXiHAWEMQAiPBqYoh+E4efRfx2N7nbYEnW9GJMCX9WOWCwg+rOxv2lC WygA== 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=/3STmS+zatbijavWt2TOuzoxTb1FHjkZNwlSMF11jw0=; b=YRHOVPMvXzbBs/1YcED+VmInBFMisED1y2BLK1oSHkjjtDnemIGIglEp4uUU8RTTHy dNpozRASZ5Ht9IHQR3hUiHt7nOynqbI38jdbopPllvu/3W0WC0fwZDYiZDlPJG+pii54 kyHtgmFF0O9BduBBrzrQsybxfZf2ka4EUuFm0iQiciS7KqEFlj1HN5J4TBI1XdhOgqS+ NYvcVi9ZvKEPFxYF6Y5MzPW3/lijNr+mJtLkD3hJm+e7X+2gYtsVKVw7YUUAR9bDGHCB C9MRJzXqKASwJVEWJTSP7EB9XGyls5/6FJ7r3uDQf6mQ2gky1HHdGLsQ3XfpStJwvu8j h3GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qGncu76O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si1329093edy.255.2021.01.13.09.20.45; Wed, 13 Jan 2021 09:21:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qGncu76O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728243AbhAMRSL (ORCPT + 99 others); Wed, 13 Jan 2021 12:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbhAMRSK (ORCPT ); Wed, 13 Jan 2021 12:18:10 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21DB2C061786 for ; Wed, 13 Jan 2021 09:17:30 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id z21so1905099pgj.4 for ; Wed, 13 Jan 2021 09:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/3STmS+zatbijavWt2TOuzoxTb1FHjkZNwlSMF11jw0=; b=qGncu76OHOBf70DtOp94s5WPBtUSZQAg9+TESOqjGujjFleamyY7hjpE4ZxMc8dpmu qPPOlr9HEDxXMAWavY5ppT70MRbTVUHv/Te2aS1zBCqVHsQ/GD5hrLLnYv2vNbYKvwPN aDIBZNwv9K8iHbf456M0lrc7C6vMHpjaBY80TSBYK97jXyuZ5cdgo+zBbPRIhgywlF69 bbLfS2CLHSJU6ujTMmp7A/L9uiEQmkqyq7tS64XVX5olYQUoQfafMMWdSgtyxw5QPx6q slrDtXpbIOOIltYbkZC/TyVX8TNeC9YDg0A1574F1afRqi7BCmdWQh1ijQg/aeV7dXoU Byug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/3STmS+zatbijavWt2TOuzoxTb1FHjkZNwlSMF11jw0=; b=pyaVsDpKVXnnp277vaOh76qwx5B+jU5V/5dHFNOOY5sZiCJ5ZksQu0hzytmQhrkNpJ pv8zWXl83DsdZeQj/H3Eb1NCLO7KS1ape/b1PySANCD0DaUdaDWA4mSKWeSaSeSfJ3ML dOlic22TrbVUL8PL2lsGNsoIcNklMEnpsFxp5xD9R8vUcHFyJR5s1oFPL2UvjmNreFom MuOh5L+XARhW4Vad8B9PfL/pjStUS7J4l36pHMHhcQJGEkot/72wJdTu1O4eSAi94uV6 IIQ2G2R1k/a5pVSIlD6zDCivzNaj5sL6DIsIO9Z1dD5LLyaRuJVADr9SSWTDY4ziCxlS yogg== X-Gm-Message-State: AOAM531VidZ7eMt3Y0ne5vBV+7djpwZs35S0eOY9TN2UZPqdPnoc8rLI A3zXQowYMnw/X2Veo4Bjk9PT8A== X-Received: by 2002:a63:e151:: with SMTP id h17mr2963978pgk.120.1610558249502; Wed, 13 Jan 2021 09:17:29 -0800 (PST) Received: from google.com ([2620:15c:f:10:1ea0:b8ff:fe73:50f5]) by smtp.gmail.com with ESMTPSA id d20sm40837423pjz.3.2021.01.13.09.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 09:17:28 -0800 (PST) Date: Wed, 13 Jan 2021 09:17:22 -0800 From: Sean Christopherson To: Paolo Bonzini Cc: Jason Baron , kvm@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, peterz@infradead.org, aarcange@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021, Paolo Bonzini wrote: > If you need to choose between DECLARE_STATIC_CALL_NULL and > DECLARE_STATIC_CALL, you can have kvm-x86-ops.h use one of two macros > KVM_X86_OP_NULL and KVM_X86_OP. > > #define KVM_X86_OP(func) \ > DECLARE_STATIC_CALL(kvm_x86_##func, \ > *(((struct kvm_x86_ops *)0)->func)); > > #define KVM_X86_OP_NULL(func) \ > DECLARE_STATIC_CALL_NULL(kvm_x86_##func, \ Gah, DECLARE_STATIC_CALL_NULL doesn't exist, though it's referenced in a comment. I assume these should be s/DECLARE/DEFINE? I haven't fully grokked the static call code yet... > *(((struct kvm_x86_ops *)0)->func)); > > #include > > ... > > #define KVM_X86_OP(func) \ > static_call_update(kvm_x86_##func, kvm_x86_ops.func) > #define KVM_X86_OP_NULL(func) \ > static_call_update(kvm_x86_##func, kvm_x86_ops.func) > #include > > In that case vmx.c and svm.c could define KVM_X86_OP_NULL to an empty string > and list the optional callbacks manually. > > Paolo >