Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5578926rwb; Mon, 8 Aug 2022 23:44:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aKpHTQHIcH6xZtPa5UHv7UXn9DGg4/I/G8C7+kfWp4cmuy7kIYpoHdt/6vzbjQSuq9NcV X-Received: by 2002:aa7:c30c:0:b0:440:a189:541d with SMTP id l12-20020aa7c30c000000b00440a189541dmr8117983edq.64.1660027471943; Mon, 08 Aug 2022 23:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660027471; cv=none; d=google.com; s=arc-20160816; b=M9beSDMZyEkdpgc8xKf+q+WSMXIfSGT91T/28DmXWDwkbIzp42cn6nnnR0TsBdBJca AsugSEwXuQgOReuneKZm3dlH7YYzycsW6xsrEarN+NhdSJpqS7z8QxAtKAbf35mDEzNt Kj5L4Ewf2MjcEHl33hnqX5EQ6w7huwWu9QEjHXMiuRSOaHQMSPEL+eHVSZ/zd8z0NRUs OrUSJcbkTBGqVMw1fAgYCr1k9SN942ErU+WQYpIi9wN5MQ2nZG0vfJhUlYoFIJM4xBwA Gi1MA131PU8l1PEClOsB5ycQyRJmOC7HContDJ8hBO6bcc9QjcJKRF7GIwpzWjauHWxU KINQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=q2eAM1/hYw4jzhc9gj4LD1tO4qXa+Z9mYKQuildX4rA=; b=ZvG6vKjpeljg7SdjW/d5SDfzHyWE3W7PAFWtyH6KpR6WivRkGx33shrYNucwjPMOU1 vHFT+jg2BwNIxIyvIbq00fdF+bTj/UyIx3g6gA4dbyqIurJcxYiSXYAYAtyb7fTfXWfl qrotuWTUfSuLHpcx52UPRmx1GgwTVa/rxkTeqONOapbpJ70GL9437OYPhZyZWsGoKQTs PB8jzDsb8kcDqOTbg8sss5XgT47t+/Vg8RO0BD0qZH9MVyYwGbP4fsv++YRUzC6dQjH9 AyU1LP/z+LPV1iSnfOSOY1slCUSg4bwy0Ztjk8VyQyMFsjplSjcXDXgvcSb3D3CsPTKs jSUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Mtyz6qgQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go16-20020a1709070d9000b0072b4cba9671si1490718ejc.186.2022.08.08.23.44.04; Mon, 08 Aug 2022 23:44:31 -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=@redhat.com header.s=mimecast20190719 header.b=Mtyz6qgQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237821AbiHIGfd (ORCPT + 99 others); Tue, 9 Aug 2022 02:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237733AbiHIGfb (ORCPT ); Tue, 9 Aug 2022 02:35:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC88E13E2F for ; Mon, 8 Aug 2022 23:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660026930; 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=q2eAM1/hYw4jzhc9gj4LD1tO4qXa+Z9mYKQuildX4rA=; b=Mtyz6qgQRy7qBrFIFqwim3Jrntp0K5Imga7sH7pBgDHUeBsaF7k5xvUmnm1O7ONCqE8dx3 5V43jroPoN2sa/JeWcYRumXv/SsHGuoKWQ1bMw79joy1r6DTVj5ktwJz6saOMzcy1hUhSU duCXGJ4wxtBto3BJtYLdYf4E7CDMmkA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-4bi-5j_ePrmKV_eqokFj0A-1; Tue, 09 Aug 2022 02:35:19 -0400 X-MC-Unique: 4bi-5j_ePrmKV_eqokFj0A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC68F3C0E20D; Tue, 9 Aug 2022 06:35:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA20318EB5; Tue, 9 Aug 2022 06:35:15 +0000 (UTC) From: Florian Weimer To: Gavin Shan Cc: 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, seanjc@google.com, 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 References: <20220809060627.115847-1-gshan@redhat.com> <20220809060627.115847-3-gshan@redhat.com> Date: Tue, 09 Aug 2022 08:35:14 +0200 In-Reply-To: <20220809060627.115847-3-gshan@redhat.com> (Gavin Shan's message of "Tue, 9 Aug 2022 14:06:27 +0800") Message-ID: <87y1vxncv1.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 * 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? Thanks, Florian