From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1029DC433DB for ; Wed, 13 Jan 2021 17:18:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C80E623437 for ; Wed, 13 Jan 2021 17:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728250AbhAMRSL (ORCPT ); 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-Google-Smtp-Source: ABdhPJzQAr5AwCj9j/9lCm0gPeLTxznNLGrNOq388mriy/cQdG48dqpJ/7jgEBs02tqYbK/EN/1gow== 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 >