Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp155518otr; Tue, 26 Jul 2022 20:02:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v6tYL//11Atkvz/M5utoWXL9zyEmJciO4TLA0phM+uwr193I2dJzZ74BCAq1oCzB+i2VOt X-Received: by 2002:aa7:d491:0:b0:43c:7efc:1112 with SMTP id b17-20020aa7d491000000b0043c7efc1112mr4780658edr.373.1658890975987; Tue, 26 Jul 2022 20:02:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658890975; cv=pass; d=google.com; s=arc-20160816; b=YnDoj0j9LE6DKekftFWmmm6rS4MC6X0h2V1oL1owdisgIv1Ybb4IQnY8xnTNK+HUX0 B7/ctoZxz3UfcEkid7szzY1O6XGX1pjDvZD8i2ZXQ8c0euxy/fpAVf1qHxFOlehBfnw8 eQcTbRI8sKMlqOMCUJ4s3aUUx4wNJlPiDbGikw7f9z8hacHwW7MBR5srp7qlu1Ybti22 2rsSUIRRSWwDA3TdcIz43auf+tHD7BTzS3QujIDcUmKIJuF2VGHOEnll2S7p39rkxxvx G865P6MqACtddfWKI8iUZKQ8svEFso4eIePHVAPs7EoWKJtaPPwbw5i1dg/h9sZ/Ziew 6eFA== 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=nDZd34IMJCasbjHdpsqbcPs8WQh0LQBvkfu7wDDqoYc=; b=0NtIa42C40Yh3QUA9VXE+Qjj6TZAfcBxhbz9UHsOV1BAJ1R5SFc2pNqT7YvgSpgTk9 bK3ZvALoAlYMnPsR7+R7x/B9yxpM0Jn0hnNBUUkzIgSt+LiQUfu0QSzrY0mA4Kit9gtY OcRznsYjIdWC1kQHi6FuJ7gQdgT2SSQ6lNSnOI/cwMIjmzlft3KtYaVTh0d9yYWyZQlg 9FR4Dbm1+BKTvTjFLTkfH79JN0iPuP1ub8a5RArz/TGWjNsX0HC2Xa0d/6bv5HJEuiCs EEt0DaXf9FLeXk1UllbzeG0SXPSW4gnlpHP2w/btujrqJzFilQR2xZwbcEt7HeASF9Uz o5ag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=q4vMlgqS; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a1709064fca00b0072afc15af40si19098690ejw.39.2022.07.26.20.02.28; Tue, 26 Jul 2022 20:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=q4vMlgqS; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240145AbiG0Cje (ORCPT + 99 others); Tue, 26 Jul 2022 22:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbiG0Cjc (ORCPT ); Tue, 26 Jul 2022 22:39:32 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2074.outbound.protection.outlook.com [40.107.93.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9678115FDB for ; Tue, 26 Jul 2022 19:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBSnOGuiahEEzGxNvOIt2CrWeQkiAkWoxktPUl+tIrXpD/VmQoA+X681D7vGU0gb34oVlXBG6k8Qm6c1NIq+W6hBmyGMzQRdPjLerztSgRTGKfefjliTauqdOePQFkC4G2o/mop5dljIhSonlol4lo2JFOI9LUECxSki3ImXlYDzniTZrycBA0ecca/V6++jV8ksdq/d8F/JjW1l47XQd1nSm4Mqpi8tkBm3b6s4VquaYX0I3S3CSZiakRaggDjS5y0EwW1Ga3g20L+nFGuOknHuvsgbmgD228vPhzPbCUQk143ELUdd42vm03K0Xap64AP4PqxzHREnvyh4KmRHoQ== 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=nDZd34IMJCasbjHdpsqbcPs8WQh0LQBvkfu7wDDqoYc=; b=CbSAw9+BWo3ZAOWy5MD6pFJvb/KOAIazlmiXrutNwV5oShVJpob+cAD0iIpxFUWCOfSsnSoudXhX+HsxySFoJ3AQ9DbVSbG/4hWb3TbuTMvTgpPt8Bsf+ouYA9zmDQNq36X9iCvJe0Dc8jO9d91xyP9iZul54qD3/Iu+CUeUR6witWXEb8WuCWyaDm9X3pF8syf3DocLXA8hJewfGZ+qDizyn09bBU4Dx427qmhA6cpij2vM9R43q+yDdIgKMl+HexO08u3tSXDy5dIpCAhSJxL8Wte3apWcfiIDZFRrDpA7ZqHlZvKoXlkDxanFZLFi+C6++n0IfP3JckVauPsUfw== 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=nDZd34IMJCasbjHdpsqbcPs8WQh0LQBvkfu7wDDqoYc=; b=q4vMlgqSg0RI8HRB6rkV24qsg4l0jkk5A0oxT6eFPBOOuzjOM0KOarXEA2UGMVicNqjZ70yI6vQPNLLxsw0lHdPqqrvsHfJrd3rBYArPB/ALZV40RL5Zxy8T1t8/zoSVd27EoXkPkQoevdxZpZPOF68d+nZT2njbCxUN3GaZmpI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM8PR12MB5445.namprd12.prod.outlook.com (2603:10b6:8:24::7) by BN8PR12MB4625.namprd12.prod.outlook.com (2603:10b6:408:71::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.21; Wed, 27 Jul 2022 02:39:27 +0000 Received: from DM8PR12MB5445.namprd12.prod.outlook.com ([fe80::d4af:b726:bc18:e60c]) by DM8PR12MB5445.namprd12.prod.outlook.com ([fe80::d4af:b726:bc18:e60c%7]) with mapi id 15.20.5458.025; Wed, 27 Jul 2022 02:39:27 +0000 Message-ID: Date: Wed, 27 Jul 2022 09:39:19 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 2/2] iommu/amd: Add support for AVIC when SNP is enabled Content-Language: en-US To: Jerry Snitselaar Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev, joro@8bytes.org, will@kernel.org, vasant.hegde@amd.com, jon.grimm@amd.com References: <20220726134348.6438-1-suravee.suthikulpanit@amd.com> <20220726134348.6438-3-suravee.suthikulpanit@amd.com> <20220726153227.caqf6hagmwu727ls@cantor> From: Suravee Suthikulpanit In-Reply-To: <20220726153227.caqf6hagmwu727ls@cantor> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SGBP274CA0015.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::27) To DM8PR12MB5445.namprd12.prod.outlook.com (2603:10b6:8:24::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67b306b5-936d-44a5-c53b-08da6f79392d X-MS-TrafficTypeDiagnostic: BN8PR12MB4625:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P6j32X7fru+WBOaJKpA8cCUqf3LLIGCFB/ibcIXXfVocNCjzsNPOm9DrJbYpY/d+Pn2xVQNly9MXmb7TgrU1piTV3HA5A11n/96uiiINrHLb4z2ghAfMA1MGP96QMfGuw3EdjELXEvwoGbVyqIgLYwRFvmolFMgrJVBkgBkfsc8Xo+iuuiTEicTpn3ppbed6egyq+nL+gDE5d5QdXrcE2PJVqW7WzHL5zYHzN1dEIcrmXq2KgeccDf212BjWh5yi3CcsoeYdSDSqGehtvUBEHz8Yn+nvFt3Vdsi9g5nY8N1GViF4FO0puOq1svfbTV/HjJjSS6ApyXkFnd/GOwT8qlONxf3jvn4O9Rnvo7Lz15Et/LrqieE6RoR5tNvjimSJ/jHsyOg5C6thTquJQPcunlhXH86anYgjchowuFLPl20NafHaVc8cwCO4odNnQYVVeC/nksnNXqemuUu3UBJes2XTQgarZvRDYbg+2AOYq06o4hBv0wV+p3d/t6hk/995LMyaxKtGxyNMGdMo1vC2RhNdoiPn+FvjEUgTgJFj4K0GMgTyJ1ZEJeCoxfJzwomzSbhIw36ggHh5v2gKVaIhH0Dajrb7t2P3OkoD7P4SRkN2TonYoJ90R0USMGKCnZngG8PAAsq37xsZlaHYMmQ+avDQDgmEnFAOx48iw3iOs/CXUr69JczXcx2mlBFLMUwkRq2lsm1E4jbxPOQvwZUTt4Pl4ahnA+kbELde2alC19S3hDkLk4SMG3VkEbY36O7E3byreCemN5Q9dJ1HMC/9yKmxfbwPqvVymPf1SXG6ubqBUm5I/a2gfbRYXRt5BOQXxoVfcaqKtq3IIziv/RuWa8pE1G76AYxW6RFhBOI5Ssw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR12MB5445.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(376002)(346002)(366004)(396003)(136003)(66556008)(6512007)(38100700002)(66946007)(31686004)(8936002)(6666004)(4326008)(36756003)(45080400002)(8676002)(31696002)(44832011)(6506007)(478600001)(2906002)(2616005)(41300700001)(53546011)(6916009)(186003)(5660300002)(66476007)(86362001)(6486002)(316002)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eW52bHVuT1phY2REN21qWTRGQlVuakR0M245SzZMeU93RWNGN2gyVFBScUE0?= =?utf-8?B?b1FqMGU1N0s3L3BnRFUyUGFrVUdtWE55NlJ0QkFjWXNSaU85czRJNjJPeGg5?= =?utf-8?B?aWdXVlVBTldYN2dkQjlRVWNYa3F0ZzFscGxaNW5naTN5MGlhOWpBQWcwWHUy?= =?utf-8?B?a0lJNFcvV3lvb1VFdEcwSXZnWWtvT0lydFBSUzltNTJUZzN5N0FaSlBTTkdI?= =?utf-8?B?b3Z3eHJGazQ2bTBYUTVzb1QzL2cwck1WaGdJbTU0cDMzRlppNWNPTHQ2VFZl?= =?utf-8?B?dXBjd3orY2Zueit2OWhlRjQ3N0svbzczQ2o1L2s0cTh3Z25TNEhucWpuY3Vo?= =?utf-8?B?cDdBTTFtWVFRaUNNcUREdmFJQ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?= =?utf-8?Q?IuGocoKU5KHil3OKNF72+7j53TVd9Dihpww4NaJnnz00?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67b306b5-936d-44a5-c53b-08da6f79392d X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5445.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2022 02:39:27.0341 (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: G5z1GPx7ZbRnJRLsz94KtwL2c+eSypD5HwzLiFpQAFwOqFfZQi+T4V0c9UCh4mO3978lcl2i7v1mblC/eVnFWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB4625 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 7/26/22 10:32 PM, Jerry Snitselaar wrote: > On Tue, Jul 26, 2022 at 08:43:48AM -0500, Suravee Suthikulpanit wrote: >> In order to support AVIC on SNP-enabled system, The IOMMU driver needs to >> check EFR2[SNPAVICSup] and enables the support by setting SNPAVICEn bit >> in the IOMMU control register (MMIO offset 18h). >> >> For detail, please see section "SEV-SNP Guest Virtual APIC Support" of the >> AMD I/O Virtualization Technology (IOMMU) Specification. >> (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.amd.com%2Fsystem%2Ffiles%2FTechDocs%2F48882_IOMMU.pdf&data=05%7C01%7Csuravee.suthikulpanit%40amd.com%7C844cc78ad4674484b1f208da6f1c0ee1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637944463702725122%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=U%2Fe%2FxqqQ14UmlF5ThaB55Col4mbNzuqNj8IqEyxmsxo%3D&reserved=0) >> >> Signed-off-by: Suravee Suthikulpanit > Is this a typo in the 3.06 spec for SNPAVIC_EN? > > "001b-111b = Reserved." > > Or I guess maybe there is a newer revision that isn't available yet > that describes 001b? That's correct. The newer version should be coming out soon. > Reviewed-by: Jerry Snitselaar Thank you, Suravee