From patchwork Mon Jul 1 11:57:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11025755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41C81138B for ; Mon, 1 Jul 2019 12:01:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 330A128511 for ; Mon, 1 Jul 2019 12:01:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26FDD286BE; Mon, 1 Jul 2019 12:01:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B158928511 for ; Mon, 1 Jul 2019 12:01:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hhuyd-0006o3-LG; Mon, 01 Jul 2019 12:00:07 +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.89) (envelope-from ) id 1hhuyc-0006eV-5u for xen-devel@lists.xenproject.org; Mon, 01 Jul 2019 12:00:06 +0000 X-Inumbo-ID: c27005da-9bf7-11e9-bda1-5701688e4a24 Received: from m4a0040g.houston.softwaregrp.com (unknown [15.124.2.86]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c27005da-9bf7-11e9-bda1-5701688e4a24; Mon, 01 Jul 2019 12:00:03 +0000 (UTC) Received: FROM m4a0040g.houston.softwaregrp.com (15.120.17.147) BY m4a0040g.houston.softwaregrp.com WITH ESMTP; Mon, 1 Jul 2019 11:59:45 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 1 Jul 2019 11:57:28 +0000 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Mon, 1 Jul 2019 11:57:28 +0000 Received: from BY5PR18MB3394.namprd18.prod.outlook.com (10.255.139.95) by BY5PR18MB3267.namprd18.prod.outlook.com (10.255.138.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17; Mon, 1 Jul 2019 11:57:27 +0000 Received: from BY5PR18MB3394.namprd18.prod.outlook.com ([fe80::2005:4b02:1d60:d1bc]) by BY5PR18MB3394.namprd18.prod.outlook.com ([fe80::2005:4b02:1d60:d1bc%3]) with mapi id 15.20.2008.020; Mon, 1 Jul 2019 11:57:27 +0000 From: Jan Beulich To: "xen-devel@lists.xenproject.org" Thread-Topic: [PATCH 4/6] x86: move INVPCID_TYPE_* to x86-defns.h Thread-Index: AQHVMAQn0iMfDW9J7UmVK8PmECrSKg== Date: Mon, 1 Jul 2019 11:57:27 +0000 Message-ID: <630dddd7-3467-9204-c9da-3b776dade6a8@suse.com> References: <2d69ac51-9c4a-96f9-fd37-578658076571@suse.com> In-Reply-To: <2d69ac51-9c4a-96f9-fd37-578658076571@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6PR05CA0033.eurprd05.prod.outlook.com (2603:10a6:6:14::46) To BY5PR18MB3394.namprd18.prod.outlook.com (2603:10b6:a03:194::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [87.234.252.170] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 20c589eb-ab22-4cdf-4be9-08d6fe1b4991 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BY5PR18MB3267; x-ms-traffictypediagnostic: BY5PR18MB3267: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 00851CA28B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(189003)(199004)(36756003)(68736007)(14454004)(8676002)(66556008)(6486002)(305945005)(31686004)(6916009)(2351001)(73956011)(52116002)(7736002)(66476007)(64756008)(66946007)(25786009)(478600001)(5660300002)(66066001)(53936002)(66446008)(476003)(99286004)(72206003)(2616005)(486006)(4326008)(6116002)(81156014)(3846002)(6436002)(81166006)(11346002)(5640700003)(86362001)(6506007)(102836004)(446003)(54906003)(6512007)(31696002)(26005)(186003)(80792005)(386003)(256004)(316002)(8936002)(76176011)(2501003)(71190400001)(71200400001)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY5PR18MB3267; H:BY5PR18MB3394.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TMV2yhGuaimHNKiwcLXE+86zt9q3t7rs7KH2me+Kao9Orju4L6Jwg0vhkks8KpH1ByVBV/Plh0uC+ptdXA9rWoTPpAnUtgoyduThoe5luxaGzjqADCUyLv7bbEmInjimD4isyPbclClxAGRo/datraFHb483l/UmCaJz2gh3vkRa+OVWRKzmzQDm2bRK1I5HqwI9TwhuAh2QwlpTOUvZ52LG3iI3NMsyLN0BCMvWs4yjNXWOJTxzXYQW6mRjSr4jHZ7n1k0kDe8/lxhazrWhjBWnbCotqm6wvDpD9lz4FeqRn5H0Pw6joqQz8e5FrZMJ7HZLePA6/l5znnmPR1RQ6Yds99wPuXln5ry2BkVVs4ZYc8RxSaFJFX234lIF0NDMN86EtlfHbucku05FyT25yplJAxcv4eaSTjUTCfG42Xg= Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 20c589eb-ab22-4cdf-4be9-08d6fe1b4991 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2019 11:57:27.4603 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JBeulich@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3267 X-OriginatorOrg: suse.com Subject: [Xen-devel] [PATCH 4/6] x86: move INVPCID_TYPE_* to x86-defns.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Paul Durrant , Wei Liu , RogerPau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This way the insn emulator can then too use the #define-s. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant --- v2: New. --- a/xen/include/asm-x86/invpcid.h +++ b/xen/include/asm-x86/invpcid.h @@ -5,11 +5,6 @@ extern bool use_invpcid; -#define INVPCID_TYPE_INDIV_ADDR 0 -#define INVPCID_TYPE_SINGLE_CTXT 1 -#define INVPCID_TYPE_ALL_INCL_GLOBAL 2 -#define INVPCID_TYPE_ALL_NON_GLOBAL 3 - #define INVPCID_OPCODE ".byte 0x66, 0x0f, 0x38, 0x82\n" #define MODRM_ECX_01 ".byte 0x01\n" @@ -38,25 +33,25 @@ static inline void invpcid(unsigned int /* Flush all mappings for a given PCID and addr, not including globals */ static inline void invpcid_flush_one(unsigned int pcid, unsigned long addr) { - invpcid(pcid, addr, INVPCID_TYPE_INDIV_ADDR); + invpcid(pcid, addr, X86_INVPCID_TYPE_INDIV_ADDR); } /* Flush all mappings for a given PCID, not including globals */ static inline void invpcid_flush_single_context(unsigned int pcid) { - invpcid(pcid, 0, INVPCID_TYPE_SINGLE_CTXT); + invpcid(pcid, 0, X86_INVPCID_TYPE_SINGLE_CTXT); } /* Flush all mappings, including globals, for all PCIDs */ static inline void invpcid_flush_all(void) { - invpcid(0, 0, INVPCID_TYPE_ALL_INCL_GLOBAL); + invpcid(0, 0, X86_INVPCID_TYPE_ALL_INCL_GLOBAL); } /* Flush all mappings for all PCIDs, excluding globals */ static inline void invpcid_flush_all_nonglobals(void) { - invpcid(0, 0, INVPCID_TYPE_ALL_NON_GLOBAL); + invpcid(0, 0, X86_INVPCID_TYPE_ALL_NON_GLOBAL); } #endif /* _ASM_X86_INVPCID_H_ */ --- a/xen/include/asm-x86/x86-defns.h +++ b/xen/include/asm-x86/x86-defns.h @@ -108,4 +108,12 @@ */ #define X86_DR7_DEFAULT 0x00000400 /* Default %dr7 value. */ +/* + * Invalidation types for the INVPCID instruction. + */ +#define X86_INVPCID_TYPE_INDIV_ADDR 0 +#define X86_INVPCID_TYPE_SINGLE_CTXT 1 +#define X86_INVPCID_TYPE_ALL_INCL_GLOBAL 2 +#define X86_INVPCID_TYPE_ALL_NON_GLOBAL 3 + #endif /* __XEN_X86_DEFNS_H__ */