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=-19.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 B7254C433F5 for ; Thu, 9 Sep 2021 09:58:12 +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 5BBB26109F for ; Thu, 9 Sep 2021 09:58:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5BBB26109F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.182913.330764 (Exim 4.92) (envelope-from ) id 1mOGog-0007h3-GY; Thu, 09 Sep 2021 09:57:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 182913.330764; Thu, 09 Sep 2021 09:57:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mOGog-0007gw-D7; Thu, 09 Sep 2021 09:57:58 +0000 Received: by outflank-mailman (input) for mailman id 182913; Thu, 09 Sep 2021 09:57:56 +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 1mOGoe-0007gq-Nb for xen-devel@lists.xenproject.org; Thu, 09 Sep 2021 09:57:56 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6764c71e-1154-11ec-b1aa-12813bfff9fa; Thu, 09 Sep 2021 09:57:55 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2054.outbound.protection.outlook.com [104.47.0.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-38-OeYDtL1-Pza57_bz_DDN-Q-1; Thu, 09 Sep 2021 11:57:53 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB7375.eurprd04.prod.outlook.com (2603:10a6:800:1a8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Thu, 9 Sep 2021 09:57:52 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4500.017; Thu, 9 Sep 2021 09:57:52 +0000 Received: from [10.156.60.236] (37.24.206.209) by AM0PR04CA0141.eurprd04.prod.outlook.com (2603:10a6:208:55::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 9 Sep 2021 09:57:52 +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: 6764c71e-1154-11ec-b1aa-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631181474; 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=eEL9qNvSrPO3a2KYULh+dWzPR46hwF5kM/seQC0Iyus=; b=LTezPbAnViKKLsoQ/eA7Z4IxGvxrXoSEcTw3kYDDWWVj9ZZexnsrE/P1euzUD8GksV22ah nsbyFuIAwW26l6fJX9v6foH3yMbGklDsyJ/HEKM67INF/qgCA7IgxLR9oIEFevuJvGxvLb GzxdLOZAzmmsVjLZogFbiYxOGCFm9UY= X-MC-Unique: OeYDtL1-Pza57_bz_DDN-Q-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f9vzmnOWx4dfdCVunZ2TH7Ts+ORsAs533phdQ8czWF/gVnnbCEIAP6JN1X83G9OwpSRu3ERQOfvyn5K0scYZbYQAHACyj8ybrOR1fo43d3Is98iGsQrm/IA0LpK4iOLX9MnKNa6+7pIWUagUcXGW0P9rxYKUnTxrOc46DMfq5PoexiS9vcJ+GpeO60eOs6/AdTtbRfo3fMobFYWfhPpe2REObkSB4QRwH5gt1J/isPK4TCRrywaSWjqli8PHGliJTcsR/QS6og0dvnwhzvYjwi8ZTcL4MUrcSuw75MRUs7rXEArHeZni8hkotAfFI5+l/L/u6Rg+hFILlSLl5RJFsg== 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; bh=A86rnhXZOE1JDW4J3/2PB7wdjmEoc211vRmY04sxYjc=; b=NVV2na+bWcRJRmjkvgyi9jqTzbjfd73HII6tbJXF3zmrziHCqcV3ENVCAGJ31aXwKQIHqbOGngHRY5woyDAJrec6NKeHmh4xrkSoxmvI+/H1YwL7u5Usgr1s0FnfMaqxixOhJUdgdm/5znMkQk+6lwn3xB0ZIYfegwmzIQ4EzY6IgTZjlRNFYfxcfE9mV39kDCINZ8OAUXF07IOyUiuf1V4caW+ibxNg2QL8IQeGafzVtDyB99oJngTliWAClxxJpjW4nPb+asHLOMBuQCoUe2QRWpH37EruZFA/4VkDMR6aeIeLHr0DnvZm4zxfHXQzaQfq3C9bWv9mNzXBO1nSWg== 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] x86/svm: Intercept and terminate RDPRU with #UD To: Andrew Cooper CC: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Wei Liu , Xen-devel References: <20210908161918.25911-1-andrew.cooper3@citrix.com> From: Jan Beulich Message-ID: <3f272ea6-02ab-8f70-19cf-28a92421531e@suse.com> Date: Thu, 9 Sep 2021 11:57:50 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20210908161918.25911-1-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR04CA0141.eurprd04.prod.outlook.com (2603:10a6:208:55::46) 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: 573a0c99-a700-4b48-9efc-08d973784a10 X-MS-TrafficTypeDiagnostic: VE1PR04MB7375: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: myzAP1Cxp0rTDCvzmEiB9+v0AwE2u9LuCXnIMbDyaJN4dI7Y3m/EUePjsH9igWro9HwOpxJqQHM3pac4GsLOPIyWbs0DEgJbQI6yE/8ihgNZj1mnHaUPT5MwSMMR22kUyi56iis+dj4Sn9OqUmsDYMWnD56pr2p9ka9XnhhBpgV8CNxIc0ALZkUqFUwp6QOmYtKvK2f+YS8ub5J1dfAmdQg7e5HD96CrfiXfGglRzA1pgO2GQKZVVAmk1OvbAPXcNnMU8jVNLv2Hgkm1mzz1o6IgGBRNUoBYgPZIFfnNMgmQnNBV3uBaRjY+C3yh9r8qYUQleEbzuYBl3jYHfqHqEOlx/QUXfpnmRNGmSB13XJkY9sXRj5PSbytrrNFPIWtg9Z+gWokTpjBDDv8CacEJ+snwZ4xddpFokZu+jv87GpUOHOppoxuPXl7sRJ7ErKdfhSvHv6YKkQsEmB2RETrjgLH9g644PvrtuQkO+O3/m5KGCI+8xHgPTDSz/I4TtvZV0w2CH4mZjcFyJO92FVPDTI83wKA9K7Kk2cToZZIIgvHAqw+82pf6jwGaB30SvZxOwrzIeaImfczcqxusbsVfyCsXxleCUdE+4ShhhG2pFayYUIn0BCixg5j+cvieT/i44AwQznZ+yM/QcFVtVN0RsOJ8MUQSbB6z5i3j0IDpdKPT5h+Ju75T6opSg5J4eOyobc0ZcRVwac8PMU5aYxZcsoo7k8ulNmroxgp05zT18ng= 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:(136003)(396003)(39860400002)(366004)(346002)(376002)(8936002)(6916009)(38100700002)(5660300002)(86362001)(26005)(83380400001)(36756003)(53546011)(2906002)(2616005)(66946007)(186003)(66556008)(4326008)(31686004)(16576012)(316002)(6486002)(8676002)(478600001)(31696002)(66476007)(956004)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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Q?aDYjsR25HJFRX7yPfx5UstxhOWPIouXdL/A2OUxR9fE2qpV7d03za3Trg1SN?= =?us-ascii?Q?EYt+TW8K/NHCsD428TNv/tCoOSNyAKbYosE3bG6WoKYTSCHlWtH/Oriv+MiU?= =?us-ascii?Q?xXOVKNIYptQkTnZQk7wC1HBvpN3ohbsbMp8mWu2XbJYw4J23yimLZScQd4OW?= =?us-ascii?Q?TalOS95Ij8BHioe83jENGoN2iH9VOomIXEEpFazFFsdQdf5ngmOg5iiQHYaZ?= =?us-ascii?Q?LMq1UIVvN+uJ5C7i9vxO0d4oUPXWkYa/rFNhBvMtKXSuL/iR6ERMjAtcnLHd?= =?us-ascii?Q?7Td8DrLFkF7+xq0MA5h9jcS6BlAd0fASqwAL3mX+6XDgD8vXojR6v1fXEsBQ?= =?us-ascii?Q?YsT0PkUSvX9pHZaos7XB3k02RgzG09Ikmp+yLpODkvGLuo2f5tWppoHy6rV8?= =?us-ascii?Q?mRNnCrG0UvrdYqeZ+LF8NgHPoec5RXloJRxMCEhB/Eankb4g5bYWsOfxRYVl?= =?us-ascii?Q?n0PD8dKUKI/X7SHhCwLTMcKX?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 573a0c99-a700-4b48-9efc-08d973784a10 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 09:57:52.6658 (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: kfeemXsUcyEAWRbkWHRd9m8OqsVR/4eD3c1lzNulpyHCxqcfum2H5xADNt+TYfgy7tvruxXa+JWXoTf3xNDZZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7375 On 08.09.2021 18:19, Andrew Cooper wrote: > The RDPRU instruction isn't supported at all (and it is unclear how this = can > ever be offered safely to guests). An implicit hint to me to consider "x86emul: support RDPRU" rejected? That'= s still in my queue waiting for ... > However, a guest which ignores CPUID and > blindly executes RDPRU will find that it functions. >=20 > Use the intercept and terminate with #UD. While at it, fold SKINIT into = the > same "unconditionally disabled" path. >=20 > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monn=C3=A9 > CC: Wei Liu >=20 > I could have sworn that I'd posted this before, but I can't locate any > evidence of it. I've got a separate patch adding the CPUID infrastructur= e for > rdpru, but that is better left until we've got more libx86 levelling logi= c in > place. ... this. Which - if exposure to guests makes no sense - would seem pretty pointless then as well? > --- a/xen/arch/x86/hvm/svm/vmcb.c > +++ b/xen/arch/x86/hvm/svm/vmcb.c > @@ -70,7 +70,8 @@ static int construct_vmcb(struct vcpu *v) > GENERAL2_INTERCEPT_STGI | GENERAL2_INTERCEPT_CLGI = | > GENERAL2_INTERCEPT_SKINIT | GENERAL2_INTERCEPT_MWAIT = | > GENERAL2_INTERCEPT_WBINVD | GENERAL2_INTERCEPT_MONITOR = | > - GENERAL2_INTERCEPT_XSETBV | GENERAL2_INTERCEPT_ICEBP; > + GENERAL2_INTERCEPT_XSETBV | GENERAL2_INTERCEPT_ICEBP = | > + GENERAL2_INTERCEPT_RDPRU; Some of the other intercepts here suggest it is okay to enable ones in the absence of support in the underlying hardware, but I thought I'd double check. I couldn't find any statement either way in the PM. Assuming this is fine Reviewed-by: Jan Beulich Jan