From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3146CC6FA86 for ; Fri, 23 Sep 2022 06:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbiIWG3q (ORCPT ); Fri, 23 Sep 2022 02:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbiIWG3S (ORCPT ); Fri, 23 Sep 2022 02:29:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A75451280F9; Thu, 22 Sep 2022 23:27:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F346612F0; Fri, 23 Sep 2022 06:27:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06BEBC433D6; Fri, 23 Sep 2022 06:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663914469; bh=TdJrTT8FDQYJZs18nJ4Mh6O+0KQmY7Nw9igqLQnPdHg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dj90cAbpLQwo0BQCpgx5QtvWWoCxxsRGMyxHbRtcniQDPc/eSESsBaV03vBz2W4SZ PU3EViDNQ13xk1gDgM4A8zZApDXj/zXhXQXb8j68AneZ2cJSJCbY4g4Xn+V9Z1qidD Vk6LoRQ41AIDMOMJYb7vvZCJbIeR1Xn36Ahkns28= Date: Fri, 23 Sep 2022 08:28:20 +0200 From: Greg Kroah-Hartman To: Shuah Khan Cc: cgel.zte@gmail.com, pbonzini@redhat.com, shuah@kernel.org, seanjc@google.com, dmatlack@google.com, jmattson@google.com, peterx@redhat.com, oupton@google.com, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jinpeng Cui , Zeal Robot Subject: Re: [PATCH linux-next] KVM: selftests: remove redundant variable tsc_val Message-ID: References: <20220831143150.304406-1-cui.jinpeng2@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Sep 22, 2022 at 12:45:22PM -0600, Shuah Khan wrote: > On 8/31/22 08:31, cgel.zte@gmail.com wrote: > > From: Jinpeng Cui > > > > Return value directly from expression instead of > > getting value from redundant variable tsc_val. > > > > Reported-by: Zeal Robot > > Signed-off-by: Jinpeng Cui > > --- > > tools/testing/selftests/kvm/include/x86_64/processor.h | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h > > index 0cbc71b7af50..75920678f34d 100644 > > --- a/tools/testing/selftests/kvm/include/x86_64/processor.h > > +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h > > @@ -237,7 +237,6 @@ static inline uint64_t get_desc64_base(const struct desc64 *desc) > > static inline uint64_t rdtsc(void) > > { > > uint32_t eax, edx; > > - uint64_t tsc_val; > > /* > > * The lfence is to wait (on Intel CPUs) until all previous > > * instructions have been executed. If software requires RDTSC to be > > @@ -245,8 +244,8 @@ static inline uint64_t rdtsc(void) > > * execute LFENCE immediately after RDTSC > > */ > > __asm__ __volatile__("lfence; rdtsc; lfence" : "=a"(eax), "=d"(edx)); > > - tsc_val = ((uint64_t)edx) << 32 | eax; > > - return tsc_val; > > + > > + return ((uint64_t)edx) << 32 | eax; > > } > > static inline uint64_t rdtscp(uint32_t *aux) > > My understanding is that this patch isn't coming from individuals that work > for ZTE. We won't be able to accept these patches. Refer to the following > for reasons why we can't accept these patches. > > https://patchwork.kernel.org/project/linux-kselftest/patch/20220920063202.215088-1-ye.xingchen@zte.com.cn/ Thanks for catching this. Also this address has now been banned from the kernel mailing lists, so watch out for patches sent to maintainers that do not show up on lore.kernel.org. thanks, greg k-h