Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4620242ioa; Wed, 27 Apr 2022 07:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKbsuI0DYjVCG+ZLgWwDDKsZ3M6muYTAWNW3ybtkc3/mEk+jv1k1AXN1UzYLI090zgXVws X-Received: by 2002:a05:6a00:2349:b0:4fa:934f:f6db with SMTP id j9-20020a056a00234900b004fa934ff6dbmr30249317pfj.44.1651070284139; Wed, 27 Apr 2022 07:38:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651070284; cv=pass; d=google.com; s=arc-20160816; b=voFNj7Sdq68LBfv4u+FPsj1Yub1iYhnvCMKQEnGBiMEAzk9C28hIPBqVWWj+Za3rpL 4xkb4HlQk2poGLR+cvKf3lu4tdrrWdkbU/zcc5Q+S6qCThj7OXitCE26I6dTf8Vl4w3q OMhbZ9SWPuUm3KauFWeHXws3iE3xIWcX/BL6qZWHyPOLF/kJo91W5j6wdUQJSK9/Nv+7 J2irScqkQrSmYmLu5Xie7rxRABh99mIe9g2t/ay6JHYkMNAqT1YY5fKg+iBMY6zrJMyW 2wf5IAJdr8tgPl7KOv7czvI6G6pT/x+3Ydp3hEqcfuFIr4NrA9/HMF+TZ5rbebVwJ4Gw 3TWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=iiQKMgHKfWwR2IuJOkUtq3i/GbNxbvccwSVvcoxnB90=; b=UtclyGa32bsUuEiLA8a/fDdrxbWmpJdHWzl1DfI6vx3T2n6EC0ECBfP43lmThgy7Y+ I1ZDQKD+2sXlQj1J0qQjuND0dpgrAnlZ7I5tRY8CvvABamF/HMG/sYntr5Wtzn43gisl vS51A47rhZgoSeSpXG2ZkvffAd/aGuwPzwIHM8EflKnVFEKJEbk5pNamsRUeEiVzgEm6 QRbSLpoKmIFcalHxEdFjGd1aHK27IQ3qQRyk7wcPMqHhA/KAOkmnAeS9Zi8zaxuzST9r kc4YW7SPp9nOsbPDmrCrIEhPWGxpx6FcCRRmYrVpCIn7nyDRONPZ9GAakLK25B8IBAQd 5Fhw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dJJEZH0b; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j16-20020a056a00131000b00505ad6b7610si1573671pfu.63.2022.04.27.07.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:38:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dJJEZH0b; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F7525006B; Wed, 27 Apr 2022 07:10:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237329AbiD0ONR (ORCPT + 99 others); Wed, 27 Apr 2022 10:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237259AbiD0ONO (ORCPT ); Wed, 27 Apr 2022 10:13:14 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2071.outbound.protection.outlook.com [40.107.102.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A64444F9DE; Wed, 27 Apr 2022 07:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kGq4qouSjKepHTDgmrScIM8Y2w3aipkAzgEhWtZboeAC/qvuNF73gb2uUuIi8QmtB5Q6RNpDsiJdImHmv/fj/RhahI/nC3p37JIFob31QDkVboho9TsXUmXBj3bVWFl93jBVUt+UEG4wFN+6V1W/6s0MWpxpFFpCVONRpc71150Z24dbfMti5DhiNoFFew4ims3vFtd9qnp7kCZD8t6yhdSo47AUdcx8AR4o4eO3E2AkY+w+VUZLXRBHw7U/oUnp6IQXh8167DNRoJ+tlh7Ha/u+lRi8APyaUWJeyGLSM4BErcIqQa14TtYMB80G5EZQOVOi1k/jVliasQOwC8T2sA== 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=iiQKMgHKfWwR2IuJOkUtq3i/GbNxbvccwSVvcoxnB90=; b=hD5gH+8wpxbeJ7fAvvHDpnuOZKa5tYrILwPGppSlz8ZEXI6ud54UuyCOIq84ScFp0PZ5Cz74ldl7aOlKTdacrRxUmYat8/2KdHajhgbQ1YiiVnWVkOld6e+ZbL+Bz63yw/XGNM2JE2g4UaSVgEYV2XpsBgxsFBLhhSgtfynP98CQbwVCaQSE9ovSOlnxrAh1I32KrD49y9oLyYVIFKP9/0j7ebL1MJcx8ziC8T4GLaKEkBOKt0E1/4BEwkPlLdznDwf0mXJMOavGgoACy5QT+B4hrnjEGPfOymA+Mp/qtwBRM0ju8vV3J/jbkzLJ3sJ3SbGSQXQVNtN3EO1WWE8xBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iiQKMgHKfWwR2IuJOkUtq3i/GbNxbvccwSVvcoxnB90=; b=dJJEZH0bdurHGLM7Byk0bLVo3NJe0lI3c6BxiRox9fKEeqQCpTxMXqFHq6Xp0WeWeEnEHt1HzRg/c5tB9Ht1pZz0c5sG4f1T0GRy2Bh3k2SWFZtyf75/VrNvtwV3jUVlFyay2JlRB7LEi5nHEwcz99kskLbwx1n/vdQM5ogluho= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by MN2PR12MB3118.namprd12.prod.outlook.com (2603:10b6:208:c6::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Wed, 27 Apr 2022 14:09:58 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::781d:15d6:8f63:a4e7]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::781d:15d6:8f63:a4e7%7]) with mapi id 15.20.5186.021; Wed, 27 Apr 2022 14:09:58 +0000 Message-ID: Date: Wed, 27 Apr 2022 09:09:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access() Content-Language: en-US To: Juergen Gross , Borislav Petkov Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, Arnd Bergmann , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Andy Lutomirski , Peter Zijlstra , "Michael S. Tsirkin" , Jason Wang , Christoph Hellwig , Oleksandr Tyshchenko References: <20220426134021.11210-1-jgross@suse.com> <20220426134021.11210-3-jgross@suse.com> <1c1a4a7d-a273-c3b0-3683-195f6e09a027@suse.com> <2a340424-29e6-8ad8-0181-f70450eecb80@suse.com> From: Tom Lendacky In-Reply-To: <2a340424-29e6-8ad8-0181-f70450eecb80@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MN2PR10CA0015.namprd10.prod.outlook.com (2603:10b6:208:120::28) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76156ede-2110-476c-088f-08da28579cd2 X-MS-TrafficTypeDiagnostic: MN2PR12MB3118:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 267Du0EWzGz4w1LzxZHJD7O4owB0RLnMBp0dx7a1P7/6gBFKQVAAusNK5fRTLNkpIGXy0h4Po70l26fcO+4UrBC6NrwklrVhWql3oFUwvL452w4Nk+oOJ2t3OWLmvUB2Y5ICzQuqd3/JJdu1SjdvFRb+OVe13e6cFn1zMcZFlAYFs3vqaMotfm9iPRU337iM2n00mw7/Cl/2BRj8Y9JShwUkQU6NGmDKVBCWZ0QGq5tV4u+ErDgC9oYPWJe7tyASf11GQTZUrjbclyI24D5Osb2iHNJkdvsw6oUvjn4/O3TMkPBOOrs1JYo61NpPEyzdSyu/1Nr2b0DC1epEUqVCzrDhZZdSfO7zDXAufRNMR1jJ0HB0Zo+9jDtaO5WoO/DfJJy9VpAc19eKCB/5PFIFAwz8fY/Tz1yE8h23Lk3VjtHdMJ7aOUglwo8ZHnJMHRRtI8VsACvyxsjtKI0lYNIt7fBuJhT7k253UeIQtXTXUrL7qAenMf/8SB323WBTvwlgA3m7zGL34tj63ddzGOqjyeYY+dPi6cD1z3dQC+GTBUe4/ibDIbGt1iDnLxXLhV11Ic4m+iArDNjNWlWzS3wAAjMF4ti7Kg/fq2VfduDmXWhWrUm76xG1q2N3iKnWf+B8fl+D5f/mWP/Pw4/dGPsJYxVnMWUV4h1cPTUrKynVkaxIwfcizJL70U/2V0AIDq6PfpVq+R0bIr2Rucj3xpZw4PKnSbjDH44zGtY+HIaH2Dn/3Jje1oAzNnNAMfPotFdQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(5660300002)(508600001)(186003)(8936002)(36756003)(6486002)(316002)(83380400001)(2616005)(66556008)(66476007)(31686004)(53546011)(6666004)(2906002)(38100700002)(54906003)(7416002)(31696002)(86362001)(26005)(110136005)(6506007)(8676002)(4326008)(6512007)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NldiV3E1QkdtdzcwNzdsT0ljekxkeE4wcTRyZEZFQURzL0xzbmkvSzE1ME8x?= =?utf-8?B?NmErR3dQblYrYWd4bThWeWlTRS8yZUlNd3RJ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E9TakhzNGdmYjFHMFpVMnRRTXJXUG8yN0ZwdlU4RTIy?= =?utf-8?B?ZUpHbk1KZWdHMjN5ekNOV3VzR3NCbmZiVElRTlg3NWFpZjJIbThLLzFwUkdl?= =?utf-8?B?QndUMWdkTFhNaTdZQUt2NzB3SnNLOEcwUGpCZmxma0NIM1ZPVnNhV052bStC?= =?utf-8?B?L05scnRmL3RQajFqUHo1OGdEN3BMSzRhbS9hL2d4bzA4TXpLdk0wankvaDFN?= =?utf-8?B?OHd2bFJGMFFweUsvNDJoZWYzZ2FMTzFQMWMraGgvWW8rRkJodlU4cWw2M2M0?= =?utf-8?B?UklYRm56Z2ovMW9FSi9qT0FSSndsdWNPSFcxVWlUZWNDdnkrdWhFUTI0akVn?= =?utf-8?B?dmpsUEVwbnI4MXd2WTVveHIyNVg0a1RGSzhtbVlqVitiVE5EckY1SDhlcUN1?= =?utf-8?B?bUwzNlU3NGR0WG0raDhFQ2JucHdDYUdaSE03bmwvYzBHWlQya3JsUT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76156ede-2110-476c-088f-08da28579cd2 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 14:09:58.6979 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n1f2EgLdqJKQXQxH9kLGyqHC1IIoBdf7fcvVZRnIGHk3pYJ94mwD75Rx7z1yz8VsSgrDIJoRdtzmeWXbTcBV+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3118 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 On 4/27/22 07:37, Juergen Gross wrote: > On 27.04.22 14:28, Borislav Petkov wrote: >> On Wed, Apr 27, 2022 at 08:37:31AM +0200, Juergen Gross wrote: >>> On 26.04.22 19:35, Borislav Petkov wrote: >>>> On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote: >>>>>    /* protected virtualization */ >>>>>    static void pv_init(void) >>>>>    { >>>>>        if (!is_prot_virt_guest()) >>>>>            return; >>>>> +    platform_set_feature(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); >>>> >>>> Kinda long-ish for my taste. I'll probably call it: >>>> >>>>     platform_set() >>>> >>>> as it is implicit that it sets a feature bit. >>> >>> Okay, fine with me. >>> >>>> >>>>> diff --git a/arch/x86/mm/mem_encrypt_identity.c >>>>> b/arch/x86/mm/mem_encrypt_identity.c >>>>> index b43bc24d2bb6..6043ba6cd17d 100644 >>>>> --- a/arch/x86/mm/mem_encrypt_identity.c >>>>> +++ b/arch/x86/mm/mem_encrypt_identity.c >>>>> @@ -40,6 +40,7 @@ >>>>>    #include >>>>>    #include >>>>>    #include >>>>> +#include >>>>>    #include >>>>>    #include >>>>> @@ -566,6 +567,10 @@ void __init sme_enable(struct boot_params *bp) >>>>>        } else { >>>>>            /* SEV state cannot be controlled by a command line option */ >>>>>            sme_me_mask = me_mask; >>>>> + >>>>> +        /* Set restricted memory access for virtio. */ >>>>> +        platform_set_feature(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); This is way early in the boot, but it appears that marking the platform feature bitmap as __read_mostly puts this in the .data section, so avoids the issue of bss being cleared. TDX support also uses the arch_has_restricted_virtio_memory_access() function and will need to be updated. Seems like a lot of changes, I just wonder if the the arch_has...() function couldn't be updated to also include a Xen check? Thanks, Tom >>>> >>>> Huh, what does that have to do with SME? >>> >>> I picked the function where sev_status is being set, as this seemed to be >>> the correct place to set the feature bit. >> >> What I don't understand is what does restricted memory access have to do >> with AMD SEV and how does play together with what you guys are trying to >> do? >> >> The big picture pls. > > Ah, okay. > > For support of virtio with Xen we want to not only support the virtio > devices like KVM, but use grants for letting the guest decide which > pages are allowed to be mapped by the backend (dom0). > > Instead of physical guest addresses the guest will use grant-ids (plus > offset). In order to be able to handle this at the basic virtio level > instead of the single virtio device drivers, we need to use dedicated > dma-ops. And those will be used by virtio only, if the "restricted > virtio memory request" flag is set, which is used by SEV, too. In order > to let virtio set this flag, we need a way to communicate to virtio > that the running system is either a SEV guest or a Xen guest. > > HTH, > > > Juergen