public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: David Hildenbrand <david@redhat.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	Janosch Frank <frankja@linux.ibm.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>
Subject: Re: linux-next: manual merge of the akpm-current tree with the kvms390 tree
Date: Thu, 27 Feb 2020 10:49:49 +0100	[thread overview]
Message-ID: <cd971e35-538a-13c1-e05a-1a7dd8ceda9f@de.ibm.com> (raw)
In-Reply-To: <adf233cd-9c7a-1c2e-82bc-83bc8572faa2@redhat.com>



On 27.02.20 10:20, David Hildenbrand wrote:
>> Yes. Changes to mm/gup.c really should normally go through linux-mm and 
>> Andrew's tree, if at all possible. This would have been caught, and figured out
>> on linux-mm, had that been done--instead of leaving the linux-next maintainer
>> trying to guess at how to resolve the conflict.
>>
>> +Cc David Hildenbrand, who I see looked at the kvms390 proposed patch a bit.
>> Maybe he has some opinions, especially about my questions below.
> 
> I'll leave figuring out the details to Christian/Claudio (-EBUSY) :)
> 
>>
>> The fix-up below may (or may not) need some changes:
>>
>>
>> diff --cc mm/gup.c
>> index 354bcfbd844b,f589299b0d4a..000000000000
>> --- a/mm/gup.c
>> +++ b/mm/gup.c
>> @@@ -269,18 -470,11 +468,19 @@@ retry
>>   		goto retry;
>>   	}
>>   
>> + 	/* try_grab_page() does nothing unless FOLL_GET or FOLL_PIN is set. */
>> + 	if (unlikely(!try_grab_page(page, flags))) {
>> + 		page = ERR_PTR(-ENOMEM);
>> + 		goto out;
>> + 	}
>>  +	if (flags & FOLL_GET) {
>>
>>
>> If I'm reading the diff correctly, I believe that line should *maybe* be changed to:
>>
>> 	if (flags & (FOLL_GET | FOLL_PIN)) {
>>
>> ...because each of those flags has a similar effect: pinned pages for DMA or RDMA
>> use. So either flag will require a call to arch_make_page_accessible()...except that
>> I'm not sure that's what you want. Would the absence of a call to 
>> arch_make_page_accessible() cause things like pin_user_pages() to not work correctly?
>> Seems like it would, to me.
> 
> Yes, it's required. From the commit message "enable paging, file backing
> etc, it is also necessary to protect the host against a malicious user
> space. For example a bad QEMU could simply start direct I/O on such
> protected memory.". So we really want to convert the page from
> unencrypted/inaccessible to encrypted/accessible at this point (iow,
> make it definitely accessible, and make sure it stays accessible).
> 
>>
>> (I'm pretty unhappy that we have to ask this at the linux-next level.)
> 
> Yeah, I *think* this fell through the cracks (on linux-mm, but also in
> Andrew's inbox) because the series has a big fat "KVM: s390:" as prefix.
> Christian decided to pull it in to give it some churn yesterday (I think
> he originally wanted to have this patch and the other KVM protvirt
> patches in 5.7 [2] ... but not sure what will happen due to this conflict).

Yes, I would like to have this patch in 5.7. Depending on the schedule of the
FOLL_PIN patches that means:
1. Claudios callback patch _before_ the FOLL_PIN patches + Claudio will provide a fixup.
2. Claudios callback patch on top of the FOLL_PIN patches (Claudio will provide a
version that combines the first patch + fixup)


> 
> At least now this patch has attention ... although it would have been
> better if linux-next admins wouldn't have to mess with this :)
> 
> [1] https://lkml.kernel.org/r/20200224114107.4646-2-borntraeger@de.ibm.com
> [2] https://lkml.kernel.org/r/20200224114107.4646-1-borntraeger@de.ibm.com
> 


      reply	other threads:[~2020-02-27  9:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27  3:11 linux-next: manual merge of the akpm-current tree with the kvms390 tree Stephen Rothwell
2020-02-27  5:58 ` John Hubbard
2020-02-27  8:02   ` Christian Borntraeger
2020-02-27  9:20   ` David Hildenbrand
2020-02-27  9:49     ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd971e35-538a-13c1-e05a-1a7dd8ceda9f@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox