Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbdIOTV0 (ORCPT ); Fri, 15 Sep 2017 15:21:26 -0400 Received: from mail-sn1nam01on0051.outbound.protection.outlook.com ([104.47.32.51]:34400 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751748AbdIOTVV (ORCPT ); Fri, 15 Sep 2017 15:21:21 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Subject: Re: [PATCH v2 3/3] KVM: SVM: Add irqchip_split() checks before enabling AVIC To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1505230962-86304-1-git-send-email-suravee.suthikulpanit@amd.com> <1505230962-86304-4-git-send-email-suravee.suthikulpanit@amd.com> <20170914152031.GA23415@flask> <3603043c-964f-d10c-8cc0-fa3476e3bbb5@amd.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, joro@8bytes.org From: Suravee Suthikulpanit Message-ID: Date: Fri, 15 Sep 2017 12:21:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <3603043c-964f-d10c-8cc0-fa3476e3bbb5@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [165.204.53.123] X-ClientProxiedBy: CY4PR1201CA0015.namprd12.prod.outlook.com (10.172.75.25) To DM5PR12MB1740.namprd12.prod.outlook.com (10.175.89.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9f60e9d-18dd-4da7-18bf-08d4fc6ef193 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1740; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1740;3:nSh2NIZc9MZ4YcKbhTO4z8rS4m2vUhHVwcPyueWTCgJoj/125w45/Zc42TKzWnxIxocNa+4rf5xVymcLroYJ5uTZ5MnfV2gNF2akOb7RPJhXwbSZITCws8gXsxC+Jod/mQVnEbrMUXn6gaaoC/PGUFYxBW+wkY0tjmKhp1o+mXFLLJZ57M7w/r/3Md81yk/oUjltU0ir+1xTcSb+6eNtsa0ChADLzYYmEORt3JdV+HPqFXXkYkRkL7WQySuZ9rMq;25:3P0uCD6V/vB/brxDbZ8q9O1TQ2JAsKHRMIXwGtuN5sj4/jMbwWwFADoVVofozdpvtdqpGuQXeJ+3Bvz8Y5IW6y0CPVegfFXGsnm0mbj4vMreO4sWXsL45BYKcPcHnf7NWykv2Q8vZUc1qlo09Hx3zL465Hio4OTKoSirGYv9USmFjiFRKPj/fsah280BuDsYvJ7MghvqQTA2ZrYJn8GrHOodTTXJdalAdJ/JhM1BAmSViRFjoe01n3huYwRypnRU2uNCpS0BhxtAAHEHaYQmBGoY6wzZMoKlevPpyoEsoo8Hm2gSe4W+Wobr7abM6FldC3ZzBsB0dqwdywsQbTsxbQ==;31://w6zJRWWuchmJMOUdsqxAake3t8ut5mFgu6PEughRdCVeJ3WDNq+Z+LeD4TlVjSngrFPqdLTUEQJkHQu3IwlzaM+wumhpN9u8xzrJhOqzdDt9v8U3J9nJDleqkTAnT+DQHu0sy3CxUo/d7jroQfidMqM2eaHPWYokFgPSiIszq2Vn6mTuX3GIa2fUSVskjmTNiGryrmHklxBL+FzF4qMQdXDhTLVlpfqIEeDX13iiE= X-MS-TrafficTypeDiagnostic: DM5PR12MB1740: X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1740;20:ga55DnuXevdLvmlOVo/AIGsZ9fHyxboK8ljT4ZuKoGWRw5L9knsY1Gt1x0zqthzSXJaTe6QV+SZDa299e0aD7JowYe0j9dPP0lbS6stkZ3AN0j8VpBItdya7nxLXHjo1OkrR5aZDWmg70raf5SFea/Xu+9FZHzJ5CFMys3C21vSR9JDp7PfRcRzfRxdyogi95B8VumWOynlsTBd6HzNbunH6oMF0OfG4cNhcxHkoUBVLAT3jL7HVZmLoqDo7z68SliA26H7q4QDx2/dq1+JG7D2PtmycadvuM/QIkyBQdltsRBYi7/VCQCMvxSOzvEjXxYlT2X4BAj/+OWZh+/xNavgGkNhL9G9mopgPjjLc/gqflkb6FpSz2CPdX8saWm8aWQJZd7I2l1DhOddbqWBQv+YtdVkC4NUW6SO8n50UPMXF1ZnKsmKSHJea4p2h8WimklVwKA2ydTVEildq7Rjt4QswE56CNXgtSFP9tCASZ8oDHjRHcGg2N51+fCcIzkFO;4:TGhUuf89NDpl2vQ9Velm+f8jxULpqft6gx8LA4Or8pgW5nUl7KDtbmfncJx7A4/e+zUYH9R78dKHE2ywBrRq2kkcqQbYxC2XP9WjTAAq1z1T3W2O9B32VuVRP4BDOj+yrasKG3xzIIVmZTYibux9Lw/kH9CyhZcKpL9SVOpzR89E5FK7TOlRAZn9gKfrOHA/8nlk9DVTQ0d+Fw60JhP1yfzce4CVZYC/o1zOsdGMYtAraUHrcJccnS4ECiJyC9p5 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1740;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1740; X-Forefront-PRVS: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(346002)(376002)(189002)(24454002)(199003)(81156014)(478600001)(316002)(106356001)(72206003)(4326008)(65956001)(66066001)(31686004)(47776003)(2906002)(105586002)(2870700001)(16526017)(189998001)(65806001)(101416001)(3846002)(50986999)(25786009)(76176999)(54356999)(33646002)(93886005)(6666003)(50466002)(6916009)(8676002)(2950100002)(6116002)(83506001)(36756003)(7736002)(65826007)(53936002)(5660300001)(97736004)(8936002)(58126008)(53546010)(81166006)(6246003)(305945005)(68736007)(64126003)(229853002)(110136004)(6486002)(23676002)(31696002)(86362001)(53416004)(21314002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1740;H:wsp093588wss.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxNzQwOzIzOlFPRTlsZUFrcjlGcS92VE92SjljeXlnVGlY?= =?utf-8?B?bGNESTZ1NEtqUFl1eis5Q2REVEUrUmpiMW45eE1FMEh1L0trb2Vka2J6RWxF?= =?utf-8?B?ZWdPeWlnTWc3d0VETVZvUVBjT2pmelMrZ3IwOGJqK1dWK2dTakE5OGxjZm0w?= =?utf-8?B?Um1WUXNlUnlPRmZrWE1rc3Z1Z29Vdi9vQ2swRVVYVFQyTFpXRkx1MmsvSmh0?= =?utf-8?B?TVoxN0taa25sWXJHY1A3cUJaSnV1eVQ0VWlieDRnV2pSOHBaV2lEbk9oTEdO?= =?utf-8?B?bW5OWXhPOWdjeWs1TW53KzEwUllqWGcySWhyaVlOZGdkbGI3b2FJZTdrRzBm?= =?utf-8?B?aWpIRjZSL1NUM1lwYXFRamxyYUwzeGxoazhGUWwrenVlSDFIR0VOWHVQeE9I?= =?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ZiRQ==;5:Ies67UtjmXE+vZoy3zp9cdk5VotfmP9d2JPyineL3eh7gfEkNGaODINqq3OCrgUZmzJ3Nnw6l7rQNamrXRHxljhXyFnoKT3XxyUkqeveJG2w+onXqBjVB2bptFAJJscPStiH00gO7kt8XGqf++Unxw==;24:4nR2HPLXTF2ukivkhKuQASmW+cdlKEu/deFInaAgff7MHwfrAXQ0nYmWVCFbXbSbRYf0XUCyps7RuK0eruEVzHlvHzjyTKxCnivWqXkOFcQ=;7:Txn3txf4PklPvnu99UmvH05G68OJ4SNmv3ctTH0qk+UmYebA+JH676puUzVWxyr9yjAueetfMRLMB6CPqDL66lkCtfb02bRN+hNfgd7DjXiDFvHmbuBoM1cdz1QTCMeJqQZBItNTzhn9UZ4cxDAyqtNJcMNO/aP38yTy6YU5qRwe8DIPZvZGCFO8OK78ij+GAOoy5qSP1R1Z99wo3TIRN+xExYs2TOwmyQzKz7EFBR0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1740;20:pCY1eqrvisolgn0E6WSEJhp5tP7kizffLgNItxuSUQSdkgVSJPuGw+ePsxUWz0kPR22tJNzE/xorfgW0LuaX6BNrJj8VzVlMkx/fkyMPtuXyQEcyEjTVDtJyTdrhEjo/eW7lLrIbrQYok/KDQh23MXClOnTwenN4x41WiED1CZALXbjarsbM9cxYWnn1SEOLlsHoTwKpM2wyvo9pip6oKEmVMAfq0vt2Lt58WSCSC4nWVdJwvhklCyvsdRBHDSqB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 19:21:18.8602 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1740 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 49 Radim, On 9/14/17 08:23, Suravee Suthikulpanit wrote: > Radim, > > On 9/14/17 08:20, Radim Krčmář wrote: >>> @@ -1594,6 +1593,12 @@ static int avic_init_vcpu(struct vcpu_svm *svm) >>> if (!avic) >>> return 0; >>> >>> + if (!kvm_vcpu_apicv_active(&svm->vcpu)) { >>> + pr_debug("%s: Disable AVIC due to non-split irqchip.\n", >>> + __func__); >> We need to have an extra condition just because of this print ... >> I removed the print altogether when applying -- I thought more about >> that and it was aimed at people who wonder why AVIC was suddenly >> disabled and it's unlikely that they will enable a debug message without >> already knowing the reason, > > Make sense. Thanks. > >> >> thanks. >> >>> @@ -4388,7 +4393,7 @@ static void svm_set_virtual_x2apic_mode(struct kvm_vcpu >>> *vcpu, bool set) >>> >>> static bool svm_get_enable_apicv(struct kvm_vcpu *vcpu) >>> { >> A close contender was pr_info_once() here: >> >> if (avic && !irqchip_split(vcpu->kvm)) >> pr_info_once(...) >> > > Looks good. Actually, thinking about it again, this would not work either since pr_xxx_once() would only print the message once per loading of kvm_amd module. However, we would prefer the message to be printed per VM initialization. I also tried adding the check and print this message in the kvm_x86_ops.vm_init(), but this also does not work since the vm_init() function is called before the kvm_vm_ioctl_enable_cap(KVM_CAP_SPLIT_IRQCHIP). Therefore, pr_info() might be better here, even though this would get print per VCPU initialization. Any other suggestions? Thanks, Suravee