Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1390506ybn; Wed, 25 Sep 2019 17:37:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0Zl8cyi6zKjecA7M94H/F3/K0UTb5YOAbuwk4ksVl2LgX7GeNDuCU5LphqqRAtBOVFDz9 X-Received: by 2002:a50:f009:: with SMTP id r9mr797761edl.195.1569458258487; Wed, 25 Sep 2019 17:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458258; cv=none; d=google.com; s=arc-20160816; b=XA57MEzBlZANssGUo2m5VMaDx4ypizNpBxfbStsiY/uxI37Ta0VLeNIkryq96TCYRd 6JcHO9g/VTFJ3Jh7eXivxOtkkNMz+KXc/FpdmBv9RdGqSG4h+7ESiOmrtt1m2aLtVlbj +5xx9HRENL3x7T2bNnvhN84zhveWr6hRs+RH00N5C47+nYjdHXaZkZaRxGicxFMUGFkO QbSWP2KqyFT8joTgvJXEZv1tY7wOC/oRqybHU+SHRtmuDhASAZSsBx+wIHKRsr6yI5ay ajdjx8onCwY6aKA6G9l6Yt8i1K92oz4+iK5hL/ZvMI+qrvZqz0lbCFZ3dvH5Z6ND20Rs +W4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=0UXLU1GiG9GRzblHITT/kKxOAXLFHZe9KDWnxtoZOGA=; b=Zi/wnJ8iYkzoM9fBSaFA3kKdHJcbRLfVjRcxT1QJq/P9TUcsHSy5Pb1PAMdbPQJbSx piwLw6exJbjWACUyzld+Ucd3+KcyxozWxsS2rkZUORr2HxAiy87VMeJqa5o04GhOvglE bccFm+SDQ0/ML2N8tSUfU7s0bvUKHnusFZELOsisQMKsP+9hKvwqMPpQeXarVF5331c+ 9gVFjVGlEjkKBwQZsV2J5i9rbXh9p3UnMMIFozXT+iWuTv5xOZM0CuMh4EbzoP+u0RwP kyYqHN++MxiUDLBcgGm6Mmug6ViDUYz8HKSXe5WCEYdy7iPLMdjWgXuy9k7oYqmQ9uzH DcUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si262227ejr.29.2019.09.25.17.37.14; Wed, 25 Sep 2019 17:37:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503605AbfIXAQl (ORCPT + 99 others); Mon, 23 Sep 2019 20:16:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503595AbfIXAQk (ORCPT ); Mon, 23 Sep 2019 20:16:40 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36ABCC049E32 for ; Tue, 24 Sep 2019 00:16:40 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id b6so29002wrx.0 for ; Mon, 23 Sep 2019 17:16:40 -0700 (PDT) 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:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0UXLU1GiG9GRzblHITT/kKxOAXLFHZe9KDWnxtoZOGA=; b=kRWcJ9/uhSrlIhoLJqlN0nfq2MrECl4XBtLSKKmbwvi8vNxqPmjq9QRiQ7eImcWPaC o3DcsJlCHiiXJUqr7GgIRvBjhGeNy+BXFsdKPxaXfCKj27HNyjI05/oCgOt6DMruMHKl 3/c7jrn1H62SmmezF3Xf9CiZoo1BTdFraSXYC18sKwt9o7mLPXoBBGQju/m09vm+TRLa pvoMADsqr7APCF5eyKQ7w09XAhFEtdjqD9NyzePNxjWgVwNDSojCn/xChNRBUeAiU9cY QeSRiDix055rPC1bruJZBJ8TtwY/xKvIoW0EU3fBqZwV+z7Hv9k2/Yl1cRVzQVd4QyoL Q1sA== X-Gm-Message-State: APjAAAW+PiGH8yJLkqmNQHb7sl40gaqaUzYZe4rvH0EcJA73eQaV8PyB aQvoinxJmQSlsiBMmEr6NzZ/VkJFZfmlCQxEtavJ0715mtbTi2t3pcM3StA7tKxPso1ufmHfIi1 QtBGPVWslC2GkBRmKJ3up9wGG X-Received: by 2002:a1c:7c08:: with SMTP id x8mr160868wmc.140.1569284198725; Mon, 23 Sep 2019 17:16:38 -0700 (PDT) X-Received: by 2002:a1c:7c08:: with SMTP id x8mr160853wmc.140.1569284198377; Mon, 23 Sep 2019 17:16:38 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:9520:22e6:6416:5c36? ([2001:b07:6468:f312:9520:22e6:6416:5c36]) by smtp.gmail.com with ESMTPSA id s12sm48776wra.82.2019.09.23.17.16.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 17:16:37 -0700 (PDT) Subject: Re: [PATCH 15/17] KVM: retpolines: x86: eliminate retpoline from vmx.c exit handlers To: Andrea Arcangeli , Sean Christopherson Cc: Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-16-aarcange@redhat.com> <87o8zb8ik1.fsf@vitty.brq.redhat.com> <7329012d-0b3b-ce86-f58d-3d2d5dc5a790@redhat.com> <20190923190514.GB19996@redhat.com> <20190923202349.GL18195@linux.intel.com> <20190923210838.GA23063@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Tue, 24 Sep 2019 02:16:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190923210838.GA23063@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/19 23:08, Andrea Arcangeli wrote: > The two most attractive options to me remains what I already have > implemented under #ifdef CONFIG_RETPOLINE with direct calls > (optionally replacing the "if" with a small "switch" still under > CONFIG_RETPOLINE if we give up the prioritization of the checks), or > the replacement of kvm_vmx_exit_handlers with a switch() as suggested > by Vitaly which would cleanup some code. > > The intermediate solution that makes "const" work, has the cons of > forcing to parse EXIT_REASON_VMCLEAR and the other vmx exit reasons > twice, first through a pointer to function (or another if or switch > statement) then with a second switch() statement. I agree. I think the way Andrea did it in his patch may not the nicest but is (a bit surprisingly) the easiest and most maintainable. Paolo