Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2788966rwi; Fri, 21 Oct 2022 07:58:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d7hFW6sxLsX1l4Ys/mpDesYFDuga5zUGRisU/Xk7/wKG+a8Fj4Qdc01b+Bebz7zc6E0lz X-Received: by 2002:a62:ea0d:0:b0:55f:8624:4d8b with SMTP id t13-20020a62ea0d000000b0055f86244d8bmr19539939pfh.74.1666364326201; Fri, 21 Oct 2022 07:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666364326; cv=none; d=google.com; s=arc-20160816; b=FoKh+RDbP/sauJT4A+Nwvx8KbmGkpXjf6MpIkwXLCtB5w6ui1YTyWwSwupLGJHnGxd aB/ZH/A9OXBv4hnS70n0dJtcYwn5B4H7uOmeq+onm1l+Rn3G/0Wdsh0kJ06b+FUOf4+d GA729TJmp4sfuOz0xt+rRSoaKjY6SEvlTEwmmpu3yA5EWi566HbPNRSe8/bg7tnmHBpV PVwQ58m4lsxNl0IXlfJjeymnOtJJ9y+odONjE4+A4QuIQz/WtBa2ds43wYH6Lm8VooTw ZU383o1H/PDvF+uCiJSzPR3KnBgWV7FNZhS1yz0TETQOoqxB8jrCZ5chFKlLBSx8wBiL RI1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=ZsPij9BvW1d4VCHGwc7667RVR2VkSQ3/k+XB1C+z4tA=; b=zF9k3RajTDqbkKzb+N7NathrEV/9QvJz6gyTl2tOO07vcwMgxSdRlB+l+jL2jYlpW9 pSRRoA5FVoe0lsDUmZH7dYxWvAd8lgwRJ2IQtrJBfVqQCe4dylh0jN9b866AivaXPO/l ZhbPltyZcy4mdO7pe3ItPtngteb56+HwPPa1QFEvPbdGrt+MhphsX0smWvFqN/DFCOYD mEdsciFMqBFtMlsabhT9q0f/p7lZaXqCXaA/TzaDjOD5wDZg5GcQWkkS/KblwkgZmNgV d0AUO5chXV/N79xa/4JL6Khi26JLnz16KMRtvtR87eENAd7yf3q0jJ64vJFZ4EMmqkmB uNKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dRXKJMxm; 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 v2-20020a634642000000b00462ed2102e4si23713675pgk.368.2022.10.21.07.58.33; Fri, 21 Oct 2022 07:58:46 -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=dRXKJMxm; 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 S230432AbiJUNU7 (ORCPT + 99 others); Fri, 21 Oct 2022 09:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbiJUNUy (ORCPT ); Fri, 21 Oct 2022 09:20:54 -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 ESMTPS id AA89D24E38E for ; Fri, 21 Oct 2022 06:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666358450; 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=ZsPij9BvW1d4VCHGwc7667RVR2VkSQ3/k+XB1C+z4tA=; b=dRXKJMxmepjAj74b+76AQ3LVWS6kWKDakUfY4nG1ZSGGP5f7bK1TNV/0w89dnRKWlRCuH/ r+ZyXbH2ipxlfr02I+TWrEycZK7f+6A/YWXbyXgDY1bwTnU1+Hx4jwN4M5KEP5ZJGuLizs 1fnjJ8iADjlp2iCZsXMWh4fFruBHm7c= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-662-i1A2PuoiNxmi5pn9vig8RA-1; Fri, 21 Oct 2022 09:20:49 -0400 X-MC-Unique: i1A2PuoiNxmi5pn9vig8RA-1 Received: by mail-ed1-f70.google.com with SMTP id y14-20020a056402440e00b0044301c7ccd9so2415031eda.19 for ; Fri, 21 Oct 2022 06:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZsPij9BvW1d4VCHGwc7667RVR2VkSQ3/k+XB1C+z4tA=; b=yuX/46xLXYfoKh21Zu1eAYDNfxJrinwFYsPo4FyZurHwK9bqYGvwti8Taq6kexP+RO XY36LuveIA8ySUNGdEeUg66XgkuKORiT3gK7u/7XsG3yXzVOLl/2SIa/OlIVBfK5sLA3 /vrizF6oXruBA5Q2gOxmavfch8h6UNcjArpp/ND9NQNvCZ0bVaOLhQQ9mLKlYTdcchDp ei74L6xYUaosquHJH8HPNCCnMBXRuScn4BYnKyBKtJr36LiAnVIghm2HpuNheAQFtRvK tLelHgtYNlRaz7hWZAqZs9Luu+RgW3xiek0dPI9koVrIJaffMJiEeWjIIumTRC0j9DC7 ptqw== X-Gm-Message-State: ACrzQf2PeJR+dXEfwRx9B+5x3Afo5sQWdhFSZbQFtsLskrpx27FPDj1g 52qSGFE4rv+DsDjBYE8Mo+xxfv8YkOwdJzaTpXA6142JgU5Nnv0WngDNuZ9M8aiEFtM1JLd4ewp 4EMi6fh/oW9OSlYrR1ttbEqFpeoSIC1RzIveq9xjygEnDnNLRVADRoNaufq15lb2xscgGNv6sTU xu X-Received: by 2002:a17:906:d550:b0:78d:a6d4:c18f with SMTP id cr16-20020a170906d55000b0078da6d4c18fmr15768855ejc.113.1666358448492; Fri, 21 Oct 2022 06:20:48 -0700 (PDT) X-Received: by 2002:a17:906:d550:b0:78d:a6d4:c18f with SMTP id cr16-20020a170906d55000b0078da6d4c18fmr15768817ejc.113.1666358448188; Fri, 21 Oct 2022 06:20:48 -0700 (PDT) Received: from ovpn-192-65.brq.redhat.com (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id de13-20020a1709069bcd00b0078d957e65b6sm11587521ejc.23.2022.10.21.06.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:20:47 -0700 (PDT) From: Vitaly Kuznetsov To: Sean Christopherson Cc: kvm@vger.kernel.org, Paolo Bonzini , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 33/46] KVM: selftests: Hyper-V PV IPI selftest In-Reply-To: References: <20221004123956.188909-1-vkuznets@redhat.com> <20221004123956.188909-34-vkuznets@redhat.com> Date: Fri, 21 Oct 2022 15:20:46 +0200 Message-ID: <874jvxcnyp.fsf@ovpn-192-65.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 Sean Christopherson writes: > On Tue, Oct 04, 2022, Vitaly Kuznetsov wrote: ... >> + >> + r = pthread_cancel(thread); >> + TEST_ASSERT(r == 0, > > !r is generally preferred over "r == 0" > >> + "pthread_cancel on vcpu_id=%d failed with errno=%d", >> + vcpu->id, r); > > Do you happen to know if errno is preserved? I.e. if TEST_ASSERT()'s print of > errno will capture the right errno? If so, this and the pthread_join() assert > can be: > > TEST_ASSERT(!r, pthread_cancel() failed on vcpu_id=%d, vcpu->id); > The example from 'man 3 pthread_cancel' makes me think errno is not set. 'man 3 errno' confirms that: " Note that the POSIX threads APIs do not set errno on error. Instead, on failure they return an error number as the function result. These error numbers have the same meanings as the error numbers returned in errno by other APIs. " but nothing stops us from doing something like #include ... errno = pthread_cancel(thread); TEST_ASSERT(!errno, pthread_cancel() failed on vcpu_id=%d, vcpu->id); I believe. -- Vitaly