Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-09-06 Thread Christoph Hellwig
On Fri, Sep 06, 2019 at 05:06:39PM +0530, Bharata B Rao wrote: > > Also is bit 56+ a set of values, so is there 1 << 56 and 3 << 56 as well? > > Seems > > like even that other patch doesn't fully define these "pfn" values. > > I realized that the bit numbers have changed, it is no longer bits 60

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-09-06 Thread Bharata B Rao
On Mon, Sep 02, 2019 at 09:53:56AM +0200, Christoph Hellwig wrote: > On Fri, Aug 30, 2019 at 09:12:59AM +0530, Bharata B Rao wrote: > > On Thu, Aug 29, 2019 at 10:38:10AM +0200, Christoph Hellwig wrote: > > > On Thu, Aug 22, 2019 at 03:56:14PM +0530, Bharata B Rao wrote: > > > > +/* > > > > + * Bit

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-09-02 Thread Christoph Hellwig
On Fri, Aug 30, 2019 at 09:12:59AM +0530, Bharata B Rao wrote: > On Thu, Aug 29, 2019 at 10:38:10AM +0200, Christoph Hellwig wrote: > > On Thu, Aug 22, 2019 at 03:56:14PM +0530, Bharata B Rao wrote: > > > +/* > > > + * Bits 60:56 in the rmap entry will be used to identify the > > > + * different us

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-30 Thread Bharata B Rao
On Thu, Aug 29, 2019 at 12:39:11PM -0700, Sukadev Bhattiprolu wrote: > Bharata B Rao [bhar...@linux.ibm.com] wrote: > > On Wed, Aug 28, 2019 at 08:02:19PM -0700, Sukadev Bhattiprolu wrote: > Where do we serialize two threads attempting to H_SVM_PAGE_IN the same gfn > at the same time? Or one thread

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-29 Thread Bharata B Rao
On Thu, Aug 29, 2019 at 10:38:10AM +0200, Christoph Hellwig wrote: > On Thu, Aug 22, 2019 at 03:56:14PM +0530, Bharata B Rao wrote: > > +/* > > + * Bits 60:56 in the rmap entry will be used to identify the > > + * different uses/functions of rmap. > > + */ > > +#define KVMPPC_RMAP_DEVM_PFN (0

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-29 Thread Sukadev Bhattiprolu
Bharata B Rao [bhar...@linux.ibm.com] wrote: > On Wed, Aug 28, 2019 at 08:02:19PM -0700, Sukadev Bhattiprolu wrote: > > Some minor comments/questions below. Overall, the patches look > > fine to me. > > > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +static struc

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-29 Thread Christoph Hellwig
On Thu, Aug 22, 2019 at 03:56:14PM +0530, Bharata B Rao wrote: > +/* > + * Bits 60:56 in the rmap entry will be used to identify the > + * different uses/functions of rmap. > + */ > +#define KVMPPC_RMAP_DEVM_PFN (0x2ULL << 56) How did you come up with this specific value? > + > +static inline boo

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-28 Thread Bharata B Rao
On Wed, Aug 28, 2019 at 08:02:19PM -0700, Sukadev Bhattiprolu wrote: > Some minor comments/questions below. Overall, the patches look > fine to me. > > > +#include > > +#include > > +#include > > +#include > > + > > +static struct dev_pagemap kvmppc_devm_pgmap; > > +static unsigned long *kvmpp

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-28 Thread Sukadev Bhattiprolu
Some minor comments/questions below. Overall, the patches look fine to me. > +#include > +#include > +#include > +#include > + > +static struct dev_pagemap kvmppc_devm_pgmap; > +static unsigned long *kvmppc_devm_pfn_bitmap; > +static DEFINE_SPINLOCK(kvmppc_devm_pfn_lock); Is this lock protect

[PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-22 Thread Bharata B Rao
KVMPPC driver to manage page transitions of secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. H_SVM_PAGE_IN: Move the content of a normal page to secure page H_SVM_PAGE_OUT: Move the content of a secure page to normal page Private ZONE_DEVICE memory equal to the amount of secure memory av