Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2928544rdb; Fri, 22 Sep 2023 12:18:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3XejSXB7JVvJ1vcjw/hijoQ/nvDCl5xZJKbdyP1hszsj9RjoeEQB63WFQTw3fC4qbgF7H X-Received: by 2002:a05:6a20:bb21:b0:15d:9a73:b146 with SMTP id fc33-20020a056a20bb2100b0015d9a73b146mr335199pzb.54.1695410289684; Fri, 22 Sep 2023 12:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695410289; cv=none; d=google.com; s=arc-20160816; b=ZlDE8wdHe9O0wJEcqiLOzVAp0bkPByAfpTHFx3+rPjTICxeFo1wUh9DzcOYWZ1kPjw N87WTtK8JxjGu7bbRyiUjw4TfHFlB4HN209/9g4CWMWvg+ykJhKx1b8eQrK50t85HN3n u8N6T+hxe4pvj7UJn7q4GlaUEWjWxUb7sD1V4E7yMyu8lM54qdY9FkWHNqSyVAbi1Ym/ kVckFzkMhGPCVLk6jw/Fky6kegonNUko9KnCkO4Bl8UfGl0jD1IGjPjKHVj5c5ir7rhd Ap51g21aGpvk63ZKNaHZsS5aAL9By4ngtB4Cng4xcXflL4102IefQtREl+51/89FQB4P hSBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=yymdn5Ib3vdedE1bKPjXhrIk07DP2toWMx0YBeOSCKc=; fh=VtO5FTDWkiEWg9L/zOPwtrxA/JAqmiAe7mVLSJpwU/c=; b=McDhLDz9BOYpk8E7e+ANNGN61AdH7zI8x/37UkqF8Ow7U+y9AoymNluhM1WGPB8/sR 9asZJ5Qu37kH6dWI3V34amhwsvo8B7nLHrBgTKU2mew47jde6lUceZm7ZzmqkEMBQZPm 5PZRrcEnpG8jcWdD5WZGpRsQVr9b402DnJhSZuc5e2jne6fgGMSegqO8oJAqNKhxY9bQ 53p/F+x98gzCPHFavElHKr9VUyit/NkCQqwE7KKR64R8vAyh7M/xbLFnPhzuV4FAMgUQ bAep+amWsF5iv3yZsrakLiuatbl+B6h7LGILXaBC/FBcoj2u5WoOfObU0WHzHEVuNeBK HYLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JCA+KUnb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CIDz5h5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 142-20020a630294000000b00578b6e32b5dsi4265708pgc.405.2023.09.22.12.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 12:18:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JCA+KUnb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CIDz5h5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 95E488271746; Fri, 22 Sep 2023 08:00:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbjIVPAM (ORCPT + 99 others); Fri, 22 Sep 2023 11:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232056AbjIVPAL (ORCPT ); Fri, 22 Sep 2023 11:00:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1CE196; Fri, 22 Sep 2023 08:00:04 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695394802; 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: in-reply-to:in-reply-to:references:references; bh=yymdn5Ib3vdedE1bKPjXhrIk07DP2toWMx0YBeOSCKc=; b=JCA+KUnb692VWlx1fmj161S4ivDwYTrM1u8X2p5arIqoauHvahJMRyQgJNnCijDhvdZTN5 2vhPfci1iBhuF4Qy2zYMF8JGpNHrq0VAOBaIOZz4r3zSiAs1S0WjK2Y/a5ZLPZiRHiR72P REbPguOF78kSQmQ7J0MndgAQ5u9+VLIa/hw1U5uaXSml+++MgocMsUUHEo8yUUBhh55/dy QQw13O85IYkSyENm5eCNprEvBu0VGY6MYJBQev1Uj1n9rrZjN0zSSXrLOJq5WBnRYuLa3i /YCovSEvga/R0iW5oDIVClJYgWEFtXfzNaoHbWAAyTqcD536K6Nb5/nqacqCUg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695394802; 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: in-reply-to:in-reply-to:references:references; bh=yymdn5Ib3vdedE1bKPjXhrIk07DP2toWMx0YBeOSCKc=; b=CIDz5h5BcX/Bz/jkuzgX2qYw3Xx+SDJYkCZCT8rgToE1CkxZkoLWZYWz8rraUAqGtvF28b 64aTOX6aC7JwbuBQ== To: "Li, Xin3" , "Li, Xin3" , Nikolay Borisov , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , "xen-devel@lists.xenproject.org" Cc: "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "Lutomirski, Andy" , "pbonzini@redhat.com" , "Christopherson,, Sean" , "peterz@infradead.org" , "Gross, Jurgen" , "Shankar, Ravi V" , "mhiramat@kernel.org" , "andrew.cooper3@citrix.com" , "jiangshanlai@gmail.com" Subject: RE: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support In-Reply-To: References: <20230914044805.301390-1-xin3.li@intel.com> <20230914044805.301390-4-xin3.li@intel.com> Date: Fri, 22 Sep 2023 17:00:02 +0200 Message-ID: <87o7hugsnh.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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]); Fri, 22 Sep 2023 08:00:12 -0700 (PDT) On Fri, Sep 22 2023 at 08:16, Xin3 Li wrote: >> > > +static __always_inline void __wrmsrns(u32 msr, u32 low, u32 high) >> > >> > Shouldn't this be named wrmsrns_safe since it has exception handling, similar >> to >> > the current wrmsrl_safe. >> > >> >> Both safe and unsafe versions have exception handling, while the safe >> version returns an integer to its caller to indicate an exception did >> happen or not. > > I notice there are several call sites using the safe version w/o > checking the return value, should the unsafe version be a better > choice in such cases? Depends. The safe version does not emit a warning on fail. So if the callsite truly does not care about the error it's fine.