Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp326610pxb; Wed, 13 Jan 2021 04:50:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl6yrcqzhdAQsN5bH3+fN5ib9gHi9xrYXC52Bt1wt/SR9pzOYcbp11Aq8X3iy9aeMAJgvt X-Received: by 2002:a17:906:339a:: with SMTP id v26mr1431346eja.107.1610542243951; Wed, 13 Jan 2021 04:50:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610542243; cv=none; d=google.com; s=arc-20160816; b=J5DtrAALf0alHDWCe/OwwxHW7wWDDxOwlE+CG9jyjCra2GtSfEqZ1TChWpylVbe8qX Cz1vLnsM6wv5s4Id+53o0nDBgWVLgxcj4/BcmCixdU1AisLyuSTBm/zGmaIl2TZUYMok KmJMr4ceZuMIPjNiiy5QwkC7MdzylohjV4wXClPg1p86owvXsHlWC83h0cnUFNrX5/nc SI4gTisvKRIgXFCsmtad5zoZ25spM2BcWSvhCFktPyz03JgEPhmAV+jkSUZ1u4Dh5PuT QKgYBJA8dzPEPUH2u2/hChNRsZFXSWVW9GPHc3Vn88p7fk51Y7gQJRbQWqJed4QVUm1H 7a0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=MN//j4KfkaQDO4C4FoLF4BEjv0MtOHoXDo9L7ieqXmM=; b=xXEceBhWEns4AX1gn5TKAbgDVw9KYcSshuYg0bIqK0MZOL8iteyXGqPaPrhHIMnIcL y2IIPGV9DZUcrgFfizwrXSfoXjbs9qO9GR9uTkkmj6yh8EGHm6/Ke/+TfRpddkSnMeN1 3isjCXVKWFCwkUTajPXFRw80RPTssUTR3I2mE8ucMcYxuer5+4gMnlWrQRujlf0x+RuB 6OgolsljgnMQMx0xKFgoCGDOUfMIO4MLU5KlmXhWJcP+ttaIzGmmTKc1F6e38yKzXFQx kIiA0C9Ha7ecNo//7+TcZEu9wjTVm/aoYmcSwdt1vwXDoGWm5Qtir/Ljq30Yt8qXmRlr /Gzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I5CmDh7E; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si1028613edi.560.2021.01.13.04.50.18; Wed, 13 Jan 2021 04:50:43 -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=@redhat.com header.s=mimecast20190719 header.b=I5CmDh7E; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbhAMMtV (ORCPT + 99 others); Wed, 13 Jan 2021 07:49:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25835 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbhAMMtU (ORCPT ); Wed, 13 Jan 2021 07:49:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610542073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MN//j4KfkaQDO4C4FoLF4BEjv0MtOHoXDo9L7ieqXmM=; b=I5CmDh7EO/abyiii09JlW/09xm8GIRfUYlIGc/XoyOjQC9+Vfh+hT+649A5KMYP9jrN227 VgSWzwBuR8oSeChb8n86Jb/F5GcrWAWQi19j+wFs02VcXj2P31cApfxe8BRcVyObOgFdo9 t/9QeYMQT31G7he8nvAK/0h3YWbI7YQ= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-OF6w4_i2PXa9rb90N2oj-A-1; Wed, 13 Jan 2021 07:47:49 -0500 X-MC-Unique: OF6w4_i2PXa9rb90N2oj-A-1 Received: by mail-ed1-f72.google.com with SMTP id g14so805768edt.12 for ; Wed, 13 Jan 2021 04:47:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MN//j4KfkaQDO4C4FoLF4BEjv0MtOHoXDo9L7ieqXmM=; b=fdys+Ow9ylGG5knxJTMXBZ9Mbh2ctDwm9JMMgfoC4JC3gXnC02Ll89IVq8oTjwGX+z 56DI4euIVrKBtmi+M9ihUxqN4aOLkX90jhIpmhRGZO6AFoTpgmFWFrmxIX83QNfNa2lJ cr15TX0r8HO7BiOwbFwHX9Dd61e839kv7P7f5vQwyfedv7zkq8RIvotHxIFKpIxyeDy+ ZJl1J1Gyi5P6CX30gUhHT0AP6u92I1JRCSP8UAZk1Po2S1+RtF1AZLXTW8C2zgmyor1z D2wtKiZJWTvRIeW8u1sEtlyDHeMP0HGydiqeQEWUdtv5setsjBi23DwclfCIvNa6DM7h muhg== X-Gm-Message-State: AOAM530Ji8QGIf8ruXF12/y1k4M/kyPEGmsDs2lCGV2dO3crjtwf7FB2 6L4xkZ3sPdQEQFWl7hjeZRRTdQrU0jz+RlwQuG9yo/s54cDfBUguj35bK4R0/q0AV3uDdFlPgrA +m9e9qIZ+l58qG5rIjRGYMSpBAkk35iABBjlJHqGf1BYu1shy4CPAhjT35eI0ZCiIOOOQt7O9Mk xP X-Received: by 2002:a50:9ee6:: with SMTP id a93mr1676116edf.174.1610542068562; Wed, 13 Jan 2021 04:47:48 -0800 (PST) X-Received: by 2002:a50:9ee6:: with SMTP id a93mr1676096edf.174.1610542068394; Wed, 13 Jan 2021 04:47:48 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id z25sm684934ejd.23.2021.01.13.04.47.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jan 2021 04:47:47 -0800 (PST) Subject: Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops To: Jason Baron , Sean Christopherson Cc: 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 References: <1784355c-e53e-5363-31e3-faeba4ba9e8f@akamai.com> From: Paolo Bonzini Message-ID: <86972c56-4d2e-a6ab-11ad-c972a395386a@redhat.com> Date: Wed, 13 Jan 2021 13:47:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1784355c-e53e-5363-31e3-faeba4ba9e8f@akamai.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/01/21 05:12, Jason Baron wrote: >> > Looking at the vmx definitions I see quite a few that don't > match that naming. For example: > > hardware_unsetup, > hardware_enable, > hardware_disable, > report_flexpriority, > update_exception_bitmap, > enable_nmi_window, > enable_irq_window, > update_cr8_intercept, > pi_has_pending_interrupt, > cpu_has_vmx_wbinvd_exit, > pi_update_irte, > kvm_complete_insn_gp, > > So I'm not sure if we want to extend these macros to > vmx/svm. Don't do it yourself, but once you introduce the new header it becomes a no-brainer to switch the declarations to use it. So let's plan the new header to make that switch easy. Using trailing commas unconditionally would be okay, i.e. #define X86_OP(func) .func = vmx_##func, #include "kvm-x86-ops.h" and leave out the terminator/delimiter in kvm-x86-ops.h. This is similar to how we use vmx/vmcs_shadow_fields.h: #define SHADOW_FIELD_RO(x, y) { x, offsetof(struct vmcs12, y) }, #include "vmcs_shadow_fields.h" #define SHADOW_FIELD_RW(x, y) case x: #include "vmcs_shadow_fields.h" Thanks, Paolo