From patchwork Tue Apr 18 15:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13215858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C4691C6FD18 for ; Tue, 18 Apr 2023 15:43:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.522979.812672 (Exim 4.92) (envelope-from ) id 1ponTi-0007Ar-95; Tue, 18 Apr 2023 15:42:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 522979.812672; Tue, 18 Apr 2023 15:42:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ponTi-0007Ak-6L; Tue, 18 Apr 2023 15:42:46 +0000 Received: by outflank-mailman (input) for mailman id 522979; Tue, 18 Apr 2023 15:42:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ponTh-0007Ae-3T for xen-devel@lists.xenproject.org; Tue, 18 Apr 2023 15:42:45 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a74b8755-ddff-11ed-b21f-6b7b168915f2; Tue, 18 Apr 2023 17:42:43 +0200 (CEST) Received: from mail-dm6nam11lp2174.outbound.protection.outlook.com (HELO NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.174]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Apr 2023 11:42:39 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by SJ0PR03MB5677.namprd03.prod.outlook.com (2603:10b6:a03:2dd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 15:42:32 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::48bb:fedd:a394:9f39]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::48bb:fedd:a394:9f39%5]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 15:42:31 +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: a74b8755-ddff-11ed-b21f-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1681832563; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=QNJaYcfp3uTRR3yCJmGaeDRdpgauMlX3e/Mo3bOiQr0=; b=I5KitI+Ip2cmeiOT+WBBY7+NI/VOMO4cQs3+v+G0FSTxE4gpIVydz0dC rGxq57u91r9ZPbfeKqAI0bWNIzhAVZag10Ar9+cSjJTEfN3a87sKCBQhq KmyqTEzMp6xyo9S6/KfhQxOXwaBxb0aE4S2bxfYTy8QvgqrQ9mXBDdSVy Y=; X-IronPort-RemoteIP: 104.47.57.174 X-IronPort-MID: 106384467 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:2XdY16rdIxtonwaPuFwtCLnRm/1eBmKcZBIvgKrLsJaIsI4StFCzt garIBnVafncZ2v0L4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talos-CUID: 9a23:fdEM723G2EeMaihfC09TbbxfONE0Y37Hy2jqIVLiFUdyWuSxR1mewfYx X-Talos-MUID: 9a23:uA1Uewq04ti6zMov6iYezw5lMNxss4GIM3ImiYVYltPUKn1hNjjI2Q== X-IronPort-AV: E=Sophos;i="5.99,207,1677560400"; d="scan'208";a="106384467" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H3goudBVEvvF3s4STo5N5Z/xrBZx56IGydA+KTIscPzlKfSePA8p5evZ2+q4kzqnWu4TOtXqIz/Bcc8E5AGF3DeKNjzLPtz1iYxMNP1ByCRFxf2z8FKBbdfBBX4t/GFaIdLHHJaj24dv3cIchiBBfyXtEYJ+6Gv1wkZHqi76KMLJCqF6ojUq0uU+KDk2yWI52QgIo1l6jFVC1Dyv9ptVS7IFYQgxFdXjPXdYrnA7a+qmk1mtLZ1BuJJQMH2oXGJ/KzYTEPN23BwrmxqCSRpp+uOI0yxBbIRJ77rCNpXMehWWQ/co6+rxk4SOqONKZQimUXi8v6FEUMJYf3ZTDr3yBw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CUnHgYjtSUltMVGFEA0os/QHQZE4foAxTSPRIIYyuQQ=; b=J62MtTDUe/c/avRQDCAkuRAsNVlius8NSj1Z+TeMY/9sprFmUnvA7giTrEaoC979tSuw1ql8EKhBCUjwPnU3KYiUbUYTEwyjsL3bztM+fh45T+GTw4P4Yy508aiHIJ5SNOooYAyjOE8MPoReZ3SOcEkP6nsszMsq9utDQ9N3+cWeGjEu5wjNImL3wjvZrKR6k54SsLRc879UGLZWcryszapgsd9Bm1267QlgPpg+sjh5QR5NNx5FKZnM59Gk6e43BVtklFNoakNxvPJJaGNdSPvrBBmaD3OFXneQElRY8WloZyMcG/HgfQplw8AGenMOnEiRXdenE93Y1eSumCGt1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CUnHgYjtSUltMVGFEA0os/QHQZE4foAxTSPRIIYyuQQ=; b=EgQXFgvpOKI9trPxbqNlT1RHrALnfQgYWMd0hyxQ1Qgs0lm0O5B/ssEDMqG4ivCEpKAnTjgwfvAizYYiZvxCnMfe6fdA/aceJaDtEJyoAul8FQCwUXmiYh/FOWI8FRS9UVWhjui+1wQILipkw7cQZWCCdJVBp8FktFYcnZtIsho= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Henry Wang , Community Manager , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH] xen/vcpu: remove vcpu_set_singleshot_timer flags field Date: Tue, 18 Apr 2023 17:42:23 +0200 Message-Id: <20230418154223.20181-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.40.0 X-ClientProxiedBy: LO2P265CA0464.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::20) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5677:EE_ X-MS-Office365-Filtering-Correlation-Id: e25a8800-1147-41c1-97b1-08db402385c9 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iap20tkaVeEppaor6wwiK43ERKjwk16QfTMHQdzaHxPec60XvjV1Hhh2RfrqWYAx5ik/Ia8mBWxkCOOBE2U2s1j/j8zwCSdSBvZpVpnzWf+YuhvJMW8qOqir5BqXq1j3nXQDjtJmxT2v5l+xGrx0HEvTHfSBi8qSaV3KT4WiefUgW5Y5wp3GwZy962g2JoGWXziOKYR2jXy3MU9SurHUvhn9b+pbMLv2DILNHCMINIpXMctInNV2GwcJ6ZcvNmHCLhli5IIxzcn+E2JtMIgDARDeLOqPb5CoIbW3otb3t/pqoKQ+lC+PG8+J5z4jbzle+OU0GOEZw4oMhBd7OSqkbiui/sgxgJCemOgcumoJnbNfFYRzoM+JoOJVL3EhEJWxeg/GYdJq3vhUPrQg6OhGXJ/tlga6scYSeh+cRwg0jUlIcCCI5uIl59cfR6afygTixZ/7DIDEqPzVWIQCMI+0U1pr2cak/xcFjU4/PA7QgjpgF3tIPkRktTjGBMXKS0/5Od611RF8ZRaQBe5id58zLZkRbSBhopoQMmYRbezUVDs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(39860400002)(366004)(346002)(451199021)(36756003)(86362001)(2906002)(6486002)(2616005)(6666004)(186003)(83380400001)(6512007)(6506007)(1076003)(26005)(316002)(4326008)(478600001)(66946007)(66556008)(66476007)(6916009)(82960400001)(41300700001)(7416002)(38100700002)(54906003)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6q5qZVWTtC/6PmUvNv9ulPpIfM4c?= =?utf-8?q?BUcg4kf5yLEU51xCp5P6RT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R1ef/ReZpTq0Ap+Cmb/AbE4Y29wWHBnT?= =?utf-8?q?RuW6TLg06T4mhKIqphMqRV9ldyGX1ZZ9CIxzyj5JswpX+U3VqGFSEo5GlFiGp4qYy?= =?utf-8?q?HFn97xGJPpTM/u/Q4qha7KUEhYTQLPmk+pstTje1JoqLO+MOpcQeD4wPBxAfJ3zjs?= =?utf-8?q?lLOYqWZnSMw50ukuEEAa/z1EjxHLguRTS8wpmTonmm8BewNaJt5iT0B1fIH+sN5mg?= =?utf-8?q?Ca7pZTBWPrJhAi7D1Kgy7kzUny/X221ruQyOx0AUO00Wjh+b6G8tRD95EDHyU1Za6?= =?utf-8?q?PFxPaSQAyTnvhe4JUPrTZjQkZGdmhvI7CYCiOWkuH5nayJW5CmUhGsORnSfb1zady?= =?utf-8?q?6fUgLwqi86URhxgAHhwPs2acqkAD3w7EZlFA/oSArDGQ9ENCJGGssdXCRO1ZzCyd0?= =?utf-8?q?7fuJbLaeDR0qSIPiaro0HdhkTCe61KJCF9SjsYkpCr0Yl1278iVcnMwU+hG78hLsF?= =?utf-8?q?3oGdSSB9wq0Pwt9G97KXWdR1H7MN1HnbaRV/jv62V1wKuyJOzbLXvsamouRB84B9Y?= =?utf-8?q?UwZH5AlkAqXDjbJZ6Ka+OazBaXxGhLevstovFw2ovI5lwyBXFE7DOuP3oZghW9JyP?= =?utf-8?q?HiVqjD3pp6zt?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +xCC2+DS5whec1F4NXKJBhxTZO+da2oIL43krN+2xablTMgvZYl3acsK6SmABo3oWzQATr4kDhOM0muoFBnLXXLv8kLw6XWiyGtkmTEn5xNP+AKDefoQWr+QItF2QZ3tS4Q6kNWeBexB2tynUBrbtgnOWs748llxcABSVkDFxdgdim/u+sjUvsYSYkL1MwZNBEtq0p1mERKjfTg1T72/eutnPHtzGtop4rLc++i5KXeXyQf46mwNbTspDuwMWL3N0ZjxwFU87IDHEf8lKbu6SWGpWubc3/egjEkAzTP4HKBung4uLkFQfpDyNLq/YNHomWQYz9Jrrc8mujMDWI+b0gFGxcW8r5ujL9sm+MjxjHKw7bhuiax6gCnSD52fpKQL4DOjOYcaeSjQY4LTS/briVQ8rEN84RJxJo6bu51PlhLYM/qWEzXutttulKy/YnRibFcxKhvbiI69UUOZ2/zeVCRLCpW5Q7jMuDDOA3s7J92YmWRj3iT77egzyNjv2GuUMu1G9BCx3LhOlF6NXZBKA7OLPooeD/CCAQ1wtEyVEvhnska0ly6dvLx8FQ//S0y17U9eznombn7E13mGxnflJnH1dizt5opZs3IsHwfA0L9IeG4yV4XJ0V9IPnhtKAr1HUsuT8+ge6ruH5yyCZRfYlx2ncFWa5VPkJX62Ww8D+wUZAbGvoyue8kzk972fDVlrEB56h7PP5Pz5XejHVy7UWrkTMcFoXozD8AU2+XRexnUdMjvANi0T9pPYZHdKRWyVE2qGwYG/rPKaK9APUlGl5A5SNmZ9vsJ2eEy33ViPC5UlhyJMrOtfocYIU3CSKtL6DNpyZFdI9UoaKk0PNxez43RtWejX1Skk3hEpzIxe8kbpXV+650w2iyqQu4HNyGRJsrL17dTDkatdvU7zmP0qYIRphO4qRIhMwXRl6h/JWc= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: e25a8800-1147-41c1-97b1-08db402385c9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 15:42:31.8510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I4rgbHxv3tz9BTGbMwhZsVbypdrZ+E9PcNKlMpHZpgf5RBX2sPslyEvz9Xxd7/2cSu+wvi1fMFfGP/RPcvmjYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5677 The addition of the flags field in the vcpu_set_singleshot_timer in 505ef3ea8687 is an ABI breakage, as the size of the structure is increased. Remove such field addition and drop the implementation of the VCPU_SSHOTTMR_future flag. If a timer provides an expired timeout value just inject the timer interrupt. Bump the Xen interface version, and keep the flags field and VCPU_SSHOTTMR_future available for guests using the old interface. Note the removal of the field from the vcpu_set_singleshot_timer struct allows removing the compat translation of the struct. Fixes: 505ef3ea8687 ('Add flags field to VCPUOP_set_singlsehot_timer.') Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monné Acked-by: Henry Wang # CHANGELOG --- CHANGELOG.md | 2 ++ xen/common/compat/domain.c | 18 +++++------------- xen/common/domain.c | 13 ++++++++++--- xen/include/public/vcpu.h | 12 +++++++----- xen/include/public/xen-compat.h | 2 +- xen/include/xlat.lst | 2 +- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dbf8b06d72c..b0d9bf4edbda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Changed - Repurpose command line gnttab_max_{maptrack_,}frames options so they don't cap toolstack provided values. + - Remove flags field from vcpu_set_periodic_timer: its introduction was an + ABI breakage. ### Added - On x86, support for features new in Intel Sapphire Rapids CPUs: diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c index c4254905359e..ffc73a9a1dc9 100644 --- a/xen/common/compat/domain.c +++ b/xen/common/compat/domain.c @@ -16,6 +16,10 @@ EMIT_FILE; CHECK_vcpu_set_periodic_timer; #undef xen_vcpu_set_periodic_timer +#define xen_vcpu_set_singleshot_timer vcpu_set_singleshot_timer +CHECK_vcpu_set_singleshot_timer; +#undef xen_vcpu_set_singleshot_timer + #define xen_vcpu_info vcpu_info CHECK_SIZE_(struct, vcpu_info); #undef xen_vcpu_info @@ -97,6 +101,7 @@ int compat_common_vcpu_op(int cmd, struct vcpu *v, case VCPUOP_is_up: case VCPUOP_set_periodic_timer: case VCPUOP_stop_periodic_timer: + case VCPUOP_set_singleshot_timer: case VCPUOP_stop_singleshot_timer: case VCPUOP_register_vcpu_info: rc = common_vcpu_op(cmd, v, arg); @@ -116,19 +121,6 @@ int compat_common_vcpu_op(int cmd, struct vcpu *v, break; } - case VCPUOP_set_singleshot_timer: - { - struct compat_vcpu_set_singleshot_timer cmp; - struct vcpu_set_singleshot_timer *nat; - - if ( copy_from_guest(&cmp, arg, 1) ) - return -EFAULT; - nat = COMPAT_ARG_XLAT_VIRT_BASE; - XLAT_vcpu_set_singleshot_timer(nat, &cmp); - rc = do_vcpu_op(cmd, vcpuid, guest_handle_from_ptr(nat, void)); - break; - } - default: rc = -ENOSYS; break; diff --git a/xen/common/domain.c b/xen/common/domain.c index 626debbae095..6a440590fe2a 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1762,9 +1762,16 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg) if ( copy_from_guest(&set, arg, 1) ) return -EFAULT; - if ( (set.flags & VCPU_SSHOTTMR_future) && - (set.timeout_abs_ns < NOW()) ) - return -ETIME; + if ( set.timeout_abs_ns < NOW() ) + { + /* + * Simplify the logic if the timeout has already expired and just + * inject the event. + */ + stop_timer(&v->singleshot_timer); + send_timer_event(v); + break; + } migrate_timer(&v->singleshot_timer, smp_processor_id()); set_timer(&v->singleshot_timer, set.timeout_abs_ns); diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h index 81a3b3a7438c..6d86a661bd67 100644 --- a/xen/include/public/vcpu.h +++ b/xen/include/public/vcpu.h @@ -144,15 +144,17 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_set_periodic_timer_t); #define VCPUOP_stop_singleshot_timer 9 /* arg == NULL */ struct vcpu_set_singleshot_timer { uint64_t timeout_abs_ns; /* Absolute system time value in nanoseconds. */ - uint32_t flags; /* VCPU_SSHOTTMR_??? */ +#if __XEN_INTERFACE_VERSION__ < 0x00040f00 + uint32_t flags; /* Ignored. */ +#endif }; typedef struct vcpu_set_singleshot_timer vcpu_set_singleshot_timer_t; DEFINE_XEN_GUEST_HANDLE(vcpu_set_singleshot_timer_t); -/* Flags to VCPUOP_set_singleshot_timer. */ - /* Require the timeout to be in the future (return -ETIME if it's passed). */ -#define _VCPU_SSHOTTMR_future (0) -#define VCPU_SSHOTTMR_future (1U << _VCPU_SSHOTTMR_future) +#if __XEN_INTERFACE_VERSION__ < 0x00040f00 +/* Ignored. */ +#define VCPU_SSHOTTMR_future 1 +#endif /* * Register a memory location in the guest address space for the diff --git a/xen/include/public/xen-compat.h b/xen/include/public/xen-compat.h index 97fe6984989a..dc43cc9567c0 100644 --- a/xen/include/public/xen-compat.h +++ b/xen/include/public/xen-compat.h @@ -10,7 +10,7 @@ #ifndef __XEN_PUBLIC_XEN_COMPAT_H__ #define __XEN_PUBLIC_XEN_COMPAT_H__ -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040e00 +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040f00 #if defined(__XEN__) || defined(__XEN_TOOLS__) /* Xen is built with matching headers and implements the latest interface. */ diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index d601a8a98421..5463961ce26b 100644 --- a/xen/include/xlat.lst +++ b/xen/include/xlat.lst @@ -168,7 +168,7 @@ ? vcpu_register_vcpu_info vcpu.h ! vcpu_runstate_info vcpu.h ? vcpu_set_periodic_timer vcpu.h -! vcpu_set_singleshot_timer vcpu.h +? vcpu_set_singleshot_timer vcpu.h ? build_id version.h ? compile_info version.h ? feature_info version.h