Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2095686pxa; Fri, 7 Aug 2020 03:04:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8Z2mkJQtH52OGQ/b99YA0hXLdiK0F42uxoSmSuvL0HqwzoTwftbFBhZznNu2Jj/iZ1Ln3 X-Received: by 2002:a50:8f44:: with SMTP id 62mr8397157edy.3.1596794684724; Fri, 07 Aug 2020 03:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596794684; cv=none; d=google.com; s=arc-20160816; b=ADF8pablaFD3wXc32S520wVqvdvndOC9d8A6GrTERmnUoVa05uqh61Y7s3KZTZTkEa 2nw9Rs8cfMDQnfBhyw+ajNbfz7AT5wsw8p8wGdZOItWCJSWCMRQS8qooCf9pP2MP+OOd Stx2tJx1dDd7H8RzAZuqTtvU7ZvVALwjH0jAPvtVNsZqMN9FZu3SEXt6fIL6meOOJ40h Qf6FQgQIZaJYtDvvfCUfpXrz2lC2z2p1f5KO3wl+qDA5MbIgMoNvlyZW1Y+GTJoL6dUA TH322e3XhdPs//Azr3fcbh0LUIOGEPCLTUDKfDXOIFkX/soc3hbRxp1iVUQ6QqXVnN6D yaQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pA4LFuWXNd5qehGG1svy3+nuspnDKcCy8uGBM3L+QAE=; b=j9gG1QNejnABd2Pw3+ycwpxQKsmEecsY2hnjWUdGSkmLV7XMjHjXhbPbfkqa1JEpJ8 BHVjS9Z+KofKAP78Hp+YhvSXDrGs9gUzn7GeShVOqJFsSx1rMhgRHcsdu0ikTqwBJh29 JHWa4x3xZTMCRXNZYZx6HDwdETpRVoRym9m7moWsDau9A0bjID14a6OfLJYeN704Tk9y yv/NJ8btmqMMbzrxgttRA+wzhCpTRg35cSXmyQhDlaa/2IiN7Ll/w04SKVP9lUdeRu3g vXcV1sRR7HfZ6uhN5B1I5rR1DzRC2yX6wtUVgJ17SJU6wIK17onYdCNqJHT9uRooO7n8 FeBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se5si4852718ejb.744.2020.08.07.03.04.21; Fri, 07 Aug 2020 03:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbgHGKDC (ORCPT + 99 others); Fri, 7 Aug 2020 06:03:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:47190 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgHGKDB (ORCPT ); Fri, 7 Aug 2020 06:03:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DAF6FAB9F; Fri, 7 Aug 2020 10:03:17 +0000 (UTC) Subject: Re: [PATCH v3 4/7] x86/paravirt: remove 32-bit support from PARAVIRT_XXL To: peterz@infradead.org Cc: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Deep Shah , "VMware, Inc." , Boris Ostrovsky , Stefano Stabellini References: <20200807083826.16794-1-jgross@suse.com> <20200807083826.16794-5-jgross@suse.com> <20200807093916.GF2674@hirez.programming.kicks-ass.net> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <3a0712ee-efca-5684-d321-3b789e01fc16@suse.com> Date: Fri, 7 Aug 2020 12:02:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200807093916.GF2674@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.08.20 11:39, peterz@infradead.org wrote: > On Fri, Aug 07, 2020 at 10:38:23AM +0200, Juergen Gross wrote: > >> -# else >> - const unsigned char cpu_iret[1]; >> -# endif >> }; >> >> static const struct patch_xxl patch_data_xxl = { >> @@ -42,7 +38,6 @@ static const struct patch_xxl patch_data_xxl = { >> .irq_save_fl = { 0x9c, 0x58 }, // pushf; pop %[re]ax >> .mmu_read_cr2 = { 0x0f, 0x20, 0xd0 }, // mov %cr2, %[re]ax >> .mmu_read_cr3 = { 0x0f, 0x20, 0xd8 }, // mov %cr3, %[re]ax >> -# ifdef CONFIG_X86_64 >> .mmu_write_cr3 = { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3 >> .irq_restore_fl = { 0x57, 0x9d }, // push %rdi; popfq >> .cpu_wbinvd = { 0x0f, 0x09 }, // wbinvd >> @@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl = { >> 0x48, 0x0f, 0x07 }, // swapgs; sysretq >> .cpu_swapgs = { 0x0f, 0x01, 0xf8 }, // swapgs >> .mov64 = { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax >> -# else >> - .mmu_write_cr3 = { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3 >> - .irq_restore_fl = { 0x50, 0x9d }, // push %eax; popf >> - .cpu_iret = { 0xcf }, // iret >> -# endif > > I was looking at x86_64 paravirt the other day and found we actually > have pv_ops.cpu.iret users there.. On x86_64 we have (without PARAVIRT_XXL): #define INTERRUPT_RETURN jmp native_iret and with PARAVIRT_XXL this is basically a jmp *pv_ops.cpu.iret which will then be patched to either jmp native_iret or jmp xen_iret. On x86_32 INTERRUPT_RETURN was just "iret" for the non-paravirt case. This is the reason for above dropping of the static patch data. > So we want to change the above to also patch iret on x86_64 or do we > need to fix x86_64 to not have pv-iret? We want it to stay how it is. This will let both variants (PARVIRT y/n) continue to work. Juergen