From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80851C2B9F4 for ; Mon, 14 Jun 2021 14:59:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23A3261019 for ; Mon, 14 Jun 2021 14:59:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23A3261019 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.141612.261518 (Exim 4.92) (envelope-from ) id 1lso40-0008M9-7p; Mon, 14 Jun 2021 14:59:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 141612.261518; Mon, 14 Jun 2021 14:59:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lso40-0008M2-4W; Mon, 14 Jun 2021 14:59:44 +0000 Received: by outflank-mailman (input) for mailman id 141612; Mon, 14 Jun 2021 14:59:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lso3y-0008Lu-7o for xen-devel@lists.xenproject.org; Mon, 14 Jun 2021 14:59:42 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 229b1db1-fad4-4716-a850-ef13262a142a; Mon, 14 Jun 2021 14:59:41 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2054.outbound.protection.outlook.com [104.47.2.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-7-1HI_6QEgNiOn38S9iAGQeA-1; Mon, 14 Jun 2021 16:59:39 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4381.eurprd04.prod.outlook.com (2603:10a6:803:6d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Mon, 14 Jun 2021 14:59:38 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::f06c:6f5d:34d2:1c36]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::f06c:6f5d:34d2:1c36%5]) with mapi id 15.20.4219.025; Mon, 14 Jun 2021 14:59:38 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR2P281CA0022.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Mon, 14 Jun 2021 14:59:37 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 229b1db1-fad4-4716-a850-ef13262a142a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1623682780; 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=wpD3cR1gk7HASzyY+f5N3PorKTwg02z3WvEFIYP4MRw=; b=CDJnUb8dKCud2EaUVli/d9o+fn8/6ZgBJEyzbzlXvyQcScBaqW1PV42E7QPS5MiLwUV77J LUA7+oM0rPb+u1AL81MCV/7C2TmUrsuwEgVwydxJuysqfJBe4ZTBIJYI0agg/sAa+oLEQf 4iffWfs5up3e4Idxd/OXOce64bRNClc= X-MC-Unique: 1HI_6QEgNiOn38S9iAGQeA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXE7E7y/gW2k+wbWuCGPYlmTJPnWVbrfXGB7T0xKcby3bu+/II0wdNSlY4cBqPOyhLs+A0EvrlF0oIOdK0zBlj0aKcpssxI6DF6aAfL+BNR9FtIHEQgi32yGSsZmKDCY2fU5w9dqrsXGVoV/L2ApziuGtEERlwcujdKYbZ6hYsZRpUT261HkK1vIxVDMP263H0wwhP8sZaAW6pNtindUtc8Y+3HhdTi96/4IVIJ6qhIqNQ3qgORzLeXyw33CNvrEPJKlVnc3f/8whOea/15OFywAMVhjTrjTvIfs3w938vlvk/r1mdm7ccVsJZTLv7bPJ2ZYrNtxyLSgkSmQXzFEJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wpD3cR1gk7HASzyY+f5N3PorKTwg02z3WvEFIYP4MRw=; b=AC0ucYPOPAR6/ejvNFTzl0uKaExRFnA1M1s9Go1uu7+B8iuWeUVZ8fQkiLu82QA9EkK7NhTED1yRilrE1dfb7mklLyanN5+ATVCw4qRuowDKmW1m+IX2+agOQqyqRHlKE539JtqMwBoFEFHs7hSoqHM/rksC+q3e069mLrv0s5XvVzAz0i4nGbHDUAKppmbSoizrekD8fT+0ToL1BCqMIaYKrUDmvhozGBLbfKfpZ4ufzzd9LfQYKIG1n6CcoEWTURo9lvDv4NajS4+XDFacNH4pQWjcT92hAQiJgUWHRkO8OJFYzH/KRPnqC5b8CZgd27UbEJ85RgSAtl/eEVFDEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: Re: [PATCH v1.1 5/5] tests: Introduce a TSX test To: Andrew Cooper Cc: Igor Druzhinin , Edwin Torok , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Wei Liu , Xen-devel References: <20210611163627.4878-6-andrew.cooper3@citrix.com> <20210614104716.23405-1-andrew.cooper3@citrix.com> <9257fd40-65cb-8b08-7639-00b15dd0aba4@suse.com> From: Jan Beulich Message-ID: Date: Mon, 14 Jun 2021 16:59:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [37.24.206.209] X-ClientProxiedBy: FR2P281CA0022.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::9) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bba61029-8163-4345-0ac1-08d92f4507da X-MS-TrafficTypeDiagnostic: VI1PR04MB4381: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eT2iH0y2cdB0UZ1AsMfFCnBZkk1JCzjeWD/ndczDPtFvUtsLTsBsUfoBm/BOoRH4sQRrMcgKNOy0lEuMOcbLAQmeDApK0SCC/YrG0gzBESnPaZH0d20h3foYvWDHl+Wx4k4VMRmqC7CxY/QNT2Ke4aWhiFSo26G2fK4ch1RqJ3zPCZ6f5bFGpKVPOTmke//nloReP/BUNgJx6aIV+qqAqhO4YCHTUQQrXMbRAT0IakcsnUBpNlDT1Jb47vTcbtZ5AXga4bRp+/Wp4eVJ+E5fdI52+REjtjT0ytQTHlNs7QauN+bJuzevZ6zU4CNi5ENyOCd8GhVllSnfR4SuU/crL8UWzG58W1UEqjbowOZWZlEeUoEhUdhzx0BN4AthXfWV4aSxGiYBUWR94VO5DFzoYc5DvmVRGJurp4o5P6a9K20uC2+Tt5OebKHqT/sSyXzH9MtfB+JDH2pzQ4ipM8lfmqQs+LQnTXTCIxEiE2PIc/ZSOV8LOQl5zbEAYDITWgknxT1EXq6ZodbiHX47Mnh4I7gWNZ6UxqeuQFhyhZ9JS5YepK6uYI7E+olKd12of545Jos5wHvD+S8RLKuuxbeCsZodjOwZhmAOto2hLEty5SPOt0P7fCdWOZFy62eiV2dktqJnh7cTAmZSHWm2gQ4kanh5vYvGvlEbVyFB6D+DA8YiH4TzNPS70bDzGQC39Pv7 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(396003)(376002)(346002)(366004)(136003)(53546011)(31696002)(66476007)(66556008)(478600001)(38100700002)(4326008)(31686004)(66946007)(6666004)(186003)(36756003)(16526019)(86362001)(6916009)(16576012)(2906002)(316002)(8936002)(5660300002)(26005)(6486002)(8676002)(2616005)(54906003)(956004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Ex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QBi6LiLNZWRNugSJysTiD?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: bba61029-8163-4345-0ac1-08d92f4507da X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2021 14:59:38.1824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VETmXgttV8a0BaQCDbYonjspYCBOSOeh9eYZ7mIDWn/xo6YK416asq/fZ0D+E5g4MbnOkla4u3UbFdmixa7V8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4381 On 14.06.2021 16:50, Andrew Cooper wrote: > On 14/06/2021 14:31, Jan Beulich wrote: >> On 14.06.2021 12:47, Andrew Cooper wrote: >>> +static void test_tsx(void) >>> +{ >>> + int rc; >>> + >>> + /* Read all policies except raw. */ >>> + for ( int i = XEN_SYSCTL_cpu_policy_host; >> To avoid having this as bad precedent, even though it's "just" testing >> code: unsigned int? (I've first spotted this here, but later I've >> found more places elsewhere.) > > Well - I question if it even is "bad" precedent. > > For array bounds which are constants, the compiler can (and does) do > better than anything we can write in C here, as it is arch-dependent > whether signed or unsigned is better to use. > > Beyond that, it's just code volume. Well, no, I disagree. Any use of variables for array indexing, when not intentionally meaning negative indexes as well, would better use unsigned variables. This is just so that in cases where it does matter, people will not end up cloning from an instance where it may not be important because of, as you say, e.g. constant loop bounds. As to the compiler doing better - if it can when the induction variable is (implicitly) signed, why would it not be able to when the variable is (explicitly) unsigned? Jan