Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6375671rwb; Tue, 9 Aug 2022 14:15:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR7KIqaGhNv62obhBMOHr81NZzKeCoXqeHJv1ZAQFENkdiRryzX0z9xa7GCcPMGBbYsuzPZS X-Received: by 2002:a05:6402:4442:b0:43b:c866:21be with SMTP id o2-20020a056402444200b0043bc86621bemr24072644edb.28.1660079744510; Tue, 09 Aug 2022 14:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660079744; cv=none; d=google.com; s=arc-20160816; b=ngpDYBLHVMKD+VHiCBE/ijXlyJhBfjCbvMdvOov4d4omFgJYRhqzFstXuXZMvXJ+j7 8gagtbaZC7Gug13Kbg5Uu7YlXxWkzUsJxAzLRHZdLUh+RICwSfb2kt9a7KZvSRallGWq oHIJXtzWTUn8Zmip1Pm7ynrSkZ14AsYkzEO5uNe96SoxDCxp1nP2xuSGW3ibs7HBvUPv NTYOBkQrN+/L+xpCqzYB41ZbfBFe6ugc0yZPLiHyXkG3Zz9hqPezL5m0ASFohvhVjblW 6Xa4rg8aNOGw3CPZ0Vs/i4BRb/ozW9O7BeAad0Et1+qnhk2dkzFskPe/cFHT+ixf+JDP fWtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pJblVN/EwDKnGoYTvY52rorYjnKswwmvjLRNuq3g3VE=; b=isUuPKqH1cdIT+7oNRjI6vWdAKWUo3SqsK2spz4oRw36TKoitez5+fHwDJFwKEawLS 8kT7EPxtSiEZpcsEEEOZAb/AQKEdTcrHgRAmUKCyykmjQqFgCSnyTryhD3fLJVSBOhZx bDMcuIK6/Drg7+yoR9lyOniSyp0ZTQY+IuhGFGUq7AadJU0Lssf4FgitUkxggL8ZU8Y8 4ANKPqqp7tUdZaaxAktt9xxzABuZyM4kkxg3XCpqlJS7rcMr+on3FtxtWB10M9TLDWgL jvF/k+R99iOnYEGtO4VOkxfS09lVm+aaCsANlNyH7YMvbK6F0LilLJcuqzwbszG/Frgl A/SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GbUPKddy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec43-20020a0564020d6b00b0043d98dddc27si8203165edb.59.2022.08.09.14.15.19; Tue, 09 Aug 2022 14:15:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GbUPKddy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbiHIUyK (ORCPT + 99 others); Tue, 9 Aug 2022 16:54:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbiHIUxm (ORCPT ); Tue, 9 Aug 2022 16:53:42 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CFA15A24 for ; Tue, 9 Aug 2022 13:53:41 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id p14-20020a17090a74ce00b001f4d04492faso116648pjl.4 for ; Tue, 09 Aug 2022 13:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=pJblVN/EwDKnGoYTvY52rorYjnKswwmvjLRNuq3g3VE=; b=GbUPKddyRcffK7GnxZeqqcUioCOBYjZYcND1JWvpTTanaun1D9fGTvEAbdn125PW6m JLjs5YyKKh7edLtHVT0tHekB/pNop76ht7souklms4QnoaKiHs8glUoRTRM+Mfo8T9Wd Q8JXLAja5U0d1nkYehhAvAfuKo06DjcO+uoxCK8jXyV1FA9g3aXQEBfaTLKZJ6FVL/Mt NMgBfRYESMHWHpBAQGqe86ARj9HVA94d7TsUE/YkyfA1kBd8DX8QSHykjK5j4xexTJPv k3mNOu14Dx9T3iSZbwK0WM2QonrbFR+wdYL0qCqooRcYs3zUHOlu/GhNspIACNbPZ6x3 ZDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=pJblVN/EwDKnGoYTvY52rorYjnKswwmvjLRNuq3g3VE=; b=t0crquo8wrVPfFcQTyzHvb3+WIhFEnxrZbD1a0SqasoZY9JNbYXB2WlWIv+5vwUICi HCzfWQiMusae4qjBxBj6fSbXr/wkgx211hMu5OFQeka19JGUo1F1KCdFlJPhU04E2ey3 ceEOzofhjUwTr9/Nw7bySc5IBRIiGCaiSHqQXVxk+aps/6099o/uyelwG6LrGpuLm+ig Rr+43M+etS3WSApxX0pN+tnhundI/i1y+VreL5mZP2P3B94iJ2DLSahuR32ZwTOAKwRw JdvHzITT2pOQAmWig9I2tyRtd9nrNJelA4DeL5O9xzS+23GqSQwoX7I56kNVytsA7/Vy E0bg== X-Gm-Message-State: ACgBeo2BncQJ/Kb2fI30yvgV/5WIeVvLFwbcL8EceWZKWOmNVFtGOXXf hrSkK3DHsUCsKZOKMHWeISeqKIau/333GQ== X-Received: by 2002:a17:902:eb8a:b0:16d:c75a:c40b with SMTP id q10-20020a170902eb8a00b0016dc75ac40bmr25435222plg.102.1660078420716; Tue, 09 Aug 2022 13:53:40 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id u8-20020a170902e5c800b00170a359eb0esm5711482plf.63.2022.08.09.13.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 13:53:40 -0700 (PDT) Date: Tue, 9 Aug 2022 20:53:36 +0000 From: Sean Christopherson To: Gavin Shan Cc: Florian Weimer , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, maz@kernel.org, oliver.upton@linux.dev, andrew.jones@linux.dev, mathieu.desnoyers@efficios.com, yihyu@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH 2/2] KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test Message-ID: References: <20220809060627.115847-1-gshan@redhat.com> <20220809060627.115847-3-gshan@redhat.com> <87y1vxncv1.fsf@oldenburg.str.redhat.com> <87mtcdnaxe.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no 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 On Tue, Aug 09, 2022, Gavin Shan wrote: > On 8/9/22 5:17 PM, Florian Weimer wrote: > > * Florian Weimer: > > > > > * Gavin Shan: > > > > > > > sched_getcpu() is glibc dependent and it can simply return the CPU > > > > ID from the registered rseq information, as Florian Weimer pointed. > > > > In this case, it's pointless to compare the return value from > > > > sched_getcpu() and that fetched from the registered rseq information. > > > > > > > > Fix the issue by replacing sched_getcpu() with getcpu(), as Florian > > > > suggested. The comments are modified accordingly. > > > > > > Note that getcpu was added in glibc 2.29, so perhaps you need to perform > > > a direct system call? > > > > One more thing: syscall(__NR_getcpu) also has the advantage that it > > wouldn't have to be changed again if node IDs become available via rseq > > and getcpu is implemented using that. > > > > Thanks, > > Florian > > > > Thanks, Florian. It makes sense to me to use syscall(__NR_getcpu) in > next revision. Thanks for your quick review :) +1, and definitely add a comment to prevent future "cleanup".