Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2905861rdb; Sat, 9 Dec 2023 04:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8pxr8iJ3APvXNE/Bdb24558iaRwC9uf2/ScU9AMD9Th2JwGtKPzoVbrjnEfgwyaEbhy5d X-Received: by 2002:a92:c565:0:b0:35d:6997:9cb3 with SMTP id b5-20020a92c565000000b0035d69979cb3mr1932093ilj.52.1702123512661; Sat, 09 Dec 2023 04:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702123512; cv=none; d=google.com; s=arc-20160816; b=SiRrsYxZQBiMTL4tXzKyhKceyQRLNGk9IrIvB/+aMFHBuMy4HlUS0yjfsRaQiwtsuw xoYGrS5u30hN4PiUBcFzN9IQePYtL1aFN/+LqCts/R2BUww0Pk4A+cQAhpTXE9pJXi5n cXTUGwI64pWBeVpcdyUUaAHPBqdB37oA60BDAo6Mg70ObZzi9Qq5vMwQhDx5H1uqAZvt pTF6poTITjaPmEcB+LCSYcfxqmPXip8TPVKGWuPq1Bm+ReqGtqwc1e46Rh79u1h8txep NwHNqIlYrhJt6r7EyJff7qHVPsNkPrU6l/pz6s/MhtL6z1qgl4z3BjTYG6b6GDubGb6F QI3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mj9IkjGM5bRDRMCtZPs5pD8acnCJT6TuxhCGWsEoCBo=; fh=b4Eoz5BSATi3y+BygiEFmUqKIP3dcfpKQ3/tzwvy7xI=; b=KhQ88zP/bweeWbjjxqorWTrqRuJfc2kHAiKpAWZcLSggXgjTP1EMncnKiyx+A7Mbwe TUovSWz3sYSpcHzc2CkL6dK/QaBvC/yKBbylekfVxycAsWqB5y48iEkn66GeGw01Wi7H 7apOkLvHLnqATZtqPgP0sXcin2k/FEVZ4rp4E0SaMXuUE/Bvj/LFvw2StAn3WDLZ+e8F B5/J7xKTOWyAw5mPGhfTwqs/5p8OXcGwjrnr/ImZJoVPsmidzc6TlBaMBh+ltY2Bwpcn UTS8K7z/CKxdNkUzBdhL/XRM40NiYdmWCAxmRUXJPgpFZofJGyE96FtX4eMVvEvjrztc jYSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=gpE8cWrc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m8-20020a1709026bc800b001d06d7f9134si3063174plt.97.2023.12.09.04.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 04:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=gpE8cWrc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 02A7C805F9E8; Sat, 9 Dec 2023 04:05:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbjLIL5V (ORCPT + 99 others); Sat, 9 Dec 2023 06:57:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjLIL5U (ORCPT ); Sat, 9 Dec 2023 06:57:20 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A7F10DF for ; Sat, 9 Dec 2023 03:57:26 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a1ca24776c3so829309066b.0 for ; Sat, 09 Dec 2023 03:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1702123045; x=1702727845; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mj9IkjGM5bRDRMCtZPs5pD8acnCJT6TuxhCGWsEoCBo=; b=gpE8cWrctNE5uq6ayiROwrSSvv5RMFp1Uod0s6dO2YgmjuAaBVq7kpKthAeDaa8Sh9 PAeQNvTko6CMpD8TrCWJUts3a0d30pgX6bLAeK7Ni8+qLQCHdmdDepHsxX8vPxe+5w73 FWPxR7KEvrpujSGcSfOMDWgYzU1gjJDpvJ2JfW0/1E9oQzlLIqJhioqXUut/LFoBuLWN 83zudLSl0rVJ2j2ZJ9wT0WmCffYJGELNnj/qrzjxohra9op6+VbcaMv1H7T8p/opVvV1 73H82jgdciBSSjzgZT1WaflwMhl5/+Xl29aisijFJexDf2rG1sUj8aLlgg/8rjia1IRp QPkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702123045; x=1702727845; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mj9IkjGM5bRDRMCtZPs5pD8acnCJT6TuxhCGWsEoCBo=; b=dW437dO9WJRSpiCUmiwtCrmv9CJGyLdPpeFYCmvhDX51iTKvEdfHB5/MDkhQrQ+XZc Zcie4K0MPPVqyHdiWwSM+u8T6hjHfd3OG9iaMhuJdWfvyNXwG8xUeRX6nu5nIDGVdZM6 FewbHjsTwJA2JLvi0jZnr+W2ouxXpx2s3QYUb0R7bOWCMLkgjIvCSCxzm6dfJDfepMxd hOYRhNHYkWDGHv4EMaLeQVNb+3E08nQAjshQnRSL4LC1u+akD70N50/zDpUeexbtAAM7 z3XU6e85wzrV1awCUAsMKAriJt6OKjWC59uaxeqPJezILjhwz9oTioCJQA6OEkDEEfvm 9Evw== X-Gm-Message-State: AOJu0YzAeQmwIS4KHVjJmPcM5Mj+6yDGC7IkdxcalbbZn+1AzHUFfxSA MWm1w3S5PDUWpiGomZOvYEmngQ== X-Received: by 2002:a17:907:da6:b0:a19:a409:37ce with SMTP id go38-20020a1709070da600b00a19a40937cemr2110755ejc.39.1702123045154; Sat, 09 Dec 2023 03:57:25 -0800 (PST) Received: from ?IPV6:2a10:bac0:b000:731f:e6b0:e567:aab6:1db2? ([2a10:bac0:b000:731f:e6b0:e567:aab6:1db2]) by smtp.gmail.com with ESMTPSA id mn6-20020a1709077b0600b00a18374ade6bsm2129793ejc.67.2023.12.09.03.57.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Dec 2023 03:57:24 -0800 (PST) Message-ID: Date: Sat, 9 Dec 2023 13:57:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] KVM: x86: User mutex guards to eliminate __kvm_x86_vendor_init() Content-Language: en-US To: Sean Christopherson Cc: pbonzini@redhat.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231030141728.1406118-1-nik.borisov@suse.com> From: Nikolay Borisov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 09 Dec 2023 04:05:09 -0800 (PST) On 30.10.23 г. 18:07 ч., Sean Christopherson wrote: > On Mon, Oct 30, 2023, Nikolay Borisov wrote: >> Current separation between (__){0,1}kvm_x86_vendor_init() is >> superfluos as > > superfluous > > But this intro is actively misleading.  The double-underscore variant > most definitely > isn't superfluous, e.g. it eliminates the need for gotos reduces the > probability > of incorrect error codes, bugs in the error handling, etc.  It _becomes_ > superflous > after switching to guard(mutex). > > IMO, this is one of the instances where the "problem, then solution" > appoach is > counter-productive.  If there are no objections, I'll massage the change > log to > the below when applying (for 6.8, in a few weeks). > >  Use the recently introduced guard(mutex) infrastructure acquire and >  automatically release vendor_module_lock when the guard goes out of > scope. >  Drop the inner __kvm_x86_vendor_init(), its sole purpose was to simplify >  releasing vendor_module_lock in error paths. > >  No functional change intended. > >> the the underscore version doesn't have any other callers. >> Has this fallen through the cracks as I don't see it in 6.7?