Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1565702rda; Mon, 23 Oct 2023 17:25:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPo9TUTsHNuSmkT9yNl1BKb2i+Hm8dWLf1NqZrJTy0Gwi7XXlKLpK2sIYtvQ8YGt+oNy89 X-Received: by 2002:a17:903:120d:b0:1c0:bcbc:d64 with SMTP id l13-20020a170903120d00b001c0bcbc0d64mr9062383plh.51.1698107136909; Mon, 23 Oct 2023 17:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698107136; cv=none; d=google.com; s=arc-20160816; b=pAJ1yljcKF+ywGKdR4XqU/3vaByklKMCDvqckTuQe5BZudLVmMnWH06mzsTp6pF06m oKHdpK05iK6/0+/coMjRggsoRwDr8mI/oujdZr+kXiMOYc2m8APs5Voa1+CLPZPcGFk3 qieAxJ1AvAWKcLhopaYeQoDb42QREJPqeC2e7JrCz0N2rPZ4kRouID0c5yP3AJ+gTy4u nNQHAbmPNY9+O+GzfnQx2Kp1x+qFrub+37ueHLizxZo+7A1cQ8B/VGdJI/BStuB7NiNj 4xrUFX+jZ5acKDGJAvTzudNKsOV1CckmPJ0b1eyHWrPrW30WUDnFbjV6xRbjK5lqaXOW fFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=LWHz1xqzDxYD9+2i5v6SK4a1uaV9iTpi5M+TWlqOotc=; fh=mHDIMeQp5VcH+VrjYS+PuHnTt1zqm/2sNYm2XnRLeFU=; b=Is35oUDPK9yfiGzbPsazuWvE7DRGAvAICyag2ahnHeTTbpf4DuK1tGL701NnABOXur m0nomdBjj7/vLF/HNGXr6aaviTVN2p+T2RoP7zdBZa8WMui2fxJPj/gsWqN8B96oIo90 /IgZb5ZOAYjBsN1JxXn6PpxGTSXB2SVvwBr2lxbZRaSGfVqY4sF6CkehhLBpBzMx+eWl 6+mwVwVJjeXKW4J2Au6GkkRPa0J5KmTcltXVPFOvRlAEkKfA6Z513q395l1draMF++dS GYhv8d9cRfbyBRgpp+Ea7zZwLmPgo1jTtYrk0C5Uqf9be9PBIRxTpG5x6ns0Fbx0qQms x3tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MFmCHNsm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id z12-20020a170903018c00b001c612f42c78si7369750plg.513.2023.10.23.17.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 17:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MFmCHNsm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E995C803EE0E; Mon, 23 Oct 2023 17:25:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231513AbjJXAZ0 (ORCPT + 99 others); Mon, 23 Oct 2023 20:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbjJXAZZ (ORCPT ); Mon, 23 Oct 2023 20:25:25 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C7C10D for ; Mon, 23 Oct 2023 17:25:22 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-27d0a173c7bso3048145a91.3 for ; Mon, 23 Oct 2023 17:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698107122; x=1698711922; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=LWHz1xqzDxYD9+2i5v6SK4a1uaV9iTpi5M+TWlqOotc=; b=MFmCHNsmdyIBqdk+4C2iw+qYybxCOhwo9VKfTMR2x/E21VATr79UCdlwGOta1vjVb4 tu5AClHeCz8Logj3Gi9zCjtqJSYQoEKJQtwpbFNRCyRr8i4+4xLtqJrYXr2cY2sKZagO cXGjTSJgxhI+1qxkxiQpRL6JSXfxYUn1Tn9rZG2CuHf+cqjgP8sI7VNc7tdrLx6QoNrF /9T6ykc7MApXoEgL910EfNxywas3kmGLr9lx+P9jLD2CTticMh36wkqgZFToCJIL7M88 lILIkQBcqRzCOlbDDdq+xqwA9Bn9rxuxXWWefRmnyMiE0xKgj1YzMuOwWVSkEY4KcwxY WGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698107122; x=1698711922; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LWHz1xqzDxYD9+2i5v6SK4a1uaV9iTpi5M+TWlqOotc=; b=nC2Z5Z9KoTaLs2XTupVmDCXQ0e76adOxACepIpREkusb9yE8dalStIbg2ZHptgijYo 2BDBNz/RsMKqPVsyibFBZgp2c4kZDs3HXKWbig0n0hIuXq+/iL6iK39PfOa07XgBhb2c ACiYcN0wqrVaXrpJeYWrd08CTbA5xBUVC2XuPPmfP/MEZzUcLu7gHTSUN4op15ix9Sk8 FKeYP/0DjUDaMI9v1xXWET7RQ6WfE1pO1WJ0TzASIadDjIHW1uSBWoHMs9PFjSccjANg TnzlHB0qhzX/vgvyvmytWuBqUParZV9qwa2Gpf/tG/L8pPSgrfq28XdlZTR4Ht/48mMi copw== X-Gm-Message-State: AOJu0YxIp73Lq9V6thSAEgio1kuSWXCKec9nIIx1VR+9QqKelBkCo0Fx XFNVqFL6XFm/Fb59Z30/DvbQllCR8M0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:6548:b0:1c9:c95e:6b2d with SMTP id d8-20020a170902654800b001c9c95e6b2dmr192625pln.4.1698107122205; Mon, 23 Oct 2023 17:25:22 -0700 (PDT) Date: Mon, 23 Oct 2023 17:25:20 -0700 In-Reply-To: <20231024001636.890236-2-jmattson@google.com> Mime-Version: 1.0 References: <20231024001636.890236-1-jmattson@google.com> <20231024001636.890236-2-jmattson@google.com> Message-ID: Subject: Re: [PATCH 2/2] KVM: x86: Use a switch statement in __feature_translate() From: Sean Christopherson To: Jim Mattson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "'Paolo Bonzini '" Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 17:25:34 -0700 (PDT) On Mon, Oct 23, 2023, Jim Mattson wrote: > The compiler will probably do better than linear search. It shouldn't matter, KVM relies on the compiler to resolve the translation at compile time, e.g. the result is fed into reverse_cpuid_check(). I.e. we should pick whatever is least ugly.