Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751638AbdFHNRd (ORCPT ); Thu, 8 Jun 2017 09:17:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59473 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751405AbdFHNRc (ORCPT ); Thu, 8 Jun 2017 09:17:32 -0400 Date: Thu, 8 Jun 2017 15:17:24 +0200 From: Heiko Carstens To: Martin Schwidefsky Cc: Christian Borntraeger , David Hildenbrand , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Huth , Andreas Krebbel Subject: Re: [PATCH RFC 0/2] KVM: s390: avoid having to enable vm.alloc_pgste References: <20170602070210.GA4221@osiris> <20170602114647.35e6d30f@mschwideX1> <2d45c9d5-2108-7408-e7cd-44b9f6d03b0f@de.ibm.com> <20170602125345.5ac9e12e@mschwideX1> <63b5c762-fbbb-b6dc-0f2d-6837dac5bb04@de.ibm.com> <20170607143440.7c86af85@mschwideX1> <20170607204756.GA3143@osiris> <20170608073528.52b17428@mschwideX1> <20170608062531.GA3266@osiris> <20170608132401.5eafacc4@mschwideX1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170608132401.5eafacc4@mschwideX1> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 17060813-0008-0000-0000-000004622174 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060813-0009-0000-0000-00001DEA14E2 Message-Id: <20170608131724.GM3266@osiris> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-08_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706080238 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1830 Lines: 34 On Thu, Jun 08, 2017 at 01:24:01PM +0200, Martin Schwidefsky wrote: > On Thu, 8 Jun 2017 08:25:31 +0200 > Heiko Carstens wrote: > > It would be more consistent, since right now a 32-bit ELF file with > > PT_S390_REQUEST_PGSTE will be exectuted, but the page tables won't have any > > pgstes. That's sort of odd, isn't it? And that later on it won't be able to > > create a virtual machine because our current implementation doesn't allow > > that for compat tasks is sort of unrelated. > > But anyway, I'll leave that up to you, it doesn't really matter. > > Actually the code will be less complex if we add PT_S390_REQUEST_PGSTE for > 32-bit ELF files as well. It does not make sense to define the segment for > a compat process as KVM won't work but you get what you ask for.. > > This looks like this: > > #define arch_elf_pt_proc(ehdr, phdr, elf, interp, state) \ > ({ \ > int _rc = 0; \ > if (phdr->p_type == PT_S390_REQUEST_PGSTE && \ > !page_table_allocate_pgste && \ > !test_thread_flag(TIF_REQUEST_PGSTE)) { \ > set_thread_flag(TIF_REQUEST_PGSTE); \ > set_pt_regs_flag(task_pt_regs(current), \ > PIF_SYSCALL_RESTART); \ > _rc = -EAGAIN; \ > } \ > _rc; \ > }) > > phdr is a (struct elf_phd *) which is either define to a a (struct elf64_phdr *) > or a (struct elf32_phdr *). The check works in both cases. Yes, that makes sense.