Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp169656rwb; Wed, 10 Aug 2022 17:09:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6EhJOHni45I7ta9IhuQdKy7vedIJUqlX6Dro30vjU+ef0SNv+atDh6pl+6vh44TrV/Qvvh X-Received: by 2002:a05:6a00:2294:b0:52e:2371:8bb with SMTP id f20-20020a056a00229400b0052e237108bbmr29139671pfe.42.1660176543608; Wed, 10 Aug 2022 17:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660176543; cv=none; d=google.com; s=arc-20160816; b=c6dflOd/wVHepZBsPIasN+r6pwSwTE+1MMP41GDxJunsheijP9MK7jmMvebMADoqXs czP4Yu22CZbbJcQBgYWy7xVqXchN/XnoWgREnoAFSCATtq4jBktxZ2jItmiD10hFXP1L Jpw8DrUoAUFeAVJyrsIKtCG76ROEHdeiwrMUDYK95Q9osiXlO3rsNIwQ9EpNhraMeLir I77aL6qnsR/Uz0A8S+KmzlvXYHZAEsmK78VWVyM/UM30LgOhHxKrGnuBQHEbZgDNww3p oHS+VJNhl+aB4Vg3YdXisOeBbVh0E9tTqF2sg2YUvoxA+Cs/qgPeKV5l+t56xYwet0HF pnJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=YkaDvS1GtXz21uszXexDjRybO4QCX+ccRTITPMo9eXE=; b=FOMZK4XHtCg0MoUIzhn+P7cgt7Gu0Bl33HsIOc0oSDH6uA1z0w269anGyWiLAzV/d8 4rM/Vs49SbgXEbIFtE/Ht1mhrLocPzJHI/MFSEnzRyd30IeVN64oJBk4+xWx5YLUjyRn fUVo2f1Yu8yPGcK1nRrt9woOhK+5JFmNdsImSSnhdESKJ6iWuunhugSteZGx6AhlqMPL SKzDY0emnBBEhbCmDM3gaz0LnZTkxPKE7ZL6+2ftOO0kZAyFMo94QrxnPnEO8UxOzXjy Ysj+0mp5FT8Nw8cBKV6izUV8Y0QvY6rp/hZ2av0WPG1HoSJuLVHGYU6EYNkPEaTM0ppS SA2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fHa+aBJw; 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 r26-20020a639b1a000000b0041c2c6ad5fesi17628746pgd.376.2022.08.10.17.08.50; Wed, 10 Aug 2022 17:09:03 -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=fHa+aBJw; 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 S233603AbiHJX5y (ORCPT + 99 others); Wed, 10 Aug 2022 19:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232777AbiHJX5w (ORCPT ); Wed, 10 Aug 2022 19:57:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C3E56CF73 for ; Wed, 10 Aug 2022 16:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660175870; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YkaDvS1GtXz21uszXexDjRybO4QCX+ccRTITPMo9eXE=; b=fHa+aBJwW/oihUz0cP73nxXbqgq+b03Czf7HUICU4R/OyRmQbBFGvi3XP0fXXJXxeWqQn9 Jb9E8dWdqDstSCvFFQu9jzcRIRpfG+jdpYcO1FkRKN/osv3Fdn+OmFaPK9hQ9LOe3WXcoo yO2Qo+OdhuMwU/kmYuP4Glxw1srLtIU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-252-e1rY7k2YO5CQOlhqspYqBw-1; Wed, 10 Aug 2022 19:57:40 -0400 X-MC-Unique: e1rY7k2YO5CQOlhqspYqBw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0D8F18A64F7; Wed, 10 Aug 2022 23:57:39 +0000 (UTC) Received: from [10.64.54.77] (vpn2-54-77.bne.redhat.com [10.64.54.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6BDA0C15BA3; Wed, 10 Aug 2022 23:57:35 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v2 1/2] KVM: selftests: Make rseq compatible with glibc-2.35 To: Paolo Bonzini , Mathieu Desnoyers Cc: kvmarm , KVM list , linux-kernel , linux-kselftest , Florian Weimer , shan gavin , maz , andrew jones , yihyu , Sean Christopherson , oliver upton References: <20220810104114.6838-1-gshan@redhat.com> <20220810104114.6838-2-gshan@redhat.com> <876568572.367.1660134156963.JavaMail.zimbra@efficios.com> <1e41a634-0419-e0a8-364c-2e30ed2dbe4d@redhat.com> From: Gavin Shan Message-ID: <234b81a0-d7eb-ee92-3ed3-ce2abf566b63@redhat.com> Date: Thu, 11 Aug 2022 09:57:32 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <1e41a634-0419-e0a8-364c-2e30ed2dbe4d@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 On 8/10/22 10:29 PM, Paolo Bonzini wrote: > On 8/10/22 14:22, Mathieu Desnoyers wrote: >>> >>>     /* >>>      * Create and run a dummy VM that immediately exits to userspace via >>> @@ -256,7 +244,7 @@ int main(int argc, char *argv[]) >>>              */ >>>             smp_rmb(); >>>             cpu = sched_getcpu(); >>> -            rseq_cpu = READ_ONCE(__rseq.cpu_id); >>> +            rseq_cpu = READ_ONCE(__rseq->cpu_id); >> #include >> >> and use >> >> rseq_current_cpu_raw(). > > Thanks, I squashed it and queued it for -rc1 (tested on both > glibc 2.34 and 2.35). > Paolo, Thanks for the makeup, which looks good to me :) > diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c > index 84e8425edc2c..987a76674f4f 100644 > --- a/tools/testing/selftests/kvm/rseq_test.c > +++ b/tools/testing/selftests/kvm/rseq_test.c > @@ -29,7 +29,6 @@ >  #define NR_TASK_MIGRATIONS 100000 > >  static pthread_t migration_thread; > -static struct rseq_abi *__rseq; >  static cpu_set_t possible_mask; >  static int min_cpu, max_cpu; >  static bool done; > @@ -218,7 +217,6 @@ int main(int argc, char *argv[]) >      r = rseq_register_current_thread(); >      TEST_ASSERT(!r, "rseq_register_current_thread failed, errno = %d (%s)", >              errno, strerror(errno)); > -    __rseq = rseq_get_abi(); > >      /* >       * Create and run a dummy VM that immediately exits to userspace via > @@ -256,7 +254,7 @@ int main(int argc, char *argv[]) >               */ >              smp_rmb(); >              cpu = sched_getcpu(); > -            rseq_cpu = READ_ONCE(__rseq->cpu_id); > +            rseq_cpu = rseq_current_cpu_raw(); >              smp_rmb(); >          } while (snapshot != atomic_read(&seq_cnt)); >