Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6862402rwb; Wed, 10 Aug 2022 02:26:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR4k2phQvaKg38UqRMdDsELFyxMFNEl8Vxwr4bnXfJAMpj8HHLnVFZ2MMS2Qacfkufxzcl5Y X-Received: by 2002:a05:6402:64c:b0:43c:ea8e:85d6 with SMTP id u12-20020a056402064c00b0043cea8e85d6mr26350872edx.269.1660123573179; Wed, 10 Aug 2022 02:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660123573; cv=none; d=google.com; s=arc-20160816; b=Ko8wxWcQMVFAsbXMSKBARi3KgweSXoBh7kNYhrWr80OLFM0EcfTI9mHThfZS/EJZbd 1+z/E0Y9lrR0BUUUKH/AfvflHznpt9BX7k0czwW573e6OS5CeV5bU5pPSR22vLQRxU/H 0boCFWZSt5tz885Jtbqwtun3ZoXhuUFN4S5W8UQf3rtvvQxe3cRwKnWePPSklB9nQn/k MHihlgExKNC02aecTEycnh/kz5RhVC7cGmxqCDqtyzhtK8JFnhe3WHvK/PU8ySAcsrDH nvOVmvDFfiFaA4Yody+K7lGmTnXngURBehjVVeJTWECyNvhxoxu4/FmBRvG4G7w7fUsS varg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=BrnJHJ9Mo9d6LF8fLd160jO7vgau2DqXTrpWN+Q+1lI=; b=Yl8CG3qWbBeDcZILxvPzvcr8mSq3UxuytREU7cFPnWg3Qy9WxlLH6CO2x1qijgUl+z gF6K3/Uz9DsEn3Y7obfqhDnp/cErSo8XywfWLYVzakqM5KqgovghHzADBwsXkeKT/mm4 8qconHhaeVgNxZyicfBkPBEmzUMxJmBjWBbeS0n0+XKD0MLa/LkiRQiotp/MaCiGRBou hWaVwWUzmPCqAoVYFir9C9d4frLkzKYSkKGi1RInzrLj7rsGyOh34bUlb/L9LeV8ri3P e+WBRqzm9xTQUISrbrXrIyhvO92w62lWTtnk7Rse90aQmDQsPZbCu0zTiNjxryglRXuK SpOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N4l5kO7x; 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 w19-20020a056402269300b0042e0b28922asi12310420edd.7.2022.08.10.02.25.46; Wed, 10 Aug 2022 02:26:13 -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=N4l5kO7x; 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 S231199AbiHJJOq (ORCPT + 99 others); Wed, 10 Aug 2022 05:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbiHJJO3 (ORCPT ); Wed, 10 Aug 2022 05:14:29 -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 EB20C86C33 for ; Wed, 10 Aug 2022 02:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660122868; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BrnJHJ9Mo9d6LF8fLd160jO7vgau2DqXTrpWN+Q+1lI=; b=N4l5kO7xPQuFiy9um6uyOFaLK/B8ez6rtDf6SmjD0A/SQ/TvjJZ0j+uUWHlQPOKkfZcoxw IQqYf/I7vIo5ROE4jZ3950jvVOAfWe3E/2x6hSesefa93tjzbOO0sGH2pzQ4ihXccyDdFj ixoz/q2/KFNFKEb0uOvH5q3tTVs3OXo= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-257-vc0VuxHTP9qWxLlnf80lbg-1; Wed, 10 Aug 2022 05:14:26 -0400 X-MC-Unique: vc0VuxHTP9qWxLlnf80lbg-1 Received: by mail-ej1-f70.google.com with SMTP id gb41-20020a170907962900b00730961131a7so4020937ejc.1 for ; Wed, 10 Aug 2022 02:14:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=BrnJHJ9Mo9d6LF8fLd160jO7vgau2DqXTrpWN+Q+1lI=; b=Lc3hOfimVHYLp+BswgKzIHFfM7z8WwgVPWnamzC4HDk1ukI1upo4nGOZxK2cEtXjyw tpF60c/Ztp5C5nuMB+Hh/v4h1EvvyyoZUndyPxibcpws4v12sVvtWF7OAtkZVu+uLtxg LTTpsz3dpnM7ZtiwscaJDQ5VDRnirRI76KYzw8629f3U1XdOouC0Y2sUPD3nkbPwk46J OfYSjAGWRjGlVU5mdKhnwpzQ6T0maAsqAc3mB+bPizWY84jRXr1GbpFjtbcyIRCj4eSN 6UDKG60JR/ErHk/jIIZ8BkXP8rBZHFE+AqzdrNKRyLsGz4IGadq6KObEkw37TZAAV8Ow jX8w== X-Gm-Message-State: ACgBeo3+t66LwLtGsUIEgSangowSGmeH9DvfCIH8/GMhG8SAmt4x/ufh HF6T3xHRJRunb0ImwEQ6A3JXpwqDCQV35XtGzbCxEUAw9x1faGOJQP4qyTOKssmrecrTKAnnHLb Bg4lGBkTYbh93BH/4S0RHR65i X-Received: by 2002:a05:6402:1cc4:b0:440:5af8:41c9 with SMTP id ds4-20020a0564021cc400b004405af841c9mr17458846edb.339.1660122865384; Wed, 10 Aug 2022 02:14:25 -0700 (PDT) X-Received: by 2002:a05:6402:1cc4:b0:440:5af8:41c9 with SMTP id ds4-20020a0564021cc400b004405af841c9mr17458830edb.339.1660122865199; Wed, 10 Aug 2022 02:14:25 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id r17-20020a17090609d100b0073145afd156sm162913eje.80.2022.08.10.02.14.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 02:14:24 -0700 (PDT) Message-ID: Date: Wed, 10 Aug 2022 11:14:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US To: Mathieu Desnoyers , Gavin Shan Cc: Florian Weimer , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org, oliver upton , andrew jones , seanjc@google.com, yihyu@redhat.com, shan gavin References: <20220809060627.115847-1-gshan@redhat.com> <20220809060627.115847-2-gshan@redhat.com> <8735e6ncxw.fsf@oldenburg.str.redhat.com> <7844e3fa-e49e-de75-e424-e82d3a023dd6@redhat.com> <87o7wtnay6.fsf@oldenburg.str.redhat.com> <616d4de6-81f6-9d14-4e57-4a79fec45690@redhat.com> <797306043.114963.1660047714774.JavaMail.zimbra@efficios.com> From: Paolo Bonzini Subject: Re: [PATCH 1/2] KVM: selftests: Make rseq compatible with glibc-2.35 In-Reply-To: <797306043.114963.1660047714774.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A, 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 On 8/9/22 14:21, Mathieu Desnoyers wrote: >> For kvm/selftests, there are 3 architectures involved actually. So we >> just need consider 4 cases: aarch64, x86, s390 and other. For other >> case, we just use __builtin_thread_pointer() to maintain code's >> integrity, but it's not called at all. >> >> I think kvm/selftest is always relying on glibc if I'm correct. > All those are handled in the rseq selftests and in librseq. Why duplicate all that logic again? Yeah, rseq_test should reuse librseq code. The simplest way, if slightly hackish, is to do something like diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 690b499c3471..6c192b0ec304 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -37,6 +37,7 @@ ifeq ($(ARCH),riscv) UNAME_M := riscv endif LIBKVM += lib/assert.c LIBKVM += lib/elf.c LIBKVM += lib/guest_modes.c @@ -198,7 +199,7 @@ endif CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ - -I$(